/* Basisontwerp in de stijl van Apple: systeemlettertype, rustige grijzen, witte afgeronde vlakken,
   pilvormige knoppen. Alle pagina's delen dit bestand. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Vlakken en tekst */
  --paper: #f5f5f7;
  --surface: #ffffff;
  --fill: #f2f2f7;
  --fill-2: #e8e8ed;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --faint: #86868b;
  --line: #e5e5ea;
  --line-strong: #d2d2d7;
  /* Accent. Een zaak kan een eigen kleur kiezen; de afgeleide tinten staan op body. */
  --accent: #0071e3;
  --accent-ink: #ffffff;
  /* Systeemkleuren */
  --rood: #ff3b30;
  --groen: #34c759;
  --danger: #d70015;
  --danger-soft: #fff1f0;
  --ok: #1d7a34;
  --ok-soft: #eaf8ee;
  --warn: #9a5b00;
  --warn-soft: #fff6e5;
  /* Vorm */
  --radius: 18px;
  --radius-s: 12px;
  --pil: 980px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.05);
  --shadow-l: 0 8px 24px rgba(0, 0, 0, 0.08), 0 24px 64px rgba(0, 0, 0, 0.14);
  --glas: saturate(180%) blur(20px);
  --zacht: cubic-bezier(0.25, 0.1, 0.25, 1);
  /* San Francisco op Apple-apparaten, Inter als dichtstbijzijnde alternatief elders. */
  --ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Afgeleide accenttinten opnieuw berekenen op het element waar --accent wordt gezet. */
