/* Страницы оплаты: абонементы зала и тарифы интенсива.
   Своя вёрстка: от конструктора Т-Банка взяты только тексты и картинки.
   Светлый разворот — как и в оригинале: форма оплаты там отличалась
   от тёмной главной, и менять это незачем.

   Шрифты подключены в fonts.css, отдельных @font-face здесь нет. */

:root {
    --accent:        #546DE5;   /* цвет кнопок из конструктора */
    --accent-dark:   #3f55c2;
    --ink:           #1a1a1a;
    --ink-muted:     #6b6b6b;
    --line:          #e2e2e6;
    --bg:            #ffffff;
    --bg-soft:       #f7f7fa;
    --danger:        #c0392b;
    --ok:            #2e9b4f;
    --radius:        12px;
    --shadow:        0 2px 16px rgba(20, 20, 40, .08);
}

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

/* Браузерное [hidden]{display:none} — правило для тега, его перебивает любой
   класс с display. У .qr и .btn-open-bank класс как раз такой, из-за чего
   скрытый QR оставался пустым белым квадратом на телефоне. Правило нужно
   ЛЮБОМУ элементу, который прячут через свойство hidden. */
[hidden] { display: none !important; }

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

body {
    margin: 0;
    font: 16px/1.55 "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

h1, h2, h3, h4 {
    font-family: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 .6em;
}

h1 { font-size: clamp(28px, 4vw, 42px); }
h2 { font-size: clamp(24px, 3vw, 34px); }
h3 { font-size: clamp(19px, 2vw, 23px); }

a { color: var(--accent); }

img { max-width: 100%; height: auto; }

.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ─────────────────────────── шапка ─────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 8px 26px;
    flex-wrap: wrap;
    min-height: 60px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.site-header a {
    color: var(--ink);
    text-decoration: none;
    font-size: 15px;
}

.site-header a:hover { color: var(--accent); }

.site-header a[aria-current="page"] {
    color: var(--accent);
    font-weight: 600;
}

/* ─────────────────────────── тарифы ─────────────────────────── */

.tariff {
    padding: 46px 0;
    border-bottom: 1px solid var(--line);
}

.tariff__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.tariff__art img { display: block; margin: 0 auto; }

/* Одиночный тариф без картинки: колонка одна и по центру страницы.
   Обычная сетка — пара «картинка слева, форма справа»; без картинки
   форма прижималась бы к правому краю, а слева зияла бы пустота. */
.tariff_solo .tariff__grid {
    grid-template-columns: minmax(0, 520px);
    justify-content: center;
}

/* Название тарифа и сумма — на шаг мельче общего h2 (24-34) и прежних 40 px.
   В карточке они соседствуют с полями формы в 15-16 px, и в прежнем кегле
   перетягивали внимание с кнопки оплаты. Меняем только внутри карточки:
   глобальный h2 нужен заголовкам остальных разделов. */
.tariff__form h2 { font-size: clamp(21px, 2.4vw, 27px); }

.tariff__price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.tariff__price b {
    font-family: "Golos Text", sans-serif;
    font-size: 32px;
    line-height: 1;
}

.tariff__price span { color: var(--ink-muted); }

/* ─────────────────────────── форма ─────────────────────────── */

.field { margin-bottom: 14px; }

.field label {
    display: block;
    font-size: 13px;
    color: var(--ink-muted);
    margin-bottom: 5px;
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(84, 109, 229, .16);
}

.field input[aria-invalid="true"] { border-color: var(--danger); }

.field__error {
    display: none;
    margin-top: 5px;
    font-size: 13px;
    color: var(--danger);
}

.field input[aria-invalid="true"] ~ .field__error { display: block; }

.consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 18px 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ink-muted);
}

.consent input {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--accent);
}

/* ─────────────────────────── кнопки ─────────────────────────── */

.btn-sbp {
    display: block;
    width: 100%;
    padding: 17px 20px;
    font: 600 18px/1.25 "Golos Text", sans-serif;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s;
}

.btn-sbp:hover:not(:disabled) { background: var(--accent-dark); }

/* Блик, пробегающий по главной кнопке раз в шесть секунд.
   Задача прикладная: разница в комиссии между СБП и остальными способами
   больше 3%, на годовом абонементе это под три сотни рублей. Из первых
   шести живых платежей четверо ушли на форму банка, и лишь один выбрал
   там СБП — значит главную кнопку надо делать заметнее.

   Сделано псевдоэлементом, а не картинкой: ничего не грузится, анимируется
   только `transform`, то есть слой едет на видеокарте и не заставляет
   браузер пересчитывать раскладку. На слабом телефоне это бесплатно. */
