/* Kadran — "Paper Signal by day, Night Shift by night".
   Paper + ink in light, night + mist in dark. Orange = act now / your turn, lime = live / all good.
   Archivo (wide) for numbers and headings, Inter for text, JetBrains Mono for labels. */
:root {
  --bg: #121614;          /* night */
  --card: #181D1A;
  --raise: #222924;
  --ink: #E9EDE6;         /* mist: never pure white */
  --ink2: #A3ABA4;        /* moss */
  --line: #2A312C;
  --grid: transparent;
  --brand: #FF5B1F;       /* signal orange: act now, your turn */
  --brand-hover: #FF7A47;
  --brand-text: #FF7A47;  /* orange that reads on night */
  --brand-ink: #141414;
  --lime: #C6F24E;        /* live, alerts on, all good */
  --lime-ink: #141414;
  --lime-text: #C6F24E;
  --soft: #222924;
  --warn: #FFB86B;
  --warn-ink: #141414;
  --ok: #C6F24E;
  --radius: 16px;
  --btn-radius: 12px;
  --display: 'Archivo', 'Inter', system-ui, sans-serif;
  --text: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --sans: var(--text);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background-color: var(--bg); color: var(--ink);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px; background-attachment: fixed;
  font: 16px/1.5 var(--text);
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "wdth" 110; /* Archivo's width axis; Inter and JetBrains Mono ignore it */
}
.wrap { max-width: 480px; margin: 0 auto; padding: 18px 16px 40px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font: 900 18px var(--display); font-variation-settings: "wdth" 112; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); text-decoration: none; min-height: 44px; }
a.brand:hover { color: var(--ink); opacity: .85; }
.brand svg { flex: none; }
.place { font: 500 13px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); margin: 0 0 12px; }
h1 { font: 900 32px/.95 var(--display); font-variation-settings: "wdth" 118; margin: 0 0 16px; letter-spacing: -0.03em; text-transform: uppercase; }
h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.01em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 12px; position: relative; }
.big { font: 700 96px/1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin: 6px 0 8px; color: var(--ink); }
.label { font: 500 13px var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink2); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.stat { font: 700 32px var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--ink2); }
.center { text-align: center; }

/* split-flap digits: DOR.flap() puts one tile per character and flips the ones that change */
.flap { display: inline-flex; gap: .06em; justify-content: center; vertical-align: middle; }
.flap b { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: .68em; padding: .04em .06em;
  background: var(--card); border: 1px solid var(--line); border-radius: .08em; color: inherit; font-weight: 700; line-height: 1; }
.flap b::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--bg); opacity: .9; }
.flap b.flip { animation: flip .42s cubic-bezier(.3, .7, .4, 1); }
@keyframes flip { 0% { transform: perspective(400px) rotateX(-90deg); opacity: .3; } 100% { transform: none; opacity: 1; } }
.card .flap b { background: var(--bg); }

