/* ============================================================
   IT Grip Scan — Enso design-fundament
   Afgeleid uit 04-design-systeem/design.md (Enso v2.22)
   Regels die hier bewust worden toegepast:
   - Barlow Condensed 700, UPPERCASE, letter-spacing +0.5px (koppen)
   - Noto Sans 400/600 (body), JetBrains Mono 400 (data/output)
   - Eén Samurai-Rood accent per view; rood spaarzaam
   - Geen drop-shadows (sumi-e / no-shadows-discipline) — diepte via borders + grijsladder
   - Radius: base 2px (default), sm 4px (containers/foto), pill (cirkels/switch)
   - 8-punts spacing; card-padding 32px; witruimte (ma) als hoofdrolspeler
   - Focus-ring rood 2px, nooit verwijderd; hit-target >= 44px; WCAG AA
   ============================================================ */

:root {
  /* Primair */
  --red: #9D0A0E;
  --red-hover: #7A0709;
  --red-active: #5C0406;
  --red-subtle: #F2E5E0;       /* warme washi-tint voor error */
  --white: #FAFAFA;
  --black: #121212;

  /* Secundair (zeer spaarzaam) */
  --indigo: #2C3E50;
  --gold: #D4AF37;

  /* Grijsladder (chouboku — geen treden overslaan) */
  --gray-50:  #F4F4F4;
  --gray-100: #EDEDED;
  --gray-200: #E0E0E0;
  --gray-300: #CCCCCC;
  --gray-400: #B3B3B3;
  --gray-500: #8A8A8A;
  --gray-600: #666666;
  --gray-700: #4A4A4A;
  --gray-800: #2E2E2E;
  --gray-900: #1C1C1C;

  /* Semantisch */
  --success: #2F6E3C;
  --success-subtle: #E8F1EA;
  --warning: #A67A00;
  --warning-subtle: #F5EFE0;

  /* Rollen — light */
  --bg: var(--white);
  --surface: var(--white);
  --surface-alt: var(--gray-50);
  --border: var(--gray-200);
  --border-strong: var(--gray-400);
  --fg: var(--black);
  --fg-muted: var(--gray-600);
  --fg-subtle: var(--gray-400);
  --accent: var(--red);

  /* Typografie */
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Noto Sans", Arial, Helvetica, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;

  /* Spacing (8-pt grid) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 40px; --s-8: 48px;
  --s-9: 64px; --s-10: 80px; --s-11: 96px; --s-12: 120px;

  /* Radius */
  --r-base: 2px;
  --r-sm: 4px;
  --r-pill: 999px;

  --container: 1200px;
  --measure: 64ch;            /* leesbreedte body */
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ============ RESET ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  font-feature-settings: "kern", "calt", "tnum";
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
::selection { background: var(--red); color: var(--white); }

/* ============ TYPOGRAFIE ============ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.05;
  color: var(--fg);
}
h1 { font-size: clamp(2.4rem, 7vw, 4.25rem); }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.75rem); }
h3 { font-size: clamp(1.15rem, 3vw, 1.6rem); }
h4 { font-size: 1.05rem; letter-spacing: 0.4px; }

p { max-width: var(--measure); }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--fg-muted); }
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.78rem;
  color: var(--red);
}
.muted { color: var(--fg-muted); }
.data { font-family: var(--font-mono); font-feature-settings: "tnum"; }

a {
  color: var(--black);
  text-decoration: underline;        /* links ALTIJD onderstreept */
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease);
}
a:hover { color: var(--red); }

/* ============ LAYOUT ============ */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-5); }
.section { padding: var(--s-11) 0; }
.section--alt { background: var(--surface-alt); }
.stack > * + * { margin-top: var(--s-4); }
.center { text-align: center; }
.maxw-720 { max-width: 720px; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* ============ KNOPPEN ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: var(--s-3) var(--s-5);
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; border-radius: var(--r-base);
  cursor: pointer; text-decoration: none;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-hover); color: var(--white); }
