/* Trap-decor visualizer — Traprenovatie-Expert huisstijl (Poppins, blauw #2055a2 + groen #1ec793, pill-knoppen). */
:root {
  --tv-accent: #cd7f3b;
  --tv-font: 'Montserrat', system-ui, sans-serif;
  --tv-radius: 999px;
  --bg: #ffffff;
  --bg-soft: #f5f8fc;       /* lichte blauw-tint */
  --card: #ffffff;
  --ink: #2c2928;          /* koppen / sterk — antraciet */
  --text: #3a3a3a;         /* body */
  --muted: #7a8290;        /* koel grijs */
  --line: #e2e8f0;         /* koel lichtgrijs */
  --accent: var(--tv-accent);
  --accent-dk: #1a4785;
  --accent-ink: #ffffff;
  --cta: #1ec793;          /* groen — CTA/succes */
  --cta-dk: #17a97c;
  --taupe: #196ba2;        /* secundair blauw */
  --radius: 18px;
  --pill: 999px;
  --shadow: 0 10px 34px rgba(32,85,162,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Poppins', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.tv { max-width: 600px; margin: 0 auto; padding: 16px 18px calc(44px + env(safe-area-inset-bottom)); }

/* Header + voortgang */
.tv-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 20px; }
.tv-brand { font-weight: 600; font-size: 1.2rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink); }
.tv-logo-link { display: inline-flex; align-items: center; text-decoration: none; }
.tv-logo { height: 38px; width: auto; display: block; }
.tv-progress { display: flex; gap: 6px; }
.tv-progress i { width: 22px; height: 4px; border-radius: 2px; background: var(--line); transition: background .3s; }
.tv-progress i.on { background: var(--accent); }

/* Typografie — koppen licht (300) */
.tv-h1 { font-weight: 300; font-size: 2.1rem; line-height: 1.12; margin: 8px 0 12px; color: var(--ink); letter-spacing: -.5px; }
.tv-h1 em { font-style: normal; font-weight: 500; color: var(--accent); }
.tv-intro { color: var(--muted); font-size: 1rem; line-height: 1.55; margin: 0 0 24px; }
.tv-q { font-weight: 300; font-size: 1.5rem; margin: 0 0 16px; color: var(--ink); letter-spacing: -.3px; }
.tv-sub { font-size: .95rem; font-weight: 600; margin: 20px 0 9px; color: var(--ink); }

