/* TS Timetracker: kiosk */
:root {
  color-scheme: light;
  --bg: #EEF2F5;
  --surface: #FFFFFF;
  --surface-2: #F6F8FA;
  --ink: #16232E;
  --muted: #576776;
  --line: #D3DCE3;
  --key-edge: #C3CED7;
  --go: #2E7A54;
  --pause: #B5661B;
  --stop: #B13F39;
  --on-tone: #FFFFFF;
  --warn-bg: #FFF4E5;
  --warn-ink: #7A4300;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111A21;
    --surface: #1A252E;
    --surface-2: #16212A;
    --ink: #E3EAF0;
    --muted: #97A7B4;
    --line: #2A3743;
    --key-edge: #0C1318;
    --go: #2B7350;
    --pause: #A35C19;
    --stop: #A33A35;
    --warn-bg: #3A2A12;
    --warn-ink: #F6CF95;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  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);
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

.kiosk { display: flex; flex-direction: column; min-height: 100%; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; }
.brandmark { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; }
.brandmark .dot { width: 14px; height: 14px; border-radius: 4px; background: var(--brand); }
.device-owner { color: var(--muted); font-size: 15px; }

#app { flex: 1; display: flex; }
.screen { display: none; flex: 1; padding: 8px 28px 28px; }
.screen.is-active { display: flex; }

/* ---------- Scherm 1: klok + toetsen ---------- */
#screen-pin { align-items: center; justify-content: center; gap: clamp(32px, 7vw, 112px); flex-wrap: wrap; }
.clock-block { text-align: left; min-width: 260px; }
.clock {
  font-size: clamp(64px, 13vw, 168px);
  font-weight: 250;
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.date { margin-top: 14px; font-size: clamp(18px, 2.2vw, 26px); color: var(--muted); }
.date::first-letter { text-transform: uppercase; }

.pin-block { width: min(100%, 380px); }
.pin-label { margin: 0 0 14px; color: var(--muted); text-align: center; }
.pin-dots { display: flex; justify-content: center; gap: 18px; height: 22px; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); transition: background .12s, border-color .12s; }
.pin-dots span.on { background: var(--brand); border-color: var(--brand); }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-error { min-height: 1.5em; margin: 12px 0 8px; text-align: center; color: var(--stop); font-weight: 550; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.key {
  height: clamp(64px, 10.5vh, 92px);
  border: 1px solid var(--line);
  border-bottom: 4px solid var(--key-edge);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 32px;
  font-weight: 450;
  font-variant-numeric: tabular-nums;
  touch-action: manipulation;
  transition: transform .06s, border-bottom-width .06s;
}
.key:active { transform: translateY(3px); border-bottom-width: 1px; }
.key-fn { font-size: 17px; color: var(--muted); background: var(--surface-2); display: grid; place-items: center; }

/* ---------- Scherm 2: wie + knoppen ---------- */
#screen-actions { flex-direction: column; align-items: center; gap: 24px; overflow-y: auto; }
.person { text-align: center; max-width: 640px; }
.person h1 { margin: 12px 0 4px; font-size: clamp(30px, 4.6vw, 48px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.status { margin: 0; color: var(--muted); font-size: 19px; }
.warning { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); }

.actions { display: grid; gap: 14px; width: min(100%, 640px); }
.actions[data-count="2"] { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .actions[data-count="2"] { grid-template-columns: 1fr; } }
.action {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  min-height: 112px; padding: 18px 22px;
  border: 0; border-radius: var(--radius);
  color: var(--on-tone);
  font-size: clamp(21px, 2.6vw, 26px); font-weight: 650; text-align: left; line-height: 1.2;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.18);
  touch-action: manipulation;
}
.action:active { transform: translateY(2px); box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.action:disabled { opacity: .55; }
.action svg { flex: none; }
.tone-go { background: var(--go); }
.tone-pause { background: var(--pause); }
.tone-stop { background: var(--stop); }

.summary {
  width: min(100%, 640px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px;
  padding: 16px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
}
.summary > div { display: flex; justify-content: space-between; align-items: baseline; }
.summary-label { color: var(--muted); }
.summary-value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.today-list { grid-column: 1 / -1; list-style: none; margin: 8px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); columns: 2; column-gap: 24px; color: var(--muted); font-size: 15px; }
.today-list li { break-inside: avoid; padding: 2px 0; }
.today-list:empty { display: none; }
.today-list time, .correction time { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; margin-right: 4px; }

.corrections { width: min(100%, 640px); display: grid; gap: 12px; }
.corrections:empty { display: none; }
.correction { padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--brand); }
.correction h2 { margin: 0 0 4px; font-size: 19px; }
.correction h3 { margin: 0 0 4px; font-size: 14px; color: var(--muted); font-weight: 550; }
.correction .reason { margin: 0 0 12px; color: var(--muted); }
.correction ul { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.correction-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dispute { margin-top: 12px; display: grid; gap: 8px; }
.dispute label { display: grid; gap: 6px; color: var(--muted); }
textarea, input { font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

.btn-primary, .btn-secondary {
  min-height: 48px; padding: 10px 20px; border-radius: 10px; font-weight: 600; border: 1px solid transparent;
}
.btn-primary { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #0E1A23; } }
.btn-secondary { background: transparent; border-color: var(--line); }
.btn-link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 12px; font-size: 17px; }

/* ---------- Scherm 3: bevestiging ---------- */
#screen-done { align-items: center; justify-content: center; text-align: center; }
.done h1 { margin: 22px 0 6px; font-size: clamp(30px, 4.6vw, 48px); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.done p { margin: 0; color: var(--muted); font-size: 20px; }
.done-mark { width: 120px; height: 120px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; color: var(--on-tone); }
.screen.is-active .done-mark { animation: pop .32s cubic-bezier(.2,.9,.3,1.3); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Activatie ---------- */
.activate { width: min(100% - 40px, 460px); margin: 6vh auto; }
.activate h1 { font-size: 32px; letter-spacing: -0.02em; margin: 0 0 10px; }
.activate p { color: var(--muted); }
.activate .hint { font-size: 15px; }
.activate form { display: grid; gap: 10px; margin-top: 24px; }
.activate input { font-size: 28px; letter-spacing: 0.12em; text-transform: uppercase; text-align: center; padding: 14px; }
.error { color: var(--stop); font-weight: 550; margin: 0; }

@media (max-width: 720px) {
  .topbar { padding: 14px 18px; }
  .screen { padding: 4px 18px 20px; }
  #screen-pin { flex-direction: column; gap: 28px; }
  .clock-block { text-align: center; min-width: 0; }
  .summary { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
