/* Страница активации PlataPay.
 *
 * Оформление повторяет payoplata.ru: те же токены, что в seo/app-shell.mjs
 * основного сайта — тёмно-синяя палитра, фирменный синий #2e7bff,
 * скруглённые панели, кнопки-пилюли с градиентом, золотые акценты.
 * Сайт свёрстан только в тёмной теме (color-scheme:dark), поэтому и
 * страница активации всегда тёмная — в том числе внутри Telegram,
 * который открывает ссылки в теме телефона.
 *
 * Страница открывается во встроенном браузере Telegram, поэтому:
 *   • шрифты только системные — своих не подгружаем, они там долго тянутся;
 *   • тап-цели не меньше 44 px;
 *   • горизонтальной прокрутки нет ни при каком содержимом.
 */

:root {
    color-scheme: dark;

    /* ─── Фон и поверхности (payoplata.ru) ─── */
    --ink: #040b18;
    --navy: #08172f;
    --app: #091b36;
    --panel: #112243;
    --panel2: #0d1c37;
    --deep: #0e1e39;
    --chip: #16294a;
    --footer: #0d1c37;

    /* ─── Границы ─── */
    --line: #26374f;
    --line-soft: #22334f;
    --line-strong: #24395c;
    --line-dim: #16253d;

    /* ─── Фирменный синий ─── */
    --brand: #2e7bff;
    --brand-hover: #5093ff;
    --brand-soft: #6fa8ff;
    --brand-ice: #8fb4ff;
    --brand-deep: #1b4fd8;

    /* ─── Текст ─── */
    --ice: #eef3ff;
    --ice2: #dce8ff;
    --text2: #c7d6f5;
    --text3: #a3b8dd;
    --muted: #97add6;
    --dim: #6b80a8;
    --faint: #5d7099;

    /* ─── Акценты ─── */
    --gold: #ffc53d;
    --sale: #ff5c7a;
    --mint: #2fcf9a;
    --teal: #4dd0c0;

    /* ─── Роли на странице ─── */
    --text: var(--ice);

    --ok: var(--mint);
    --ok-bg: rgba(47, 207, 154, 0.13);
    --ok-line: rgba(47, 207, 154, 0.42);
    --info: var(--brand-soft);
    --info-bg: rgba(46, 123, 255, 0.13);
    --info-line: rgba(46, 123, 255, 0.34);
    --warn: var(--gold);
    --warn-bg: rgba(255, 197, 61, 0.12);
    --warn-line: rgba(255, 197, 61, 0.4);
    --err: #ff8d8d;
    --err-bg: rgba(255, 92, 122, 0.12);
    --err-line: rgba(255, 92, 122, 0.42);

    --radius: 20px;
    --radius-sm: 14px;
    --pill: 999px;
    --cta-shadow: 0 10px 26px -10px rgba(46, 123, 255, 0.7);
}

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

html {
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    margin: 0;
    padding: 16px 16px calc(36px + env(safe-area-inset-bottom));
    font-family: -apple-system, "SF Pro Text", "Helvetica Neue", "Segoe UI",
        system-ui, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ice);
    background:
        radial-gradient(1100px 560px at 10% -8%, rgba(46, 123, 255, 0.26), transparent 60%),
        radial-gradient(920px 480px at 94% 16%, rgba(77, 208, 192, 0.16), transparent 62%),
        radial-gradient(760px 420px at 62% 58%, rgba(124, 92, 255, 0.1), transparent 66%),
        var(--app);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    max-width: 100%;
    width: 100%;
    position: relative;
    overflow-x: hidden;
    overflow-x: clip;
}

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

.wrap {
    max-width: 520px;
    margin: 0 auto;
}

/* ─── Шапка сайта ───────────────────────────────────────────────── */

.masthead {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 56px;
    padding: 8px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(
            92deg,
            rgba(46, 123, 255, 0.14) 0%,
            rgba(46, 123, 255, 0.05) 42%,
            rgba(77, 208, 192, 0.09) 100%
        ),
        rgba(8, 23, 47, 0.92);
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
}

