/* Lettertype: neutrale grotesque via systeemstack (Helvetica/Arial) — ambtelijke uitstraling,
   geen webfont-download nodig. fonts/ map blijft beschikbaar voor eventuele toekomstige swapping. */

:root {
  /* Minimalistisch: wit hoofdkleur, zwarte tekst, #f0f4f7 tint, rood accent subtiel. */
  --primary: #d8232a;
  --primary-dark: #a91b21;
  --accent: #d8232a;
  --accent-strong: #b01e24;
  --hero-bg: #f0f4f7;
  --page-bg: #f0f4f7;
  --surface: #ffffff;
  --field-bg: #ffffff;
  --text: #111111;
  --muted: #5a6673;
  --border: #dde4ea;
  --error: #b42318;
  --success: #067647;
  --focus-ring: rgba(216, 35, 42, 0.28);
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.06);
  --shadow-small: 0 1px 2px rgba(17, 17, 17, 0.05);
  --footer-bg: #14181d;
  --radius: 12px;
}

* { box-sizing: border-box; }
/* ---------- Beveiliging: geen selectie, geen kopie-hint, geen lang-drukken (security.js) ---------- */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;      /* lang-drukken (iOS/Android contextmenu) uit */
}
/* Invoervelden blijven functioneel: typen en cursor bewegen moet kunnen */
input, textarea, select, [contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}
::selection { background: transparent; }

/* DevTools open? Pagina-inhoud afdekken (klasse wordt door security.js gezet) */
body.devtools-open::after {
  content: "⛔ Inspecteren is niet toegestaan op deze pagina";
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: #14181d; color: #fff;
  font-family: sans-serif; font-size: 1.1rem; text-align: center;
}


html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;  /* ambtelijk: neutrale grotesque */
  font-size: 1rem;            /* 16px: geen iOS-zoom bij invoer */
  color: var(--muted);
  background: var(--page-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-top: 0;
}
strong { color: var(--text); }

img { max-width: 100%; display: block; }
code { font-size: 0.88em; background: var(--page-bg); padding: 0.1rem 0.3rem; border-radius: 5px; }

.container { width: min(1280px, calc(100% - 48px)); margin-inline: auto; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

/* ---------- Header: ambtelijk — klein logo + dienstvermelding, taalwisselaar rechts ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  min-height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--text);
}
.brand-logo { width: auto; height: 40px; max-width: 140px; object-fit: contain; object-position: center; }
/* Dienstvermelding naast het logo: gezag in plaats van groot bedrijfslogo */
.brand-org {
  display: flex; flex-direction: column; line-height: 1.25;
}
.brand-org strong {
  font-size: 1.05rem; font-weight: 700; letter-spacing: 0.02em;
}
.brand-org small {
  font-size: 0.72rem; color: var(--muted); letter-spacing: 0.01em;
}

/* Taalwisselaar: DE / FR / IT */
.lang-switch { display: flex; gap: 4px; flex: 0 0 auto; }
.lang-switch button {
  font-family: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--muted); cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.lang-switch button:hover { color: var(--text); border-color: var(--muted); }
.lang-switch button.is-active {
  color: #fff; background: var(--primary); border-color: var(--primary);
}
.lang-switch button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus-ring); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font-family: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif; font-size: 1rem; font-weight: 600; text-decoration: none;
  padding: 12px 20px; transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: none; box-shadow: 0 0 0 4px var(--focus-ring);
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--small { padding: 9px 16px; }
.btn--large { padding: 14px 26px; }

