/* Geen externe lettertypes of CDN's: alleen systeemfonts. */
:root {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --ink: #1A1F2B;
  --muted: #5B6475;
  --line: #D9DDE5;
  --accent: #1E5BFF;
  --accent-ink: #FFFFFF;
  --ok: #2CFF05;
  --ok-ink: #0B1A05;
  --warn: #FFC21A;
  --err: #E10600;
  --brand: #7B2FF7;          /* merkkleur logo 4d-3: "stream" en accenten van het merk */
  --brand-on-dark: #A97BFF;  /* zelfde paars, licht genoeg voor donkere achtergronden */
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "Georgia", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151C;
    --surface: #1A1F2A;
    --ink: #EEF1F6;
    --muted: #9AA3B5;
    --line: #2A3040;
    --accent: #5C8BFF;
    --accent-ink: #0B1020;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Merk: logo 4d. Schaalt mee met de schermbreedte:
   320 px (kleinste telefoons) ~ 30 px letters, 390-430 px ~ 35-38 px, vanaf tablet maximaal 44 px.
   Het woordmerk is ongeveer 6x de lettergrootte breed; dat past op 320 px met 20 px marge per kant. */
.brand { display: inline-flex; align-items: center; gap: clamp(.45rem, 2vw, .7rem); text-decoration: none; color: var(--ink); max-width: 100%; }
.brand img { display: block; width: clamp(40px, 12vw, 60px); height: auto; flex: none; }
.brand-word { font-family: var(--sans); font-weight: 800; letter-spacing: -0.025em; line-height: 1; white-space: nowrap;
  font-size: clamp(28px, 9vw, 44px); }
.brand-accent { color: var(--brand); }
@media (prefers-color-scheme: dark) { .brand-accent { color: var(--brand-on-dark); } }
.tv .brand-accent, .slides .brand-accent { color: var(--brand-on-dark); }
.brandbar { margin-bottom: clamp(1rem, 4vw, 1.75rem); }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--sans);
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
main { max-width: 40rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
main.wide { max-width: 72rem; }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: clamp(2rem, 7vw, 3.2rem); letter-spacing: -.01em; }
h2 { font-size: 1.5rem; margin-top: 2.5rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: 0 1.25rem; border-radius: .6rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.danger, button.danger { color: var(--err); border-color: var(--err); background: transparent; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

label { display: block; font-weight: 600; margin-bottom: .35rem; }
input[type=text] {
  width: 100%; min-height: 3rem; padding: 0 .9rem; border-radius: .6rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit;
}

/* Gastpagina: de ontspanknop is het herkenningspunt. */
.event-name { margin-top: 1rem; }
.shutter {
  position: relative; display: grid; place-items: center;
  width: min(15rem, 70vw); aspect-ratio: 1; margin: 2.5rem auto 1.5rem;
  border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 .6rem var(--bg), 0 0 0 .8rem var(--accent);
  font: 600 1.25rem/1.2 var(--sans); text-align: center; cursor: pointer;
}
.shutter input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.shutter:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .shutter:active { transform: none; } }

.limits { font-weight: 600; }
.tip { font-size: .9rem; }
.choice { display: flex; flex-wrap: wrap; gap: .5rem; padding: .25rem 0 .75rem; }
.choice p { flex-basis: 100%; margin: 0; font-size: .9rem; color: var(--muted); }
.choice button { min-height: 2.5rem; font-size: .9rem; }
.uploads { list-style: none; margin: 0; padding: 0; }
.uploads li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.uploads .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { flex: none; padding: .1rem .55rem; border-radius: 1rem; font-size: .85rem; font-weight: 600; }
.badge.ok { background: var(--ok); color: var(--ok-ink); }
.badge.busy { background: var(--line); color: var(--ink); }
.badge.err { background: var(--err); color: #FFFFFF; }

.notice { padding: 1rem 1.1rem; border-radius: .6rem; border-left: .35rem solid var(--warn); background: var(--surface); margin: 1rem 0; }
.notice.err { border-left-color: var(--err); }
.notice.ok { border-left-color: var(--ok); }

/* Organisator */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: .6rem; padding: 1rem; }
.stats strong { display: block; font: 600 1.6rem/1.2 var(--serif); }
.qr-block { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }
.qr-block svg { width: 9rem; height: auto; background: #fff; border-radius: .4rem; }
.link { word-break: break-all; font-size: .95rem; }
.link, .resume input, .kv dd { font-variant-ligatures: none; font-feature-settings: "calt" 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .5rem; }
.grid figure { margin: 0; position: relative; background: var(--surface); border-radius: .4rem; overflow: hidden; }
.grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.grid figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .25rem; padding: .3rem .4rem; font-size: .8rem; color: var(--muted); }
.grid .play { position: absolute; top: .4rem; left: .4rem; background: rgba(0,0,0,.65); color: #fff; padding: .1rem .45rem; border-radius: .3rem; font-size: .8rem; }
.grid form { margin: 0; }
.grid button { min-height: 2rem; padding: 0 .55rem; font-size: .8rem; }

.footer { margin-top: 3rem; font-size: .9rem; }
.resume { margin-top: 1.5rem; }
.resume input { width: 100%; margin-top: .75rem; min-height: 2.5rem; padding: 0 .6rem; border-radius: .4rem;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: .85rem var(--sans); }
.slide-code { font: 600 clamp(1.5rem, 6.5vw, 2.4rem)/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .12em; margin: .5rem 0; }
.code-fields { border: 0; padding: 0; margin: 0; min-width: 0; min-inline-size: 0; display: flex; align-items: center; gap: .5rem; }
.code-fields legend { font-weight: 600; margin-bottom: .5rem; padding: 0; }
.code-fields span { color: var(--muted); font-size: 1.4rem; }
.code-part { flex: 1 1 0; min-width: 0; width: 100%; max-width: 7.5rem; min-height: 3.2rem; padding: 0 .25rem; text-align: center; border-radius: .6rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 clamp(1.05rem, 4.6vw, 1.4rem) ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }
details { border-bottom: 1px solid var(--line); padding: .75rem 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: .6rem 0 0; }

/* Beheer */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.topbar a.home { font: 600 1.1rem var(--serif); color: var(--ink); text-decoration: none; }
.topbar form { margin: 0; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.list th, table.list td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.list td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge.info { background: #1E5BFF; color: #FFFFFF; }
.badge.warn { background: #F44611; color: #FFFFFF; }
.badge.muted { background: var(--line); color: var(--muted); }
.form-grid { display: grid; gap: 1rem; max-width: 34rem; }
select, input[type=datetime-local], input[type=email], input[type=password] {
  width: 100%; min-height: 3rem; padding: 0 .9rem; border-radius: .6rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit;
}
.check { display: flex; gap: .6rem; align-items: center; font-weight: 400; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: .6rem; padding: 1.1rem; margin: 1rem 0; }
.flash { padding: .8rem 1rem; border-radius: .6rem; background: var(--surface); border-left: .35rem solid var(--ok); margin-bottom: 1rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.danger-zone { border-color: var(--err); }

/* Diavoorstelling */
body.slides { background: #000; color: #fff; overflow: hidden; }
.slides #stage img { position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100vw; height: 100vh; object-fit: contain; opacity: 0; transition: opacity 1.2s ease; }
.slides #stage img.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .slides #stage img { transition: none; } }
.slides .caption { position: fixed; left: 1.5rem; bottom: 1.2rem; font: 600 1.1rem var(--sans); text-shadow: 0 1px 4px #000; }
.slides .fs { position: fixed; right: 1rem; top: 1rem; opacity: .4; }
.slides .empty { display: grid; place-items: center; height: 100vh; font: 600 2rem var(--serif); }

/* Kaartjes om te printen */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
.print-card { border: 1px dashed #999; padding: 1.2rem; text-align: center; break-inside: avoid; color: #000; background: #fff; }
.print-brand { display: flex; align-items: center; justify-content: center; gap: .5rem; font: 800 1.6rem var(--sans); letter-spacing: -0.025em; margin-bottom: .5rem; }
.print-brand img { width: 2.1rem; height: auto; }
/* Logo linksboven en rechtsonder, een maat groter dan eerst. Vaste waarden eerst als terugval voor oude tv-browsers. */
.slides .slide-brand img { width: 3.8rem; width: clamp(3rem, 4.6vw, 5.2rem); height: auto; }
.slides .slide-brand-tl { top: 1.3rem; left: 1.6rem; }
.slides .slide-brand-br { bottom: 1.3rem; right: 1.6rem; }
.slides .slide-brand { position: fixed; display: flex; align-items: center; gap: .7rem; font: 800 2.6rem var(--sans); font-size: clamp(2rem, 3.4vw, 3.7rem); letter-spacing: -0.02em; color: #fff; text-shadow: 0 1px 4px #000; opacity: .9; }
.print-card h2 { margin: 0 0 .3rem; font-size: 1.4rem; }
.print-card svg { width: 55%; height: auto; }
.print-card p { margin: .3rem 0 0; font-size: .9rem; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
}

/* ---------- Organisator (variant 2: tabbladen) ---------- */
.org-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 1rem 1.25rem .75rem; }
.org-head .inner, .org-main { max-width: 40rem; margin: 0 auto; }
.org-head .brand img { width: clamp(36px, 10.5vw, 52px); }
.org-head .brand-word { font-size: clamp(26px, 8vw, 38px); }
.org-head .meta { font-size: .8rem; color: var(--muted); font-weight: 600; margin: .8rem 0 .2rem; }
.org-head h1 { font-family: var(--sans); font-size: 1.5rem; font-weight: 750; margin: 0 0 .75rem; }
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; background: var(--bg); padding: 4px; border-radius: 12px; }
.tabs a { min-height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 9px; font-weight: 600; font-size: .82rem; color: var(--muted); text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.org-main { padding: 1rem 1.25rem 2rem; display: flex; flex-direction: column; gap: .9rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.card.pad { padding: .9rem 1rem; display: flex; flex-direction: column; gap: .6rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); font-weight: 650; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metrics > div { padding: .85rem 1rem; border-bottom: 1px solid var(--line); }
.metrics > div:nth-child(odd) { border-right: 1px solid var(--line); }
.metrics > div:nth-last-child(-n+2) { border-bottom: 0; }
.metrics strong { display: block; font-size: 1.6rem; font-weight: 750; line-height: 1.2; }
.metrics strong.small { font-size: 1.05rem; }
.metrics span { font-size: .8rem; color: var(--muted); }
.section-title { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.section-title a { font-size: .9rem; font-weight: 600; }
.btn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.btn-row .button, .btn-row button { text-align: center; padding: 0 .6rem; }
.button.block { width: 100%; }
.button.big { min-height: 3.25rem; font-size: 1rem; }
.code { font: 700 1.5rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .08em; font-variant-ligatures: none; }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.thumbs img, .thumbs .ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--line); }
.qr-row { display: flex; gap: .9rem; align-items: center; }
.qr-row .qr { flex: none; width: 7.25rem; height: 7.25rem; background: #fff; border-radius: 8px; padding: 4px; }
.qr-row .qr svg { width: 100%; height: 100%; }
.status { font-size: .75rem; font-weight: 700; padding: .2rem .65rem; border-radius: 999px; white-space: nowrap; }
.status.ok { background: var(--ok); color: var(--ok-ink); }
.status.info { background: #1E5BFF; color: #FFFFFF; }
.status.warn { background: #FFD60A; color: #1A1F2B; }
.status.err { background: var(--err); color: #FFFFFF; }
.status.muted { background: var(--line); color: var(--ink); }
.link-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .8rem 1rem; color: var(--ink); text-decoration: none; min-height: 3rem; }
.link-row small { display: block; color: var(--muted); font-size: .8rem; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chips a { min-height: 36px; padding: 0 .85rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; font-weight: 600; font-size: .82rem; text-decoration: none; }
.chips a[aria-current="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.pgrid .tile { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--line); }
.pgrid .tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pgrid .tile .tag { position: absolute; left: 5px; bottom: 5px; background: rgba(26,31,43,.78); color: #fff; font-size: .7rem; padding: 2px 6px; border-radius: 5px; }
.pgrid .tile.pending { border: 1px dashed var(--muted); display: flex; align-items: center; justify-content: center; text-align: center; font-size: .75rem; color: var(--muted); padding: 6px; }
.pgrid .tile input { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; display: none; }
.selecting .pgrid .tile input { display: block; }
.sticky-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: .75rem 1.25rem calc(.9rem + env(safe-area-inset-bottom, 0)); margin: 0 -1.25rem -2rem; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .8rem 1rem; min-height: 3.75rem; font-weight: 400; margin: 0; }
.toggle-row strong { display: block; font-size: .95rem; }
.toggle-row small { color: var(--muted); font-size: .8rem; }
.toggle-row input { width: 24px; height: 24px; flex: none; }
.kv2 { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .9rem; }
.kv2 dt { color: var(--muted); }
.kv2 dd { margin: 0; }
.divided > * + * { border-top: 1px solid var(--line); }

body.slides.idle { cursor: none; }
body.slides.idle .fs { opacity: 0; }
.slides .caption { font-size: 1.4rem; font-size: clamp(1.1rem, 2vw, 2rem); }

/* ---------- Tv koppelen ---------- */
/* Tv-browsers rekenen vaak met 960x540 of 1280x720 CSS-pixels: maten in vw/vh, met vaste waarden als terugval. */
body.tv { margin: 0; background: #12151C; color: #EEF1F6; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
.tv-wrap { position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4vh 6vw; }
.tv-brand { display: flex; align-items: center; gap: 2vw; font-weight: 800; letter-spacing: -0.025em; font-size: 48px; font-size: 6vw; line-height: 1; }
.tv-brand img { width: 80px; width: 8vw; height: auto; }
.tv-lead { font-size: 28px; font-size: 3vw; margin: 6vh 0 2vh; color: #C9CEDA; }
.tv-code { font: 800 120px ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14vw; letter-spacing: .08em; line-height: 1; color: #FFFFFF; }
.tv-how { font-size: 24px; font-size: 2.4vw; line-height: 1.45; margin: 5vh 0 1vh; max-width: 80vw; }
.tv-how strong { color: #FFD60A; }
.tv-small { font-size: 18px; font-size: 1.7vw; color: #9AA3B5; margin: 0; }

.tv-link-form { display: flex; gap: .5rem; margin: 0; }
.tv-link-form input { flex: 1; min-width: 0; min-height: 3rem; padding: 0 .9rem; border-radius: .6rem; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 700 1.4rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .12em; }

/* ---------- Verkooppagina ---------- */
main.landing { max-width: 64rem; }
.qr-expired { display: flex; flex-direction: column; gap: .3rem; border-left-color: var(--brand); }
.qr-expired span { color: var(--muted); font-size: .92rem; }
.hero { padding: clamp(1rem, 5vw, 3rem) 0 clamp(1.5rem, 5vw, 2.5rem); }
.hero h1 { font-family: var(--sans); font-weight: 800; letter-spacing: -0.02em; font-size: clamp(2rem, 8vw, 3.4rem); margin-bottom: .8rem; }
.hero .lead { font-size: clamp(1.05rem, 3.6vw, 1.3rem); color: var(--muted); max-width: 40rem; margin-bottom: 1.4rem; }
.steps { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-bottom: 1rem; }
.step { display: flex; gap: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.step .num { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.step p, .perk p { margin: .25rem 0 0; color: var(--muted); font-size: .95rem; }
.perks { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-bottom: 2.5rem; }
.perk { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.pkg-section h2 { font-family: var(--sans); font-weight: 800; margin-top: 0; }
.pkg-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); margin: 1rem 0; }
.pkg { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem; display: flex; flex-direction: column; gap: .6rem; }
.pkg h3 { margin: 0; font-size: 1.15rem; }
.pkg .price { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; color: var(--brand); }
@media (prefers-color-scheme: dark) { .pkg .price, .step .num { color: var(--brand-on-dark); } .step .num { background: var(--brand); color: #fff; } }
.pkg ul { margin: 0 0 .4rem; padding-left: 1.1rem; color: var(--ink); font-size: .95rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.small { font-size: .9rem; }
.contact { margin: 2rem 0 1rem; }
