/* Vormgeving volgens het ontwerpsysteem van Licensr (DESIGN.md in die repo):
   Fluent-neutralen, één blauwe stem, gekozen = inkt, bijna plat. */

@font-face {
  font-family: "Public Sans";
  src: url("fonts/public-sans.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --paper: #ffffff;
  --canvas: #faf9f8;
  --paper-3: #f3f2f1;
  --ink: #201f1e;
  --ink-2: #323130;
  --muted: #605e5c;
  --muted-2: #737170;
  --line: #e1dfdd;
  --line-strong: #c8c6c4;
  --field-border: #8a8886;
  --blue: #0078d4;
  --blue-hover: #106ebe;
  --blue-active: #005a9e;
  --link-blue: #106ebe;
  --primary-text: #ffffff;
  --green: #107c10;
  --red: #d13438;
  --red-ink: #a4262c;
  --red-soft: #fde7e9;
  --hover-surface: color-mix(in srgb, var(--ink) 5%, transparent);
  --pressed-surface: color-mix(in srgb, var(--ink) 9%, transparent);
  --focus-halo: color-mix(in srgb, var(--blue) 18%, transparent);
  --field-focus-halo: color-mix(in srgb, var(--blue) 22%, transparent);
  --card-shadow: 0 1px 2px rgba(20, 18, 12, 0.04), 0 1px 3px -1px rgba(20, 18, 12, 0.05);

  --font-sans: "Segoe UI Variable Text", "Segoe UI", "Public Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "Public Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;

  --radius-xs: 4px;
  --radius-md: 12px;
  --radius-full: 999px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #2a2a2c;
    --canvas: #323234;
    --paper-3: #3c3c3e;
    --ink: #f5f5f7;
    --ink-2: #dcdcde;
    --muted: #b5b5b8;
    --muted-2: #9a9a9e;
    --line: #4a4a4c;
    --line-strong: #5d5d5f;
    --field-border: #808084;
    --blue: #1372c4;
    --blue-hover: #0f63ab;
    --blue-active: #0d5596;
    --link-blue: #50a6ff;
    --primary-text: #f5f5f7;
    --green: #6ccb6c;
    --red-ink: #ff9ea1;
    --red-soft: #4a2426;
    --hover-surface: color-mix(in srgb, var(--ink) 9%, transparent);
    --pressed-surface: color-mix(in srgb, var(--ink) 14%, transparent);
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, ul, fieldset, legend { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 808px;
  margin-inline: auto;
  padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
}
@media (min-width: 768px) {
  .wrap { padding-inline: 24px; }
}

/* ---------- Bovenbalk ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}
.logo { display: block; height: 30px; width: auto; }

.tekstlink {
  color: var(--link-blue);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  border-radius: var(--radius-xs);
}
@media (hover: hover) {
  .tekstlink:hover { text-decoration: underline; }
}
@media (max-width: 479px) {
  .topbar .tekstlink { display: none; }
}

.skiplink {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--blue);
  color: var(--primary-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}
.skiplink:focus { transform: none; }

/* ---------- Paginakop ---------- */
.paginakop { padding-block: 40px 28px; }
@media (min-width: 768px) {
  .paginakop { padding-block: 64px 36px; }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--link-blue);
}
.eyebrow-groen { color: var(--green); }

h1 {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
@media (min-width: 768px) {
  h1 { font-size: 40px; }
}
.lead {
  margin-top: 16px;
  max-width: 60ch;
  font-size: clamp(1.0625rem, 1.03rem + 0.35vw, 1.1875rem);
  color: var(--ink-2);
  text-wrap: pretty;
}
.meta { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---------- Kaarten ---------- */
.kaart {
  margin-bottom: 16px;
  padding: 20px 16px 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}
@media (min-width: 768px) {
  .kaart { margin-bottom: 20px; padding: 24px 28px 28px; }
}
.kaartkop {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
h2 {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.15rem + 0.45vw, 1.4375rem);
  font-weight: 600;
  line-height: 1.2;
}

/* ---------- Vragen ---------- */
.vraag { margin-top: 24px; }
.vraaglabel {
  display: block;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  text-wrap: pretty;
}
.verplicht, .hint { font-size: 13px; font-weight: 400; color: var(--muted); }
.hint { display: block; margin-top: 2px; }

.veld {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.625rem 0.875rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--field-border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 16px; /* voorkomt inzoomen op de iPhone */
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
textarea.veld { min-height: 132px; resize: vertical; }
.veld-kort { max-width: 220px; }
.veld-anders { margin-top: 10px; }
.veld::placeholder { color: var(--muted-2); }
@media (hover: hover) {
  .veld:hover { border-color: var(--ink-2); }
}
.veld:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--field-focus-halo);
}
.veld[aria-invalid="true"] { border-color: var(--red); }
.veldfout { margin-top: 6px; font-size: 14px; font-weight: 500; color: var(--red-ink); }

/* ---------- Keuzes ---------- */
.optie {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out), transform 150ms var(--ease-out);
}
/* Het echte keuzevakje blijft bestaan voor toetsenbord en schermlezer, maar
   ligt onzichtbaar over de hele keuze. */
.optie input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
@media (hover: hover) {
  .optie:hover { background: var(--hover-surface); }
}
.optie:active { background: var(--pressed-surface); }
.optie:has(input:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--focus-halo);
}

