/* ============================================================================
   DE PLAFONDSCAN
   Opbouw van dit bestand:
     1. basis
     2. raamwerk (kop, voortgang, voet)
     3. knoppen en links
     4. startscherm
     5. vraagschermen
     6. gegevensscherm
     7. uitslagscherm en de onthulling
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. BASIS
   --------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--grond);
  color: var(--inkt);
  font-family: var(--font-body);
  font-size: var(--tekst-m);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  margin: 0;
  text-wrap: balance;
  color: var(--inkt);
}

p {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

/* Verbergen moet altijd winnen, ook van display:flex en display:inline-flex. */
[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Alleen zichtbaar voor schermlezers */
.alleen-voorlezen {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.overslaan-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 var(--rand) 0;
  text-decoration: none;
}
.overslaan-link:focus {
  left: 0;
}

/* ---------------------------------------------------------------------------
   2. RAAMWERK
   --------------------------------------------------------------------------- */

.scan {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.kop {
  padding: var(--ruimte-4) var(--zijkant) var(--ruimte-3);
  display: flex;
  justify-content: center;
}

.kop img {
  height: 3.4rem;
  width: auto;
}

.voortgang-balk {
  height: 3px;
  background: rgba(51, 72, 70, 0.1);
  position: relative;
  overflow: hidden;
}

.voortgang-balk > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  transition: width 420ms var(--soepel);
}

.voortgang-balk[hidden] {
  display: none;
}

.hoofd {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--breedte);
  margin: 0 auto;
  padding: 0 var(--zijkant);
}

.voet {
  padding: var(--ruimte-5) var(--zijkant) var(--ruimte-4);
  text-align: center;
  font-size: var(--tekst-xs);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--inkt-zacht);
}

/* Elk scherm komt rustig omhoog */
.scherm {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: opkomen 440ms var(--soepel) both;
}

@keyframes opkomen {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------------------
   3. KNOPPEN EN LINKS
   --------------------------------------------------------------------------- */

.knop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--rand-rond);
  padding: 0.95rem 1.7rem;
  font-family: var(--font-body);
  font-size: var(--tekst-m);
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  min-height: 3rem;
  transition: background-color 180ms ease, transform 180ms var(--soepel);
}

.knop:hover {
  background: var(--accent-diep);
}

.knop:active {
  transform: translateY(1px);
}

.knop[disabled],
.knop[aria-disabled="true"] {
  background: var(--salie);
  cursor: default;
}

.knop--breed {
  width: 100%;
}

.knop-tekst {
  background: none;
  border: 0;
  padding: 0.5rem 0;
  font-family: var(--font-body);
  font-size: var(--tekst-s);
  color: var(--inkt-zacht);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  align-self: flex-start;
}

.knop-tekst:hover {
  color: var(--accent);
}

a {
  color: var(--accent-diep);
}

/* ---------------------------------------------------------------------------
   4. STARTSCHERM
   --------------------------------------------------------------------------- */

.start {
  justify-content: center;
  gap: var(--ruimte-3);
  padding: var(--ruimte-5) 0 var(--ruimte-6);
}

.start__streep {
  width: 2.75rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.start__titel {
  font-size: var(--titel);
}

.start__subtitel {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--tekst-l);
  line-height: 1.4;
  color: var(--inkt);
}

.start__intro {
  color: var(--inkt-zacht);
}

.start .knop {
  align-self: flex-start;
  margin-top: var(--ruimte-2);
}

.start__klein {
  font-size: var(--tekst-s);
  color: var(--inkt-zacht);
}

/* ---------------------------------------------------------------------------
   5. VRAAGSCHERMEN
   --------------------------------------------------------------------------- */

.vraag {
  padding: var(--ruimte-3) 0 var(--ruimte-6);
  gap: var(--ruimte-4);
}

.vraag__balk {
  display: flex;
  align-items: center;
  gap: var(--ruimte-3);
  min-height: 2.25rem;
}

.terug {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 0;
  padding: 0.4rem 0.5rem 0.4rem 0;
  margin-left: -0.15rem;
  font-family: var(--font-body);
  font-size: var(--tekst-s);
  color: var(--inkt-zacht);
  cursor: pointer;
}

.terug:hover {
  color: var(--accent);
}

