/* Сайт клиента Alibi. Только токены из tokens.css, правила в docs/DESIGN.md.
   Раскладка: одна колонка на телефоне; кабинет и оплата в две колонки от 900 px. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--night); color: var(--fog);
  font: 400 var(--t-md)/1.55 var(--font-text);
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; outline: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.6vw, var(--t-xl)); }
h3 { font-size: 1.125rem; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--fog); }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { width: 100%; max-width: var(--content); margin: 0 auto;
  padding-left: max(var(--s-4), env(safe-area-inset-left, 0px)); padding-right: max(var(--s-4), env(safe-area-inset-right, 0px)); }
.muted { color: var(--mist); }
.small { font-size: var(--t-sm); }
.hint { color: var(--mist); font-size: var(--t-xs); line-height: 1.5; }
.center { text-align: center; justify-self: center; }
.ok { color: var(--accent); }
.warn { color: var(--amber); }
.bad { color: var(--coral); }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mist); margin: 0 0 var(--s-2); padding: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--r-control); z-index: 30; }
.skip:focus { left: 8px; }
.row { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; }
.panel { background: var(--deep); border: 1px solid var(--line); border-radius: var(--r-panel); }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 12px 20px; border-radius: var(--r-control); border: 1px solid transparent;
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer; text-align: center;
  transition: background var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}
.btn:disabled { opacity: .5; cursor: progress; }
.btn--main { background: var(--accent); color: var(--accent-ink); }
.btn--main:hover:not(:disabled) { background: var(--accent-hover); color: var(--accent-ink); }
.btn--line { background: transparent; border-color: var(--line); color: var(--fog); font-weight: 500; }
.btn--line:hover:not(:disabled) { background: var(--deep-2); color: var(--fog); }
.btn--quiet { background: none; color: var(--mist); font-weight: 500; padding: 10px 0; min-height: 44px; justify-content: flex-start; }
.btn--quiet:hover:not(:disabled) { color: var(--fog); }
.btn--danger { color: var(--coral); }
.btn--danger:hover:not(:disabled) { color: var(--fog); }
.btn--sm { min-height: 40px; padding: 8px 14px; font-size: var(--t-sm); }
.btn--quiet.btn--sm { padding: 8px 0; }
.btn--wide { width: 100%; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 8px; font-size: var(--t-sm); }
.copy { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--mist); font-size: var(--t-xs); padding: 4px 10px; min-height: 32px; cursor: pointer; }
.copy:hover { color: var(--fog); }

/* Шапка */
.top { position: sticky; top: 0; z-index: 20; background: rgba(3, 15, 39, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top__row { display: flex; align-items: center; gap: var(--s-4); min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fog); text-decoration: none; font: 700 1.3rem/1 var(--font-display); letter-spacing: -.03em; }
.brand img { border-radius: 9px; }
.top__nav { display: none; gap: var(--s-1); margin-left: var(--s-5); }
.top__link { color: var(--mist); text-decoration: none; padding: 10px 12px; border-radius: 10px; font-size: var(--t-sm); }
.top__link:hover { color: var(--fog); background: var(--deep); }
.top__right { margin-left: auto; display: flex; gap: var(--s-3); align-items: center; }
.top__who { color: var(--mist); font-size: var(--t-sm); max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 720px) { .top__nav { display: flex; } }

/* Витрина */
.hero { display: grid; gap: var(--s-6); padding-block: var(--s-7) var(--s-6); }
.hero h1 { max-width: 15ch; }
.lead { color: var(--mist); font-size: 1.125rem; max-width: 52ch; margin-top: 18px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: 28px; }
.hero__price { margin-top: var(--s-3); color: var(--mist); font-size: var(--t-sm); }
.hero__price b { color: var(--fog); font-weight: 600; }
.hero .hint { margin-top: var(--s-2); font-size: var(--t-sm); }
.route { margin: 0; padding: 28px var(--s-4); display: grid; grid-template-columns: auto minmax(20px, 1fr) auto minmax(20px, 1fr) auto; align-items: center; gap: 10px; }
.route__end { display: grid; justify-items: center; gap: 10px; text-align: center; font-size: var(--t-xs); color: var(--mist); max-width: 88px; }
.route__dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); }
.route__dot--full { background: var(--accent); }
.route__mid { display: grid; justify-items: center; gap: 8px; font-size: var(--t-xs); text-align: center; max-width: 104px; }
.route__mid img { border-radius: 14px; filter: drop-shadow(0 0 14px rgba(30, 210, 244, .3)); }
.route__line { height: 2px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); transform-origin: left; animation: draw var(--d-slow) var(--ease) both; }
.route__line--2 { animation-delay: .25s; }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr .9fr; align-items: center; padding-block: 72px 64px; } }

