/*
 * booki v2 — "Рецепция"
 * Visual language from the front desk: key tags, the registration card, the key board, the clock.
 * One family (Onest) for text, a mono for times, room numbers and codes.
 * Indigo is the brand; brass is the key-tag metal and is used sparingly.
 */

/* Layout concept: a ledger — hairline rules on a stone ground, a time gutter on the left, few boxes. */
:root {
  --paper: #F3F3EF;
  --surface: #FFFFFF;
  --surface-2: #F8F8F5;
  --line: #E2E2DB;
  --line-strong: #C9C9C0;

  --ink: #14162B;
  --ink-2: #393C51;
  --muted: #62657A;

  --accent: #5B5BD6;
  --accent-text: #4339B8;
  --accent-deep: #2A2878;
  --accent-wash: #ECECFB;
  --on-accent: #FFFFFF;
  --violet: #8B7FF5;

  --brass: #A8762A;
  --brass-text: #7E5714;
  --brass-wash: #F2E8D5;

  --ok: #0F7A55;     --ok-wash: #DDF3E8;     --ok-text: #0A5C40;
  --warn: #C67A06;   --warn-wash: #FBEFD3;   --warn-text: #81500A;
  --danger: #B42318; --danger-wash: #FBE3E1; --danger-text: #8F1C13;

  --f-text: 'Onest', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-1: 4px; --r-2: 8px; --r-3: 12px;
  --rule: 1px solid var(--line);
  --lift: 0 1px 0 rgba(20,22,43,.04), 0 12px 32px -18px rgba(20,22,43,.28);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 38%, transparent);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1014; --surface: #17181E; --surface-2: #1C1D24; --line: #2A2B33; --line-strong: #3A3B45;
    --ink: #EDEDEA; --ink-2: #C6C7CF; --muted: #969AAD;
    --accent: #8C8CF2; --accent-text: #ABABFA; --accent-deep: #D3D3FF; --accent-wash: #1F1F3A; --on-accent: #0F1014;
    --brass: #D2A459; --brass-text: #E2BC7C; --brass-wash: #2C2414;
    --ok: #3DD39B; --ok-wash: #102A21; --ok-text: #7BE4BD;
    --warn: #F0A93A; --warn-wash: #2E2412; --warn-text: #F6C979;
    --danger: #F2766B; --danger-wash: #331716; --danger-text: #F7A79F;
    --lift: 0 1px 0 rgba(0,0,0,.3), 0 16px 40px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1014; --surface: #17181E; --surface-2: #1C1D24; --line: #2A2B33; --line-strong: #3A3B45;
  --ink: #EDEDEA; --ink-2: #C6C7CF; --muted: #969AAD;
  --accent: #8C8CF2; --accent-text: #ABABFA; --accent-deep: #D3D3FF; --accent-wash: #1F1F3A; --on-accent: #0F1014;
  --brass: #D2A459; --brass-text: #E2BC7C; --brass-wash: #2C2414;
  --ok: #3DD39B; --ok-wash: #102A21; --ok-text: #7BE4BD;
  --warn: #F0A93A; --warn-wash: #2E2412; --warn-text: #F6C979;
  --danger: #F2766B; --danger-wash: #331716; --danger-text: #F7A79F;
  --lift: 0 1px 0 rgba(0,0,0,.3), 0 16px 40px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--f-text); font-optical-sizing: auto; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-text); color: var(--ink); text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-1); }
::selection { background: var(--brass-wash); color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-feature-settings: "zero" 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Small mono label, used where a front-desk form would print one */
.label { font: 500 11px/1.2 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Wordmark */
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font: 700 22px/1 var(--f-text); letter-spacing: -0.03em; text-decoration: none; }
.wordmark:hover { color: var(--ink); }
.wordmark .i { position: relative; }
.wordmark .i::after { content: ""; position: absolute; left: 50%; top: -0.03em; width: .2em; height: .2em; border-radius: 50%; background: var(--violet); transform: translateX(-50%); }
.symbol { width: 28px; height: 28px; flex: none; }

/* Key tag — the signature shape. A rounded tag with a ring hole on the left. */
.tag {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 12px 0 26px;
  border-radius: 5px 14px 14px 5px;
  background: var(--brass-wash); color: var(--brass-text);
  font: 600 12px/1 var(--f-mono); letter-spacing: .02em; white-space: nowrap;
}
.tag::before { content: ""; position: absolute; left: 9px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--brass); }
.tag.ink { background: var(--ink); color: var(--paper); }
.tag.ink::before { background: var(--ink); box-shadow: inset 0 0 0 1.5px var(--paper); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--r-2);
  font: 600 15px/1 var(--f-text); letter-spacing: -0.005em; white-space: nowrap; text-decoration: none;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--paper); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-text); border-color: var(--accent-text); color: var(--on-accent); }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-quiet:hover { background: var(--surface); border-color: var(--line); }
.btn-danger { color: var(--danger); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
.btn-lg { height: 52px; padding: 0 22px; font-size: 16px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.arrow { font-family: var(--f-mono); font-weight: 500; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .flabel { font: 500 13px/1.3 var(--f-text); color: var(--ink-2); }
.input, .select {
  height: 46px; width: 100%; padding: 0 14px; border-radius: var(--r-2);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 400 15px/1 var(--f-text);
}
.input::placeholder { color: var(--muted); }
.input:focus, .select:focus { outline: none; border-color: var(--ink); box-shadow: var(--focus); }
.input.is-error { border-color: var(--danger); }
.help { font-size: 12px; color: var(--muted); }
.error-text { font-size: 13px; color: var(--danger-text); }

/* State marks — a square swatch, not a pill */
.state { display: inline-flex; align-items: center; gap: 7px; font: 500 13px/1 var(--f-text); color: var(--ink-2); white-space: nowrap; }
.state::before { content: ""; width: 9px; height: 9px; border-radius: 2px; background: var(--c, var(--muted)); box-shadow: var(--ring, none); }
.st-ok { --c: var(--accent); }
.st-in { --c: var(--ok); }
.st-wait { --c: var(--warn-wash); --ring: inset 0 0 0 1.5px var(--warn); }
.st-out { --c: var(--line-strong); }
.st-due { --c: var(--danger); }

/* Theme switch */
.theme-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); }
.theme-switch button { height: 28px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font: 500 12px/1 var(--f-text); cursor: pointer; }
.theme-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.rule { height: 0; border: 0; border-top: var(--rule); margin: 0; }
.kbd { font: 500 11px/1 var(--f-mono); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 3px 6px; color: var(--muted); background: var(--surface); }