.btn-primary:active { background: var(--red-active); }
.btn-secondary { background: var(--white); color: var(--black); border-color: var(--black); }
.btn-secondary:hover { background: var(--black); color: var(--white); }
.btn-tertiary { background: transparent; color: var(--black); padding-left: var(--s-2); padding-right: var(--s-2); }
.btn-tertiary:hover { color: var(--red); text-decoration: underline; }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--gray-200); color: var(--gray-400); border-color: transparent; cursor: not-allowed; }
.btn-lg { min-height: 52px; padding: var(--s-4) var(--s-7); font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ============ FOCUS (nooit verwijderen) ============ */
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
a.skip-link {
  position: absolute; left: var(--s-4); top: -56px; z-index: 200;
  background: var(--red); color: var(--white); padding: var(--s-2) var(--s-4);
  text-decoration: none; border-radius: var(--r-base);
  transition: top 0.15s var(--ease);
}
a.skip-link:focus { top: var(--s-4); color: var(--white); }

/* ============ ENSŌ-ANKER ============ */
.enso { display: block; }
.enso svg { width: 100%; height: 100%; }

/* dunne, gestreepte sumi-e-divider */
.divider {
  border: 0; height: 1px;
  background: repeating-linear-gradient(90deg, var(--gray-300) 0 2px, transparent 2px 9px);
  margin: 0;
}

/* ============ HEADER ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,250,0.92); backdrop-filter: saturate(120%) blur(6px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: var(--s-2); text-decoration: none; color: var(--black); }
.brand:hover { color: var(--black); }
.brand__mark { width: 26px; height: 26px; flex: 0 0 auto; }
.brand__name { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; font-size: 1.15rem; }
.brand__sub { font-family: var(--font-body); font-weight: 400; font-size: 0.7rem; letter-spacing: 1px; color: var(--fg-muted); text-transform: uppercase; }
.nav { display: none; gap: var(--s-5); }
.nav a { font-weight: 600; font-size: 0.9rem; text-decoration: none; color: var(--black); }
.nav a:hover { color: var(--red); text-decoration: underline; }
@media (min-width: 820px) { .nav { display: flex; align-items: center; } }

/* ============ HERO ============ */
.hero { position: relative; overflow: hidden; padding: var(--s-11) 0 var(--s-10); }
.hero__grid { display: grid; grid-template-columns: 1fr; gap: var(--s-7); align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.2fr 0.8fr; } }
.hero h1 { margin-bottom: var(--s-5); }
.hero .lead { margin-bottom: var(--s-6); }
.hero__meta { font-size: 0.9rem; color: var(--fg-muted); margin-bottom: var(--s-6); }
.hero__enso { position: relative; aspect-ratio: 1 / 1; max-width: 420px; margin-inline: auto; }

/* ============ KAARTEN / GRID ============ */
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: var(--s-6);
}
.card--accent { border-left: 3px solid var(--red); }
.card__icon { width: 44px; height: 44px; margin-bottom: var(--s-4); color: var(--red); }
.card h3, .card h4 { margin-bottom: var(--s-2); }
.card p { color: var(--fg-muted); font-size: 0.95rem; }

/* genummerde stap */
.step__num {
  width: 48px; height: 48px; border: 2px solid var(--red); border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--red);
  margin-bottom: var(--s-4);
}

/* dimensie-tegel */
.dim {
  display: flex; gap: var(--s-3); align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: var(--s-5);
}
.dim__no { font-family: var(--font-mono); color: var(--red); font-size: 0.85rem; padding-top: 2px; }
.dim h4 { margin-bottom: 2px; }
.dim p { color: var(--fg-muted); font-size: 0.85rem; }

/* ============ FORMULIEREN ============ */
.field { margin-bottom: var(--s-5); }
.field > label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: var(--s-2); }
.field .req { color: var(--red); }
.field .hint { display: block; font-weight: 400; color: var(--fg-muted); font-size: 0.82rem; margin-top: 2px; }
.input, .select {
  width: 100%; min-height: 44px; padding: var(--s-2) var(--s-3);
  font-family: var(--font-body); font-size: 1rem; color: var(--fg);
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-base);
  transition: border-color 0.15s var(--ease);
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.input:focus, .select:focus { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--border-strong); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--red); }
.field__error { display: none; color: var(--red); font-size: 0.82rem; margin-top: var(--s-2); }
.field.has-error .field__error { display: block; }

/* checkbox */
.check { display: flex; align-items: flex-start; gap: var(--s-3); }
.check input[type="checkbox"] { width: 20px; height: 20px; min-width: 20px; margin-top: 2px; accent-color: var(--red); }
.check label { font-size: 0.92rem; color: var(--fg-muted); }

/* twee kolommen op desktop */
.form-row { display: grid; gap: var(--s-5); }
@media (min-width: 680px) { .form-row { grid-template-columns: 1fr 1fr; } }

/* ============ BARS RADIO-KAARTEN ============ */
/* Expliciet Enso-kader (i.p.v. browser-default fieldset-rand): de
   kaderlijn staat bewust ruim van de vraagtitel én de antwoordopties af. */