.terug svg {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.vraag__teller {
  font-size: var(--tekst-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--inkt-zacht);
  margin-left: auto;
}

.vraag__kern {
  display: flex;
  flex-direction: column;
}

.vraag__laag {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--tekst-l);
  color: var(--laagkleur);
  margin-bottom: var(--ruimte-2);
}

.vraag__tekst {
  font-size: var(--vraag);
  font-weight: 400;
  margin-bottom: var(--ruimte-2);
}

.vraag__onderschrift {
  font-size: var(--tekst-s);
  color: var(--inkt-zacht);
  margin-bottom: var(--ruimte-3);
}

.vraag__kern > .opties,
.vraag__kern > .open-veld {
  margin-top: var(--ruimte-3);
}

/* --- antwoordopties --- */

.opties {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ruimte-2);
}

.opties > legend {
  padding: 0;
}

.optie {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.05rem;
  background: var(--vlak);
  border: 1px solid var(--lijn);
  border-radius: var(--rand);
  cursor: pointer;
  line-height: 1.45;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.optie:hover {
  border-color: var(--salie);
}

.optie input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.optie__bol {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: 1.5px solid var(--salie);
  background: transparent;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.optie--meer .optie__bol {
  border-radius: 5px;
}

.optie input:checked ~ .optie__bol {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--vlak);
}

.optie:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-zacht);
}

.optie:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Voor browsers zonder :has, via een klasse vanuit JavaScript */
.optie.is-gekozen {
  border-color: var(--accent);
  background: var(--accent-zacht);
}

.optie__label {
  flex: 1;
}

/* het kleine veld bij "Ja, namelijk..." */
.toelichting {
  display: flex;
  flex-direction: column;
  gap: var(--ruimte-1);
  margin: calc(var(--ruimte-2) * -1 + 0.1rem) 0 0;
  padding: 0 0 0 1.05rem;
}

.toelichting[hidden] {
  display: none;
}

.toelichting label {
  font-size: var(--tekst-s);
  color: var(--inkt-zacht);
}

/* --- open vragen --- */

.open-veld {
  display: flex;
  flex-direction: column;
  gap: var(--ruimte-3);
}

.veld {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--tekst-m);
  line-height: 1.6;
  color: var(--inkt);
  background: var(--vlak);
  border: 1px solid var(--lijn);
  border-radius: var(--rand);
  padding: 0.85rem 1rem;
  transition: border-color 160ms ease;
}

.veld::placeholder {
  color: var(--inkt-zacht);
  opacity: 1;
}

.veld:focus {
  border-color: var(--accent);
}

textarea.veld {
  min-height: 9.5rem;
  resize: vertical;
}

.open-veld__acties {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ruimte-2);
}