.section { padding-block: 56px; border-top: 1px solid var(--line); }
.section__lead { color: var(--mist); margin-top: 10px; max-width: 60ch; }
.feats { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.feats li { background: var(--night); padding: 22px; }
.feats h3 { margin-bottom: 6px; }
.feats p { color: var(--mist); font-size: var(--t-sm); }
@media (min-width: 620px) { .feats { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .feats { grid-template-columns: repeat(3, 1fr); } }

.plans { display: grid; gap: var(--s-3); margin-top: 28px; }
.plan { position: relative; display: grid; gap: 4px; justify-items: start; text-align: left; padding: 20px; background: var(--deep); border: 1px solid var(--line); border-radius: var(--r-panel); color: var(--fog); cursor: pointer; transition: border-color var(--d-fast) var(--ease); }
.plan:hover { border-color: var(--accent-deep); }
.plan--best { border-color: var(--accent); }
.plan__tag, .plan__off { position: absolute; top: 18px; right: 18px; font-size: var(--t-xs); color: var(--leaf); }
.plan__tag { color: var(--accent); }
.plan__term { font: 600 1.125rem/1.2 var(--font-display); }
.plan__price { font: 600 1.9rem/1.1 var(--font-display); letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.plan__per { font-size: var(--t-sm); color: var(--mist); margin-bottom: 14px; }
@media (min-width: 560px) { .plans { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .plans { grid-template-columns: repeat(4, 1fr); } }

.steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: var(--s-4); }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; align-items: start; }
.steps__n { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); display: grid; place-items: center; font: 600 1rem/1 var(--font-display); }
.steps h3 { margin: 8px 0 4px; }
.steps p { color: var(--mist); font-size: var(--t-sm); }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s-5); } }

.faq { margin-top: var(--s-5); border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 36px 18px 0; font-weight: 500; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 14px; font-size: 22px; color: var(--mist); transition: transform var(--d-fast) var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--mist); padding: 0 0 18px; max-width: 65ch; }

.contact { display: grid; gap: var(--s-4); padding: 28px; margin-block: 56px; }
.contact h2 { font-size: 1.5rem; margin-bottom: 6px; }
@media (min-width: 700px) { .contact { grid-template-columns: 1fr auto; align-items: center; } }

/* Кабинет */
.cabinet, .pay { display: grid; gap: var(--s-5); padding-block: 28px 64px; }
.cabinet h1, .pay h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); }
.cabinet__cols { display: grid; gap: var(--s-5); align-items: start; }
@media (min-width: 900px) { .cabinet__cols { grid-template-columns: minmax(0, 1fr) 340px; } }
.cards, .side { display: grid; gap: var(--s-5); min-width: 0; }
.sub { padding: var(--s-5); display: grid; gap: 18px; min-width: 0; }
.sub__top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.sub__title { font: 600 1.125rem/1.3 var(--font-text); letter-spacing: 0; }
.until { display: grid; gap: 4px; }
.until__big { font: 600 clamp(1.6rem, 5vw, 2rem)/1.15 var(--font-display); letter-spacing: -.02em; }
.sub__note { font-size: var(--t-sm); color: var(--coral); }
.sub__note--wait { color: var(--amber); }
.sub__actions { display: grid; gap: 10px; }
@media (min-width: 520px) { .sub__actions { grid-template-columns: 1fr auto; } .sub__actions > :only-child { grid-column: 1 / -1; } }
.sub > .btn--quiet { justify-self: start; margin-block: -8px; }
.key { display: grid; gap: var(--s-2); }
.key__row { display: flex; gap: var(--s-2); align-items: stretch; }
.key code, .kv code { font: 500 var(--t-sm)/1.4 var(--font-mono); color: var(--fog); }
.key code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: var(--night); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.auto { display: grid; gap: var(--s-3); padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--night); }
.auto__head, .consent__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); }
.auto > .btn--quiet { justify-self: start; margin-block: -6px; }
.facts { display: grid; gap: var(--s-2); margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: var(--s-4); font-size: var(--t-sm); }
.facts dt { color: var(--mist); }
.facts dd { margin: 0; text-align: right; font-weight: 500; }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: var(--t-xs); font-weight: 500; padding: 4px 10px 4px 9px; border-radius: var(--r-chip); border: 1px solid var(--line); color: var(--mist); white-space: nowrap; justify-self: start; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip--ok { color: var(--accent); }
.chip--wait { color: var(--amber); }
.chip--bad { color: var(--coral); }
.empty { justify-items: start; }
.empty h2 { font-size: 1.5rem; }
.preparing { display: flex; gap: var(--s-4); align-items: flex-start; }
.preparing .sub__title { margin-bottom: 4px; }
.pulse { width: 12px; height: 12px; margin-top: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s var(--ease) infinite; flex: none; }
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }

