/* =====================================================================
   Epoka Visitor Kiosk
   Brand colours sampled from the Epoka logo
   Fonts: Space Grotesk (headings & subtitles), Open Sans (body)
   ===================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&family=Space+Grotesk:wght@300..700&display=swap");

:root {
  --font-heading: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Open Sans", "Segoe UI", system-ui, sans-serif;
  --navy: #003c6c;
  --navy-700: #002b4f;
  --navy-50: #eaf1f7;
  --teal: #86b4b9;
  --teal-50: #eef5f6;
  --orange: #ec6e01;
  --ink: #0d1b2a;
  --muted: #5b6b7b;
  --line: #dde4ea;
  --bg: #f3f6f9;
  --ok: #15803d;
  --ok-50: #effaf3;
  --danger: #b91c1c;
  --r: 16px;
  --shadow: 0 1px 2px rgba(0,43,79,.06), 0 8px 24px rgba(0,43,79,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased;
}
body.kiosk { overflow: hidden; height: 100dvh; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* Headings & subtitles */
h1, h2, h3, h4,
.eyebrow, .clock,
.w-main p, .title p, .admin-head p,
.policy-head b, .sheet header b,
.big .txt b, .code-box b, .input.code {
  font-family: var(--font-heading);
}
h1, h2 { letter-spacing: -.02em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: .05em; }

/* ---------- Welcome ---------- */
.welcome { display: flex; height: 100dvh; background: #fff; }
.w-left { flex: 1.25; display: flex; flex-direction: column; padding: 56px 64px; }
.w-left .logo { height: 52px; width: auto; align-self: flex-start; }
.w-main { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 620px; }
.eyebrow { font-size: 14px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--orange); }
.w-main h1 { font-size: 56px; line-height: 1.05; font-weight: 800; color: var(--navy); margin: 12px 0 14px; letter-spacing: -.02em; }
.w-main p { font-size: 19px; color: var(--muted); line-height: 1.5; }
.w-actions { display: flex; flex-direction: column; gap: 16px; margin-top: 40px; }
.big {
  display: flex; align-items: center; gap: 20px; padding: 22px 26px; border-radius: 20px; text-decoration: none;
  border: 2px solid var(--line); background: #fff; transition: transform .12s;
}
.big:active { transform: scale(.985); }
.big .ico { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--navy-50); color: var(--navy); }
.big .txt b { display: block; font-size: 23px; color: var(--navy); }
.big .txt span { font-size: 15px; color: var(--muted); }
.big .arrow { margin-left: auto; color: var(--muted); }
.big.primary { background: var(--navy); border-color: var(--navy); box-shadow: 0 10px 24px rgba(0,60,108,.25); }
.big.primary .ico { background: rgba(255,255,255,.14); color: #fff; }
.big.primary .txt b, .big.primary .arrow { color: #fff; }
.big.primary .txt span { color: rgba(255,255,255,.75); }
.w-foot { font-size: 13px; color: var(--muted); }

.w-right {
  flex: 1; position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-700) 100%);
  display: flex; flex-direction: column; justify-content: space-between; padding: 56px 52px;
}
.mark-bg { position: absolute; right: -60px; bottom: -70px; height: 115%; width: auto; pointer-events: none; }
.clock { position: relative; }
.clock b { display: block; font-size: 64px; font-weight: 300; letter-spacing: -.02em; line-height: 1; }
.clock span { display: block; margin-top: 8px; font-size: 18px; opacity: .75; }
.tips { position: relative; display: flex; flex-direction: column; gap: 14px; max-width: 340px; }
.tip { display: flex; gap: 14px; align-items: flex-start; font-size: 16px; line-height: 1.4; }
.tip svg { flex: none; margin-top: 2px; color: var(--teal); }

/* ---------- Kiosk page shell ---------- */
.page { display: flex; flex-direction: column; height: 100dvh; }
.bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--line); flex: none; }
.bar .logo { height: 30px; }
.back { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 17px; color: var(--navy); padding: 10px 14px 10px 8px; border-radius: 12px; text-decoration: none; }
.back:active { background: var(--bg); }
.scroll { flex: 1; overflow: auto; padding: 24px 28px; }
.wrap { max-width: 1180px; margin: 0 auto; }
.narrow { max-width: 720px; margin: 0 auto; }
.title h2 { font-size: 30px; font-weight: 800; color: var(--navy); letter-spacing: -.01em; }
.title p { color: var(--muted); font-size: 16px; margin-top: 4px; }

.errors:empty, .errors.validation-summary-valid { display: none; }
.errors { margin-top: 16px; padding: 14px 18px; border-radius: 12px; background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); font-weight: 600; }
.errors ul { list-style: none; }

