:root {
  /* Lichte, frisse palette voor de kiosk */
  --bg-1: #f6f9ff;
  --bg-2: #eaf2ff;
  --bg-3: #ffffff;
  --fg:        #0f172a;
  --fg-soft:   #334155;
  --muted:     #64748b;
  --line:      #e2e8f0;
  --card:      #ffffff;
  --primary:   #1d4ed8;
  --primary-2: #2563eb;
  --primary-fg: #ffffff;
  --accent:    #0ea5e9;
  --ok:        #16a34a;
  --warn:      #f59e0b;
  --err:       #dc2626;
  --info:      #0284c7;
  --radius:    18px;
  --radius-lg: 28px;
  --shadow-s:  0 2px 6px rgba(15, 23, 42, .06);
  --shadow:    0 10px 30px rgba(15, 23, 42, .08);
  --shadow-lg: 0 30px 60px rgba(15, 23, 42, .18);
  --font: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 60%, var(--bg-3) 100%);
  color: var(--fg);
  font-family: var(--font);
  font-size: 22px;
  -webkit-user-select: none; user-select: none;
  -webkit-font-smoothing: antialiased;
}
body.admin {
  background: #f8fafc; color: #0f172a; font-size: 16px;
  -webkit-user-select: text; user-select: text;
}

/* ---------- Kiosk ---------- */
.kiosk { display: flex; flex-direction: column; min-height: 100vh; touch-action: manipulation; position: relative; overflow: hidden; }

/* Logo als watermark op de achtergrond */
.bg-logo {
  position: fixed; inset: 0;
  background-image: url('/assets/img/logo.svg');
  background-repeat: no-repeat;
  background-position: center 56%;
  background-size: min(70vw, 70vh) auto;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
  filter: saturate(1.1);
}

#scanInput { position: fixed; left: -10000px; top: -10000px; width: 1px; height: 1px; opacity: 0; }

