/* My-Event — huisstijl
   Layout: smalle bovenbalk, inhoud in één kolom (max 1100px); gastpagina's in een smalle kaart.
   Systeemlettertypes: geen externe fonts (privacy en snelheid). */
:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --ink: #111a24;
  --muted: #566372;
  --line: #d6dce3;
  --accent: #0d6278;
  --accent-ink: #ffffff;
  --accent-soft: #e1eff3;
  --ok: #1d7a45;      --ok-bg: #e3f3e9;
  --warn: #a35d00;    --warn-bg: #fbefd8;
  --bad: #b8252a;     --bad-bg: #fbe4e4;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1219; --surface: #141c26; --surface-2: #1a2430; --ink: #e6ebf0; --muted: #98a5b3;
    --line: #2a3644; --accent: #5cc3d9; --accent-ink: #06141a; --accent-soft: #123441;
    --ok: #4fca83; --ok-bg: #11301f; --warn: #f0a640; --warn-bg: #36260f; --bad: #ff6b6f; --bad-bg: #3b1416;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0; text-wrap: balance; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 13px; }
[hidden] { display: none !important; }

/* Bovenbalk */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: inline-block; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-weight: 500; }
.nav a[aria-current="page"], .nav a:hover { color: var(--ink); background: var(--surface-2); }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }

.page { max-width: 1100px; margin: 0 auto; padding-inline: 16px; padding-block: 24px 48px; display: flex; flex-direction: column; gap: 20px; }
.page-narrow { max-width: 480px; margin: 0 auto; padding-inline: 16px; padding-block: 32px 48px; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Panelen */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Formulieren */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.fields-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
legend { font-weight: 700; padding: 0 6px; }
.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: .3em; text-align: center; }

/* Knoppen */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border-radius: 8px; border: 1px solid transparent; background: var(--accent); color: var(--accent-ink);
  font: 600 15px var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-small { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
form.inline { display: inline; }

/* Meldingen */
.alert { border-radius: 8px; padding: 12px 14px; border: 1px solid var(--line); background: var(--surface); }
.alert-ok { background: var(--ok-bg); border-color: var(--ok); }
.alert-error { background: var(--bad-bg); border-color: var(--bad); }
.alert-info { background: var(--accent-soft); border-color: var(--accent); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn); }

/* Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* Status- en klasselabels */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; }
.pill-ok { color: var(--ok); background: var(--ok-bg); }
.pill-warn { color: var(--warn); background: var(--warn-bg); }
.pill-bad { color: var(--bad); background: var(--bad-bg); }
.pill-muted { color: var(--muted); background: var(--surface-2); }
.klasse { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; font-weight: 800; color: #fff; }
.klasse-A, .klasse-B { background: var(--ok); }
.klasse-C { background: var(--warn); }
.klasse-D { background: var(--bad); }
.klasse-none { background: var(--muted); }

/* Klassekeuze bij screening */
.klasse-choice { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.klasse-choice label { border: 2px solid var(--line); border-radius: 10px; padding: 12px 8px; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.klasse-choice input { position: absolute; opacity: 0; pointer-events: none; }
.klasse-choice b { font-size: 22px; }
.klasse-choice span { font-size: 12px; color: var(--muted); }
.klasse-choice input:checked + label { border-color: var(--accent); background: var(--accent-soft); }
.klasse-choice input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.klasse-choice input:disabled + label { opacity: .4; cursor: not-allowed; }

/* Foto's */
.photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.photo { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #000; display: block; }
.photo span { font-size: 12px; color: var(--muted); padding: 6px 8px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* Uploadvakken bij aanmelden */
.capture { border: 2px dashed var(--line); border-radius: 12px; padding: 16px; display: flex; gap: 14px; align-items: center; }
.capture.has-photo { border-style: solid; border-color: var(--ok); }
.capture img { width: 84px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--surface-2); flex: none; }
.capture .placeholder { width: 84px; height: 64px; border-radius: 6px; background: var(--surface-2); flex: none; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }
.capture .cap-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

/* QR in dashboard */
.qr-share { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr-share img { width: 160px; height: 160px; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-family: var(--mono); font-size: 13px; }

/* Gastpagina's */
.guest-head { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.guest-foot { text-align: center; color: var(--muted); font-size: 12px; padding-bottom: 24px; }
.event-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--accent); }

@media (max-width: 520px) {
  .panel { padding: 16px; }
  .klasse-choice { grid-template-columns: repeat(2, 1fr); }
  .who .who-name { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.grow { flex: 1; min-width: 200px; }

/* Toegangspas */
.pass-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 16px; text-align: center; }
.pass-top { display: flex; flex-direction: column; gap: 4px; }
.pass-state { display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: left; }
.pass-state[data-state="pass"] { align-items: center; text-align: center; }
.pass-name { font-size: 20px; font-weight: 700; }
.pass-qr { background: #fff; padding: 14px; border-radius: 12px; width: min(300px, 100%); aspect-ratio: 1; }
.pass-qr img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.pass-timer { width: min(300px, 100%); height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.pass-timer i { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; }

/* Beginpagina my-event.nl */
.home-hero { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
.home-hero img { border-radius: 20px; }
.home-hero h1 { font-size: 28px; letter-spacing: -.01em; }
.home-hero p { max-width: 36ch; }
.inline-field { display: flex; gap: 8px; }

/* Aanmeldformulier: velden die nog ontbreken */
.is-missing input, .is-missing select { border-color: var(--bad, #c0392b); }
.capture.is-missing, .check.is-missing { border-color: var(--bad, #c0392b); }
.check.is-missing { outline: 2px solid var(--bad, #c0392b); outline-offset: 4px; border-radius: 6px; }
[data-missing] ul { margin: 6px 0 0; padding-left: 20px; }
