/* Business_lounge — система оформления.
   Идея: форма заказа — посадочный талон. Имя выделено маркером,
   как на стойке регистрации. Всё остальное спокойное. */

@font-face {
  font-family: "Onest";
  src: url("fonts/onest-latin.woff2") format("woff2-variations"), url("fonts/onest-latin.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest";
  src: url("fonts/onest-cyrillic.woff2") format("woff2-variations"), url("fonts/onest-cyrillic.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  src: url("fonts/onest-ruble.woff2") format("woff2-variations"), url("fonts/onest-ruble.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+20BD;
}

/* ---------- Токены ---------- */
:root {
  color-scheme: light;
  --tarmac: #E8ECF1;       /* фон страницы */
  --paper: #FFFFFF;        /* талон */
  --paper-2: #F3F5F8;      /* поля ввода */
  --ink: #16202C;          /* текст */
  --muted: #566273;        /* вторичный текст */
  --line: #D3DAE3;         /* границы */
  --line-strong: #A9B4C2;
  --blue: #1D3F8F;         /* действие */
  --blue-hover: #16337A;
  --blue-ink: #FFFFFF;
  --blue-soft: #E3EAF8;
  --marker: #FFE45C;       /* маркер имени */
  --marker-ink: #16202C;
  --error: #B3261E;
  --error-soft: #FCEDEC;
  --focus: #1D3F8F;
  --shadow: 0 1px 0 rgba(22, 32, 44, .04), 0 18px 40px -18px rgba(22, 32, 44, .28);

  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Шкала шрифта: 1.2 */
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;

  --r-pass: 22px;
  --r-field: 12px;
  --r-pill: 999px;
  --gutter: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --tarmac: #0F1722; --paper: #172231; --paper-2: #1E2B3D; --ink: #E7ECF3; --muted: #9AA7B8;
    --line: #2A384B; --line-strong: #3E5068; --blue: #8FB0FF; --blue-hover: #A9C2FF; --blue-ink: #0B1426;
    --blue-soft: #1F2E4A; --error: #FF8A80; --error-soft: #3A1F22; --focus: #8FB0FF;
    --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 24px 48px -20px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --tarmac: #0F1722; --paper: #172231; --paper-2: #1E2B3D; --ink: #E7ECF3; --muted: #9AA7B8;
  --line: #2A384B; --line-strong: #3E5068; --blue: #8FB0FF; --blue-hover: #A9C2FF; --blue-ink: #0B1426;
  --blue-soft: #1F2E4A; --error: #FF8A80; --error-soft: #3A1F22; --focus: #8FB0FF;
  --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 24px 48px -20px rgba(0, 0, 0, .6);
}

/* ---------- Основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--tarmac); color: var(--ink);
  font: 400 var(--fs-md)/1.55 var(--font);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.shell { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 32px; } }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--blue); color: var(--blue-ink); padding: 10px 16px; border-radius: var(--r-field);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Шапка и подвал ---------- */
.masthead__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.wordmark { font-weight: 750; font-size: 1.125rem; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.lang { display: flex; padding: 3px; border-radius: var(--r-pill); background: var(--paper); border: 1px solid var(--line); }
.lang__item {
  min-width: 44px; min-height: 36px; display: grid; place-items: center; padding: 0 10px;
  border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); text-decoration: none;
}
.lang a.lang__item:hover { color: var(--ink); background: var(--paper-2); }
.lang__item--on { background: var(--ink); color: var(--paper); }

.colophon { margin-top: 64px; padding: 28px 0 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
.colophon__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.colophon__docs { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.colophon a { color: var(--ink); }

/* ---------- Сетка главной ---------- */
.stage { display: grid; gap: 28px; padding-top: 4px; }
.intro { display: grid; gap: 18px; max-width: 40rem; }
.details { display: grid; gap: 40px; max-width: 40rem; }

@media (min-width: 1024px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) minmax(400px, 460px);
    grid-template-areas: "intro pass" "details pass";
    column-gap: clamp(40px, 6vw, 96px); row-gap: 56px; padding-top: 12px; align-items: start;
  }
  .intro { grid-area: intro; padding-top: 28px; }
  .pass { grid-area: pass; }
  .details { grid-area: details; }
}

/* ---------- Вводный блок ---------- */
.intro__title {
  font-size: clamp(2.375rem, 1.55rem + 3.3vw, 4.5rem);
  font-weight: 760; line-height: 1.02; letter-spacing: -.035em;
  max-width: 11ch; text-wrap: balance;
}
.intro__lead { font-size: clamp(var(--fs-md), 1rem + .35vw, 1.25rem); color: var(--muted); max-width: 34rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; margin: 6px 0 0; max-width: 30rem; border-top: 1px solid var(--line); }
.facts div { display: contents; }
.facts dt, .facts dd { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.facts dt { color: var(--muted); padding-right: 24px; }
.facts dd { margin: 0; font-weight: 600; }

/* ---------- Талон ---------- */
.pass { outline: none; }
.pass__form {
  position: relative; background: var(--paper); border-radius: var(--r-pass); box-shadow: var(--shadow);
  animation: pass-in .6s var(--ease) both;
}
@keyframes pass-in { from { opacity: 0; transform: translateY(14px); } }

.pass__head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 20px 24px 18px; border-bottom: 1px solid var(--line);
}
.price { display: grid; gap: 0; }
.price__value { font-size: clamp(2.5rem, 2rem + 2vw, 3.25rem); font-weight: 760; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.price__unit { color: var(--muted); font-size: var(--fs-sm); margin-top: 6px; }

.stepper { display: grid; gap: 6px; justify-items: start; }
.stepper__label { font-size: var(--fs-sm); font-weight: 600; }
.stepper__control { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 3px; background: var(--paper); }
.stepper__btn {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--paper-2); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: background-color .15s, transform .1s;
}
.stepper__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.stepper__btn:hover:not(:disabled) { background: var(--blue-soft); color: var(--blue); }
.stepper__btn:active:not(:disabled) { transform: scale(.94); }
.stepper__btn:disabled { opacity: .35; cursor: not-allowed; }
.stepper input {
  width: 52px; border: 0; background: transparent; color: var(--ink); text-align: center;
  font: 700 1.375rem/1 var(--font); font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus-visible { outline-offset: 0; }
.stepper__hint { font-size: var(--fs-xs); color: var(--muted); }

.pass__form > .msg { margin: 16px 24px 0; }

/* Пассажиры */
.passengers { display: grid; gap: 0; padding: 0 24px 18px; }
.passenger { border: 0; margin: 0; padding: 16px 0; min-width: 0; display: grid; gap: 10px; }
.passenger__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.passenger + .passenger { border-top: 1px dashed var(--line-strong); }
.passenger.is-new { animation: passenger-in .35s var(--ease); }
@keyframes passenger-in { from { opacity: 0; transform: translateY(-6px); } }
.passenger__title { padding: 0; font-weight: 650; font-size: var(--fs-sm); color: var(--muted); }
.passenger__names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 400px) { .passenger__names { grid-template-columns: 1fr; } }

.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-size: var(--fs-sm); font-weight: 600; }
.field__input, .input-wrap input {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-field);
  background: var(--paper-2); color: var(--ink); font: 500 var(--fs-md)/1.2 var(--font);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.field__input--name { text-transform: uppercase; letter-spacing: .04em; }
.field__input:hover, .input-wrap input:hover { border-color: var(--line-strong); }
.field__input:focus, .input-wrap input:focus { outline: none; border-color: var(--blue); background: var(--paper); box-shadow: 0 0 0 3px var(--blue-soft); }
[aria-invalid="true"].field__input, .input-wrap input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-soft); }