/* live indicator and small index tags */
.live { display: inline-flex; align-items: center; gap: 7px; font: 500 13px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lime-text); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); animation: blink 1.6s infinite; }
html[data-theme="light"] .live::before { background: #4D7C0F; box-shadow: none; }
.live.off { color: var(--ink2); } .live.off::before { background: var(--ink2); animation: none; }
@keyframes blink { 50% { opacity: .2; } }
.idx { font: 500 13px var(--mono); color: var(--brand-text); letter-spacing: .08em; }

/* scrolling strip */
.ticker { overflow: hidden; white-space: nowrap; background: #0A0C0B; color: #E9EDE6; border-top: 1px solid var(--line); font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 8px 0; }
.ticker span { display: inline-block; padding-left: 16px; animation: marquee 40s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }
.ticker:hover span, .ticker:focus-within span, .ticker:active span { animation-play-state: paused; }

button, .btn {
  appearance: none; border: 1px solid transparent; border-radius: var(--btn-radius); padding: 15px 18px; font: 600 16px var(--display); letter-spacing: .02em;
  background: var(--brand); color: var(--brand-ink); cursor: pointer; width: 100%; display: block; text-align: center; text-decoration: none;
  min-height: 52px; transition: transform .14s var(--ease-out), background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
button:active:not(:disabled), a.btn:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { button:hover:not(:disabled) { background: var(--brand-hover); } }
button.secondary, .btn.secondary { background: transparent; color: var(--ink); border-color: var(--ink2); }
@media (hover: hover) and (pointer: fine) { button.secondary:hover:not(:disabled) { background: var(--raise); } }
button.ghost { background: transparent; color: var(--ink2); border-color: var(--line); }
@media (hover: hover) and (pointer: fine) { button.ghost:hover:not(:disabled) { background: var(--raise); color: var(--ink); } }
button.warn { background: transparent; color: var(--warn); border-color: var(--warn); }
@media (hover: hover) and (pointer: fine) { button.warn:hover:not(:disabled) { background: var(--warn); color: var(--warn-ink); } }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
a { color: var(--brand-text); }
.lang { width: auto; min-height: 44px; padding: 6px 10px; font: 500 16px var(--mono); text-transform: uppercase; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); } /* 16px: iPhone zooms into smaller fields */
select { appearance: none; -webkit-appearance: none; font: 500 16px var(--text); letter-spacing: 0; text-transform: none; min-height: 52px; padding: 12px 42px 12px 14px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A3ABA4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--ink); width: 100%; margin-top: 4px; cursor: pointer; }
html[data-theme="light"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235A5A5A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
select:hover, input:hover { border-color: var(--ink2); }
input[type=time] { min-height: 52px; }
.banner { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; font-weight: 600; border: 1px solid transparent; }
.banner.soon { background: var(--ink); color: var(--bg); }
.banner.now { background: var(--brand); color: var(--brand-ink); font: 700 22px var(--display); text-transform: uppercase; letter-spacing: .02em; text-align: center; padding: 22px 16px; }
.banner.info { background: var(--card); color: var(--ink); border-color: var(--line); }
.banner.alert { background: var(--warn); color: var(--warn-ink); }
.stack > * + * { margin-top: 10px; }
.small { font-size: 14px; }
input { font: 600 22px var(--mono); padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); color: var(--ink);
  width: 100%; text-align: center; letter-spacing: .3em; min-height: 52px; }
input[type=email], input[type=time], input[type=url], input[type=number] { letter-spacing: 0; }
input::placeholder { color: var(--ink2); opacity: .6; }
.err { color: var(--warn); font-weight: 600; min-height: 1.4em; }
.pulse { animation: pulse 1s ease-in-out 3; }
@keyframes pulse { 50% { transform: scale(1.03); } }
footer { margin-top: 26px; font: 13px var(--mono); letter-spacing: .04em; color: var(--ink2); text-align: center; }
footer a { color: inherit; display: inline-block; padding: 12px 4px; }
@media (prefers-reduced-motion: reduce) {
  .pulse, .flap b.flip, .live::before, .ticker span { animation: none; }
}
/* progress toward your turn */
.track { height: 6px; background: var(--raise); border-radius: 3px; margin-top: 16px; overflow: hidden; }
.track i { display: block; height: 100%; width: 100%; background: var(--lime); border-radius: 3px; transform: scaleX(0); transform-origin: left; transition: transform .8s cubic-bezier(.3, .7, .4, 1); }

/* ticket: stale data stays visible but is clearly marked */
#numcard.stale .big, #numcard.stale .live { opacity: .45; }
#conn.banner { text-align: center; margin-bottom: 12px; }
/* full-screen end state: expired / cancelled / missed ticket */
.endstate { text-align: center; padding: 28px 20px; }
.endstate .big { font-size: 56px; opacity: .5; margin: 4px 0 12px; }
.endstate p { margin: 0 0 16px; font-weight: 600; font-size: 18px; }
/* light theme for the desk, opt-in (bright offices) */
html[data-theme="light"] { --bg: #F2EEE6; --card: #FBFAF7; --raise: #E6E1D7; --ink: #141414; --ink2: #5A5A5A; --line: #D6D0C4;
  --grid: transparent; --brand-text: #B83A0A; --brand-hover: #FF7A47; --lime-text: #3F6212; --warn: #8A4B00; --ok: #3F6212; --soft: #E6E1D7; color-scheme: light; }
@media (hover: hover) and (pointer: fine) { html[data-theme="light"] button.warn:hover:not(:disabled) { color: #fff; } }
html[data-theme="light"] .banner.alert { background: #FFB86B; color: #141414; }
html[data-theme="light"] .banner.soon { background: var(--ink); color: var(--bg); }
.banner.alert a { color: inherit; font-weight: 700; }

/* phone feel: no grey tap flash or tap delay, and long-press doesn't select button text */
a, button, summary, select, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, .btn { -webkit-user-select: none; user-select: none; }

/* language picker with small flags */
.langpick { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.langpick button { width: auto; min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 0;
  font: 500 13px var(--mono); letter-spacing: .06em; text-transform: uppercase; background: transparent; color: var(--ink2); }
.langpick button[aria-checked="true"] { background: var(--raise); color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .langpick button:hover:not([aria-checked="true"]) { background: var(--raise); color: var(--ink); } }
.langpick svg { width: 22px; height: 15px; flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(127, 127, 127, .35); }
.langpick button[data-v="auto"] svg { box-shadow: none; width: 20px; }
html[data-theme="light"] .track i { background: var(--ink); }

/* the customer's "your turn" moment: the whole ticket page turns signal orange (set by ticket.html) */
body.turn { --bg: #FF5B1F; --card: #FF6E38; --raise: #FF7A47; --ink: #141414; --ink2: #2B1A12; --line: rgba(20, 20, 20, .25);
  --brand: #141414; --brand-ink: #FF5B1F; --brand-text: #141414; --lime-text: #141414; --lime: #141414; background-color: #FF5B1F; color: #141414; }
body.turn .banner.now { background: #141414; color: #FF5B1F; }
body.turn .flap b { background: transparent; border-color: rgba(20, 20, 20, .3); }
body.turn .flap b::after { background: rgba(20, 20, 20, .2); }
body.turn .brand svg rect { fill: #141414; }
body.turn .brand svg path { stroke: #FF5B1F; }

/* site footer on the sign-up and sign-in pages */
.pagefoot { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 18px; justify-content: center; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); }
.pagefoot a { color: inherit; text-decoration: none; padding: 10px 2px; }
.pagefoot a:hover { color: var(--brand-text); }
/* phones: long business names keep the header on one line (the logo stays, the word "Kadran" goes) */
@media (max-width: 600px) { .brand .bword { display: none; } .brand { font-size: 15px; min-width: 0; } .brand #place { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* trial page: currency choice next to the languages */
.toppick { display: inline-flex; align-items: stretch; gap: 8px; }
.toppick select.cur { width: auto; min-height: 44px; margin: 0; padding: 0 28px 0 10px; font: 500 13px var(--mono); }

/* ---------- polish, December 2026: depth instead of outlines, calm motion only where it explains something ---------- */
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }
.stat, .chip, .mnum, .tiles button, input[type=time] { font-variant-numeric: tabular-nums; }
.card { border-color: transparent; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, .06), 0 12px 32px -24px rgba(0, 0, 0, .35); }
/* the main action stands off the page */
#next:not(:disabled), #wnext, #esave, a.big-btn:not(.secondary), a.take { box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 12px 26px -14px rgba(255, 91, 31, .75); }
input.answer { box-shadow: 0 1px 2px rgba(0, 0, 0, .05); transition: border-color .15s ease, box-shadow .15s ease; }
input.answer:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 91, 31, .22); }
/* windows arrive from just below their final size (never from nothing); closing is instant */
dialog { box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .5); border-radius: 24px !important; }
dialog[open] { transition: opacity .2s var(--ease-out), transform .2s var(--ease-out); }
@starting-style { dialog[open] { opacity: 0; transform: scale(.96) translateY(6px); } }
/* sign-up and settings pages: seen rarely, so each question settles in; the queue itself never animates its buttons */
.step:not([hidden]) > *, #edit:not([hidden]) > form > * { animation: settle .28s var(--ease-out) backwards; }
.step:not([hidden]) > :nth-child(2), #edit:not([hidden]) > form > :nth-child(2) { animation-delay: .04s; }
.step:not([hidden]) > :nth-child(n+3), #edit:not([hidden]) > form > :nth-child(n+3) { animation-delay: .08s; }
@keyframes settle { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .step:not([hidden]) > *, #edit:not([hidden]) > form > * { animation: none; }
  button:active:not(:disabled), a.btn:active { transform: none; }
  @starting-style { dialog[open] { opacity: 0; transform: none; } }
}
