/* Klokin — shared styles. Rebrand by changing the variables in :root. */
:root {
  --brand: #1d4ed8;
  --brand-ink: #1e3a8a;
  --brand-soft: #e8eefc;
  --accent: #f5b301;
  --warn-soft: #fff8e6;
  --warn-ink: #8a5a00;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --ink: #17201b;
  --muted: #5f6b64;
  --line: #dfe5e1;
  --bg: #f3f5f2;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--brand); }

/* ---- Check-in shell -------------------------------------------------------- */
.hero { background: var(--brand); color: #fff; padding: 18px 20px 22px; }
.hero .org { display: flex; align-items: center; gap: 8px; font-size: 13px; opacity: .9; }
.hero .org .dot { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.hero h1 { margin: 10px 0 2px; font-size: 22px; letter-spacing: -.01em; }
.hero p { margin: 0; font-size: 13px; opacity: .85; }
.steps { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 12px; }
.steps .step { display: flex; align-items: center; gap: 6px; opacity: .55; white-space: nowrap; }
.steps .step b { width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; font-size: 11px; }
.steps .step.on { opacity: 1; }
.steps .step.on b { background: #fff; color: var(--brand); }
.steps .bar { flex: 1; height: 2px; background: rgba(255,255,255,.25); border-radius: 2px; }
.steps .bar.on { background: #fff; }

.wrap { max-width: 480px; margin: 0 auto; padding: 16px 16px 40px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card h2 { font-size: 16px; margin: 0 0 4px; }
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }

.id-input { width: 100%; text-align: center; font-size: 22px; font-weight: 700; letter-spacing: .08em; padding: 14px; border: 2px solid var(--line); border-radius: 12px; outline: none; background: #fff; }
.id-input:focus { border-color: var(--brand); }
.hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 6px; }

.pill { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 13px; margin-bottom: 14px; }
.pill.ok { background: var(--brand-soft); color: var(--brand-ink); }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.pill.err { background: var(--danger-soft); color: var(--danger); }
.pill.wait { background: #eef1ef; color: var(--muted); }
.pill svg { flex: none; }

.found { border: 2px solid var(--brand); background: var(--brand-soft); border-radius: 12px; padding: 14px; display: flex; gap: 12px; margin-top: 14px; }
.found .tick { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.found small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--brand); }
.found strong { display: block; font-size: 16px; }
.found span { display: block; font-size: 12px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; border-radius: 12px; padding: 14px 16px; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; transition: filter .15s, opacity .15s; }
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.small { width: auto; padding: 8px 12px; font-size: 13px; border-radius: 9px; }
.btn.danger { background: var(--danger); }
.linkish { background: none; border: 0; color: var(--brand); text-decoration: underline; padding: 0; font-size: 12px; cursor: pointer; }

/* ---- Camera ---------------------------------------------------------------- */
.cam-title { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 17px; }
.cam-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 16px; }
.cam-sub b { color: var(--brand); }
.ring { position: relative; width: 240px; height: 240px; margin: 0 auto; border-radius: 50%; padding: 6px; background: conic-gradient(var(--brand) var(--p, 0%), var(--line) 0); transition: background .2s; }
.ring video { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; transform: scaleX(-1); background: #111; display: block; }
.ring .rec { position: absolute; top: 14px; right: 26px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.prompt { text-align: center; font-weight: 600; margin: 16px 0 4px; min-height: 22px; }
.tip { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 14px; }

/* ---- Result ---------------------------------------------------------------- */
.done { text-align: center; padding-top: 10px; }
.done .badge { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; }
.done.review .badge { background: var(--accent); }
.done h2 { font-size: 24px; margin: 0; }
.done p { color: var(--muted); margin: 6px 0 16px; }
.avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--brand); margin: 0 auto 14px; display: block; }
.kv { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.kv td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv td:first-child { color: var(--muted); }
.kv td:last-child { text-align: right; font-weight: 600; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 20px auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.fineprint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ---- Clock action badge ------------------------------------------------- */
.action { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.action.in { background: var(--brand); color: #fff; }
.action.out { background: #111827; color: #fff; }
.big-time { font-size: 44px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0; }
.note { font-size: 13px; font-weight: 600; display: inline-block; padding: 3px 10px; border-radius: 99px; margin-bottom: 14px; }
.note.good { background: var(--brand-soft); color: var(--brand-ink); }
.note.bad { background: var(--warn-soft); color: var(--warn-ink); }