/* Pillen: korte keuzes waarvan je er één kiest. Gekozen is inkt. */
.opties-pillen { display: flex; flex-wrap: wrap; gap: 8px; }
.opties-pillen .optie {
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
}
.opties-pillen .merk { display: none; }
.opties-pillen .optie:active { transform: scale(0.97); }
.opties-pillen .optie:has(input:checked) {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  font-weight: 600;
}
@media (min-width: 768px) {
  .opties-pillen .optie { min-height: 40px; }
}

/* Rijen en vinklijst: langere keuzes, onder elkaar. */
.opties-rijen, .opties-vinklijst { margin-inline: -10px; }
.opties-rijen .optie, .opties-vinklijst .optie {
  padding: 8px 10px;
  border-radius: var(--radius-md);
}
@media (min-width: 640px) {
  .opties-vinklijst { columns: 2; column-gap: 16px; }
  .opties-vinklijst .optie { break-inside: avoid; }
}

.merk {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--muted-2);
  border-radius: var(--radius-xs);
  background: var(--paper);
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}
.opties-rijen .merk { border-radius: 50%; }
.optie:has(input:checked) { color: var(--ink); }
.optie:has(input:checked) .merk { background: var(--ink); border-color: var(--ink); }
.opties-vinklijst .optie:has(input:checked) .merk::after {
  content: "";
  width: 9px;
  height: 5px;
  margin-top: -2px;
  border-left: 2px solid var(--paper);
  border-bottom: 2px solid var(--paper);
  transform: rotate(-45deg);
}
.opties-rijen .optie:has(input:checked) .merk::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper);
}

/* ---------- Advies en verzenden ---------- */
.advies p:not(.eyebrow) { margin-top: 12px; max-width: 62ch; color: var(--ink-2); }
.advieslijst {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 16px;
  list-style: none;
}
.advieslijst li {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 14px;
  color: var(--ink-2);
}

.verzendbalk { padding-block: 12px 8px; }
.knop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-full);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.knop-primair { background: var(--blue); color: var(--primary-text); font-weight: 600; }
@media (hover: hover) {
  .knop-primair:hover:not(:disabled) { background: var(--blue-hover); }
}
.knop-primair:active:not(:disabled) { background: var(--blue-active); transform: scale(0.97); }
a.knop { text-decoration: none; }
.knop:disabled, .knop[aria-disabled="true"] {
  background: var(--paper-3);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  cursor: default;
}
.knop:focus-visible, .tekstlink:focus-visible, .skiplink:focus-visible, .bedankt:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--focus-halo);
}
@media (max-width: 479px) {
  .knop-primair { width: 100%; }
}
.kleine-letters { margin-top: 12px; font-size: 13px; color: var(--muted); max-width: 60ch; }

.melding {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
}
.melding-fout { background: var(--red-soft); color: var(--red-ink); }

.bedankt { margin-top: 8px; }
.pdfblok { margin-block: 20px 4px; }
.bedankt .pdfblok .kleine-letters { margin-top: 8px; color: var(--muted); }
.bedankt p:not(.eyebrow) { margin-top: 12px; color: var(--ink-2); max-width: 60ch; }
.bedankt strong { color: var(--ink); overflow-wrap: anywhere; }

.voet {
  padding-block: 24px calc(32px + env(safe-area-inset-bottom, 0px));
  font-size: 13px;
  color: var(--muted);
}

.niet-zichtbaar {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .optie:active, .knop:active { transform: none !important; }
}
