/* Kiosk: brand-gedreven, één lichte look (de zuil staat in een hal, geen OS-thema).
   Layout: merkpaneel links (logo, welkom, klok), handelingen rechts; stapelt op smalle schermen.
   Tokens --brand/--accent/--surface worden per klant gezet door kiosk.js. */
:root {
  --brand: #0B3C6E;
  --accent: #1C9AD6;
  --surface: #F3F8FC;
  --ink: #1B2430;
  --ink-muted: #5C6B7A;
  --card: #FFFFFF;
  --line: #E3E8EE;
  --ok: #1F7A4D;
  --danger: #B42318;
  --radius: 22px;
  --radius-sm: 14px;
  --font-display: "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-body); color: var(--ink); background: var(--surface) center / cover no-repeat fixed;
  display: flex; flex-direction: column; min-height: 100vh; -webkit-user-select: none; user-select: none;
}
.kiosk { flex: 1; display: grid; grid-template-columns: minmax(300px, 38%) 1fr; gap: 28px; padding: 28px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* ---------- merkpaneel */
.brand { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-width: 0; }
.brand .logo { max-height: 150px; max-width: 360px; width: auto; height: auto; object-fit: contain; mix-blend-mode: multiply; }
.brand .logo-fallback { font: 800 34px/1.1 var(--font-display); color: var(--brand); }
.brand h1 { font: 800 clamp(34px, 4.2vw, 56px)/1.05 var(--font-display); margin: 18px 0 8px; color: var(--brand); text-wrap: balance; letter-spacing: -.01em; }
.brand .lead { font-size: 19px; color: var(--ink-muted); margin: 0; max-width: 38ch; }
.clock { display: grid; gap: 2px; }
.clock .time { font: 700 clamp(44px, 5vw, 64px)/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.clock .date { font-size: 17px; color: var(--ink-muted); text-transform: capitalize; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--ink-muted); }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.chip.test { background: #FFF1DF; border-color: #F3C06B; color: #9A5B00; font-weight: 700; }
.chip.test::before { background: #E8890C; }
.powered { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-muted); letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
.powered img { height: 22px; width: auto; opacity: .85; }

/* ---------- handelingen */
.stage { min-width: 0; display: flex; align-items: center; }
.screen { display: none; width: 100%; }
.screen.active { display: block; }
.screen h2 { font: 700 clamp(26px, 2.6vw, 34px)/1.15 var(--font-display); margin: 0 0 6px; color: var(--ink); text-wrap: balance; }
.screen .sub { color: var(--ink-muted); font-size: 17px; margin: 0 0 22px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; cursor: pointer; box-shadow: 0 6px 24px rgba(27, 36, 48, .06); transition: transform .08s ease; min-height: 190px; }
.tile:active { transform: scale(.985); }
.tile:focus-visible, .pill-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile .ic { width: 58px; height: 58px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 18%, #fff); color: var(--brand); display: grid; place-items: center; }
.tile .ic svg { width: 30px; height: 30px; }
.tile.primary .ic { background: var(--brand); color: #fff; }
.tile .t { display: block; font: 700 22px/1.2 var(--font-display); margin-top: 4px; }
.tile .d { display: block; color: var(--ink-muted); font-size: 15px; }
.secondary { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pill-btn { flex: 1 1 200px; display: flex; align-items: center; justify-content: center; gap: 10px; background: color-mix(in srgb, var(--card) 80%, transparent); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 15px 20px; font: 700 18px var(--font-display); cursor: pointer; }
.pill-btn svg { width: 22px; height: 22px; color: var(--brand); }

/* taalkeuze */
.brand-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.langs { display: flex; gap: 6px; flex-shrink: 0; }
.langs button { border: 1px solid var(--line); background: var(--card); color: var(--ink-muted); border-radius: 10px; padding: 8px 12px; font: 800 14px var(--font-display); letter-spacing: .04em; cursor: pointer; }
.langs button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* formulieren laden/lossen en pakket */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row2 > div { min-width: 0; }
.opt { font-weight: 400; color: var(--ink-muted); }
.seg { display: inline-flex; gap: 0; border: 2px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; margin-top: 4px; }
.seg button { border: 0; background: #fff; color: var(--ink); font: 700 18px var(--font-display); padding: 12px 22px; cursor: pointer; border-left: 2px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button[aria-checked="true"] { background: var(--brand); color: #fff; }
input.plate { text-transform: uppercase; font-family: ui-monospace, "Cascadia Mono", monospace; letter-spacing: .08em; background: #FFF4C2; }
input.plate::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: 18px; }
.couriers { display: flex; flex-wrap: wrap; gap: 8px; }
.couriers button { border: 2px solid var(--line); background: #fff; color: var(--ink); border-radius: 12px; padding: 12px 18px; font: 700 18px var(--font-display); cursor: pointer; }
.couriers button[aria-checked="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--brand); }
#p-other { margin-top: 10px; }
.stepper { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.stepper button { width: 56px; height: 56px; border: 0; background: color-mix(in srgb, var(--ink) 6%, #fff); font: 800 26px var(--font-display); color: var(--ink); cursor: pointer; }
.stepper output { min-width: 64px; text-align: center; font: 800 24px var(--font-display); font-variant-numeric: tabular-nums; }

/* verbindingsmelding */
.offline-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 20; background: #B42318; color: #fff; text-align: center; font-weight: 700; padding: 10px 16px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: 0 10px 34px rgba(27, 36, 48, .08); }
label { display: block; font-size: 15px; font-weight: 700; margin: 16px 0 6px; color: var(--ink); }
input[type=text], input[type=tel], input[type=search] { width: 100%; font: 400 22px/1.3 var(--font-body); padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--radius-sm); outline: none; background: #fff; color: var(--ink); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
input::placeholder { color: #9AA6B2; }
.suggest { list-style: none; margin: 6px 0 0; padding: 0; border: 2px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; display: none; background: #fff; }
.suggest.open { display: block; }
.suggest li { padding: 13px 16px; font-size: 20px; cursor: pointer; border-top: 1px solid var(--line); }
.suggest li:first-child { border-top: 0; }
.suggest li:hover, .suggest li.sel { background: color-mix(in srgb, var(--accent) 12%, #fff); }
.suggest li.note { color: var(--ink-muted); font-size: 16px; cursor: default; }
.chosen { margin-top: 8px; font-size: 17px; color: var(--ok); font-weight: 700; min-height: 24px; }
.btns { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.btn { font: 700 19px/1 var(--font-display); padding: 16px 26px; border-radius: var(--radius-sm); border: 0; cursor: pointer; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.secondary { background: color-mix(in srgb, var(--ink) 7%, #fff); color: var(--ink); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.hint { color: var(--ink-muted); font-size: 15px; margin: 8px 0 0; }
.err { color: var(--danger); font-size: 16px; margin-top: 10px; min-height: 22px; }
.kbd { display: inline-block; background: #EEF1F5; padding: 2px 8px; border-radius: 6px; font-family: ui-monospace, monospace; font-size: 14px; }

/* resultaat */
.result { text-align: center; padding: 36px 24px; }
.result .mark { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 20%, #fff); color: var(--brand); }
.result .mark svg { width: 48px; height: 48px; }
.result.out .mark { background: color-mix(in srgb, var(--ink) 8%, #fff); color: var(--ink-muted); }
.result.err .mark { background: #FDE8E6; color: var(--danger); }
.result .big { font: 800 clamp(30px, 3.4vw, 46px)/1.1 var(--font-display); margin: 0 0 8px; color: var(--ink); text-wrap: balance; }
.result .sub { font-size: 18px; color: var(--ink-muted); margin: 0 auto 22px; max-width: 46ch; }

/* scannen */
#reader { width: min(440px, 100%); margin: 0 auto; border-radius: 16px; overflow: hidden; background: #0f1b2d; min-height: 220px; }
#reader video { border-radius: 16px; }
.scanhint { text-align: center; color: var(--ink-muted); font-size: 16px; margin: 14px 0 0; }
#wedge { position: absolute; opacity: 0; left: -9999px; }

/* inactief */
.notice { border-left: 6px solid var(--accent); }

@media (max-width: 900px) {
  .kiosk { grid-template-columns: 1fr; gap: 18px; padding: 18px; }
  .brand { gap: 12px; }
  .brand .logo { max-height: 64px; }
  .brand h1 { font-size: 30px; margin: 10px 0 4px; }
  .clock .time { font-size: 36px; }
  .powered { display: none; }
  .card { padding: 20px; }
  .tile { min-height: 0; padding: 16px; }
  .row2 { grid-template-columns: 1fr; }
  .brand-top { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }

/* camera altijd aan (per klant) */
.scanbar { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 20px; box-shadow: 0 6px 24px rgba(27, 36, 48, .06); }
#home-reader { width: 200px; height: 150px; border-radius: 14px; overflow: hidden; background: #0f1b2d; }
#home-reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
#home-reader img[alt="Info icon"] { display: none !important; }
.scanbar-title { font: 800 22px/1.2 var(--font-display); color: var(--brand); }
.scanbar-sub { color: var(--ink-muted); font-size: 16px; margin-top: 4px; }
.scanbar-err { color: var(--danger); font-size: 14px; margin-top: 6px; }
@media (max-width: 900px) { .scanbar { grid-template-columns: 1fr; } #home-reader { width: 100%; } }

/* naambadge */
.badge-note { color: var(--ink-muted); font-size: 16px; margin: -10px 0 18px; }
#badge { display: none; width: var(--badge-w, 90mm); height: var(--badge-h, 38mm); box-sizing: border-box; padding: 2.5mm 3mm; gap: 2.5mm; font-family: var(--font-display); color: #000; background: #fff; overflow: hidden; }
body.badge-preview #badge { display: flex; position: fixed; right: 20px; bottom: 20px; z-index: 50; border: 1px dashed #999; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
#badge .b-main { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
#badge .b-top { display: flex; align-items: center; justify-content: space-between; gap: 2mm; }
#badge .b-logo { height: 6mm; max-width: 30mm; object-fit: contain; object-position: left; filter: grayscale(1) contrast(1.4); }
#badge .b-kind { font: 800 2.8mm/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; border: .35mm solid #000; padding: .6mm 1.4mm; border-radius: 1mm; white-space: nowrap; }
#badge .b-name { font-weight: 800; font-size: 8mm; line-height: 1.05; white-space: nowrap; overflow: hidden; }
#badge .b-name.two { white-space: normal; }
#badge .b-company { font: 700 3.6mm/1.1 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#badge .b-meta { font: 400 2.8mm/1.2 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#badge .b-qr { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6mm; font: 400 2.2mm/1 var(--font-body); }
#badge .b-qr img { width: 24mm; height: 24mm; image-rendering: pixelated; }
@media print {
  body { background: #fff !important; margin: 0; }
  body > *:not(#badge) { display: none !important; }
  #badge { display: flex !important; position: static; border: 0; box-shadow: none; }
}

/* hidden-attribuut altijd laten winnen van display-regels */
[hidden] { display: none !important; }
