/* Attendance kiosk (/kiosk); its tokens and base styles are shared by /, /admin and /m. Zero brand: monochrome; signal green/red only for the two actions.
   Layout: full-screen landscape tablet, left panel = clock and messages, right panel = keypad;
   stacks to one column on narrow screens. */
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(../fonts/inter-400.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(../fonts/inter-500.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(../fonts/inter-600.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(../fonts/inter-700.woff2) format("woff2"); }

:root {
  --ink: #111111; --ink-2: #383838; --ink-3: #6B6B6B; --ink-4: #9A9A9A;
  --line: #E2E2E2; --line-2: #CFCFCF; --fill: #F5F5F5; --fill-2: #EDEDED; --paper: #FFFFFF;
  --in: #1E7A4C; --in-tint: #E6F2EC; --out: #B42318; --out-tint: #FBEAE8;
  --lock-bg: #6B6B6B; --lock-key: #7A7A7A; --lock-key-2: #858585; --lock-ink: #FFFFFF;
  --font: "Inter", "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --ink: #F2F2F2; --ink-2: #D0D0D0; --ink-3: #A3A3A3; --ink-4: #6B6B6B;
  --line: #2A2A2A; --line-2: #3A3A3A; --fill: #1A1A1A; --fill-2: #232323; --paper: #0F0F0F;
  --in: #2E9E66; --in-tint: #12271C; --out: #D9473A; --out-tint: #2C1412;
  --lock-bg: #2B2B2B; --lock-key: #383838; --lock-key-2: #444444; --lock-ink: #F2F2F2;
  color-scheme: dark; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 14px;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; overflow: hidden; }

.screen { position: relative; height: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.left { display: flex; flex-direction: column; padding: 28px 32px; gap: 16px; border-right: 1px solid var(--line); min-width: 0; }
.right { display: flex; flex-direction: column; justify-content: center; padding: 28px 32px; gap: 18px; min-width: 0; max-width: 560px; width: 100%; justify-self: center; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; font-size: 15px; }
.brand svg { width: 26px; height: 26px; color: var(--ink); }
.tools { display: flex; align-items: center; gap: 10px; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--in-tint); color: var(--in); white-space: nowrap; }
.pill.off { background: var(--out-tint); color: var(--out); }
.lang { display: flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.lang button { font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .06em; padding: 5px 10px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.clock { font-size: clamp(56px, 8vw, 96px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.date { color: var(--ink-3); font-size: 16px; margin-top: 6px; }
.edit { display: grid; gap: 6px; justify-items: start; }
.edit button { font: inherit; color: var(--ink); background: transparent; border: 2px dashed var(--line-2); border-radius: 12px; padding: 4px 12px; cursor: pointer; text-align: left; }
.edit button.sel { border-style: solid; border-color: var(--ink); background: var(--fill); }
.edit .clock { font-size: clamp(48px, 7vw, 76px); }
.edit .date { margin-top: 0; font-size: 18px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.edit .date small { color: var(--ink-3); margin-left: 6px; }
/* Clock and date: centered in the free space of the left panel (between the top bar and the message). */
#when { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; min-height: 0; }
#when .date { margin-top: 0; }
#when.edit button { text-align: center; }

.tzbox { display: grid; gap: 6px; }
.tzbox .label { justify-self: center; }
.wheelwrap { position: relative; }
.wheelwrap::after { content: ""; position: absolute; left: 8px; right: 8px; top: 44px; height: 44px; border-block: 1px solid var(--ink-3); pointer-events: none; }
.wheel { height: 132px; overflow-y: auto; scroll-snap-type: y mandatory; border: 1px solid var(--line-2); border-radius: 12px;
  padding-block: 44px; scrollbar-width: none; overscroll-behavior: contain; }
.wheel::-webkit-scrollbar { display: none; }
.wheel button { display: flex; width: 100%; height: 44px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px;
  scroll-snap-align: center; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink-4); cursor: pointer; }
.wheel button.sel { color: var(--ink); font-weight: 600; }
.wheel button span { font-variant-numeric: tabular-nums; font-size: 13px; }

.msg { display: grid; gap: 10px; min-height: 170px; align-content: start; justify-items: center; text-align: center; }
.screen.amending .msg { min-height: 0; }
.msg h2 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
.msg p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.45; }
.label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.note { font-size: 13px; color: var(--ink-3) !important; }
.err { color: var(--out) !important; font-weight: 600; }
.linkbtn { justify-self: center; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); background: var(--fill);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 16px; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.entry { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 64px; }
.dots { display: flex; gap: 14px; }
.dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink-3); }
.dot.on { background: var(--ink); border-color: var(--ink); }
.dots.shake, .lockdots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }
.editing { font-size: 16px; color: var(--ink-2); }
.editing b { color: var(--ink); }
.back { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink);
  font-size: 22px; cursor: pointer; display: grid; place-items: center; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.key { height: clamp(64px, 11vh, 96px); border-radius: 14px; border: 1px solid var(--line-2); background: var(--fill);
  color: var(--ink); font: inherit; font-size: 30px; font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums;
  touch-action: manipulation; position: relative; overflow: hidden; }
.key:active { background: var(--fill-2); }
.key.act { color: #FFFFFF; border: 0; font-size: 16px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; line-height: 1.15; }
.key.in { background: var(--in); } .key.out { background: var(--out); }
.key.act[aria-disabled="true"] { background: var(--fill-2); color: var(--ink-4); }
.key.act small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: none; opacity: .85; margin-top: 2px; }
.hold { position: absolute; left: 0; bottom: 0; height: 5px; width: 0; background: var(--ink); }
.key.holding .hold { width: 100%; transition: width 3s linear; }

.lock { position: absolute; inset: 0; background: var(--lock-bg); display: grid; place-content: center; justify-items: center; gap: 28px; padding: 24px; color: var(--lock-ink); }
.lockdots { display: flex; gap: 14px; align-items: center; min-height: 24px; }
.lockdots .dot { border-color: var(--lock-ink); opacity: .75; }
.lockdots .dot.on { background: var(--lock-ink); opacity: 1; }
.lockdots .gap { width: 14px; }
.lockpad { display: grid; grid-template-columns: repeat(3, clamp(72px, 10vw, 96px)); gap: 14px; }
.lockpad button { aspect-ratio: 1; border-radius: 50%; border: 0; background: var(--lock-key); color: var(--lock-ink);
  font: inherit; font-size: 30px; font-weight: 500; cursor: pointer; touch-action: manipulation; }
.lockpad button:active { background: var(--lock-key-2); }
.lockpad button.ghost { background: transparent; font-size: 24px; }
.lockpad .blank { visibility: hidden; }
.lock button:focus-visible { outline-color: var(--lock-ink); }
.lockx { position: absolute; top: 16px; right: 16px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: transparent; color: var(--lock-ink); font-size: 28px; cursor: pointer; }

.overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; color: #FFFFFF; padding: 24px; }
.overlay.in { background: var(--in); } .overlay.out { background: var(--out); } .overlay.req { background: var(--ink-2); }
.overlay .big { font-size: clamp(36px, 6vw, 64px); font-weight: 700; letter-spacing: -0.02em; }
.overlay .who { font-size: 26px; font-weight: 600; }
.overlay .sub { font-size: 17px; opacity: .9; max-width: 40ch; line-height: 1.4; }

@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  body { overflow: auto; }
  .screen { grid-template-columns: 1fr; height: auto; min-height: 100%; }
  .left { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px; }
  .right { padding: 20px; }
  #when { flex: none; padding-block: 12px; }
  .msg { min-height: 0; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .dots.shake, .lockdots.shake { animation: none; } .key.holding .hold { transition: none; } }

/* Activation (0.5): a tablet without a token waits for a manager's Microsoft sign-in. */
.activate { position: absolute; inset: 0; z-index: 5; background: var(--paper); display: grid; place-content: center; justify-items: center;
  gap: 14px; padding: 24px; text-align: center; max-width: 100%; }
.activate h2 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.activate p { margin: 0; max-width: 520px; color: var(--ink-2); font-size: 16px; line-height: 1.5; }
.activate .err { color: var(--out); }
.activate .note { color: var(--ink-3); }
.actbtn { display: inline-block; margin-top: 8px; padding: 16px 26px; border-radius: 14px; background: var(--ink); color: var(--paper);
  font-weight: 700; font-size: 17px; text-decoration: none; }
.actbtn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line-2); }