.hint {
  font-size: var(--tekst-s);
  color: var(--fout);
  background: var(--fout-zacht);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

.hint[hidden] {
  display: none;
}

/* ---------------------------------------------------------------------------
   6. GEGEVENSSCHERM
   --------------------------------------------------------------------------- */

.gegevens {
  padding: var(--ruimte-4) 0 var(--ruimte-6);
  gap: var(--ruimte-4);
}

.gegevens__kop {
  font-size: var(--uitslag);
}

.gegevens__tekst {
  color: var(--inkt-zacht);
}

.gegevens form {
  display: flex;
  flex-direction: column;
  gap: var(--ruimte-3);
}

.veldgroep {
  display: flex;
  flex-direction: column;
  gap: var(--ruimte-1);
}

.veldgroep > label {
  font-size: var(--tekst-s);
  color: var(--inkt-zacht);
}

.veldfout {
  font-size: var(--tekst-s);
  color: var(--fout);
}

.veldfout[hidden] {
  display: none;
}

.veld[aria-invalid="true"] {
  border-color: var(--fout);
}

/* het vinkje */
.vinkje {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: var(--tekst-s);
  line-height: 1.55;
  padding: 0.35rem 0;
}

.vinkje input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.vinkje__vak {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
  border: 1.5px solid var(--salie);
  border-radius: 5px;
  background: var(--vlak);
  display: grid;
  place-items: center;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.vinkje__vak svg {
  width: 0.8rem;
  height: 0.8rem;
  opacity: 0;
  color: #fff;
  transition: opacity 140ms ease;
}

.vinkje input:checked ~ .vinkje__vak {
  background: var(--accent);
  border-color: var(--accent);
}

.vinkje input:checked ~ .vinkje__vak svg {
  opacity: 1;
}

.vinkje input:focus-visible ~ .vinkje__vak {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* het honeypot-veld: onzichtbaar voor mensen, zichtbaar voor spambots */
.val {
  position: absolute !important;
  left: -9999px !important;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------------------------------------------------------------------------
   7. UITSLAGSCHERM EN DE ONTHULLING
   --------------------------------------------------------------------------- */

.uitslag {
  padding: 0 0 var(--ruimte-6);
  animation: none;
}

/* het plafond */
.onthulling {
  position: relative;
  isolation: isolate;
  margin: 0 calc(var(--zijkant) * -1);
  padding: 0 var(--zijkant);
  min-height: 60svh;
  display: flex;
  flex-direction: column;
  /* houdt de panelen binnen het kader als ze wegschuiven */
  overflow: hidden;
}

.onthulling__licht {
  position: absolute;
  inset: -20% -30%;
  z-index: -1;
  background: radial-gradient(circle at 50% 42%,
              #fff8ea 0%,
              #fbe9cd 32%,
              rgba(251, 233, 205, 0) 68%);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 1000ms ease 200ms, transform 1300ms var(--soepel) 200ms;
  pointer-events: none;
}

.paneel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.5%;
  z-index: 3;
  background-image:
    repeating-linear-gradient(90deg,
      rgba(51, 72, 70, 0.05) 0 1px,
      rgba(51, 72, 70, 0) 1px 54px),
    linear-gradient(168deg, var(--grond-diep) 0%, #e4d3bc 100%);
  transition: transform 1150ms cubic-bezier(0.62, 0.02, 0.2, 1);
}

.paneel--links  { left: 0;  box-shadow: 8px 0 22px -14px rgba(51, 72, 70, 0.7); }
.paneel--rechts { right: 0; box-shadow: -8px 0 22px -14px rgba(51, 72, 70, 0.7); }

.onthulling__knop {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 300ms ease;
}

.onthulling.is-open .paneel--links  { transform: translateX(-101%); }
.onthulling.is-open .paneel--rechts { transform: translateX(101%); }
.onthulling.is-open .onthulling__licht { opacity: 0.9; transform: scale(1); }
.onthulling.is-open .onthulling__knop { opacity: 0; pointer-events: none; }

/* de uitslag zelf */
.uitslag__inhoud {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--ruimte-3);
  padding: var(--ruimte-5) 0 var(--ruimte-4);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 800ms ease 700ms, transform 900ms var(--soepel) 700ms;
}

.onthulling.is-open .uitslag__inhoud {
  opacity: 1;
  transform: none;
}

.uitslag__aanhef {
  font-size: var(--tekst-s);
  color: var(--inkt-zacht);
}

.uitslag__profielnaam {
  font-size: var(--tekst-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.uitslag__titel {
  font-size: var(--uitslag);
}

.uitslag__tekst {
  display: flex;
  flex-direction: column;
  gap: var(--ruimte-3);
}

.uitslag__citaat {
  border-left: 2px solid var(--accent);
  padding-left: var(--ruimte-3);
}

.uitslag__stap {
  border-top: 1px solid var(--lijn);
  padding-top: var(--ruimte-3);
  margin-top: var(--ruimte-1);
}

.uitslag__stap strong {
  font-weight: 600;
}

/* het slotblok met het aanbod */
.aanbod {
  margin-top: var(--ruimte-5);
  background: var(--vlak);
  border: 1px solid var(--lijn);
  border-radius: var(--rand);
  padding: var(--ruimte-4);
  display: flex;
  flex-direction: column;
  gap: var(--ruimte-3);
}

.aanbod__kop {
  font-size: 1.4rem;
}

.aanbod__prijs {
  font-size: var(--tekst-s);
  color: var(--inkt-zacht);
  margin-top: calc(var(--ruimte-2) * -1);
}

.aanbod .knop {
  align-self: flex-start;
}

.aanbod__waarschuwing {
  font-size: var(--tekst-s);
  color: var(--fout);
  background: var(--fout-zacht);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}
