/* Nwerkt — UI-bouwstenen voor website, klantomgeving en app.
   Laad eerst ../tokens/tokens.css (die laadt de lettertypen mee).
   Licht is standaard; zet data-thema="donker" (of "auto") op <html> voor de donkere modus. */

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.nw, .nw-basis {
  margin: 0;
  background: var(--nw-achtergrond);
  color: var(--nw-tekst-kleur);
  font-family: var(--nw-font-tekst);
  font-size: var(--nw-fs-tekst);
  line-height: var(--nw-lh-tekst);
  -webkit-font-smoothing: antialiased;
}
.nw h1, .nw h2, .nw h3, .nw h4, .nw-kop {
  font-family: var(--nw-font-kop);
  font-weight: 700;
  line-height: var(--nw-lh-kop);
  letter-spacing: -0.01em;
  margin: 0 0 var(--nw-ruimte-4);
  text-wrap: balance;
}
.nw h1 { font-size: var(--nw-fs-h1); }
.nw h2 { font-size: var(--nw-fs-h2); }
.nw h3 { font-size: var(--nw-fs-h3); }
.nw h4 { font-size: var(--nw-fs-h4); font-weight: 600; }
.nw p { margin: 0 0 var(--nw-ruimte-4); max-width: 68ch; }
.nw :where(a:not([class])) { color: var(--nw-accent-tekst); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.nw :where(a:not([class])):hover { text-decoration-thickness: 2px; }
.nw small, .nw-klein { font-size: var(--nw-fs-klein); }
.nw-zacht { color: var(--nw-tekst-zacht); }
.nw :focus-visible { outline: 3px solid var(--nw-oranje); outline-offset: 2px; border-radius: var(--nw-rond-s); }

/* De punt: het terugkerende teken. Gebruik <span class="nw-punt">.</span> achter een kop,
   of een leeg element met class nw-punt-vorm voor een ronde vorm. */
.nw-punt { color: var(--nw-accent); }
.nw-punt-vorm { display: inline-block; width: 0.42em; height: 0.42em; border-radius: 50%; background: var(--nw-accent); vertical-align: baseline; }

/* Bovenlabel boven een kop */
.nw-bovenlabel {
  display: block;
  font-family: var(--nw-font-tekst);
  font-size: var(--nw-fs-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nw-accent-tekst);
  margin-bottom: var(--nw-ruimte-3);
}

/* ---------- Knoppen ---------- */
.nw-knop {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--nw-ruimte-2);
  min-height: 44px; padding: 0 var(--nw-ruimte-5);
  font: 600 var(--nw-fs-klein)/1 var(--nw-font-tekst);
  border-radius: var(--nw-rond-m); border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.nw-knop:active { transform: translateY(1px); }
.nw-knop svg { width: 18px; height: 18px; }
.nw-knop--primair { background: var(--nw-knop); color: var(--nw-knop-tekst); }
.nw-knop--primair:hover { background: var(--nw-oranje-diep); }
.nw-knop--secundair { background: transparent; color: var(--nw-tekst-kleur); border-color: var(--nw-tekst-kleur); }
.nw-knop--secundair:hover { background: var(--nw-tekst-kleur); color: var(--nw-achtergrond); }
.nw-knop--tekst { background: transparent; color: var(--nw-accent-tekst); padding: 0 var(--nw-ruimte-2); }
.nw-knop--tekst:hover { text-decoration: underline; }
.nw-knop[disabled], .nw-knop[aria-disabled="true"] { background: var(--nw-vlak-2); color: var(--nw-uit); border-color: transparent; cursor: not-allowed; }
.nw-knop--klein { min-height: 36px; padding: 0 var(--nw-ruimte-4); font-size: var(--nw-fs-label); }

/* ---------- Formulieren ---------- */
.nw-veldgroep { display: grid; gap: var(--nw-ruimte-2); margin-bottom: var(--nw-ruimte-5); }
.nw-veldgroep label, .nw-veldlabel { font-size: var(--nw-fs-klein); font-weight: 600; }
.nw-hulptekst { font-size: var(--nw-fs-label); color: var(--nw-tekst-zacht); }
.nw-veld, .nw-keuze {
  width: 100%; min-height: 44px; padding: var(--nw-ruimte-2) var(--nw-ruimte-3);
  font: 400 var(--nw-fs-klein)/1.4 var(--nw-font-tekst); color: var(--nw-tekst-kleur);
  background: var(--nw-vlak); border: 1.5px solid var(--nw-rand); border-radius: var(--nw-rond-m);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nw-veld:hover, .nw-keuze:hover { border-color: var(--nw-tekst-zacht); }
.nw-veld:focus, .nw-keuze:focus { outline: none; border-color: var(--nw-oranje); box-shadow: 0 0 0 3px rgba(228, 87, 46, .22); }
textarea.nw-veld { min-height: 110px; resize: vertical; }
.nw-keuze { appearance: none; padding-right: 40px;
  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='%235A5750' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.nw-veld--fout { border-color: var(--nw-fout-tekst); }
.nw-foutmelding { font-size: var(--nw-fs-label); color: var(--nw-fout-tekst); font-weight: 500; }
.nw-vink { display: inline-flex; align-items: center; gap: var(--nw-ruimte-2); font-size: var(--nw-fs-klein); cursor: pointer; }
.nw-vink input { width: 20px; height: 20px; accent-color: var(--nw-knop); margin: 0; }

/* ---------- Kaarten en vlakken ---------- */
.nw-kaart { background: var(--nw-vlak); border: 1px solid var(--nw-rand); border-radius: var(--nw-rond-l); padding: var(--nw-ruimte-5); }
.nw-kaart--steen { background: var(--nw-vlak-2); border-color: transparent; }
.nw-kaart--donker { background: var(--nw-antraciet); color: var(--nw-wit); border-color: transparent; }
/* Fel oranje alleen met grote tekst (≥ 24 px of ≥ 19 px vet); voor kleine tekst de donkere variant. */
.nw-kaart--oranje { background: var(--nw-oranje-donker); color: var(--nw-wit-puur); border-color: transparent; }
.nw-kaart--fel { background: var(--nw-oranje); color: var(--nw-wit-puur); border-color: transparent; }
.nw-kaart > :last-child { margin-bottom: 0; }

/* Kengetal */
.nw-stat { display: grid; gap: 2px; }
.nw-stat b { font-family: var(--nw-font-kop); font-size: 2rem; line-height: 1.05; font-weight: 700; }
.nw-stat span { font-size: var(--nw-fs-label); color: var(--nw-tekst-zacht); }

/* ---------- Labels en meldingen ---------- */
.nw-label { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--nw-rond-rond);
  font-size: var(--nw-fs-label); font-weight: 600; line-height: 1.4; background: var(--nw-vlak-2); color: var(--nw-tekst-kleur); }
.nw-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.nw-label--succes { background: var(--nw-succes-vlak); color: var(--nw-succes); }
.nw-label--fout { background: var(--nw-fout-vlak); color: var(--nw-fout); }
.nw-label--let-op { background: var(--nw-let-op-vlak); color: var(--nw-let-op-tekst); }
.nw-label--oranje { background: var(--nw-perzik); color: var(--nw-oranje-diep); }
[data-thema="donker"] .nw-label--succes, [data-thema="donker"] .nw-label--fout, [data-thema="donker"] .nw-label--let-op, [data-thema="donker"] .nw-label--oranje { background: var(--nw-donker-vlak); }
[data-thema="donker"] .nw-label--succes { color: var(--nw-donker-succes); }
[data-thema="donker"] .nw-label--fout { color: var(--nw-donker-fout); }
[data-thema="donker"] .nw-label--let-op { color: var(--nw-donker-let-op); }
[data-thema="donker"] .nw-label--oranje { color: var(--nw-donker-oranje); }

.nw-melding { display: flex; gap: var(--nw-ruimte-3); align-items: flex-start; padding: var(--nw-ruimte-4); border-radius: var(--nw-rond-m);
  border-left: 4px solid currentColor; background: var(--nw-vlak); font-size: var(--nw-fs-klein); }
.nw-melding svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.nw-melding strong { display: block; color: var(--nw-tekst-kleur); }
.nw-melding p { margin: 0; color: var(--nw-tekst-kleur); }
.nw-melding--succes { color: var(--nw-succes-tekst); }
.nw-melding--fout { color: var(--nw-fout-tekst); }
.nw-melding--let-op { color: var(--nw-let-op-kleur); }
.nw-melding--info { color: var(--nw-accent-tekst); }

/* ---------- Tabel ---------- */
.nw-tabel { width: 100%; border-collapse: collapse; font-size: var(--nw-fs-klein); font-variant-numeric: tabular-nums; }
.nw-tabel th { text-align: left; font-size: var(--nw-fs-label); font-weight: 600; color: var(--nw-tekst-zacht);
  padding: var(--nw-ruimte-2) var(--nw-ruimte-3); border-bottom: 1.5px solid var(--nw-tekst-kleur); }
.nw-tabel td { padding: var(--nw-ruimte-3); border-bottom: 1px solid var(--nw-rand); }
.nw-tabel .getal { text-align: right; }
.nw-tabel tfoot td { font-weight: 600; border-bottom: none; border-top: 1.5px solid var(--nw-tekst-kleur); }

/* ---------- Navigatie ---------- */
.nw-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--nw-ruimte-5);
  padding: var(--nw-ruimte-4) var(--nw-ruimte-5); }