.box { padding: 22px; display: grid; gap: 14px; justify-items: start; }
.box h2 { font: 600 1.0625rem/1.3 var(--font-text); letter-spacing: 0; }
.kv { display: grid; gap: 6px; justify-items: start; width: 100%; }
.kv > span { font-size: var(--t-xs); color: var(--mist); }
.tg-code { display: grid; gap: 10px; justify-items: start; width: 100%; }
.orders { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; }
.orders li { padding: 10px 0; border-top: 1px solid var(--line); }
.orders li:first-child { border-top: 0; padding-top: 0; }
.orders p { margin: 2px 0 0; }
.kv--row { grid-template-columns: 1fr auto; align-items: baseline; }
.kv--row > span { font-size: var(--t-sm); color: var(--fog); }

/* Оплата */
.back { background: none; border: 0; color: var(--mist); padding: 8px 0; font-size: var(--t-sm); cursor: pointer; margin-bottom: var(--s-2); }
.back:hover { color: var(--fog); }
.pay .muted { margin-top: 6px; }
.pay__cols { display: grid; gap: var(--s-5); align-items: start; }
.pay__main { display: grid; gap: var(--s-5); min-width: 0; }
@media (min-width: 900px) { .pay__cols { grid-template-columns: minmax(0, 1fr) 360px; } .summary { position: sticky; top: 88px; } }
.terms { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: 1fr 1fr; min-width: 0; }
.terms legend { grid-column: 1 / -1; }
@media (min-width: 620px) { .terms { grid-template-columns: repeat(4, 1fr); } }
.terms--pick { width: 100%; }
.term { position: relative; display: grid; gap: 2px; align-content: start; text-align: left; padding: 14px; border-radius: 14px; background: var(--deep); border: 1px solid var(--line); color: var(--fog); cursor: pointer; min-height: 96px; }
.terms--pick .term { background: var(--night); }
.term input { position: absolute; opacity: 0; pointer-events: none; }
.term:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.term:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.term b { font: 600 1rem/1.2 var(--font-display); }
.term__price { font: 600 1.375rem/1.2 var(--font-display); margin-top: 6px; font-variant-numeric: tabular-nums; }
.term small { color: var(--mist); font-size: var(--t-xs); }
.term small.off { color: var(--leaf); }
.consent { padding: 18px; display: grid; gap: var(--s-3); }
.check { display: grid; grid-template-columns: 24px 1fr; gap: var(--s-3); align-items: start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.check input:disabled { cursor: not-allowed; }
.check:has(input:disabled) { color: var(--mist); cursor: default; }
.consent__info, .consent__tg { padding-left: 36px; display: grid; gap: 4px; font-size: var(--t-sm); color: var(--mist); }
.consent__tg { color: var(--amber); }
.summary { padding: 22px; display: grid; gap: var(--s-4); }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.summary__total b { font: 600 1.9rem/1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* Окна и формы */
.sheet { border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--deep); color: var(--fog); padding: 0; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-pop); }
.sheet::backdrop { background: rgba(0, 4, 14, .72); }
.sheet__body { padding: 28px 24px 24px; display: grid; gap: var(--s-4); position: relative; }
.sheet__close { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; background: none; border: 0; color: var(--mist); font-size: 20px; cursor: pointer; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--night); border: 1px solid var(--line); border-radius: var(--r-control); padding: 4px; margin-right: 36px; }
.tabs button { background: none; border: 0; border-radius: 9px; padding: 10px; color: var(--mist); font-weight: 500; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--deep-2); color: var(--fog); }
.note-soft { font-size: var(--t-sm); color: var(--fog); padding: 10px 14px; border: 1px dashed var(--line); border-radius: var(--r-control); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: var(--t-sm); color: var(--mist); }
.field { width: 100%; min-height: 48px; background: var(--night); border: 1px solid var(--line); border-radius: var(--r-control); padding: 12px 14px; font-size: 1rem; color: var(--fog); }
.field:focus { border-color: var(--accent); outline: none; }
.field--code { font-family: var(--font-mono); letter-spacing: .3em; max-width: 9em; }
.error { color: var(--coral); font-size: var(--t-sm); }

.foot { border-top: 1px solid var(--line); padding-block: 24px max(24px, env(safe-area-inset-bottom, 0px)); font-size: var(--t-sm); color: var(--mist); }
.foot__row { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.foot a { color: var(--mist); text-decoration: none; }
.foot a:hover { color: var(--fog); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; background: var(--deep-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; font-size: var(--t-sm); width: max-content; max-width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-pop); }

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