/* Имя в заказе: главный элемент страницы */
.boarding { display: grid; gap: 2px; padding: 10px 14px 12px; border-radius: var(--r-field); background: var(--paper-2); }
.boarding__label { font-size: var(--fs-xs); color: var(--muted); }
.boarding__name { font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem); font-weight: 720; line-height: 1.2; letter-spacing: -.005em; overflow-wrap: anywhere; }
.boarding__name mark {
  color: var(--marker-ink); padding: 0 .12em; border-radius: 3px;
  background: linear-gradient(100deg, var(--marker) 0 100%) no-repeat 0 60% / 100% 78%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.boarding__name[data-empty="1"] { font-size: var(--fs-sm); font-weight: 500; letter-spacing: 0; }
.boarding__name[data-empty="1"] mark { background: none; color: var(--muted); padding: 0; }
.boarding__name.is-swept mark { animation: marker-sweep .5s var(--ease); }
@keyframes marker-sweep { from { background-size: 0% 78%; } }
.boarding__name.is-bad mark { background-image: linear-gradient(var(--error-soft), var(--error-soft)); color: var(--error); }


/* Переключатели */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-field); background: var(--paper-2); }
.segmented__item { position: relative; }
.segmented__item input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented__item span {
  display: grid; place-items: center; min-height: 40px; padding: 0 14px; border-radius: 9px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--muted); transition: background-color .15s, color .15s;
}
.segmented__item input:hover + span { color: var(--ink); }
.segmented__item input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(22, 32, 44, .12), 0 0 0 1px var(--line); }
.segmented__item input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.segmented--small { padding: 3px; }
.segmented--small .segmented__item span { min-height: 34px; padding: 0 11px; font-size: var(--fs-xs); }