body {
  --accent-soft: color-mix(in srgb, var(--accent) 10%, #ffffff);
  --accent-line: color-mix(in srgb, var(--accent) 30%, #ffffff);
  --accent-dark: color-mix(in srgb, var(--accent) var(--accent-dark-mix, 88%), #000000);
  --accent-ring: color-mix(in srgb, var(--accent) 55%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.022em; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
img, svg { display: block; }

.display { font-family: var(--display); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.muted { color: var(--muted); }
.klein { font-size: 13px; }

/* Een focusstijl voor alles wat je met het toetsenbord bereikt. */
:where(a, button, summary, [tabindex], input[type='checkbox'], input[type='color'], .chip):focus-visible {
  outline: 3px solid var(--accent-ring);
  outline-offset: 2px;
}

/* Knoppen */
.knop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--pil);
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s var(--zacht), transform 0.12s var(--zacht), opacity 0.2s;
}
.knop:active { transform: scale(0.97); }
.knop[disabled] { opacity: 0.4; cursor: default; transform: none; }
.knop.licht { background: rgba(0, 0, 0, 0.06); color: var(--ink); }
.knop.kaal { background: transparent; color: var(--accent-dark); padding: 0 12px; }
.knop.gevaar { background: #de2b1f; color: #fff; }
.knop.gevaar.licht { background: rgba(215, 0, 21, 0.08); color: #b3000f; }
.knop.klein { min-height: 36px; padding: 0 15px; font-size: 14px; }
.knop.groot { min-height: 52px; padding: 0 28px; font-size: 17px; }
.knop.breed { width: 100%; }
.knop svg { width: 18px; height: 18px; flex: none; }
@media (hover: hover) {
  .knop:hover:not([disabled]) { background: var(--accent-dark); }
  .knop.licht:hover:not([disabled]) { background: rgba(0, 0, 0, 0.1); }
  .knop.kaal:hover:not([disabled]) { background: rgba(0, 0, 0, 0.05); }
  .knop.gevaar:hover:not([disabled]) { background: #c4241a; }
  .knop.gevaar.licht:hover:not([disabled]) { background: rgba(215, 0, 21, 0.14); }
}

/* Formulieren */
.veldgroep { display: grid; gap: 7px; align-content: start; }
.veldgroep > label, .label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.veld {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  font-size: 16px;
  line-height: 1.35;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
.veld::placeholder { color: var(--faint); }
.veld:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
.veld[aria-invalid='true'] { border-color: var(--danger); }
.veld[readonly] { background: var(--fill); }
textarea.veld { min-height: 92px; resize: vertical; line-height: 1.45; }
input[type='date'].veld, input[type='time'].veld { height: 46px; }
select.veld {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' fill='none' stroke='%236e6e73' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}
.hulp { font-size: 13px; color: var(--muted); text-wrap: pretty; }
.fout-tekst { font-size: 14px; color: var(--danger); }
.optioneel { font-weight: 400; color: var(--muted); }

.melding {
  padding: 13px 16px;
  border-radius: var(--radius-s);
  font-size: 14px;
  line-height: 1.45;
  background: var(--fill);
  color: var(--ink-2);
}
.melding.fout { background: var(--danger-soft); color: #a3000f; }
.melding.goed { background: var(--ok-soft); color: #14602a; }
.melding.let-op { background: var(--warn-soft); color: #7a4700; }

.kaart { background: var(--surface); border-radius: var(--radius); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 15px;
  border-radius: var(--pil);
  border: 0;
  background: rgba(0, 0, 0, 0.06);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
}
.chip[aria-pressed='true'], .chip.actief { background: var(--accent); color: var(--accent-ink); }
@media (hover: hover) { .chip:not([aria-pressed='true']):not(.actief):hover { background: rgba(0, 0, 0, 0.1); } }
.stip { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }

.label-pil {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--pil);
  font-size: 12px;
  font-weight: 600;
  background: var(--fill-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.label-pil.groen { background: var(--ok-soft); color: var(--ok); }
.label-pil.rood { background: var(--danger-soft); color: var(--danger); }
.label-pil.geel { background: var(--warn-soft); color: var(--warn); }

/* Schakelaar zoals in iOS */
.schakel { position: relative; display: flex; align-items: flex-start; gap: 14px; cursor: pointer; }
.schakel input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.schakel .baan { flex: none; width: 51px; height: 31px; border-radius: 31px; background: #e9e9ea; position: relative; transition: background 0.25s var(--zacht); }
.schakel .baan::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16); transition: transform 0.25s var(--zacht); }
.schakel input:checked + .baan { background: var(--groen); }
.schakel input:checked + .baan::after { transform: translateX(20px); }
.schakel input:focus-visible + .baan { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.schakel .tekst { padding-top: 4px; min-width: 0; }
.schakel .tekst strong { display: block; font-weight: 500; font-size: 16px; }
.schakel .tekst span { display: block; font-size: 13px; color: var(--muted); margin-top: 1px; }
.vink-rij { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.vink-rij input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.veldgroep > label.vink-rij { font-size: 15px; font-weight: 400; color: var(--ink); }

/* Keuzebalk zoals het gesegmenteerde besturingselement van iOS */
.segment { display: inline-flex; padding: 2px; border-radius: 10px; background: rgba(118, 118, 128, 0.12); }
.segment button { height: 32px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; font-weight: 500; font-size: 14px; color: var(--ink); transition: background 0.2s; }
.segment button[aria-pressed='true'] { background: var(--surface); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04); }

.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2.5px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--faint);
  animation: draai 0.8s linear infinite;
}
@keyframes draai { to { transform: rotate(360deg); } }
.laden { display: grid; place-items: center; padding: 56px 0; }

/* Op aanraakschermen zijn alle raakvlakken minimaal 44 pixels, de maat die Apple aanhoudt. */
@media (pointer: coarse) {
  .knop.klein { min-height: 44px; }
  .chip { min-height: 44px; }
  .segment button { height: 44px; }
}
/* Confetti: ieder papiertje schiet omhoog en opzij, valt dan en draait ondertussen om zijn as. */
.confetti { position: fixed; inset: 0; z-index: 100; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: block;
  width: var(--w);
  height: var(--h);
  opacity: 0;
  animation: confetti-zij var(--dur) linear var(--delay) forwards;
}
/* Drie lagen, omdat een element maar een transform-animatie tegelijk kan hebben: opzij, omhoog en omlaag, draaien. */
.confetti i b { display: block; width: 100%; height: 100%; animation: confetti-val var(--dur) var(--delay) forwards; }
.confetti i b s { display: block; width: 100%; height: 100%; border-radius: var(--r); background: var(--c); animation: confetti-draai var(--spin) linear infinite; }
@keyframes confetti-zij {
  0% { opacity: 1; transform: translateX(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(var(--dx)); }
}
@keyframes confetti-val {
  0% { transform: translateY(0); animation-timing-function: cubic-bezier(0.15, 0.7, 0.4, 1); }
  28% { transform: translateY(var(--omhoog)); animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.6); }
  100% { transform: translateY(var(--omlaag)); }
}
@keyframes confetti-draai {
  from { transform: rotate3d(1, 0.6, 0.2, 0deg); }
  to { transform: rotate3d(1, 0.6, 0.2, 360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