.btn-sbp { position: relative; overflow: hidden; }

.btn-sbp::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg,
        transparent 35%,
        rgba(255, 255, 255, .34) 50%,
        transparent 65%);
    transform: translateX(-100%);
    animation: sbp-sheen 6s ease-in-out 1.5s infinite;
    pointer-events: none;
}

/* Пробег занимает четверть цикла, остальное — пауза: непрерывное мерцание
   читается как реклама и раздражает, редкий проблеск только притягивает взгляд. */
@keyframes sbp-sheen {
    0%   { transform: translateX(-100%); }
    25%  { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

/* Пока платёж создаётся, кнопка выключена — блик там неуместен */
.btn-sbp:disabled::after { animation: none; }

/* Уважаем системную настройку «меньше движения»: для части людей анимация
   не украшение, а причина головной боли или тошноты */
@media (prefers-reduced-motion: reduce) {
    .btn-sbp::after { animation: none; }
}

.btn-sbp:disabled { opacity: .55; cursor: progress; }

.btn-sbp small {
    display: block;
    margin-top: 3px;
    font-family: "Golos Text", sans-serif;
    font-size: 13px;
    font-weight: 400;
    opacity: .85;
}

/* Оплата картой зарубежного банка — уводит на страницу Stripe на .com.
   Зелёная, чтобы не путалась с синими кнопками оплаты на этой странице. */
.btn-foreign {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 17px 20px;
    font: 600 18px/1.25 "Golos Text", sans-serif;
    color: #fff;
    text-align: center;
    text-decoration: none;
    background: var(--ok);
    border-radius: var(--radius);
    transition: background .15s;
}

.btn-foreign:hover { background: #268442; }

.foreign { padding-top: 8px; }

/* Карта — намеренно скромной ссылкой: приоритет у СБП */
/* Два запасных способа под кнопкой СБП: своя карта и зарубежная.
   Намеренно серые и вдвое мельче — приоритет остаётся у СБП, он выгоднее.
   Класс тот же, `.pay-card`: pay.js вешает обработчик на `.pay-card button`,
   и российская карта здесь по-прежнему ПЕРВАЯ кнопка. Ссылка на Stripe —
   это <a>, обработчик её не трогает. */
.pay-card {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.pay-card button,
.pay-card a {
    flex: 1 1 0;
    min-width: 0;
    padding: 11px 10px;
    font: 600 14px/1.3 "Golos Text", sans-serif;
    color: var(--ink-muted);
    text-align: center;
    text-decoration: none;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    transition: color .15s, border-color .15s;
}

/* Пока заказ создаётся, форма заперта целиком — серые кнопки тоже.
   Без видимого признака человек жмёт их повторно и плодит заказы. */
.pay-card button:disabled {
    opacity: .5;
    cursor: progress;
}

.pay-card button:hover,
.pay-card a:hover {
    color: var(--ink);
    border-color: #c7c7cf;
}

/* На узких экранах в строку не помещаются — ставим друг под друга */
@media (max-width: 400px) {
    .pay-card { flex-direction: column; }
}

.form__error {
    display: none;
    margin-top: 12px;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--danger);
    background: #fdf0ee;
    border-radius: var(--radius);
}

.form__error[data-shown] { display: block; }

.cards {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.cards img { height: 21px; width: auto; }

.included {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ink-muted);
}

/* ─────────────────────── окно оплаты по СБП ─────────────────────── */

.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 15, 30, .55);
}

.modal__box {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 30px 26px 26px;
    text-align: center;
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    font-size: 22px;
    line-height: 1;
    color: var(--ink-muted);
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.modal__close:hover { background: var(--bg-soft); }

.modal h3 { margin-bottom: 8px; }

.modal__sum {
    font-family: "Golos Text", sans-serif;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal__hint {
    font-size: 14px;
    color: var(--ink-muted);
    margin: 0 0 18px;
}

.qr {
    display: block;
    width: 236px;
    height: 236px;
    margin: 0 auto 18px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.qr svg, .qr img { display: block; width: 100%; height: 100%; }

.btn-open-bank {
    display: block;
    padding: 16px 20px;
    font: 600 17px/1.25 "Golos Text", sans-serif;
    color: #fff;
    text-decoration: none;
    background: var(--accent);
    border-radius: var(--radius);
}

.btn-open-bank:hover { background: var(--accent-dark); }

.btn-open-bank_secondary {
    padding: 8px;
    font: 400 14px/1.4 "Golos Text", sans-serif;
    color: var(--ink-muted);
    background: none;
    text-decoration: underline;
}

.btn-open-bank_secondary:hover { color: var(--accent); background: none; }

.modal__status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 18px;
    font-size: 14px;
    color: var(--ink-muted);
}

.spinner {
    flex: none;
    width: 15px;
    height: 15px;
    border: 2px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 3s; }
}

.modal__paid { color: var(--ok); font-weight: 600; }

/* ─────────────────────────── прочие блоки ─────────────────────────── */

.cta {
    padding: 66px 0;
    text-align: center;
    color: #fff;
    background: linear-gradient(rgba(0, 0, 0, .35), rgba(0, 0, 0, .35)),
                url(../img/cta.jpg) center / cover no-repeat;
}

.cta__btn {
    display: inline-block;
    padding: 15px 30px;
    font: 600 17px "Golos Text", sans-serif;
    color: #fff;
    text-decoration: none;
    background: #85D53E;
    border-radius: var(--radius);
}

.faq { padding: 56px 0; }

.faq details {
    border-bottom: 1px solid var(--line);
    padding: 15px 0;
}

.faq summary {
    font-family: "Golos Text", sans-serif;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
    content: "+";
    float: right;
    margin-left: 12px;
    font-weight: 400;
    color: var(--accent);
}

.faq details[open] summary::after { content: "–"; }

.faq details p {
    margin: 11px 0 3px;
    color: var(--ink-muted);
}

/* Подвал — тот же, что на главной: тёмно-синяя полоса во всю ширину.
   Цвета здесь заданы явно: pay.css не наследует палитру copy.css,
   у страницы оплаты она своя (белый фон, синие кнопки). */
.footer {
    padding: 40px 0 44px;
    color: #fff;
    background: #081E31;
}

.footer__inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
}

/* Кегль и межстрочный оригинала: 14/20 на десктопе, 12/16 на мобильном */
.footer__legal {
    font-size: 14px;
    line-height: 20px;
}

.footer__legal span,
.footer__legal a { display: block; }

.footer__legal a {
    color: inherit;
    opacity: .64;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .2em;
    transition: opacity .3s;
}

.footer__legal a:hover { opacity: 1; }

.footer__nav {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.footer__nav ul {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.footer__nav a {
    color: #fff;
    text-decoration: none;
}

.footer__nav a:hover { color: #BAF27B; }

.footer__write {
    display: inline-block;
    padding: 12px 26px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .56);
    border-radius: 999px;
    text-decoration: none;
    font-size: 16px;
    white-space: nowrap;
}

.footer__write:hover { border-color: #BAF27B; color: #BAF27B; }

/* Про эквайринг — строка нужна именно здесь, на главной её нет */
.footer__acquiring {
    margin: 26px 0 0;
    font-size: 13px;
    line-height: 18px;
    color: rgba(255, 255, 255, .56);
}

@media (max-width: 959px) {
    .footer__legal { font-size: 12px; line-height: 16px; }
}

/* ─────────────────────── текстовые страницы ─────────────────────── */

.doc { padding: 44px 0 60px; }

.doc .container { max-width: 780px; }

.doc h2 { margin-top: 1.6em; font-size: 21px; }

.doc p, .doc li { color: #333; }

.doc ol, .doc ul { padding-left: 22px; }

.doc li { margin-bottom: .5em; }

/* ─────────────────── результат оплаты (/success, /fail) ─────────────────── */

.result {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72vh;
    padding: 40px 20px;
    text-align: center;
}

.result__box { max-width: 520px; }

.result__mark {
    width: 76px;
    height: 76px;
    margin: 0 auto 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 38px;
    color: #fff;
}

.result__mark_ok   { background: var(--ok); }
.result__mark_fail { background: var(--danger); }

.result p { color: var(--ink-muted); }

.result .cta__btn { background: var(--accent); margin-top: 10px; }

/* ─────────────────────────── адаптив ─────────────────────────── */

@media (max-width: 860px) {
    .tariff__grid { grid-template-columns: 1fr; gap: 22px; }
    .tariff__art  { max-width: 380px; margin: 0 auto; }
    .tariff       { padding: 34px 0; }
}


/* ─────────── страница оплаты интенсива ───────────
   У тарифов интенсива нет картинки с ценой, как у абонементов, —
   вместо неё состав тарифа прямо в форме. */

.perks {
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
    display: grid;
    gap: 8px;
}

.perks li {
    position: relative;
    padding-left: 26px;
    font-size: 15px;
    line-height: 1.45;
    color: var(--ink-muted);
}

.perks li::before {
    content: "✔";
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Колонка под картинку остаётся пустой: на широком экране форма
   не должна разъезжаться на всю ширину — читать длинную строку тяжело. */
.tariff__art_empty { display: none; }

@media (min-width: 861px) {
    .tariff__art_empty { display: block; }
}
