/* Общие токены и компоненты: гостевая часть, экран бармена, админка */
:root {
  --night: #110d09;
  --night-2: #1a140f;
  --wood: #2b2119;
  --wood-2: #3a2c20;
  --iron: #38322b;
  --brass: #c29a5b;
  --brass-2: #e3c287;
  --brass-dark: #7d5f33;
  --paper: #ebdfc4;
  --paper-2: #d9c9a5;
  --ink: #2b2118;
  --ink-soft: #6a5641;
  --red: #9e2f22;
  --text: #f0e6cf;
  --text-dim: #b3a488;
  --ok: #8db368;
  --danger: #e0664c;

  --f-display: 'Oswald', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --f-serif: 'Old Standard TT', 'PT Serif', Georgia, serif;
  --f-mono: 'PT Mono', 'Consolas', monospace;
  --f-hand: 'Bad Script', 'Segoe Print', cursive;

  --radius: 4px;
  --gutter: clamp(16px, 4vw, 40px);
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font: 16px/1.5 var(--f-serif);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brass-2); }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--brass-2); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 44px; padding: .55em 1.3em;
  border: 1px solid var(--brass); border-radius: var(--radius);
  background: transparent; color: var(--brass-2);
  font: 500 15px/1.1 var(--f-display); letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; transition: background .2s, color .2s, border-color .2s, opacity .2s;
}
.btn:hover { background: rgba(194, 154, 91, .14); }
.btn--solid { background: var(--brass); color: var(--night); border-color: var(--brass); }
.btn--solid:hover { background: var(--brass-2); }
.btn--ink { border-color: var(--ink); color: var(--ink); }
.btn--ink:hover { background: rgba(43, 33, 24, .08); }
.btn--ink.btn--solid { background: var(--ink); color: var(--paper); }
.btn--sm { min-height: 36px; padding: .4em .9em; font-size: 13px; }
.btn--link { border: 0; min-height: 0; padding: .3em 0; text-decoration: underline; text-underline-offset: 3px; letter-spacing: .06em; }
.btn--link:hover { background: none; }
.btn.is-inactive { opacity: .55; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- Бумага, штамп, рукопись ---------- */
.paper {
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .35), transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(120, 90, 50, .18), transparent 70%),
    var(--paper);
  color: var(--ink);
}
.paper--lined {
  background-image:
    repeating-linear-gradient(transparent 0 27px, rgba(80, 100, 140, .16) 27px 28px),
    radial-gradient(120% 90% at 20% 0%, rgba(255, 255, 255, .35), transparent 60%);
  background-color: var(--paper);
}

.stamp {
  display: inline-block; padding: .35em .7em;
  border: 2px solid currentColor; border-radius: 3px;
  color: var(--red); font: 600 13px/1.15 var(--f-display);
  letter-spacing: .1em; text-transform: uppercase; text-align: center;
  transform: rotate(-6deg); opacity: .85;
  box-shadow: inset 0 0 0 2px transparent, inset 0 0 0 3px rgba(158, 47, 34, .35);
}

.hand { font-family: var(--f-hand); }
.mono { font-family: var(--f-mono); }

.eyebrow {
  font: 500 12px/1.2 var(--f-display); letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------- Поля формы ---------- */
.field { display: grid; gap: 6px; }
.field__label { font: 500 12px/1.2 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.field__input {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1px solid rgba(43, 33, 24, .45); border-radius: var(--radius);
  background: rgba(255, 255, 255, .55); color: var(--ink);
  font: 17px/1.3 var(--f-mono);
}
.field__input:focus { outline: 2px solid var(--brass-dark); outline-offset: 0; }
.field__input[aria-invalid="true"] { border-color: var(--red); background: rgba(158, 47, 34, .06); }
.field__error { margin: 0; color: var(--red); font-size: 14px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }

/* ---------- Модальные окна ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 16px;
  background: rgba(8, 6, 4, .86);
}
.paper a { color: var(--red); }
.modal__box {
  width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow);
}
.modal__title { margin: 0 0 12px; font: 600 26px/1.15 var(--f-display); letter-spacing: .04em; text-transform: uppercase; }

/* ---------- Лента «демо» ---------- */
.demo-ribbon {
  display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; align-items: center;
  padding: 6px var(--gutter);
  background: repeating-linear-gradient(-45deg, #2a2016 0 12px, #231a12 12px 24px);
  border-bottom: 1px solid rgba(194, 154, 91, .25);
  color: var(--text-dim); font: 13px/1.3 var(--f-mono); text-align: center;
}
.demo-ribbon a { color: var(--brass-2); }

/* ---------- Тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 120; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: var(--radius);
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow);
  font: 15px/1.35 var(--f-serif); animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