/* Линия отрыва талона */
.pass__tear { position: relative; height: 0; border-top: 2px dashed var(--line-strong); margin: 0 18px; }
.pass__tear::before, .pass__tear::after {
  content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--tarmac);
}
.pass__tear::before { left: -31px; }
.pass__tear::after { right: -31px; }

.pass__stub { display: grid; gap: 16px; padding: 20px 24px 22px; }
.contact { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.contact__legend { padding: 0; margin-bottom: 8px; font-weight: 650; }
.contact .segmented { display: flex; }
.contact .segmented__item { flex: 1 1 0; }
.input-wrap { position: relative; }
.input-wrap__prefix { display: none; }
.input-wrap--at .input-wrap__prefix {
  display: block; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 600; pointer-events: none;
}
.input-wrap--at input { padding-left: 32px; }

.total { display: flex; align-items: baseline; gap: 10px; }
.total__label { font-weight: 650; }
.total__calc { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.total__value { margin-left: auto; font-size: var(--fs-xl); font-weight: 760; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.check { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; cursor: pointer; font-size: var(--fs-sm); }
.check input { position: absolute; left: 0; top: 0; z-index: 1; opacity: 0; width: 24px; height: 24px; margin: 0; cursor: pointer; }
.check__box {
  width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line-strong); background: var(--paper);
  display: grid; place-items: center; transition: background-color .15s, border-color .15s;
}
.check__box svg { width: 16px; height: 16px; fill: none; stroke: var(--blue-ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .2s var(--ease); }
.check input:checked + .check__box { background: var(--blue); border-color: var(--blue); }
.check input:checked + .check__box svg { opacity: 1; transform: none; }
.check input:focus-visible + .check__box { outline: 3px solid var(--focus); outline-offset: 2px; }
.check input[aria-invalid="true"] + .check__box { border-color: var(--error); }
.consent { display: grid; gap: 6px; }

.pay {
  position: relative; width: 100%; min-height: 58px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--blue); color: var(--blue-ink); font: 700 1.125rem/1 var(--font); letter-spacing: .005em;
  transition: background-color .15s, transform .1s, opacity .15s;
}
.pay:hover:not(:disabled) { background: var(--blue-hover); }
.pay:active:not(:disabled) { transform: scale(.985); }
.pay:disabled { cursor: not-allowed; opacity: .4; }
.pay__spinner {
  display: none; position: absolute; right: 20px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite;
}
.pay.is-loading { opacity: 1; cursor: progress; }
.pay.is-loading .pay__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.pay-note { font-size: var(--fs-xs); color: var(--muted); text-align: center; }

/* Сообщения */
.hint { font-size: var(--fs-xs); color: var(--muted); }
.passengers > .hint { padding-top: 2px; }
.note { font-size: var(--fs-xs); color: var(--ink); padding: 8px 12px; border-radius: 10px; background: var(--blue-soft); }
.field-error { font-size: var(--fs-sm); color: var(--error); font-weight: 500; }
.msg { padding: 12px 14px; border-radius: var(--r-field); font-size: var(--fs-sm); }
.msg--error { background: var(--error-soft); color: var(--error); font-weight: 500; }
.msg--ok { background: var(--blue-soft); color: var(--ink); }

/* ---------- Сведения под талоном ---------- */
.block { display: grid; gap: 14px; }
.block h2 { font-size: var(--fs-lg); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: baseline; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); font-size: var(--fs-xs); font-weight: 700; color: var(--muted);
}
.contacts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; font-size: var(--fs-sm); }
.contacts div { display: contents; }
.contacts dt { color: var(--muted); }
.contacts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Простые страницы ---------- */
.page { max-width: 44rem; padding-top: 24px; display: grid; gap: 20px; }
.page h1 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem); font-weight: 750; letter-spacing: -.025em; }
.sheet { background: var(--paper); border-radius: var(--r-pass); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 40px); display: grid; gap: 18px; }
.doc { line-height: 1.65; }
.doc h2 { font-size: 1.125rem; margin-top: 12px; }
.doc ol, .doc ul { margin: 0; padding-left: 1.3em; display: grid; gap: 8px; }
.doc ul { margin-top: 8px; }
.status { font-size: var(--fs-lg); line-height: 1.4; font-weight: 600; }
.status--bad { color: var(--error); }
.people { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.people li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.people mark { background: var(--marker); color: var(--marker-ink); padding: 0 .15em; border-radius: 3px; font-weight: 700; font-size: 1.125rem; }
.people span { color: var(--muted); font-size: var(--fs-sm); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Кнопки для простых страниц и админки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 12px; background: var(--blue); color: var(--blue-ink);
  font: 650 var(--fs-md)/1 var(--font); text-decoration: none; cursor: pointer; transition: background-color .15s;
}
.btn:hover { background: var(--blue-hover); }
.btn--ghost { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 1.5px var(--blue); }
.btn--ghost:hover { background: var(--blue-soft); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: var(--fs-xs); border-radius: 8px; margin-top: 4px; }

/* ---------- Админка ---------- */
.admin main { padding-top: 16px; }
.wrap--wide { max-width: 1200px; }
.card { background: var(--paper); border-radius: var(--r-pass); padding: 22px; box-shadow: var(--shadow); }
.narrow { max-width: 380px; margin: 40px auto; display: grid; gap: 14px; }
.payform { display: grid; gap: 10px; }
.payform label { font-weight: 600; }
.payform input[type=password] { min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-field); background: var(--paper-2); color: var(--ink); font: inherit; }
.alert { background: var(--error-soft); color: var(--error); padding: 10px 12px; border-radius: 10px; font-size: var(--fs-sm); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tabs a { padding: 8px 14px; border-radius: var(--r-pill); text-decoration: none; color: var(--muted); background: var(--paper); font-size: var(--fs-sm); font-weight: 600; }
.tabs .tabs__on { background: var(--ink); color: var(--paper); }
.tablewrap { overflow-x: auto; background: var(--paper); border-radius: var(--r-pass); box-shadow: var(--shadow); }
.orders { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
.orders th, .orders td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.orders th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.orders tr.todo { background: color-mix(in srgb, var(--marker) 22%, transparent); }
.orders small { color: var(--muted); }
.top { background: transparent; }
.top__row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.brand { font-weight: 750; color: var(--ink); text-decoration: none; }
.wrap { width: 100%; margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- Движение ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- Печать ---------- */
@media print {
  .masthead, .colophon, .pass, .skip { display: none; }
  body { background: #fff; }
}