/* ---------- Check-in form ---------- */
.form-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; margin-top: 16px; align-items: stretch; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; }
.card h3 { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.field { margin-bottom: 16px; position: relative; }
.row .field, .field.last { margin-bottom: 0; }
.field label, .field .label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.req { color: var(--orange); }
.opt { color: var(--muted); font-weight: 400; }
.input, .select {
  width: 100%; height: 56px; border-radius: 12px; border: 2px solid var(--line); background: #fff;
  padding: 0 16px; font-size: 18px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(0,60,108,.12); }
.input::placeholder { color: #9aa8b5; }
.input.input-validation-error { border-color: var(--danger); }
.plate { text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.with-icon { position: relative; }
.with-icon > svg { position: absolute; left: 16px; top: 28px; transform: translateY(-50%); color: var(--muted); }
.with-icon .input { padding-left: 48px; }

.dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,43,79,.14); overflow: hidden; }
.opt-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.opt-row:last-child { border-bottom: 0; }
.opt-row:active { background: var(--navy-50); }
.opt-row b { display: block; font-size: 16px; }
.opt-row span { font-size: 13px; color: var(--muted); }
.nores { padding: 14px; color: var(--muted); font-size: 15px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex: none; background: var(--navy); }
.picked { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 8px 0 10px; border-radius: 12px; border: 2px solid var(--navy); background: var(--navy-50); }
.picked .who { flex: 1; line-height: 1.2; }
.picked .who b { display: block; font-size: 16px; }
.picked .who span { font-size: 13px; color: var(--muted); }
.picked button { font-size: 14px; font-weight: 600; color: var(--navy); padding: 10px 12px; border-radius: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 12px 16px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 600; font-size: 15px; cursor: pointer; user-select: none; }
.chips input:checked + .chip { border-color: var(--navy); background: var(--navy); color: #fff; }
.other-reason { margin-top: 10px; }
.chips input:focus-visible + .chip { box-shadow: 0 0 0 4px rgba(0,60,108,.2); }

.policy-card { padding: 0; overflow: hidden; border-color: var(--navy); }
.policy-head { background: var(--navy); color: #fff; padding: 18px 24px; display: flex; align-items: center; gap: 12px; }
.policy-head svg { color: var(--teal); flex: none; }
.policy-head b { font-size: 18px; }
.policy-head span { display: block; font-size: 13px; opacity: .75; }
.rules { list-style: none; padding: 8px 24px; }
.rules li { display: flex; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rules li:last-child { border-bottom: 0; }
.ri { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--teal-50); color: var(--navy); }
.rules b { display: block; font-size: 15px; }
.rules span { font-size: 13px; color: var(--muted); }
.policy-actions { padding: 0 24px 24px; }
.readfull { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 12px; border: 2px solid var(--line); font-weight: 600; color: var(--navy); font-size: 15px; margin-bottom: 12px; }
.accept { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; border: 2px solid var(--orange); background: #fff7f0; cursor: pointer; user-select: none; transition: all .15s; }
.accept .box { width: 30px; height: 30px; border-radius: 8px; border: 2px solid #b8c3cd; background: #fff; display: grid; place-items: center; flex: none; color: transparent; transition: all .15s; }
.accept b { font-size: 16px; display: block; }
.accept .sub { font-size: 13px; color: var(--muted); }
.accept .when-on { display: none; }
#accept:checked + .accept { border-color: var(--ok); background: var(--ok-50); }
#accept:checked + .accept .box { background: var(--ok); border-color: var(--ok); color: #fff; }
#accept:checked + .accept .sub { color: var(--ok); }
#accept:checked + .accept .when-off { display: none; }
#accept:checked + .accept .when-on { display: inline; }
#accept:focus-visible + .accept { box-shadow: 0 0 0 4px rgba(0,60,108,.2); }

.footer { flex: none; padding: 14px 28px; background: #fff; border-top: 1px solid var(--line); }
.footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hint { font-size: 15px; color: var(--muted); }
.hint b { color: var(--ink); }

.btn {
  height: 60px; padding: 0 34px; border-radius: 14px; font-weight: 700; font-size: 18px; text-decoration: none;
  background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex: none;
  box-shadow: 0 8px 20px rgba(0,60,108,.25); transition: all .15s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { background: #c4cdd6; box-shadow: none; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--navy); border: 2px solid var(--line); box-shadow: none; }
.btn.wide { width: 100%; }

/* ---------- Policy dialog ---------- */
.sheet { border: 0; border-radius: 20px; padding: 0; width: min(760px, calc(100vw - 64px)); max-height: calc(100dvh - 64px); margin: auto; overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; }
.sheet::backdrop { background: rgba(0,27,51,.55); }
.sheet header { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.sheet header b { font-size: 21px; color: var(--navy); }
.sheet .content { padding: 8px 24px 20px; overflow: auto; line-height: 1.6; font-size: 16px; }
.sheet h4 { margin: 18px 0 4px; color: var(--navy); font-size: 16px; }
.sheet ul { padding-left: 20px; }
.sheet footer { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 12px; }
.icon-btn { padding: 10px; border-radius: 10px; color: var(--navy); }

/* ---------- Check-out ---------- */
.search { margin-top: 20px; }
.privacy-note { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; margin-top: 14px; }
.visitors { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.visitor { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.visitor .meta { flex: 1; }
.visitor b { display: block; font-size: 18px; }
.visitor span { font-size: 14px; color: var(--muted); }
.visitor .btn { height: 50px; padding: 0 22px; font-size: 16px; box-shadow: none; }
.empty { padding: 28px; text-align: center; color: var(--muted); font-size: 16px; }

/* ---------- Done ---------- */
.done { height: 100dvh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px; color: #fff; background: linear-gradient(160deg, var(--navy), var(--navy-700)); }
.check { width: 104px; height: 104px; border-radius: 50%; background: #22c55e; display: grid; place-items: center; margin: 0 auto 28px; box-shadow: 0 0 0 14px rgba(34,197,94,.18); animation: pop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.done h2 { font-size: 44px; font-weight: 800; }
.done p { font-size: 19px; opacity: .85; margin: 10px auto 0; max-width: 600px; line-height: 1.5; }
.note { margin-top: 28px; display: inline-flex; padding: 14px 20px; border-radius: 12px; background: rgba(255,255,255,.1); font-weight: 600; }
.cd { margin-top: 32px; font-size: 14px; opacity: .6; }

/* ---------- Pair / message pages ---------- */
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.pair-card { width: min(460px, 100%); padding: 36px; text-align: center; }
.pair-card .logo { height: 40px; margin-bottom: 24px; }
.pair-card h2 { font-size: 26px; color: var(--navy); margin-bottom: 8px; }
.pair-card p { margin-bottom: 20px; line-height: 1.5; }
.pair-card form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.pair-card .errors { margin: 0; }
.input.code { text-align: center; font-size: 26px; letter-spacing: .2em; font-weight: 700; text-transform: uppercase; }
.dev { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--line); }

/* ---------- Admin ---------- */
body.admin { background: var(--bg); }
.admin-bar { display: flex; align-items: center; gap: 32px; padding: 14px 32px; background: #fff; border-bottom: 1px solid var(--line); }
.admin-bar .logo { height: 28px; }
.admin-bar nav { display: flex; gap: 4px; flex: 1; }
.admin-bar nav a { padding: 8px 14px; border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--muted); }
.admin-bar nav a.on { background: var(--navy-50); color: var(--navy); }
.admin-bar .who { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }
.admin-main { max-width: 1280px; margin: 0 auto; padding: 28px 32px; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; }
.admin-head h1 { font-size: 28px; color: var(--navy); }
.admin-actions { display: flex; gap: 12px; align-items: center; }
.admin-actions .select { width: 220px; height: 48px; font-size: 16px; }
.admin-actions .btn { height: 48px; font-size: 16px; padding: 0 20px; }
.admin-grid { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.card.pad { padding: 24px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack > label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.stack .input, .stack .select { height: 48px; font-size: 16px; }
.stack .btn { height: 50px; font-size: 16px; }
.code-box { margin-top: 20px; padding: 18px; border-radius: 12px; background: var(--navy-50); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 13px; }
.code-box b { font-size: 34px; letter-spacing: .12em; color: var(--navy); font-family: ui-monospace, Consolas, monospace; }
.table { width: 100%; border-collapse: collapse; padding: 0; overflow: hidden; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.dim td { color: var(--muted); }
.link { color: var(--navy); font-weight: 600; text-decoration: underline; font-size: 14px; }
.link.danger { color: var(--danger); }
.flash.error { background: #fef2f2; color: var(--danger); }
.input.compact, .select.compact { height: 42px; font-size: 15px; padding: 0 12px; border-width: 1px; }
.card-hint { margin: -8px 0 16px; }
.field-group { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.segmented { position: relative; display: inline-flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; height: 48px; background: #fff; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: flex; align-items: center; padding: 0 16px; font-weight: 600; font-size: 15px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.segmented label + input + label { border-left: 2px solid var(--line); }
.segmented input:checked + label { background: var(--navy); color: #fff; }
.segmented input:focus-visible + label { box-shadow: inset 0 0 0 3px rgba(0,60,108,.3); }
.segmented.small { height: 42px; border-width: 1px; }
.segmented.small label { padding: 0 12px; font-size: 14px; }
.checkbox { width: 22px; height: 22px; accent-color: var(--navy); }
.admin-grid.stacked { grid-template-columns: 1fr; }
.stack.inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.stack.inline > label { flex: 1; min-width: 220px; }
.stack.inline .btn { flex: none; }
.table .input.compact, .table .select.compact { width: 100%; min-width: 180px; }
.empty a { color: var(--navy); font-weight: 600; }
.flash { margin-bottom: 16px; padding: 12px 16px; border-radius: 12px; background: var(--ok-50); color: var(--ok); font-weight: 600; }

@media print {
  .admin-bar, .admin-actions, .no-print, .flash { display: none !important; }
  .admin-main { padding: 0; }
  .card { box-shadow: none; border: 0; }
}

/* ---------- Portrait / narrow ---------- */
@media (max-width: 960px) {
  .welcome { flex-direction: column; }
  .w-right { flex: none; padding: 28px 32px; flex-direction: row; align-items: center; }
  .tips, .mark-bg { display: none; }
  .w-left { padding: 36px; }
  .w-main h1 { font-size: 44px; }
  .form-grid, .admin-grid { grid-template-columns: 1fr; }
}