.question {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: var(--s-5);
  margin-bottom: var(--s-7);
}
@media (min-width: 680px) { .question { padding: var(--s-6); } }
.question__head { display: flex; gap: var(--s-3); align-items: baseline; margin-bottom: var(--s-5); }
.question__code { font-family: var(--font-mono); color: var(--red); font-size: 0.85rem; }
.question__title { font-weight: 600; font-size: 1.08rem; }
.question__aspect { font-size: 0.8rem; color: var(--fg-subtle); }
.options { display: flex; flex-direction: column; gap: var(--s-2); }
.option {
  display: flex; align-items: flex-start; gap: var(--s-3);
  min-height: 44px; padding: var(--s-3) var(--s-4);
  border: 1px solid var(--border); border-radius: var(--r-base);
  background: var(--white); cursor: pointer;
  transition: border-color 0.12s var(--ease), background-color 0.12s var(--ease);
}
.option:hover { border-color: var(--border-strong); }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option__dot {
  width: 20px; height: 20px; min-width: 20px; margin-top: 1px;
  border: 2px solid var(--gray-400); border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
}
.option__dot::after { content: ""; width: 10px; height: 10px; border-radius: var(--r-pill); background: var(--red); transform: scale(0); transition: transform 0.12s var(--ease); }
.option__text { font-size: 0.95rem; color: var(--fg); }
.option:has(input:checked) { border-color: var(--red); background: #FFF; }
.option:has(input:checked) .option__dot { border-color: var(--red); }
.option:has(input:checked) .option__dot::after { transform: scale(1); }
.option:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
.option--na { border-style: dashed; }
.option--na .option__text { color: var(--fg-muted); }
.question.has-error .options { outline: 2px solid var(--red); outline-offset: 4px; border-radius: var(--r-base); }
.question .field__error { margin-top: var(--s-3); }
.question.has-error .field__error { display: block; }

/* ============ PROGRESS ============ */
.progress { position: sticky; top: 64px; z-index: 50; background: var(--white); border-bottom: 1px solid var(--border); }
.progress .container { padding-top: var(--s-3); padding-bottom: var(--s-3); }
.progress__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-2); }
.progress__label { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; color: var(--fg-muted); }
.progress__count { font-family: var(--font-mono); font-size: 0.82rem; color: var(--fg-muted); }
.progress__bar { height: 4px; background: var(--gray-200); border-radius: var(--r-pill); overflow: hidden; }
.progress__fill { height: 100%; width: 0; background: var(--red); transition: width 0.3s var(--ease); }

/* ============ STAP-PANEEL ============ */
.panel { max-width: 760px; margin: 0 auto; padding: var(--s-8) 0 var(--s-11); }
.panel__nav { display: flex; gap: var(--s-3); justify-content: space-between; margin-top: var(--s-7); }
.scan-section { padding-top: var(--s-7); }

/* ============ BADGES / ALERTS ============ */
.badge { display: inline-flex; align-items: center; gap: var(--s-1); font-size: 0.78rem; font-weight: 600; padding: 2px 10px; border-radius: var(--r-pill); }
.badge--red { background: var(--red-subtle); color: var(--red-active); }
.badge--gray { background: var(--gray-100); color: var(--fg-muted); }
.alert { border: 1px solid var(--border); border-left: 3px solid var(--gray-400); border-radius: var(--r-base); padding: var(--s-4) var(--s-5); font-size: 0.92rem; }
.alert--warning { border-left-color: var(--warning); background: var(--warning-subtle); }
.alert--error { border-left-color: var(--red); background: var(--red-subtle); }
.alert--info { border-left-color: var(--indigo); background: #EAEDF1; }
.alert strong { font-weight: 600; }

/* ============ DEELLINK / OUTPUT ============ */
.copybox { display: flex; gap: var(--s-2); align-items: stretch; }
.copybox input { flex: 1; font-family: var(--font-mono); font-size: 0.85rem; }
.codeblock {
  font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.6;
  background: var(--gray-900); color: #EDEDED; border-radius: var(--r-sm);
  padding: var(--s-5); overflow: auto; max-height: 360px; white-space: pre;
}
details.dev { margin-top: var(--s-6); border: 1px dashed var(--border-strong); border-radius: var(--r-sm); padding: var(--s-4) var(--s-5); }
details.dev summary { cursor: pointer; font-weight: 600; }

/* ============ STAT (dashboard) ============ */
.stat { text-align: center; }
.stat__num { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.5rem, 8vw, 4rem); color: var(--black); line-height: 1; }
.stat__num--red { color: var(--red); }
.stat__label { text-transform: uppercase; letter-spacing: 1px; font-size: 0.78rem; color: var(--fg-muted); margin-top: var(--s-2); }

/* ============ FOOTER ============ */
.site-footer { background: var(--black); color: var(--gray-300); padding: var(--s-9) 0 var(--s-6); margin-top: var(--s-11); }
.site-footer a { color: var(--gray-300); text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-grid { display: grid; gap: var(--s-6); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: var(--s-7); }
.footer-grid h4 { color: var(--white); margin-bottom: var(--s-3); font-size: 0.9rem; }
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: var(--s-2); font-size: 0.9rem; }
.footer-bottom { border-top: 1px solid var(--gray-800); padding-top: var(--s-5); font-size: 0.85rem; color: var(--gray-500); }

/* ============ UTIL ============ */
.hidden { display: none !important; }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