.logo {
    display: flex;
    flex-direction: column;
    flex: none;
    line-height: 1;
    text-decoration: none;
}

.pp-wm {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ice);
    white-space: nowrap;
}

.pp-wm b {
    color: var(--brand);
    font-weight: 800;
}

.pp-tagline {
    margin-top: 3px;
    font-size: 10px;
    font-weight: 600;
    color: var(--brand-soft);
    white-space: nowrap;
}

.pp-hcta {
    margin-left: auto;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px 0 6px;
    border-radius: var(--pill);
    border: 1px solid var(--line-soft);
    background: var(--panel);
    color: var(--text2);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.pp-hcta:active {
    border-color: var(--brand);
    color: #fff;
}

.pp-hcta .dot {
    width: 28px;
    height: 28px;
    flex: none;
    border-radius: var(--pill);
    display: grid;
    place-items: center;
    background: linear-gradient(140deg, var(--brand), var(--brand-deep));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.page-title {
    margin: 0 0 18px;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.14;
    color: var(--ice);
}

/* ─── Карточки ──────────────────────────────────────────────────── */

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 12px;
}

.card-lead {
    border-color: var(--line-strong);
    border-radius: 26px;
    padding: 22px;
}

.card h2 {
    margin: 0 0 4px;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--ice);
}

.card .lead {
    margin: 0 0 15px;
    color: var(--muted);
    font-size: 13.5px;
}

.product-head {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin-bottom: 14px;
}

.product-badge {
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 16px;
    border: 1px solid var(--line-soft);
    background: #101e33;
    color: var(--brand-ice);
    display: grid;
    place-items: center;
    font-size: 17px;
    font-weight: 700;
}

.product-head h2 {
    margin: 3px 0 0;
    font-size: 19px;
}

/* ─── Строки со сведениями ──────────────────────────────────────── */

.rows {
    margin: 0;
    border-top: 1px solid var(--line);
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.row dt {
    color: var(--dim);
    flex: none;
}

.row dd {
    margin: 0;
    text-align: right;
    font-weight: 600;
    color: var(--text2);
    word-break: break-word;
    min-width: 0;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--ice);
}

/* ─── Формы ─────────────────────────────────────────────────────── */

.field {
    margin-bottom: 4px;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 7px;
}

label .hint {
    display: block;
    margin-top: 4px;
    font-weight: 400;
    font-size: 12.5px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
}

textarea,
input[type="text"] {
    width: 100%;
    padding: 13px 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ice);
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    resize: vertical;
    -webkit-appearance: none;
    appearance: none;
}

input[type="text"] {
    height: 48px;
    padding: 0 14px;
}

textarea {
    min-height: 116px;
}

textarea:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(46, 123, 255, 0.16);
}

textarea::placeholder,
input::placeholder {
    color: var(--faint);
}

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

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 12px 24px;
    margin-top: 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: 0;
    border-radius: var(--pill);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: filter 0.2s, border-color 0.2s, color 0.2s;
}

.btn-primary {
    background: linear-gradient(140deg, var(--brand), var(--brand-deep));
    color: #fff;
    box-shadow: var(--cta-shadow);
}

.btn-primary:active {
    filter: brightness(1.12);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--text2);
}

.btn-secondary:active {
    border-color: var(--brand);
    color: #fff;
}

.btn[disabled] {
    opacity: 0.55;
    box-shadow: none;
    cursor: default;
}

/* ─── Сообщения ─────────────────────────────────────────────────── */

.banner {
    display: flex;
    gap: 10px;
    padding: 13px 16px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    font-size: 14px;
    line-height: 1.5;
}

.banner .icon {
    flex: none;
    font-size: 14px;
    line-height: 1.5;
}

.banner-ok {
    color: var(--ok);
    background: var(--ok-bg);
    border-color: var(--ok-line);
}

.banner-info {
    color: var(--info);
    background: var(--info-bg);
    border-color: var(--info-line);
}