/* ---------- Layout ---------- */
.content-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 36px;
  align-items: start; padding: 40px 0 64px;
}
.form-intro {
  display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 24px;
}
/* Rij 1: titel links, stappenteller rechts — rustig en overzichtelijk */
.form-intro__head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px;
}
.form-intro h2 { font-size: 1.9rem; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
.form-intro p:not(.eyebrow) { color: var(--muted); font-size: 1rem; margin: 8px 0 0; max-width: 58ch; }
.progress-box {
  flex: 0 0 auto; min-width: 220px; text-align: right;
  background: var(--surface); border: none;
  border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow-small);
  color: var(--text); font-size: 0.95rem; font-weight: 700;
}
.progress-track { height: 8px; background: var(--page-bg); border-radius: 999px; overflow: hidden; margin-top: 9px; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 0.25s ease; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; border: none; }
.alert p { margin: 4px 0 0; }
.alert--error { background: #fef3f2; color: #7a271a; }
.alert--success { background: #ecfdf3; color: #05603a; }

/* ---------- Ambtelijke informatiebalk (admin.ch-stijl) ---------- */
/* Zwevende info-kaart: duidelijk blauw, zachte schaduw, kaart-uitstraling. */
.notice {
  display: flex; align-items: flex-start; gap: 12px;
  background: #e3eef9;                    /* zichtbaar lichtblauw */
  border: 1px solid #a8c7e8;              /* volledige blauwe rand */
  border-left: 4px solid #1f5fa8;         /* duidelijke blauwe accentrand */
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(31, 95, 168, 0.15),
              0 1px 3px rgba(31, 95, 168, 0.08);   /* zwevend kaartgevoel */
  padding: 15px 18px 15px 16px;
  font-size: 0.94rem; line-height: 1.55;
  color: #16324f;                          /* donkerblauwe tekst, goed leesbaar */
}
.notice__icon {
  flex: 0 0 auto;
  font-size: 1.15rem; line-height: 1.45;
  color: #1f5fa8;
}
.notice p { margin: 0; }

/* ---------- Form sections: blokken zonder border ---------- */
.form-section {
  background: var(--surface); border: none; border-radius: var(--radius);
  box-shadow: var(--shadow-small); padding: 34px 38px 38px; margin: 0 0 26px;
}
.section-head {
  display: flex; gap: 16px; align-items: flex-start;
  padding-bottom: 20px; margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.step-label {
  display: block; margin-bottom: 4px;
  font-family: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif; font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent-strong);
}
.section-head h3 { margin: 0; font-size: 1.3rem; font-weight: 700; line-height: 1.3; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }

/* Honeypot: onzichtbaar voor mensen, zichtbaar voor bots */
.hp-field {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden; opacity: 0; pointer-events: none;
}

.fields-grid {
  /* Slimmer ruimtegebruik: kolommen vloeien mee met de beschikbare breedte
     i.p.v. een vaste 2-koloms indeling. field--full pakt altijd de hele rij. */
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  column-gap: 26px; row-gap: 26px; align-items: start;
}
.field { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field__label--block { margin-bottom: 2px; }

/* ---------- Multi-select checklist (beleggingen / vermogen) ---------- */
.checklist {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 14px; align-items: stretch;
}
.checklist__item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 15px 16px; cursor: pointer;
  font-weight: 500; color: var(--text); font-size: 1rem; line-height: 1.35;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.checklist__item:hover { border-color: var(--primary); }
.checklist__item:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}
.checklist__item:focus-within { box-shadow: 0 0 0 4px var(--focus-ring); }
.checklist__item input[type="checkbox"] {
  width: 20px; height: 20px; accent-color: var(--primary); flex: 0 0 auto;
}
.checklist__item--other { grid-column: span 2; }
.checklist__other-input {
  flex: 1; min-width: 0; height: 44px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 0.95rem;
  padding: 0 12px;
}
.checklist__other-input:focus { outline: none; border-color: var(--primary); }
.field input, .field select {
  width: 100%; height: 56px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--field-bg); color: var(--text);
  font: inherit; font-size: 1.05rem; line-height: 1.6; padding: 0 16px;
}
.field input::placeholder { color: #9a9dab; }
.field input:hover, .field select:hover { border-color: var(--muted); }
.field input:focus, .field select:focus { border-color: var(--primary); background: var(--surface); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--error); }
.field-help { color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.field-error { color: var(--error); font-size: 0.88rem; font-weight: 600; }
.field label { font-weight: 600; font-size: 1rem; color: var(--text); line-height: 1.45; }

.form-actions {
  background: var(--surface); border: none; border-radius: var(--radius);
  box-shadow: var(--shadow-small); padding: 30px 36px;
}
.consent { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; font-size: 1rem; line-height: 1.55; color: var(--text); cursor: pointer; }
.consent input { width: 21px; height: 21px; margin-top: 3px; accent-color: var(--primary); flex: 0 0 auto; }
.action-row { display: flex; justify-content: space-between; gap: 14px; margin-top: 24px; }
.privacy-note { color: var(--muted); font-size: 0.9rem; margin: 14px 0 0; }

/* ---------- Sidebar: blokken zonder border ---------- */
.sidebar { display: grid; gap: 24px; position: sticky; top: 92px; }
.side-card {
  background: var(--surface); border: none; border-radius: var(--radius);
  box-shadow: var(--shadow-small); padding: 24px;
}
.side-card h3 { margin: 0 0 14px; font-size: 1.2rem; font-weight: 700; }
.side-card p { margin: 0; }
.side-card--dark {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  color: var(--text);
  box-shadow: none;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.side-card--dark h3 { color: var(--text); }
.side-card--dark p { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.83rem; margin-top: 10px !important; }
.section-links { display: grid; }
.section-links a {
  display: flex; align-items: center; gap: 12px;
  font-family: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif; font-size: 1.02rem;
  color: var(--text); text-decoration: none; font-weight: 600;
  padding: 11px 2px; border-bottom: 1px solid var(--border);
}
.section-links a:last-child { border-bottom: none; }
.section-links a:hover { color: var(--accent-strong); }

/* ---------- Footer: donker, neutraal (past bij wit/zwart thema) ---------- */
.site-footer { background: var(--footer-bg, #14181d); color: rgba(255,255,255,0.78); margin-top: 8px; }
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px;
  padding: 48px 0 36px;
}
.footer-col h4 { color: #fff; font-size: 1.05rem; font-weight: 600; margin: 0 0 16px; }
.footer-logo {
  width: auto; height: 42px; max-width: 180px; object-fit: contain; object-position: left center;
  background: #fff; border-radius: 7px; padding: 4px 8px; margin-bottom: 16px;
}
.footer-desc { margin: 0; max-width: 34ch; line-height: 1.55; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { color: rgba(255,255,255,0.78); text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-contact span { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.55); }
.footer-contact a { color: #fff; text-decoration: none; font-weight: 500; }
.footer-contact a:hover { text-decoration: underline; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.14); padding: 20px 0 24px; font-size: 0.88rem;
}
.footer-legal { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-legal a { color: rgba(255,255,255,0.78); text-decoration: none; }
.footer-legal a:hover { color: #fff; text-decoration: underline; }

/* ---------- Responsive ---------- */
/* Tablet + mobiel: app-weergave met één witte achtergrond voor het formulier */
@media (max-width: 940px) {
  body { background: var(--surface); }
  .header-inner { min-height: 60px; }
  .brand-logo { height: 34px; max-width: 120px; }
  .sidebar { display: none; }
  .content-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%; padding: 0 0 48px;
  }
  .form-intro { padding: 28px 24px 4px; margin-bottom: 16px; }
  .progress-box { background: var(--page-bg); box-shadow: none; }
  .alert { margin: 0 24px 16px; }
  .form-section {
    border-radius: 0; box-shadow: none; margin: 0;
    padding: 30px 24px 34px;
    border-bottom: 1px solid var(--border);
  }
  .form-actions { border-radius: 0; box-shadow: none; padding: 30px 24px 8px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 640px) {
  .container { width: min(100% - 24px, 1180px); }
  .header-inner { min-height: 56px; }
  .header-inner > .btn { display: none; }
  .brand-logo { height: 30px; max-width: 105px; }
  /* welkomstpopup verwijderd — ambtelijke header blijft compact op mobiel */
  .brand-org small { display: none; }
  .form-intro { padding: 24px 20px 4px; gap: 12px; }
  .form-intro__head { flex-direction: column; gap: 12px; }
  .progress-box { margin-top: 0; align-self: flex-end; }
  .alert { margin: 0 20px 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; padding: 36px 0 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .form-section { padding: 28px 22px 32px; }
  .form-actions { padding: 28px 22px 8px; }
  .field input, .field select { height: 52px; font-size: 1rem; }
  .section-head { align-items: flex-start; }
  .section-head h3 { font-size: 1.35rem; }
  .fields-grid, .sidebar { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
  .checklist { grid-template-columns: 1fr; }
  .checklist__item--other { grid-column: auto; }
  .action-row { flex-direction: column-reverse; }
  .action-row .btn { width: 100%; }
}

/* === VALIDATIE-FLITS === */
.field input.is-flash,
.field select.is-flash,
.field textarea.is-flash,
.consent.is-flash {
  animation: fieldFlash 2.4s ease-out forwards;
}

@keyframes fieldFlash {
  0%   { border-color: var(--error); box-shadow: 0 0 0 4px rgba(180,35,24,.22); background-color: rgba(180,35,24,.06); }
  55%  { border-color: var(--error); box-shadow: 0 0 0 3px rgba(180,35,24,.10); background-color: var(--field-bg); }
  100% { border-color: var(--border); box-shadow: none; background-color: var(--field-bg); }
}

.field-error { display: block; margin-top: 6px; font-size: .85rem; color: var(--error); }
.field-error[hidden] { display: none; }

.consent input[aria-invalid="true"] {
  outline: 2px solid var(--error);
  outline-offset: 3px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .field input.is-flash,
  .field select.is-flash,
  .field textarea.is-flash,
  .consent.is-flash { animation-duration: .01s; }
}

/* === VALIDATIE-V2 === */
.field input.is-flash,
.field select.is-flash,
.field textarea.is-flash {
  animation: fieldFlashStrong 2.4s cubic-bezier(.36,.07,.19,.97) forwards;
}

@keyframes fieldFlashStrong {
  0%   { border-color: var(--error); box-shadow: 0 0 0 6px rgba(180,35,24,.30); background-color: rgba(180,35,24,.12); transform: translateX(-4px); }
  10%  { transform: translateX(4px); }
  20%  { transform: translateX(-3px); }
  30%  { transform: translateX(3px); }
  40%  { transform: translateX(0); }
  70%  { border-color: var(--error); box-shadow: 0 0 0 3px rgba(180,35,24,.14); background-color: var(--field-bg); }
  100% { border-color: var(--border); box-shadow: none; background-color: var(--field-bg); }
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 7px;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--error);
}
.field-error::before { content: "⚠"; font-weight: 700; line-height: 1; }
.field-error[hidden] { display: none; }

.consent.is-flash {
  animation: consentFlash 2.4s ease-out forwards;
}
@keyframes consentFlash {
  0%   { outline: 3px solid var(--error); outline-offset: 4px; background-color: rgba(180,35,24,.10); }
  70%  { outline: 3px solid var(--error); outline-offset: 4px; background-color: transparent; }
  100% { outline: 3px solid transparent; outline-offset: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .field input.is-flash,
  .field select.is-flash,
  .field textarea.is-flash,
  .consent.is-flash { animation-duration: .01s; }
  /* (welkomstpopup verwijderd) */
}
