:root {
  --blauw: #0445af;
  --blauw-zacht: rgba(4, 69, 175, 0.07);
  --blauw-rand: rgba(4, 69, 175, 0.35);
  --zwart: #0b0b0f;
  --grijs: #6b7280;
  --lijn: #e5e7eb;
  --vlak: #f5f7fa;
  --wit: #ffffff;
  --rood: #c0262d;
  --rood-zacht: #fdecec;
  --groen: #12805c;
  --oranje: #b45309;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Montserrat", system-ui, -apple-system, Arial, sans-serif;
  background: var(--wit);
  color: var(--zwart);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Formulier */

.voortgang { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: var(--blauw-zacht); z-index: 5; }
.voortgang-balk { height: 100%; width: 0; background: var(--blauw); transition: width 0.4s ease; }

.scherm {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 24px 112px;
}
.kaart { width: 100%; max-width: 720px; }
/* Binnenkomst: alleen verschuiven, nooit vanaf onzichtbaar (les 15 app-bouwer). */
.kaart.in-omlaag { animation: inOmlaag 0.42s cubic-bezier(0.2, 0.8, 0.2, 1); }
.kaart.in-omhoog { animation: inOmhoog 0.42s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes inOmlaag { from { transform: translateY(36px); } to { transform: none; } }
@keyframes inOmhoog { from { transform: translateY(-36px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .kaart.in-omlaag, .kaart.in-omhoog { animation: none; } }

.vraag-kop { display: flex; gap: 12px; align-items: baseline; }
.nummer { color: var(--blauw); font-weight: 700; font-size: 16px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.nummer svg { width: 14px; height: 14px; }
.titel { font-size: clamp(22px, 3.6vw, 30px); font-weight: 600; line-height: 1.3; white-space: pre-line; }
.titel.lang { font-size: clamp(17px, 2.3vw, 21px); font-weight: 500; line-height: 1.5; }
.titel .ster { color: var(--blauw); margin-left: 2px; }
.uitleg { color: var(--grijs); font-size: clamp(16px, 2.4vw, 20px); line-height: 1.45; margin-top: 10px; }
.inhoud { margin-top: 32px; }
.inspring { padding-left: 34px; }
@media (max-width: 560px) { .inspring { padding-left: 0; } .vraag-kop { flex-direction: column; gap: 6px; } }

.veld {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--blauw-rand);
  background: transparent;
  color: var(--blauw);
  font: inherit;
  font-size: clamp(20px, 3.2vw, 28px);
  padding: 8px 0 10px;
  outline: none;
  transition: border-color 0.2s;
}
.veld::placeholder { color: rgba(0, 90, 255, 0.32); }
.veld:focus { border-bottom-color: var(--blauw); }
textarea.veld { resize: none; min-height: 52px; line-height: 1.4; overflow: hidden; }

.opties { display: flex; flex-direction: column; gap: 10px; max-width: 440px; }
.opties.naast { flex-direction: row; flex-wrap: wrap; }
.opties.naast .optie { min-width: 130px; }
.optie {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--blauw-zacht);
  border: 1px solid var(--blauw-rand);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 18px;
  color: var(--blauw);
  transition: background 0.15s, border-color 0.15s;
}
.optie:hover { background: rgba(0, 90, 255, 0.14); }
.optie:focus-visible { outline: 2px solid var(--blauw); outline-offset: 2px; }
.optie .toets {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--blauw-rand);
  border-radius: 4px;
  background: var(--wit);
  font-size: 12px; font-weight: 700;
}
.optie .label { flex: 1; }
.optie .vink { opacity: 0; font-weight: 700; }
.optie.gekozen { border: 2px solid var(--blauw); padding: 9px 11px; background: rgba(0, 90, 255, 0.12); }
.optie.gekozen .toets { background: var(--blauw); color: var(--wit); border-color: var(--blauw); }
.optie.gekozen .vink { opacity: 1; }
.optie.knipper { animation: knipper 0.32s steps(2) 1; }
@keyframes knipper { 50% { background: rgba(0, 90, 255, 0.3); } }

.schaal { display: grid; grid-template-columns: repeat(var(--stappen, 10), 1fr); gap: 8px; }
.schaal .optie { justify-content: center; padding: 14px 0; font-size: 18px; font-weight: 600; }
.schaal .optie.gekozen { padding: 13px 0; }
.schaal-labels { display: flex; justify-content: space-between; color: var(--blauw); font-size: 14px; margin-top: 10px; }
@media (max-width: 560px) {
  .schaal { grid-template-columns: repeat(5, 1fr); }
}

.acties { margin-top: 28px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.knop {
  background: var(--blauw);
  color: var(--wit);
  border: 0;
  border-radius: 6px;
  padding: 12px 22px;
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 3px 12px rgba(0, 90, 255, 0.22);
  transition: background 0.15s, transform 0.1s;
}
.knop:hover { background: #004ad6; }
.knop:active { transform: translateY(1px); }
.knop:disabled { opacity: 0.6; cursor: default; }
.knop.groot { font-size: 20px; padding: 14px 28px; }
.hint { color: var(--grijs); font-size: 13px; }
.hint b { font-weight: 700; color: var(--zwart); }
@media (hover: none) { .hint { display: none; } }

.fout {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--rood-zacht);
  color: var(--rood);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
}

.welkom, .einde { text-align: center; }
.welkom .titel, .einde .titel { font-size: clamp(28px, 5vw, 42px); font-weight: 700; }
.welkom .uitleg, .einde .uitleg { margin-top: 14px; }
.welkom .acties, .einde .acties { justify-content: center; }
.merk { font-weight: 800; font-size: 15px; letter-spacing: 0.4px; margin-bottom: 26px; }
.merk span { color: var(--blauw); }
.vinkrond { width: 64px; height: 64px; border-radius: 50%; background: var(--blauw); color: var(--wit); display: grid; place-items: center; margin: 0 auto 24px; font-size: 30px; }

.pijlen { position: fixed; right: 20px; bottom: 20px; display: flex; gap: 2px; z-index: 5; }
.pijlen button {
  width: 40px; height: 36px;
  border: 0;
  background: var(--blauw);
  color: var(--wit);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.pijlen button:first-child { border-radius: 6px 0 0 6px; }
.pijlen button:last-child { border-radius: 0 6px 6px 0; }
.pijlen button:disabled { opacity: 0.4; cursor: default; }
.pijlen button span { display: block; transform: translateY(-2px); }

/* ---------------------------------------------------------------- Beheer */

body.beheer { background: var(--vlak); }
.b-wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }
.b-kop { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.b-kop h1 { font-size: 22px; font-weight: 800; }
.b-kop h1 span { color: var(--blauw); }
.b-tabs { display: flex; gap: 4px; background: var(--wit); border: 1px solid var(--lijn); border-radius: 8px; padding: 4px; }
.b-tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 6px; font-weight: 600; font-size: 14px; color: var(--grijs); }
.b-tabs button.actief { background: var(--blauw); color: var(--wit); }
.b-balk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.b-balk select, .b-balk .b-knop {
  font: inherit; font-size: 14px; font-weight: 600;
  border: 1px solid var(--lijn); background: var(--wit); border-radius: 6px; padding: 8px 12px; color: var(--zwart);
  text-decoration: none; cursor: pointer;
}
.b-balk .b-knop.blauw { background: var(--blauw); color: var(--wit); border-color: var(--blauw); }
.b-balk .rechts { margin-left: auto; }
.b-tegels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 760px) { .b-tegels { grid-template-columns: repeat(2, 1fr); } }
.b-tegel { background: var(--wit); border: 1px solid var(--lijn); border-radius: 10px; padding: 16px; }
.b-tegel .getal { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }
.b-tegel .naam { color: var(--grijs); font-size: 13px; font-weight: 600; margin-top: 2px; }
.b-tegel .sub { color: var(--grijs); font-size: 12px; margin-top: 6px; }
.b-blok { background: var(--wit); border: 1px solid var(--lijn); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.b-blok h2 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.b-blok .klein { color: var(--grijs); font-size: 13px; margin-bottom: 14px; }
.trechter { display: flex; flex-direction: column; gap: 10px; }
.trede { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) 200px; gap: 12px; align-items: center; font-size: 14px; }
.trede .t-naam { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trede .t-naam b { color: var(--blauw); margin-right: 6px; }
.staaf { height: 22px; background: var(--vlak); border-radius: 4px; overflow: hidden; position: relative; }
.staaf div { height: 100%; background: var(--blauw); border-radius: 4px; min-width: 2px; }
.trede .t-getal { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; min-width: 150px; text-align: right; }
.trede .t-getal .af { color: var(--rood); font-weight: 600; margin-left: 8px; }
@media (max-width: 640px) {
  .trede { grid-template-columns: 1fr; gap: 4px; }
  .trede .t-getal { text-align: left; }
}
.verdelingen { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 760px) { .verdelingen { grid-template-columns: 1fr; } }
.verdelingen .b-blok { margin-bottom: 0; }
.rij { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 70px; gap: 10px; align-items: center; font-size: 13px; margin-bottom: 8px; }
.rij .r-naam { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rij .r-getal { text-align: right; font-variant-numeric: tabular-nums; color: var(--grijs); }
.rij .r-getal b { color: var(--zwart); }
.tabel-wrap { overflow-x: auto; background: var(--wit); border: 1px solid var(--lijn); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--lijn); vertical-align: top; }
th { background: var(--vlak); font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
td { max-width: 260px; overflow-wrap: anywhere; }
td:nth-child(n+5) { min-width: 160px; }
td:nth-child(-n+4) { white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.label-af { color: var(--groen); font-weight: 700; }
.label-half { color: var(--oranje); font-weight: 700; }
.leeg { color: var(--grijs); text-align: center; padding: 40px 0; }
.inlog { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.inlog form { background: var(--wit); border: 1px solid var(--lijn); border-radius: 12px; padding: 28px; width: 100%; max-width: 340px; text-align: center; }
.inlog h1 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.inlog p { color: var(--grijs); font-size: 14px; margin-bottom: 18px; }
.inlog input {
  width: 100%; font: inherit; font-size: 28px; letter-spacing: 12px; text-align: center;
  border: 1px solid var(--lijn); border-radius: 8px; padding: 10px; margin-bottom: 12px;
}
.inlog .knop { width: 100%; justify-content: center; }
.inlog .fout { margin: 0 0 12px; }
.nepband { background: #fff7e0; color: var(--oranje); font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 8px; margin-bottom: 16px; }

/* ---------------------------------------------------------------- Inzending voluit */

tr.klikbaar { cursor: pointer; }
tr.klikbaar:hover td, tr.klikbaar:focus td { background: var(--blauw-zacht); }
.detail-achter { position: fixed; inset: 0; background: rgba(11, 11, 15, 0.45); z-index: 50; display: flex; justify-content: flex-end; }
.detail { background: var(--wit); width: 100%; max-width: 680px; height: 100%; overflow-y: auto; padding: 24px; box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15); }
.detail-kop { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.detail-kop h2 { font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.detail-sluit { border: 1px solid var(--lijn); background: var(--wit); border-radius: 8px; padding: 8px 14px; font-size: 14px; font-weight: 600; flex-shrink: 0; }
.detail .klein { color: var(--grijs); font-size: 13px; margin-bottom: 18px; }
.detail-vraag { border-top: 1px solid var(--lijn); padding: 14px 0; }
.detail-titel { font-size: 13px; color: var(--grijs); font-weight: 600; line-height: 1.45; white-space: pre-line; margin-bottom: 6px; }
.detail-antwoord { font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-antwoord.leeg { color: var(--grijs); font-style: italic; }
.detail-lijst { padding-left: 20px; font-size: 15px; line-height: 1.6; }

.app-knop { display: inline-block; background: #25d366; color: #fff; font-weight: 700; font-size: 13px; padding: 7px 12px; border-radius: 8px; text-decoration: none; white-space: nowrap; }
.app-knop:hover { background: #1ebe5b; }
.klein-grijs { color: var(--grijs); font-size: 12px; }
.detail-app { margin-bottom: 16px; }
