/*
 * Docházkový kiosek (dochazka.hooray.cz) — tablet na výšku na chodbě. Tmavé téma (méně oslňuje
 * večer), velké tap targety, jen klepání. Žádné externí fonty/ikony (CSP default-src 'none').
 * Všechny styly tady — v HTML nesmí být žádný inline style (style-src 'self').
 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #121a26; color: #f4f6f8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; }
button:disabled { opacity: 0.45; cursor: default; }

.k-screen { display: none; height: 100%; padding: 4vh 5vw; }
.k-screen.show { display: flex; flex-direction: column; align-items: center; }

/* ── Registrace / zamítnuto / potvrzení ──────────────────────────────────── */
.k-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.k-center h1 { font-size: 1.6rem; margin: 0 0 10px; }
.k-center p { font-size: 1.05rem; color: #aab4c0; max-width: 460px; line-height: 1.45; }
.k-muted { color: #6f7b89; font-size: 0.9rem; }
.k-spinner { width: 46px; height: 46px; border: 4px solid #2a3647; border-top-color: #4f8cff; border-radius: 50%; animation: k-spin 1s linear infinite; margin-bottom: 18px; }
@keyframes k-spin { to { transform: rotate(360deg); } }

/* ── Hodiny ──────────────────────────────────────────────────────────────── */
.k-clockwrap { text-align: center; margin-bottom: 2vh; }
.k-clock { font-size: clamp(3.4rem, 13vw, 6.5rem); font-weight: 700; letter-spacing: 0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.k-date { margin-top: 6px; font-size: clamp(1rem, 3.5vw, 1.4rem); color: #aab4c0; text-transform: capitalize; }
.k-clockwrap--small .k-clock { font-size: clamp(1.6rem, 6vw, 2.4rem); color: #aab4c0; }

/* ── PIN ─────────────────────────────────────────────────────────────────── */
.k-pin-title { font-size: clamp(1.2rem, 4.5vw, 1.7rem); font-weight: 600; margin-top: 1vh; }
.k-dots { display: flex; gap: clamp(10px, 3vw, 18px); margin: 2.2vh 0 1vh; }
.k-dot { width: clamp(16px, 4.5vw, 24px); height: clamp(16px, 4.5vw, 24px); border-radius: 50%; border: 2px solid #5c6978; background: transparent; transition: background 0.12s, border-color 0.12s, transform 0.12s; }
.k-dot.on { background: #4f8cff; border-color: #4f8cff; transform: scale(1.08); }
.k-dots.shake { animation: k-shake 0.4s; }
.k-dots.error .k-dot { border-color: #ff5c5c; }
.k-dots.error .k-dot.on { background: #ff5c5c; }
@keyframes k-shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-10px); } 40%,80% { transform: translateX(10px); } }

.k-msg { min-height: 1.6em; font-size: clamp(0.95rem, 3.2vw, 1.15rem); color: #ffb3b3; text-align: center; margin: 0.6vh 0 1.2vh; max-width: 90vw; line-height: 1.35; }
.k-msg.ok { color: #9fe3b2; }
.k-msg.info { color: #aab4c0; }

.k-keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 2.2vw, 16px); width: min(92vw, 420px); flex: 1; align-content: center; }
.k-key {
  height: clamp(62px, 10.5vh, 104px); border-radius: 18px; background: #1f2b3b; color: #fff;
  font-size: clamp(1.8rem, 7vw, 2.6rem); font-weight: 600; box-shadow: inset 0 -3px 0 rgba(0,0,0,0.25);
  transition: background 0.08s, transform 0.08s;
}
.k-key:active { background: #2d3d52; transform: scale(0.97); }
.k-key--fn { background: #182331; color: #aab4c0; font-size: clamp(1.3rem, 5vw, 1.9rem); }
.k-keypad.busy .k-key { pointer-events: none; opacity: 0.55; }

.k-foot { margin-top: 1.5vh; font-size: 0.85rem; color: #6f7b89; }
.k-conn { display: inline-flex; align-items: center; gap: 6px; }
.k-conn-dot { width: 8px; height: 8px; border-radius: 50%; background: #35c26a; display: inline-block; }
.k-conn--offline .k-conn-dot { background: #ff5c5c; }

/* ── Akce ────────────────────────────────────────────────────────────────── */
.k-greet { font-size: clamp(1.7rem, 7vw, 2.6rem); font-weight: 700; text-align: center; margin-top: 1vh; }
.k-state { font-size: clamp(1.15rem, 4.5vw, 1.6rem); color: #d6dde6; text-align: center; margin-top: 1.2vh; line-height: 1.35; }
.k-state.warn { color: #ffcf6b; }
.k-worked { font-size: clamp(0.95rem, 3.4vw, 1.2rem); color: #aab4c0; text-align: center; margin-top: 0.8vh; min-height: 1.4em; }

.k-actions { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; width: 100%; }
.k-big {
  width: min(92vw, 460px); min-height: clamp(110px, 22vh, 200px); border-radius: 26px;
  font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 800; letter-spacing: 0.02em; color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35), inset 0 -4px 0 rgba(0,0,0,0.25);
  transition: transform 0.08s, filter 0.08s; display: none; padding: 18px 20px; line-height: 1.15;
}
.k-big.show { display: block; }
.k-big:active { transform: scale(0.98); filter: brightness(1.08); }
.k-big--arrival { background: #22a65b; }
.k-big--departure { background: #d9433b; }
.k-big--confirm { background: #2f6fed; font-size: clamp(1.15rem, 4.6vw, 1.6rem); font-weight: 700; min-height: clamp(84px, 14vh, 130px); }

.k-small { width: min(92vw, 460px); min-height: 60px; border-radius: 16px; background: #1f2b3b; color: #d6dde6; font-size: clamp(1rem, 3.8vw, 1.25rem); font-weight: 600; padding: 12px 16px; }
.k-small:active { background: #2d3d52; }
.k-link { background: transparent; color: #8793a2; font-size: clamp(0.95rem, 3.4vw, 1.1rem); padding: 14px 24px; text-decoration: underline; min-height: 48px; }

/* ── Zapomenutý odchod / příchod ─────────────────────────────────────────── */
.k-forgot-title { font-size: clamp(1.4rem, 5.5vw, 2rem); font-weight: 700; text-align: center; margin-top: 2vh; }
.k-forgot-hint { font-size: clamp(1rem, 3.6vw, 1.2rem); color: #aab4c0; text-align: center; margin-top: 1vh; line-height: 1.35; }
.k-time { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 20px); margin-top: 3vh; }
.k-time-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.k-time-val { font-size: clamp(3.2rem, 15vw, 6rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: center; }
.k-time-sep { font-size: clamp(3rem, 14vw, 5.5rem); font-weight: 700; line-height: 1; padding-bottom: 0; color: #aab4c0; }
.k-step { width: clamp(84px, 24vw, 120px); height: clamp(60px, 9vh, 84px); border-radius: 16px; background: #1f2b3b; color: #fff; font-size: clamp(1.4rem, 5vw, 2rem); }
.k-step:active { background: #2d3d52; }
.k-time-help { font-size: 0.9rem; color: #6f7b89; text-align: center; margin-top: 1vh; }

/* ── Potvrzení ───────────────────────────────────────────────────────────── */
.k-done-icon { width: clamp(96px, 28vw, 150px); height: clamp(96px, 28vw, 150px); border-radius: 50%; background: #22a65b; color: #fff; font-size: clamp(3rem, 15vw, 5.5rem); font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 3vh; animation: k-pop 0.35s ease-out; }
.k-done-icon.departure { background: #d9433b; }
.k-done-icon.warn { background: #e2a324; }
@keyframes k-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.k-done-title { font-size: clamp(1.8rem, 8vw, 3rem); font-weight: 800; text-align: center; line-height: 1.2; }
.k-done-sub { font-size: clamp(1.05rem, 4vw, 1.5rem); color: #aab4c0; text-align: center; margin-top: 1.5vh; line-height: 1.4; max-width: 90vw; }
