/* LET OP: het bovenste deel van dit bestand loopt gelijk met de stijl van
   het project zorgfuik-checks. Wijzig je de huisstijl, doe het dan in allebei.
   Zie docs/GEDEELDE-CODE.md. */

/* Zorgfuik Checks - stijl
   Huiskleuren van Zorgfuik. Bewust geen externe lettertypen: de CSP staat geen
   externe bronnen toe en dat scheelt ook een verzoek naar Google Fonts. */

:root {
  --cream: #F7F3E8;
  --dark: #063F2A;
  --green: #008F5A;
  --light: #E4F5EC;
  --white: #FFFFFF;
  --ink: #173128;
  --muted: #5E7069;
  --line: #C9D8D1;
  --danger: #9B1C1C;
  --danger-bg: #FFF0F0;
  --warning: #7A4D00;
  --warning-bg: #FFF7DF;
  --radius: 20px;
  --shadow: 0 14px 40px rgba(6, 63, 42, .10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 8% 0%, rgba(0,143,90,.08), transparent 26rem), var(--cream);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--dark); }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); }
h2 { font-size: 1.25rem; margin-top: 2rem; }
.h3 { font-size: 1.05rem; margin: 0 0 .4rem; }

.shell { width: min(880px, calc(100% - 32px)); margin-inline: auto; }
.visually-hidden, .skip-link {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link:focus { width: auto; height: auto; clip: auto; margin: 0; left: 12px; top: 12px;
  z-index: 100; background: var(--white); padding: 10px; border-radius: 8px; }

/* header */
.site-header { background: var(--dark); color: var(--cream); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: var(--green); color: var(--white); font-weight: 800; }
.brand strong { display: block; font-size: .98rem; }
.brand small { display: block; font-size: .8rem; opacity: .75; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lang-switcher { display: flex; gap: 4px; }
.lang-button { background: transparent; color: var(--cream); border: 1px solid rgba(247,243,232,.35);
  border-radius: 999px; padding: 5px 10px; font-size: .78rem; font-weight: 700; }
.lang-button[aria-pressed="true"] { background: var(--cream); color: var(--dark); border-color: var(--cream); }

/* veiligheidsbalk, altijd zichtbaar */
.safety-bar { background: var(--danger-bg); border-bottom: 1px solid rgba(155,28,28,.25); }
.safety-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; font-size: .88rem; color: var(--danger); font-weight: 600; }
.safety-bar-link { background: transparent; border: 1px solid currentColor; color: var(--danger);
  border-radius: 999px; padding: 3px 12px; font-size: .82rem; font-weight: 700; }

main { padding: 26px 0 40px; }

/* kaarten */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(18px, 4vw, 30px); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.hero { padding: 8px 0 18px; }
.lead { font-size: 1.06rem; }
.eyebrow { display: inline-block; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 800; color: var(--green); margin-bottom: 6px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.section-heading { margin-top: 0; }
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.check-card { display: flex; flex-direction: column; }
.check-card h3 { margin: 0 0 6px; }
.check-card .primary-button { margin-top: auto; align-self: flex-start; text-decoration: none; }
.meta-line { font-size: .82rem; color: var(--muted); font-weight: 700; }

/* knoppen */
.primary-button, .secondary-button, .ghost-button, .link-button {
  border-radius: 999px; padding: 11px 20px; font-weight: 700; border: 1px solid transparent;
}
.primary-button { background: var(--green); color: var(--white); }
.primary-button:hover { background: #007a4d; }
.secondary-button { background: var(--white); color: var(--dark); border-color: var(--dark); text-decoration: none; display: inline-block; }
.ghost-button { background: transparent; color: var(--cream); border-color: rgba(247,243,232,.4); padding: 7px 14px; font-size: .85rem; }
.link-button { background: transparent; color: var(--muted); border: 0; text-decoration: underline; padding: 8px 0; font-weight: 600; font-size: .9rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: center; }

/* voortgang */
.progress { margin-bottom: 18px; }
.progress-meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.progress-track { height: 6px; background: var(--light); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--green); }

/* vragen */
.q-intro { color: var(--muted); margin: 2px 0 4px; font-size: .92rem; }
.q-title { margin: 4px 0 6px; }
/* Geen zichtbare rand om de vraagtekst: de focus wordt alleen programmatisch
   gezet zodat een screenreader de nieuwe vraag voorleest. Een groene kader
   liet het lijken alsof je in een invulveld stond. */
.q-title:focus { outline: none; }
.hint { margin: 10px 0 0; }

.scale { border: 0; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.scale-option input { position: absolute; opacity: 0; pointer-events: none; }
.scale-option span { display: flex; align-items: baseline; gap: 12px; padding: 11px 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--white); transition: border-color .12s, background .12s; }
.scale-option input:checked + span { border-color: var(--green); background: var(--light); box-shadow: inset 0 0 0 1px var(--green); }
.scale-option input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 2px; }
.scale-option strong { min-width: 1.2em; color: var(--green); }
.scale-option small { font-size: .95rem; color: var(--ink); }
@media (hover: hover) { .scale-option span:hover { border-color: var(--green); } }

/* Vanaf tabletbreedte staan de vijf antwoorden naast elkaar. Daarmee past een
   hele vraag binnen het scherm en hoef je niet meer te scrollen om te kiezen. */
@media (min-width: 700px) {
  .scale { grid-template-columns: repeat(5, 1fr); gap: 10px; }
  .scale-option span { flex-direction: column; align-items: center; text-align: center;
    gap: 6px; padding: 12px 8px; height: 100%; min-height: 92px; justify-content: center; }
  .scale-option strong { font-size: 1.15rem; min-width: 0; }
  .scale-option small { font-size: .86rem; line-height: 1.25; }
}

.radio-list { border: 0; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.radio-list label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.radio-list input { margin-top: 4px; accent-color: var(--green); }

.pause-note { margin-top: 14px; padding: 10px 14px; background: var(--light); border-radius: 12px; font-size: .9rem; }

.nav-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px;
  border-top: 1px solid var(--line); padding-top: 14px; }
.nav-buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* meldingen */
.notice { border-radius: 14px; padding: 14px 18px; margin: 18px 0; border: 1px solid; }
.notice h3, .notice h2 { margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }
.notice.info { background: var(--light); border-color: rgba(0,143,90,.3); }
.notice.warning { background: var(--warning-bg); border-color: rgba(122,77,0,.3); color: var(--warning); }
.notice.danger { background: var(--danger-bg); border-color: rgba(155,28,28,.3); color: var(--danger); }

/* lijsten */
.tick-list, .flag-list, .link-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.tick-list li, .flag-list li { position: relative; padding-left: 26px; }
.tick-list li::before, .flag-list li::before { content: ""; position: absolute; left: 6px; top: .62em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.flag-list li::before { background: var(--warning); }
.numbered { padding-left: 22px; display: grid; gap: 8px; }
.link-list li { padding-left: 0; }

/* resultaatprofiel */
.profile-list { display: grid; gap: 12px; margin: 14px 0; }
.profile-item { border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; background: var(--white); }
.profile-item.top { border-color: var(--green); background: var(--light); }
.profile-item h3 { margin: 0; font-size: 1rem; }
.profile-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-item p { margin: 6px 0 10px; font-size: .94rem; color: var(--muted); }
.band { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 999px; background: var(--light); color: var(--dark); white-space: nowrap; }
.band-veryHigh { background: #f6dcdc; color: var(--danger); }
.band-high { background: var(--warning-bg); color: var(--warning); }
.mini-track { height: 6px; background: rgba(6,63,42,.10); border-radius: 999px; overflow: hidden; }
.mini-track div { height: 100%; background: var(--green); }

.consent-row { display: flex; gap: 12px; align-items: flex-start; padding: 15px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--light); font-weight: 700; margin: 16px 0; }
.consent-row input { margin-top: 4px; accent-color: var(--green); transform: scale(1.2); }
.payload summary { cursor: pointer; font-weight: 700; color: var(--dark); }
.payload pre { max-height: 260px; overflow: auto; padding: 14px; border-radius: 12px;
  background: #10251e; color: #f5fff9; font-size: .78rem; white-space: pre-wrap; word-break: break-word; }
.send-status { font-weight: 700; font-size: .92rem; }
.send-status.ok { color: var(--green); }

/* dialogen */
dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: min(560px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(6,63,42,.55); }
.dialog-body { padding: 22px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-head h2 { margin: 0; }
.icon-button { background: transparent; border: 0; font-size: 1.5rem; line-height: 1; color: var(--muted); }

/* footer */
.site-footer { background: var(--dark); color: var(--cream); padding: 18px 0; margin-top: 30px; font-size: .88rem; }
.site-footer p { margin: 0; }

/* Op het scherm staan de printonderdelen uit. */
.print-doc-head, .print-doc-foot, .print-running, .write-space, .print-only-inline { display: none; }

/* ---------------------------------------------------------------------------
   Printweergave: dit is het PDF-ontwerp.
   In elke browser levert "Opslaan als PDF" hiermee een verzorgd A4-document.
   Zet in het printvenster de kop- en voetteksten van de browser uit en
   achtergrondafbeeldingen aan.
   --------------------------------------------------------------------------- */
@page {
  size: A4;
  margin: 16mm 15mm 18mm;
}

@media print {
  :root { --shadow: none; }

  html, body {
    background: #FFFFFF !important;
    color: #14261F;
    font-size: 10.5pt;
    line-height: 1.45;
  }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* alles wat op papier niets toevoegt */
  .site-header, .site-footer, .safety-bar, .button-row, .nav-row, dialog,
  .progress, .payload, .lang-switcher, .skip-link, #seo-intro,
  .send-status, .hint, .screen-only { display: none !important; }

  /* doorlopende voettekst, op elke pagina herhaald */
  .print-running {
    display: flex !important; justify-content: space-between; gap: 12px;
    position: fixed; bottom: -12mm; left: 0; right: 0;
    font-size: 7.5pt; color: #93A29B;
    border-top: .5pt solid #DCE6E1; padding-top: 3pt;
  }

  main { padding: 0; }
  .shell { width: 100%; margin: 0; }
  .card { box-shadow: none; border: 0; padding: 0; background: none; }

  /* documentkop */
  .print-doc-head {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 10px;
    margin-bottom: 18px;
    border-bottom: 2.5pt solid var(--dark);
  }
  .print-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--dark); font-size: 11pt; }
  .print-mark {
    display: inline-grid; place-items: center; width: 22px; height: 22px;
    border-radius: 6px; background: var(--green); color: #FFFFFF; font-size: 12pt;
  }
  .print-meta { text-align: right; font-size: 9pt; color: #4A5C55; display: grid; gap: 1px; }
  .print-meta strong { font-size: 11pt; color: var(--dark); }

  .eyebrow { color: var(--green); font-size: 8pt; }
  h1.q-title { font-size: 17pt; margin: 0 0 8px; }
  h2 { font-size: 12pt; margin: 16pt 0 6pt; padding-bottom: 3pt;
       border-bottom: .75pt solid #C9D8D1; break-after: avoid; page-break-after: avoid; }
  .h3 { font-size: 10.5pt; }
  .lead { font-size: 11pt; }

  /* profiel */
  .profile-list { gap: 7pt; }
  .profile-item {
    border: .75pt solid #C9D8D1; border-radius: 4pt; padding: 8pt 10pt;
    break-inside: avoid; page-break-inside: avoid; background: #FFFFFF;
  }
  .profile-item.top { border-color: var(--green); background: #F2FAF6; }
  .profile-item h3 { font-size: 10.5pt; }
  .profile-item p { margin: 3pt 0 6pt; font-size: 9.5pt; color: #4A5C55; }
  .band { font-size: 8pt; padding: 1.5pt 7pt; border: .5pt solid rgba(0,0,0,.12); }
  .print-only-inline { display: inline !important; }
  .mini-track { height: 4pt; background: #E1EAE6; }
  .mini-track div { background: var(--green); }

  /* meldingen */
  .notice { border-width: .75pt; border-radius: 4pt; padding: 8pt 10pt; margin: 10pt 0;
            break-inside: avoid; page-break-inside: avoid; }
  .notice.info { background: #F2FAF6; }
  .notice.warning { background: #FFFAEE; }
  .notice.danger { background: #FEF3F3; }

  /* lijsten */
  .tick-list li, .flag-list li { break-inside: avoid; page-break-inside: avoid; margin-bottom: 2pt; }
  .link-list { font-size: 9pt; }
  .link-list a { text-decoration: none; color: var(--dark); }
  .link-list a[href^="http"]::after { content: " (" attr(href) ")"; color: #6B7A74; word-break: break-all; }
  a.print-url { border: .75pt solid var(--dark); background: none !important; color: var(--dark) !important;
                padding: 4pt 8pt; border-radius: 3pt; font-size: 9pt; }
  a.print-url::after { content: " (" attr(href) ")"; font-weight: 400; color: #6B7A74; }

  /* gespreksvragen met schrijfruimte, zodat het blad bruikbaar is in de spreekkamer */
  .conversation { display: block; }
  .conversation li { break-inside: avoid; page-break-inside: avoid; margin-bottom: 10pt; font-weight: 600; }
  .write-space { display: block !important; margin-top: 4pt; }
  .write-space em { display: block; font-size: 7.5pt; font-style: normal; color: #93A29B; margin-bottom: 2pt; }
  .write-space::after {
    content: ""; display: block; height: 34pt;
    border-bottom: .5pt solid #C9D8D1;
    background-image: linear-gradient(to bottom, transparent 16pt, #C9D8D1 16pt, #C9D8D1 16.5pt, transparent 16.5pt);
  }

  /* documentvoet */
  .print-doc-foot {
    display: flex !important; justify-content: space-between; gap: 12px;
    margin-top: 16pt; padding-top: 6pt; border-top: .75pt solid #C9D8D1;
    font-size: 8pt; color: #6B7A74; break-inside: avoid;
  }
}

/* ---------------------------------------------------------------------------
   Aanvullingen voor de formulieren
   --------------------------------------------------------------------------- */
.question { border: 0; padding: 0; margin: 0 0 26px; }
.question + .question { border-top: 1px solid var(--line); padding-top: 22px; }
.question-title { font-weight: 700; font-size: 1.06rem; padding: 0; margin-bottom: 6px; display: block; }
.q-hint { color: var(--muted); font-size: .9rem; margin: 0 0 10px; }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); background: var(--light); border-radius: 999px;
  padding: 2px 8px; vertical-align: middle; margin-left: 6px; }
.radio-list label.has-error { border-color: var(--danger); }
.text-input { width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--white); color: var(--ink); font-family: inherit; }
.text-input:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-color: var(--green); }
.text-input.has-error { border-color: var(--danger); }
textarea.text-input { resize: vertical; min-height: 120px; line-height: 1.5; }
.counter { font-size: .8rem; color: var(--muted); margin: 6px 0 0; text-align: right; }
.other-field { display: block; margin-top: 10px; }
.other-field span { display: block; font-size: .88rem; color: var(--muted); margin-bottom: 6px; }
.other-field input { width: 100%; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--white); font-family: inherit; }
.field-error { color: var(--danger); font-size: .88rem; font-weight: 600; margin: 8px 0 0; }

/* Lokale testweergave, verschijnt alleen op localhost */
.test-panel { margin-top: 26px; }
.test-table { width: 100%; border-collapse: collapse; font-size: .86rem; margin: 12px 0; }
.test-table th, .test-table td { text-align: left; padding: 7px 9px; border-bottom: 1px solid rgba(122,77,0,.2); vertical-align: top; }
.test-table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
.test-table td:first-child { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.test-panel pre { background: #10251e; color: #f5fff9; padding: 12px; border-radius: 10px;
  font-size: .76rem; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.test-panel summary { cursor: pointer; font-weight: 700; }

/* Een vraag per scherm */
.question.solo { margin-bottom: 4px; }
.question.solo .question-title { font-size: clamp(1.2rem, 1rem + 1vw, 1.55rem); line-height: 1.25; margin-bottom: 10px; }
.question.solo .q-title:focus { outline: none; }
.question.solo .radio-list { margin-top: 16px; }
.nav-buttons .skip { margin-left: 6px; }

/* Overzichtsscherm voor het versturen */
.review { width: 100%; border-collapse: collapse; margin: 16px 0 4px; }
.review th, .review td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top; font-size: .92rem; }
.review th { font-weight: 700; width: 42%; color: var(--ink); }
.review td { color: var(--muted); }
.review tr:last-child th, .review tr:last-child td { border-bottom: 0; }
.review td.edit { width: 1%; white-space: nowrap; text-align: right; }
.review td.edit .link-button { padding: 0; font-size: .86rem; }
.review .empty-answer { color: var(--muted); font-style: normal; opacity: .7; }
.review tr.missing th { color: var(--danger); }
.review tr.missing td { background: var(--danger-bg); }
