* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #08111f;
    --card: rgba(15, 23, 42, 0.78);
    --card-border: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --blue: #2ea6ff;
    --cyan: #22d3ee;
    --green: #34d399;
    --red: #fb7185;
    --dark-card: rgba(30, 41, 59, 0.72);
}

html,
body {
    min-height: 100%;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(circle at 20% 15%, rgba(46, 166, 255, 0.25), transparent 34%),
        radial-gradient(circle at 80% 10%, rgba(34, 211, 238, 0.18), transparent 30%),
        linear-gradient(145deg, #08111f 0%, #0f172a 52%, #111827 100%);
    color: var(--text);
    overflow-x: hidden;
}

.page {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: max(24px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-card {
    width: min(100%, 760px);
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--card-border);
    border-radius: clamp(26px, 5vw, 38px);
    background: var(--card);
    backdrop-filter: blur(24px);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
    position: relative;
    z-index: 2;
}

.top-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: clamp(24px, 4vw, 32px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.brand-icon {
    width: clamp(58px, 10vw, 72px);
    height: clamp(58px, 10vw, 72px);
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: clamp(28px, 5vw, 34px);
    color: white;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 18px 40px rgba(46, 166, 255, 0.35);
    flex: 0 0 auto;
}

.eyebrow {
    color: var(--cyan);
    font-size: clamp(12px, 2.4vw, 13px);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

h1 {
    font-size: clamp(36px, 8vw, 72px);
    line-height: 0.95;
    letter-spacing: -0.06em;
}

.status-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.10);
    color: #a5f3fc;
    font-size: 14px;
    font-weight: 700;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 16px var(--green);
}

.subtitle {
    max-width: 660px;
    color: var(--muted);
    font-size: clamp(16px, 2.4vw, 20px);
    line-height: 1.65;
    margin-bottom: 26px;
}

.progress-block {
    padding: clamp(16px, 3vw, 20px);
    border-radius: 24px;
    background: var(--dark-card);
    border: 1px solid rgba(148, 163, 184, 0.12);
    margin-bottom: 18px;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #cbd5e1;
    margin-bottom: 12px;
    font-size: 14px;
}

.progress-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.15);
    overflow: hidden;
}

.progress-fill {
    width: 35%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.45);
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 18px 0 22px;
}

.feature-card {
    padding: clamp(16px, 3vw, 20px);
    min-height: 158px;
    border-radius: 24px;
    background: rgba(15, 23, 42, 0.70);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.feature-icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(46, 166, 255, 0.12);
    margin-bottom: 14px;
    font-size: 20px;
}

.feature-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.primary-btn,
.secondary-btn,
.modal-btn {
    border: 0;
    border-radius: 18px;
    padding: 16px 18px;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
    color: white;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    box-shadow: 0 18px 40px rgba(46, 166, 255, 0.28);
}

.secondary-btn {
    color: #e0f2fe;
    background: rgba(148, 163, 184, 0.13);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.primary-btn:hover,
.secondary-btn:hover,
.modal-btn:hover {
    opacity: 0.92;
}

.primary-btn:active,
.secondary-btn:active,
.modal-btn:active {
    transform: scale(0.98);
}

.telegram-user {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.32);
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.5;
}

.footer {
    width: min(100%, 760px);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 6px 0;
    color: rgba(203, 213, 225, 0.62);
    font-size: 13px;
    position: relative;
    z-index: 2;
}

.bg-orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(18px);
    opacity: 0.36;
    z-index: 1;
    pointer-events: none;
}

.orb-one {
    width: 260px;
    height: 260px;
    background: var(--blue);
    left: -90px;
    bottom: 8%;
}

.orb-two {
    width: 220px;
    height: 220px;
    background: var(--cyan);
    right: -80px;
    top: 12%;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    padding: 20px;
    display: grid;
    place-items: center;
    background: rgba(2, 6, 23, 0.68);
    backdrop-filter: blur(18px);
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    width: min(100%, 420px);
    padding: 28px;
    border-radius: 30px;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.48);
    text-align: center;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.22s ease;
}

.modal-backdrop.is-open .modal-card {
    transform: translateY(0) scale(1);
}

.modal-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    font-size: 34px;
    background: rgba(46, 166, 255, 0.12);
}

.modal-card.success .modal-icon {
    background: rgba(52, 211, 153, 0.14);
}

.modal-card.error .modal-icon {
    background: rgba(251, 113, 133, 0.14);
}

.modal-card h2 {
    font-size: 28px;
    letter-spacing: -0.04em;
    margin-bottom: 10px;
}

.modal-card p {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.55;
    margin-bottom: 22px;
}

.modal-btn {
    width: 100%;
    color: white;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
}

/* Телефоны */
@media (max-width: 640px) {
    .page {
        justify-content: flex-start;
        padding: 14px 14px max(16px, env(safe-area-inset-bottom));
    }

    .hero-card {
        padding: 20px;
        border-radius: 28px;
    }

    .top-line {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 24px;
    }

    .status-pill {
        width: fit-content;
    }

    .brand {
        align-items: flex-start;
    }

    .features,
    .actions {
        grid-template-columns: 1fr;
    }

    .feature-card {
        min-height: auto;
    }

    .footer {
        flex-direction: column;
        text-align: center;
    }

    .modal-card {
        padding: 24px;
        border-radius: 26px;
    }
}

/* Планшеты */
@media (min-width: 641px) and (max-width: 1024px) {
    .page {
        padding-inline: 28px;
    }

    .hero-card {
        width: min(100%, 820px);
    }

    .features {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Широкие ПК */
@media (min-width: 1200px) {
    .hero-card,
    .footer {
        width: 820px;
    }

    .page {
        padding-top: 40px;
        padding-bottom: 32px;
    }
}

@media (prefers-color-scheme: light) {
    body.telegram-light {
        background: #f2f7fb;
        color: #0f172a;
    }

    body.telegram-light .hero-card,
    body.telegram-light .modal-card {
        background: rgba(255, 255, 255, 0.90);
    }

    body.telegram-light .feature-card,
    body.telegram-light .progress-block {
        background: rgba(255, 255, 255, 0.76);
    }

    body.telegram-light .subtitle,
    body.telegram-light .feature-card p,
    body.telegram-light .telegram-user,
    body.telegram-light .modal-card p {
        color: #475569;
    }

    body.telegram-light .telegram-user {
        background: rgba(226, 232, 240, 0.72);
    }
}
