/* GOLDEN KEY — дополнения к макету для живого сайта (то, чего в макете нет):
   окно оплаты (форма Impaya в шите), согласие на автопродление, загрузка кабинета,
   юридические страницы, отступ под шапку Telegram Mini App. Только токены из tokens.css. */

/* ---------- Telegram Mini App: шапка Telegram поверх страницы ---------- */
.is-tg .nav { top: var(--tg-top, 0px); }
.is-tg body { padding-top: var(--tg-top, 0px); }

/* ---------- Окно оплаты ---------- */
.sheet-pay { max-height: 96dvh; }
@media (min-width: 734px) { .sheet-pay { width: min(520px, calc(100vw - 48px)); max-height: 92dvh; } }
.sheet-pay .pf-sum { margin: -8px 0 var(--s-4); }
.pf-wrap { position: relative; min-height: 520px; border-radius: var(--r-lg); background: #fff; overflow: hidden; }
.pf-wrap iframe { display: block; width: 100%; min-height: 520px; border: 0; background: #fff; opacity: 0; transition: opacity var(--d-fast); }
.sheet-pay.is-ready .pf-wrap iframe { opacity: 1; }
.pf-loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--surface-2); transition: opacity var(--d-fast); }
.sheet-pay.is-ready .pf-loading { opacity: 0; pointer-events: none; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--fill-1); border-top-color: var(--gold); animation: spin .8s linear infinite; }
.pf-secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: var(--s-3); }
.pf-secure .i { font-size: 14px; }

/* ---------- Согласие (чекбокс) ---------- */
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-footnote); line-height: 1.4; color: var(--label-2); cursor: pointer; padding: 0 4px; }
.consent input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: -1px 0 0; border-radius: 7px; background: var(--fill-3); display: grid; place-items: center; transition: background var(--d-fast), box-shadow var(--d-fast); cursor: pointer; }
.consent input::after { content: ""; width: 10px; height: 6px; border: solid var(--on-gold); border-width: 0 0 2.2px 2.2px; transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform var(--d-fast) var(--ease-spring); }
.consent input:checked { background: var(--gold); }
.consent input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.consent input:focus-visible { box-shadow: var(--focus-ring); }
.consent.is-error input { box-shadow: inset 0 0 0 1.5px var(--red); }
.consent a { color: var(--label); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Пароль с кнопкой «показать» ---------- */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 52px; }
.pw-eye { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; color: var(--label-3); }

/* ---------- Кабинет: первичная загрузка ---------- */
.boot { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; pointer-events: none; }
[data-boot] { visibility: hidden; }
.is-booted [data-boot] { visibility: visible; }
.is-booted .boot { display: none; }

/* ---------- Статус «ждём подтверждение оплаты» ---------- */
.co-wait { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-subhead); color: var(--label-2); }
.co-wait .spinner { width: 18px; height: 18px; border-width: 2px; }

/* ---------- Юридические страницы ---------- */
.legal-page { padding: var(--s-8) 0 var(--s-20); }
.legal-page .container { max-width: calc(var(--container-text) + var(--page-margin) * 2); }
.legal-doc { color: var(--label-2); font-size: var(--fs-callout); line-height: 1.6; }
.legal-doc h1 { color: var(--label); font-size: var(--fs-large-title); line-height: var(--lh-large-title); letter-spacing: var(--ls-large-title); font-weight: var(--w-bold); margin: var(--s-4) 0 var(--s-2); }
.legal-doc h2 { color: var(--label); font-size: var(--fs-title-3); line-height: var(--lh-title-3); font-weight: var(--w-semibold); margin: var(--s-10) 0 var(--s-3); scroll-margin-top: calc(var(--nav-h) + 16px); }
.legal-doc h3 { color: var(--label); font-size: var(--fs-headline); font-weight: var(--w-semibold); margin: var(--s-6) 0 var(--s-2); }
.legal-doc p, .legal-doc li { margin: 0 0 var(--s-3); }
.legal-doc ul, .legal-doc ol { padding-left: 1.3em; margin: 0 0 var(--s-4); }
.legal-doc ul li { list-style: disc; } .legal-doc ol li { list-style: decimal; }
.legal-doc a { color: var(--gold-text); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.legal-doc .gk-legal-back { display: inline-flex; color: var(--label-2); text-decoration: none; font-size: var(--fs-subhead); }
.legal-doc .gk-legal-sub { color: var(--label-2); font-size: var(--fs-subhead); margin-top: 0; }
.legal-doc .gk-legal-clause { scroll-margin-top: calc(var(--nav-h) + 16px); }
.legal-doc .gk-legal-clause .n { color: var(--label-3); text-decoration: none; margin-right: 4px; font-variant-numeric: tabular-nums; }
.legal-doc table { width: 100%; border-collapse: collapse; margin: 0 0 var(--s-4); font-size: var(--fs-subhead); }
.legal-doc td, .legal-doc th { border-bottom: 0.5px solid var(--separator); padding: 10px 8px 10px 0; vertical-align: top; text-align: left; }
.legal-doc strong, .legal-doc b { color: var(--label); }
.legal-index { display: flex; flex-direction: column; }
.legal-doc .gk-legal-card { display: flex; flex-direction: column; gap: 2px; margin: 0 0 var(--s-2); padding: var(--s-4) var(--s-5); border-radius: var(--r-lg); background: var(--surface-1); color: var(--label); text-decoration: none; transition: background var(--d-fast); }
.legal-doc .gk-legal-card:hover { background: var(--surface-2); }
.legal-doc .gk-legal-card b { font-size: var(--fs-headline); font-weight: var(--w-semibold); }
.legal-doc .gk-legal-card span { font-size: var(--fs-footnote); color: var(--label-2); }
.legal-doc .gk-legal-req { margin-top: var(--s-8); padding: var(--s-5); border-radius: var(--r-lg); background: var(--surface-1); }
.legal-doc .gk-legal-req h3 { margin-top: 0; }
.legal-doc dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: var(--fs-subhead); }
.legal-doc dt { color: var(--label-3); } .legal-doc dd { margin: 0; color: var(--label); }
.legal-doc .gk-legal-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: var(--s-8); font-size: var(--fs-subhead); }
.legal-doc .gk-legal-nav a { color: var(--label-2); }

/* ---------- Футер лендинга: продавец ---------- */
.footer-legal { display: flex; flex-direction: column; gap: 2px; color: var(--label-3); }
.footer-legal span { white-space: nowrap; }
@media (min-width: 834px) {
  .footer .brand { flex: none; white-space: nowrap; }
  .footer nav { flex: 1; min-width: 0; }
  .footer-legal { flex: none; text-align: right; }
}