.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 16px;
  padding: 18px 28px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  font-size: 22px; font-weight: 600; margin: 0; flex: 1; text-align: center;
  color: var(--muted); letter-spacing: 0.02em;
}
.topbar .clock {
  font-variant-numeric: tabular-nums; font-size: 22px;
  min-width: 80px; text-align: right; color: var(--fg-soft); font-weight: 500;
}
.topbar .home {
  background: var(--card); color: var(--primary);
  border: 1px solid var(--line); border-radius: 14px;
  width: 56px; height: 56px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-s); transition: transform .1s;
}
.topbar .home:hover { background: #f1f5ff; }
.topbar .home:active { transform: scale(0.97); }

/* Schermen */
.screen { display: none; flex: 1; padding: 48px 32px; overflow: auto; position: relative; z-index: 1; }
.screen.active { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; }
.screen h2 { font-size: 38px; margin: 0 0 8px; letter-spacing: -0.01em; }
.screen p  { color: var(--muted); }
.screen p.lead { font-size: 20px; color: var(--fg-soft); margin: 0 0 24px; }

/* Hero (idle scherm) */
.hero { text-align: center; max-width: 900px; }
.hero .eyebrow {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: rgba(29, 78, 216, .08); color: var(--primary);
  font-size: 14px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 18px;
}
.hero .big {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { color: var(--muted); margin-top: 14px; font-size: 22px; }

/* Knoppen */
.actions { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.btn {
  padding: 22px 32px; font-size: 22px; font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card); color: var(--fg);
  cursor: pointer; min-width: 240px;
  box-shadow: var(--shadow-s);
  transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent; color: var(--primary-fg);
  box-shadow: 0 10px 24px rgba(29, 78, 216, .35);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost {
  background: transparent; box-shadow: none; color: var(--fg-soft);
}

/* Form-card */
.card.form-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 40px; box-shadow: var(--shadow);
  width: 100%; max-width: 820px;
}
.card.form-card.narrow { max-width: 480px; }
.card.form-card h2 { margin-top: 0; }

form { display: grid; gap: 18px; }
.form-grid { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: 1; } }

form label { display: grid; gap: 8px; font-size: 16px; color: var(--fg-soft); font-weight: 600; }
form input, form select {
  font-size: 22px; padding: 16px 18px; border-radius: 14px;
  border: 1.5px solid var(--line); background: #f8fafc; color: var(--fg);
  transition: border-color .12s, box-shadow .12s, background .12s;
  font-family: inherit; font-weight: 400;
}
form input::placeholder { color: #94a3b8; }
form input:focus, form select:focus {
  outline: none; border-color: var(--primary-2); background: white;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
}
.form-actions { display: flex; gap: 12px; margin-top: 12px; justify-content: flex-end; }

/* Toast / feedback */
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 48px 64px; border-radius: 28px; text-align: center;
  font-size: 48px; font-weight: 700; min-width: 60vw; max-width: 90vw;
  box-shadow: var(--shadow-lg); z-index: 100;
  letter-spacing: -0.01em;
}
.toast.ok   { background: linear-gradient(135deg, #16a34a, #22c55e); color: white; }
.toast.bye  { background: linear-gradient(135deg, #0284c7, #0ea5e9); color: white; }
.toast.warn { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #1a1300; }
.toast.err  { background: linear-gradient(135deg, #dc2626, #ef4444); color: white; }
.toast .toast-sub { font-size: 22px; font-weight: 500; margin-top: 14px; opacity: 0.95; }

.idle-countdown {
  position: fixed; bottom: 24px; right: 24px; padding: 14px 20px;
  background: var(--warn); color: #1a1300; border-radius: 14px; font-weight: 700;
  z-index: 50; box-shadow: var(--shadow);
}

/* ---------- On-screen toetsenbord ---------- */
.osk {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, .08);
  padding: 14px 16px 18px; z-index: 200;
}
.osk[hidden] { display: none; }
.osk-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.osk-row:last-child { margin-bottom: 0; }
.osk-key {
  flex: 1 1 0; min-width: 0;
  background: white; color: var(--fg);
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 22px; font-weight: 600;
  padding: 18px 6px;
  cursor: pointer; user-select: none;
  box-shadow: var(--shadow-s);
  transition: transform .04s, background .12s;
  font-family: inherit;
}
.osk-key:active { transform: translateY(1px); background: #eef2ff; }
.osk-key.wide  { flex-grow: 1.6; }
.osk-key.xwide { flex-grow: 2.4; }
.osk-key.space { flex-grow: 6; }
.osk-key.fn    { background: #eef2ff; color: var(--primary); }
.osk-key.primary { background: var(--primary); color: white; border-color: transparent; }
.osk-key.danger  { background: #fef2f2; color: var(--err); }
.osk.num .osk-row { max-width: 480px; margin-left: auto; margin-right: auto; }
.osk.num .osk-key { padding: 22px 6px; font-size: 28px; }
/* Wanneer het OSK aan staat: extra ruimte onderaan zodat knoppen
   onder de inputs zichtbaar blijven boven het keyboard. */
body.with-osk .screen { padding-bottom: 340px; }
body.with-osk .osk.num ~ .screen { padding-bottom: 340px; }

/* ---------- Admin ---------- */
body.admin a { color: #1d4ed8; }
.admin .container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.admin nav.top { background: #0f172a; color: white; padding: 12px 24px; display: flex; align-items: center; gap: 16px; }
.admin nav.top a { color: white; text-decoration: none; padding: 6px 12px; border-radius: 8px; }
.admin nav.top a:hover, .admin nav.top a.active { background: #1e293b; }
.admin nav.top .spacer { flex: 1; }
.admin h1 { font-size: 24px; margin: 0 0 16px; }
.admin .card { background: white; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.admin table { width: 100%; border-collapse: collapse; }
.admin th, .admin td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.admin th { background: #f1f5f9; font-weight: 600; }
.admin form { display: grid; gap: 12px; max-width: 600px; }
.admin label { font-size: 13px; color: #475569; display: grid; gap: 4px; }
.admin input, .admin select, .admin textarea {
   font-size: 15px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: white; }
.admin .btn { padding: 10px 16px; font-size: 15px; min-width: 0; border-radius: 8px;
              background: #2563eb; color: white; border: 0; cursor: pointer; box-shadow: none; }
.admin .btn.secondary { background: #e2e8f0; color: #0f172a; }
.admin .btn.danger    { background: #dc2626; color: white; }
.admin .flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.admin .flash.ok  { background: #dcfce7; color: #166534; }
.admin .flash.err { background: #fee2e2; color: #991b1b; }
.admin .pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: #e2e8f0; }
.admin .pill.bhv { background: #fee2e2; color: #991b1b; }
.admin .pill.visitor { background: #fef3c7; color: #92400e; }

/* Token-blok op de devices-pagina */
.admin .token-card { border-color: #fde68a; background: #fffbeb; }
.admin .token-box {
  display: flex; align-items: stretch; gap: 8px;
  background: #0f172a; padding: 10px; border-radius: 10px;
}
.admin .token-value {
  flex: 1; min-width: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px; color: #e2e8f0;
  padding: 10px 12px; background: transparent;
  word-break: break-all; line-height: 1.4;
  -webkit-user-select: all; user-select: all;
}
.admin .copy-btn {
  flex: 0 0 auto; align-self: stretch;
  padding: 0 18px; font-size: 14px; font-weight: 600;
  background: #2563eb; color: white; border: 0; border-radius: 8px;
  cursor: pointer; min-width: 110px;
  transition: background .15s;
}
.admin .copy-btn:hover  { background: #1d4ed8; }
.admin .copy-btn.ok     { background: #16a34a; }
.admin .copy-btn.err    { background: #dc2626; }
.admin .muted           { color: #64748b; }
.admin .small           { font-size: 13px; margin-top: 8px; }
