/*
 * Volwassenheidsscan — losstaande stijl.
 *
 * Geen Tailwind, geen webfont, geen externe verzoeken: de pagina moet los van
 * de app werken en ook binnen een iframe op een andere pagina netjes staan.
 * De kleuren komen uit het CLVM-palet (src/theme.js), de statuskleuren uit het
 * Executive Dashboard. Wit haalt op amber (2,1:1) en goud (3,4:1) geen 4,5:1,
 * dus daar staat donkere inkt op; groen en rood dragen wél wit. Kleur is nooit
 * de enige drager — elke meter en elk badge heeft een tekstlabel.
 */

:root {
  --brand: #5e5956;
  --brand-hover: #6e6965;
  --page-bg: #fafaf7;
  --surface: #f1efe8;
  --border: #d3d1c7;
  --text-primary: #1f1f1e;
  --text-secondary: #5f5e5a;
  --text-tertiary: #888780;
  --green: #3b6d11;
  --amber: #ef9f27;
  --red: #c4614a;
  --gold: #b9812e;
  --track: #e5e0d8;
  --ink-on-dark: #ffffff;
  --ink-on-light: #1f1f1e;
  --radius: 16px;
}

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

html { overscroll-behavior-y: contain; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

/* Losstaande pagina, geen browser-website-gevoel: geen grijze/blauwe tik-flits
   op knoppen, wel een eigen :active-terugkoppeling (zie hieronder per knop). */
button, a { -webkit-tap-highlight-color: transparent; }

.scan-shell {
  padding: 40px 20px calc(56px + env(safe-area-inset-bottom));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
/* Ingesloten in een pagina: die pagina levert de omlijsting en de witruimte al. */
body.embed { background: transparent; }
body.embed .scan-shell { padding: 24px 20px 28px; }
body.embed .card:first-of-type { margin-top: 0; }
.scan { max-width: 720px; margin: 0 auto; }

.scan-noscript {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

/* ── Typografie ──────────────────────────────────────────────────────────── */

.scan h1 {
  margin: 16px 0 0;
  font-size: clamp(1.75rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
  /* Samengestelde woorden als "leveranciersmanagement" zijn breder dan een
     telefoonscherm; laat ze afbreken in plaats van de pagina te verbreden. */
  overflow-wrap: break-word;
  hyphens: auto;
}
.scan h1 .accent {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 600;
  color: var(--brand);
}
.scan h2 {
  margin: 0 0 16px;
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
}
.scan p { margin: 12px 0 0; color: var(--text-secondary); }
.scan .lead { font-size: 1rem; line-height: 1.75; }

.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(94, 89, 86, 0.1);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.note { font-size: 0.8125rem; color: var(--text-tertiary); }

/* ── Kaarten ─────────────────────────────────────────────────────────────── */

.card {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.card.muted { background: var(--surface); }
.card.accent { border: 2px solid var(--brand); }
.card > :first-child { margin-top: 0; }

.grid { display: grid; gap: 12px; }
@media (min-width: 640px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .card { padding: 24px 28px; }
}

.usp {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.usp strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
}
.usp span { display: block; margin-top: 4px; font-size: 0.875rem; color: var(--text-secondary); }

.pillar-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
@media (min-width: 640px) { .pillar-list { grid-template-columns: 1fr 1fr; } }
.pillar-list li { display: flex; gap: 8px; font-size: 0.875rem; color: var(--text-secondary); }
.pillar-list .dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 9px; border-radius: 50%; background: var(--brand); }
.pillar-list strong { color: var(--text-primary); }

/* ── Formuliervelden ─────────────────────────────────────────────────────── */

.field { margin-top: 16px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}
.text-input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text-primary);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.15s;
}
.text-input:hover { border-color: var(--text-tertiary); }
.text-input:disabled { opacity: 0.6; cursor: not-allowed; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.checkbox-row input {
  flex: 0 0 auto;
  margin: 2px 0 0;
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* ── Knoppen ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s, transform 0.1s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: scale(0.97); }
.btn.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.btn.primary:hover { border-color: var(--brand-hover); background: var(--brand-hover); color: #fff; }
.btn:focus-visible, .answer:focus-visible, .link-btn:focus-visible,
.text-input:focus-visible, .checkbox-row input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.btn-row.spread { justify-content: space-between; }

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  touch-action: manipulation;
}
.link-btn.subtle { color: var(--text-secondary); }

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.scan-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--brand); font-size: 0.875rem; font-weight: 700; letter-spacing: 0.02em; }
.scan-logo img { display: block; }
.scan-logo:hover { opacity: 0.75; }

/* ── Vragen ──────────────────────────────────────────────────────────────── */

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.progress-head .chip {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.progress-track {
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
.progress-fill { height: 100%; border-radius: 999px; background: var(--brand); transition: width 0.3s ease; }

/* Live tussenstand: bijgewerkt ná elk antwoord, zelfde berekening als op het
   resultaatscherm — laat het niveau al tijdens de scan meebewegen. */
.live-level {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 18px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.live-level-caption { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); }
.live-level-value { font-family: Georgia, "Times New Roman", serif; font-weight: 900; font-size: 1.05rem; color: var(--text-primary); }
.live-level-label { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); }
.live-level-explainer { margin-top: 8px; line-height: 1.5; max-width: 46ch; }

.question { margin: 32px 0 0; font-size: clamp(1.25rem, 4vw, 2rem); line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: break-word; hyphens: auto; }
.question-help { margin-top: 12px; }

.answers { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.answer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 16px 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s, background-color 0.15s, transform 0.1s;
}
.answer:hover { border-color: var(--brand); background: var(--surface); }
.answer:active { transform: scale(0.985); }
.answer[aria-pressed="true"] { border-color: var(--brand); background: rgba(94, 89, 86, 0.06); }
.answer .swatch { flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%; }
.answer .label { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.answer .hint { margin-left: auto; font-size: 0.8125rem; color: var(--text-tertiary); }
@media (max-width: 519px) { .answer .hint { display: none; } }

/* ── Volwassenheidstrap ──────────────────────────────────────────────────── */

.stairs { display: flex; align-items: flex-end; gap: 8px; }
.stair { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.stair .bar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  padding-bottom: 8px;
  border-radius: 8px;
  background: var(--track);
}
.stair.active .bar { background: var(--gold); }
.stair .score {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-on-light);
  text-align: center;
}
.stair .score small { font-family: inherit; font-size: 0.8125rem; opacity: 0.8; }
/* Vijf kolommen op een telefoon zijn te smal voor "5.0 / 5" op één regel: dat
   liep over de balk heen. Het niveau staat al in de kop en de legenda eronder,
   dus op mobiel volstaat het kale cijfer. */
@media (max-width: 639px) {
  .stair .score { font-size: 1.05rem; white-space: nowrap; }
  .stair .score small { display: none; }
}
.stair .num { font-size: 0.75rem; color: var(--text-tertiary); }
.stair .name { width: 100%; font-size: 0.75rem; line-height: 1.2; text-align: center; color: var(--text-tertiary); }
.stair.active .num, .stair.active .name { font-weight: 700; color: var(--text-primary); }
/* Vijf niveaunamen passen niet naast elkaar op een telefoon: daar staat het
   cijfer onder de balk en de namenreeks eronder. */
.stair .name { display: none; }
.stairs-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 12px; font-size: 0.75rem; color: var(--text-tertiary); }
.stairs-legend .active { font-weight: 700; color: var(--text-primary); }
@media (min-width: 640px) {
  .stair .name { display: block; }
  .stair .num { display: none; }
  .stairs-legend { display: none; }
  .stair .score { font-size: 1.75rem; }
}

/* ── Meters per pijler ───────────────────────────────────────────────────── */

.meters { display: grid; gap: 20px; }
@media (min-width: 640px) { .meters { grid-template-columns: 1fr 1fr; } }
.meter-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; margin-bottom: 6px; }
.meter-head .name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}
.meter-head .right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.meter-head .pct { font-size: 0.8125rem; font-weight: 700; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.status-badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.meter-track { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 999px; }

/* ── Acties ──────────────────────────────────────────────────────────────── */

.actions { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; }
.actions li { display: flex; gap: 12px; }
.actions .rank {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
}
.actions .text { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); }
.actions .pillar {
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

/* ── CTA-balk (knoppenrij + lopende tekst) ──────────────────────────────────
   Vanilla-equivalent van de React PublicCtaBar-component, zelfde visuele
   taal (donkere merkkleur, witte pillknoppen, marquee-tekstregel). */
.cta-bar { margin-top: 24px; border-radius: 16px; background: var(--brand); overflow: hidden; }
.cta-bar-buttons { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; padding: 24px; }
.cta-bar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  touch-action: manipulation;
  transition: background-color 0.15s;
}
.cta-bar-btn:hover { background: rgba(255, 255, 255, 0.1); }
.cta-bar-btn:active { background: rgba(255, 255, 255, 0.18); }
.cta-bar-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.cta-bar-ticker { border-top: 1px solid rgba(255, 255, 255, 0.15); overflow: hidden; }
.cta-bar-ticker-track { display: inline-flex; white-space: nowrap; animation: cta-bar-marquee 28s linear infinite; }
.cta-bar-ticker-track:hover { animation-play-state: paused; }
.cta-bar-ticker-item { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; color: rgba(255, 255, 255, 0.85); font-size: 0.875rem; text-decoration: none; }
.cta-bar-ticker-item:hover { color: #fff; }
.cta-bar-ticker-accent { color: #8fe38f; font-weight: 700; }
.cta-bar-ticker-sep { padding: 0 16px; color: rgba(255, 255, 255, 0.3); }
@keyframes cta-bar-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }

@media print {
  .scan-shell { padding: 0; }
  .cta-bar, .footer-links, .lang-toggle { display: none; }
  .card { break-inside: avoid; border-color: #ccc; }
}