.nw-nav__logo img { height: 26px; display: block; }
.nw-nav__links { display: flex; gap: var(--nw-ruimte-5); list-style: none; margin: 0; padding: 0; font-size: var(--nw-fs-klein); font-weight: 500; }
.nw-nav__links a { color: var(--nw-tekst-kleur); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nw-nav__links a:hover, .nw-nav__links a[aria-current="page"] { border-bottom-color: var(--nw-oranje); }

/* App-zijbalk */
.nw-zijbalk { display: grid; gap: 2px; padding: var(--nw-ruimte-3); background: var(--nw-vlak); border-right: 1px solid var(--nw-rand); }
.nw-zijbalk a { display: flex; align-items: center; gap: var(--nw-ruimte-3); padding: 10px 12px; border-radius: var(--nw-rond-m);
  color: var(--nw-tekst-kleur); text-decoration: none; font-size: var(--nw-fs-klein); font-weight: 500; }
.nw-zijbalk a svg { width: 20px; height: 20px; color: var(--nw-tekst-zacht); }
.nw-zijbalk a:hover { background: var(--nw-vlak-2); }
.nw-zijbalk a[aria-current="page"] { background: var(--nw-vlak-2); font-weight: 600; }
.nw-zijbalk a[aria-current="page"] svg { color: var(--nw-accent); }

/* ---------- Logo wisselen tussen licht en donker ---------- */
.nw-alleen-donker { display: none !important; }
[data-thema="donker"] .nw-alleen-licht { display: none !important; }
[data-thema="donker"] .nw-alleen-donker { display: block !important; }

@media (prefers-reduced-motion: reduce) { .nw-knop, .nw-veld, .nw-keuze { transition: none; } }

[data-thema="donker"] .nw-kaart--donker { border-color: var(--nw-donker-lijn); }

/* Automatische modus: data-thema="auto" volgt de systeeminstelling. Zelfde regels als [data-thema="donker"]. */
@media (prefers-color-scheme: dark) {
  [data-thema="auto"] .nw-alleen-licht { display: none !important; }
  [data-thema="auto"] .nw-alleen-donker { display: block !important; }
  [data-thema="auto"] .nw-label--succes, [data-thema="auto"] .nw-label--fout, [data-thema="auto"] .nw-label--let-op, [data-thema="auto"] .nw-label--oranje { background: var(--nw-donker-vlak); }
  [data-thema="auto"] .nw-label--succes { color: var(--nw-donker-succes); }
  [data-thema="auto"] .nw-label--fout { color: var(--nw-donker-fout); }
  [data-thema="auto"] .nw-label--let-op { color: var(--nw-donker-let-op); }
  [data-thema="auto"] .nw-label--oranje { color: var(--nw-donker-oranje); }
  [data-thema="auto"] .nw-kaart--donker { border-color: var(--nw-donker-lijn); }
}