.banner-warning {
    color: var(--warn);
    background: var(--warn-bg);
    border-color: var(--warn-line);
}

.banner-error {
    color: var(--err);
    background: var(--err-bg);
    border-color: var(--err-line);
}

/* ─── Инструкция ────────────────────────────────────────────────── */

.howto {
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel2);
    overflow: hidden;
}

.howto summary {
    padding: 14px 18px;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--ice);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

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

.howto summary::after {
    content: "";
    flex: none;
    width: 9px;
    height: 9px;
    margin-top: -4px;
    border-right: 2px solid var(--brand-soft);
    border-bottom: 2px solid var(--brand-soft);
    transform: rotate(45deg);
    transition: transform 0.2s;
}

.howto[open] summary::after {
    margin-top: 4px;
    transform: rotate(-135deg);
}

.howto-body {
    padding: 0 18px 16px;
    font-size: 13.5px;
    color: var(--muted);
}

.howto-body ol {
    counter-reset: st;
    list-style: none;
    margin: 0 0 12px;
    padding-left: 0;
}

.howto-body li {
    counter-increment: st;
    position: relative;
    padding-left: 34px;
    margin-bottom: 10px;
    line-height: 1.55;
}

.howto-body li::before {
    content: counter(st);
    position: absolute;
    left: 0;
    top: 1px;
    width: 24px;
    height: 24px;
    border-radius: var(--pill);
    background: rgba(46, 123, 255, 0.16);
    color: var(--brand-ice);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12px;
}

.howto-body li:last-child {
    margin-bottom: 0;
}

.howto-body strong {
    color: var(--ice);
    font-weight: 600;
}

.howto-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px;
    color: var(--ice2);
    background: var(--navy);
    border: 1px solid var(--line-dim);
    border-radius: 6px;
    padding: 1px 6px;
    word-break: break-all;
}

.safety {
    display: flex;
    gap: 9px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--ok-bg);
    border: 1px solid var(--ok-line);
    color: var(--mint);
    font-size: 13px;
    line-height: 1.5;
}

/* ─── Шаги ──────────────────────────────────────────────────────── */

.steps {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.step {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--line-dim);
    transition: background-color 0.3s;
}

.step.done {
    background: var(--brand);
}

/* ─── Служебное ─────────────────────────────────────────────────── */

.spinner {
    width: 16px;
    height: 16px;
    flex: none;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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

.hidden {
    display: none !important;
}

.skeleton {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        var(--panel2) 25%,
        var(--chip) 50%,
        var(--panel2) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line-dim);
    text-align: center;
    font-size: 12px;
    line-height: 1.6;
    color: var(--faint);
}

footer p {
    margin: 0 0 8px;
}

footer p:last-child {
    margin-bottom: 0;
}

footer a {
    color: var(--dim);
    text-decoration: none;
}

/* ─── Служебные классы вместо инлайновых стилей ─────────────────── */
/* CSP запрещает атрибут style=, поэтому всё оформление живёт здесь. */

.skeleton-title {
    width: 55%;
    height: 18px;
    margin-bottom: 14px;
}

.skeleton-line {
    width: 100%;
    margin-bottom: 9px;
}

.skeleton-line-short {
    width: 80%;
}

.lead-tight {
    margin: 0;
}

.note-small {
    margin: 12px 0 0;
    font-size: 12.5px;
}

/* ─── Тап-цели и мелкие экраны ──────────────────────────────────── */

.btn,
.pp-hcta,
textarea,
input[type="text"],
.howto summary {
    min-height: 44px;
}

a,
button,
input,
textarea,
summary {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (max-width: 380px) {
    body {
        padding-left: 12px;
        padding-right: 12px;
    }

    .card {
        padding: 18px 16px;
    }

    .pp-hcta {
        padding: 0 12px 0 5px;
        font-size: 13px;
    }

    .page-title {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .spinner {
        animation-duration: 2s !important;
    }
}