/* Stappen */
.tv-step { animation: tv-in .35s ease both; }
.tv-step[hidden] { display: none; }
@keyframes tv-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Knoppen — pill */
.tv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 24px; font: inherit; font-weight: 600; font-size: 1rem;
  border: 1.5px solid var(--ink); border-radius: var(--pill); background: var(--ink); color: #fff; cursor: pointer;
  text-decoration: none; transition: transform .08s, background .2s, opacity .2s; -webkit-tap-highlight-color: transparent;
}
.tv-btn:active { transform: scale(.98); }
.tv-btn:disabled { opacity: .35; cursor: not-allowed; }
.tv-btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.tv-btn-block { width: 100%; margin-top: 24px; }
.tv-btn-cta { background: var(--cta); border-color: var(--cta); color: #fff; box-shadow: var(--shadow); }
.tv-btn-cta:active { background: var(--cta-dk); }
.tv-link { display: inline-block; margin-top: 20px; background: none; border: none; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; padding: 6px 0; }

/* Trap-type kaarten */
.tv-types { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tv-type {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 24px 14px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--card); cursor: pointer; text-align: center; transition: border-color .15s, transform .08s, box-shadow .15s;
}
.tv-type:active { transform: scale(.98); }
.tv-type.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(205,127,59,.14); }
.tv-type-ico { font-size: 1.8rem; line-height: 1; letter-spacing: -3px; color: var(--accent); }
.tv-type-naam { font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.tv-type-uitleg { font-size: .8rem; color: var(--muted); line-height: 1.4; }

/* Upload / camera */
.tv-up-choices { display: flex; flex-direction: column; gap: 10px; }
.tv-preview { border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.tv-preview[hidden] { display: none; }
.tv-preview img { width: 100%; display: block; }
.tv-hint { margin-top: 12px; font-size: .92rem; min-height: 1.2em; }
.tv-hint.err { color: var(--accent-dk); }
.tv-hint.ok { color: #2f7d4f; }

.tv-cam[hidden] { display: none; }
.tv-cam-stage { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; }
.tv-cam-stage video { width: 100%; display: block; }
/* Het camerakader heeft dezelfde 3:4-verhouding als het bijsnijkader, zodat
   fotograferen en uploaden hetzelfde beeld opleveren. Wat er buiten het kader
   valt wordt bij het vastleggen weggesneden — het kader is dus geen versiering
   maar een belofte: dit is wat je krijgt. */
.tv-frame {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  aspect-ratio: 3 / 4; height: 88%; max-width: 92%;
  border: 2px solid rgba(255,255,255,.9); border-radius: 10px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); pointer-events: none;
}
.tv-level { position: absolute; left: 50%; bottom: 14px; width: 130px; height: 4px; margin-left: -65px; background: rgba(255,255,255,.4); border-radius: 2px; pointer-events: none; }
.tv-level i { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #f1c40f; transition: transform .08s linear; }
.tv-level.ok i { background: #2ecc71; }
/* ---- bijsnijden na uploaden ---- */
.tv-bijsnij[hidden] { display: none; }
.tv-bijsnij-kop { font-weight: 600; text-align: center; margin: 0 0 12px; }
.tv-bijsnij-vak {
  position: relative; margin: 0 auto; aspect-ratio: 3 / 4; max-width: 320px; width: 100%;
  border-radius: var(--radius); overflow: hidden; background: #111;
  touch-action: none; user-select: none; cursor: grab;
}
.tv-bijsnij-vak:active { cursor: grabbing; }
.tv-bijsnij-vak img {
  position: absolute; top: 0; left: 0; transform-origin: 0 0;
  max-width: none; pointer-events: none; -webkit-user-drag: none;
}
/* Het masker markeert het kader zonder de foto eronder te verbergen. */
.tv-bijsnij-masker {
  position: absolute; inset: 0; pointer-events: none;
  border: 2px solid rgba(255,255,255,.9); border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.tv-zoom { display: flex; align-items: center; gap: 12px; max-width: 320px; margin: 14px auto 0; color: var(--muted); }
.tv-zoom input { flex: 1; accent-color: var(--tv-accent); }
.tv-bijsnij-hint { font-size: .85rem; color: var(--muted); margin: 10px 0 14px; text-align: center; }

.tv-cam-hint { font-size: .85rem; color: var(--muted); margin: 12px 0; text-align: center; }
.tv-cam-row { display: flex; gap: 10px; }
.tv-cam-row .tv-btn { flex: 1; }

/* Decors */
.tv-decors { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 10px; }
.tv-decor { border: 2px solid transparent; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--card); box-shadow: 0 2px 8px rgba(64,48,32,.06); transition: transform .08s; }
.tv-decor:active { transform: scale(.97); }
.tv-decor.sel { border-color: var(--accent); }
.tv-decor img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.tv-decor span { display: block; font-size: .76rem; padding: 6px 6px; text-align: center; color: var(--muted); }

/* Chips — pill */
.tv-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.tv-chip { padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--card); cursor: pointer; font: inherit; font-size: .9rem; color: var(--text); transition: all .12s; -webkit-tap-highlight-color: transparent; }
.tv-chip:active { transform: scale(.96); }
.tv-chip.sel { border-color: var(--accent); background: var(--accent); color: #fff; }
#tv-stootbord-blok[hidden] { display: none; }

/* Formulier */
.tv-form { display: flex; flex-direction: column; gap: 12px; }
.tv-form input { padding: 14px 16px; font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); }
.tv-form input::placeholder { color: #b3aaa3; }
.tv-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(205,127,59,.14); }
.tv-row { display: flex; gap: 12px; }
.tv-row > * { flex: 1; min-width: 0; }
.tv-field { display: flex; flex-direction: column; gap: 6px; }
.tv-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.tv-form-note { font-size: .8rem; color: var(--muted); margin: 8px 0 0; }
.tv-extra { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.tv-extra-kop { font-weight: 600; font-size: .95rem; margin: 0; color: var(--ink); }
.tv-extra-kop span { color: var(--muted); font-weight: 400; }
.tv-lbl { font-size: .85rem; color: var(--muted); }

/* Resultaat — voor/na slider */
.tv-ba { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); user-select: none; touch-action: pan-y; background: #000; }
.tv-ba-img { display: block; width: 100%; }
.tv-ba-after { position: relative; z-index: 1; }
.tv-ba-before { position: absolute; inset: 0; z-index: 2; width: 55%; overflow: hidden; }
.tv-ba-before img { width: 100vw; max-width: 600px; height: 100%; object-fit: cover; }
.tv-ba-tag { position: absolute; top: 10px; z-index: 3; font-size: .72rem; font-weight: 600; padding: 4px 11px; border-radius: var(--pill); background: rgba(38,38,37,.6); color: #fff; }
.tv-ba-tag-voor { left: 10px; }
.tv-ba-tag-na { right: 10px; }
.tv-ba-handle { position: absolute; top: 50%; left: 55%; z-index: 4; transform: translate(-50%, -50%); width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 1rem; box-shadow: 0 2px 12px rgba(0,0,0,.35); pointer-events: none; }
.tv-ba-hint { text-align: center; font-size: .8rem; color: var(--muted); margin: 10px 0 0; }
.tv-done { text-align: center; margin-top: 22px; animation: tv-in .35s ease both; }
.tv-done[hidden] { display: none; }
.tv-done-kop { font-size: 1.2rem; font-weight: 600; color: #2f7d4f; margin: 0 0 4px; }
.tv-done-sub { color: var(--muted); margin: 0 0 10px; }

/* Afsluit-acties */
.tv-next { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.tv-next .tv-btn-block { margin-top: 0; }
.tv-ba-handle::before, .tv-ba-handle::after { content: ''; position: absolute; left: 50%; margin-left: -1px; width: 2px; height: 100vmax; background: #fff; }
.tv-ba-handle::before { bottom: 40px; }
.tv-ba-handle::after { top: 40px; }

/* Overlay */
.tv-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.95); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 50; padding: 24px; text-align: center; }
.tv-overlay[hidden] { display: none; }
.tv-overlay p { color: var(--muted); margin: 0; }
.tv-spinner { width: 44px; height: 44px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: tv-spin 1s linear infinite; }
@keyframes tv-spin { to { transform: rotate(360deg); } }

@media (min-width: 480px) {
  .tv-h1 { font-size: 2.5rem; }
}

/* ---- oordeel over de render (bouwt de trainingsset op) ---- */
.tv-oordeel { text-align: center; margin: 18px 0 4px; }
.tv-oordeel-vraag { font-size: .9rem; color: var(--muted); margin: 0 0 10px; }
.tv-oordeel-knoppen { display: flex; gap: 12px; justify-content: center; }
.tv-duim {
  width: 52px; height: 52px; border-radius: 50%; font-size: 22px; cursor: pointer;
  border: 1px solid rgba(0,0,0,.12); background: #fff; line-height: 1;
  transition: transform .12s var(--soepel, cubic-bezier(.4,0,.2,1)), border-color .12s, background .12s;
}
.tv-duim:hover { transform: scale(1.08); border-color: var(--tv-accent); }
.tv-duim[aria-pressed="true"] { background: var(--tv-accent); border-color: var(--tv-accent); }
.tv-oordeel-dank { font-size: .85rem; color: #2f7d4f; margin: 10px 0 0; }

/* --- Ingesloten op de site van een dealer (iframe) --------------------------
   De wizard staat dan midden in zijn pagina, niet op een eigen pagina. Twee
   dingen moeten dan anders: geen eigen witte vlak (dat geeft een zichtbaar
   blok binnen zijn achtergrond) en geen tweede logo bovenaan — zijn eigen
   header staat er al boven. */
.tv-embed, .tv-embed body { background: transparent; }
/* Hoogte laten volgen uit de inhoud: met een vaste of 100%-hoogte meet het
   frame zijn eigen maat terug en kan het nooit meer meegroeien. */
.tv-embed, .tv-embed body { height: auto; min-height: 0; overflow: hidden; }
.tv-embed .tv { padding-top: 4px; padding-bottom: 24px; }
.tv-embed .tv-head { display: none; }
