* {
    box-sizing: border-box;
}

:root {
    --bg: #0b0e12;
    --bg-soft: #0f1318;
    --surface: #12171d;
    --surface-2: #171d24;
    --surface-3: #1b222b;
    --border: #29313b;
    --border-soft: #202731;
    --text: #eef2f6;
    --muted: #929eab;
    --muted-2: #697684;
    --primary: #3f7ee8;
    --primary-hover: #4d8cf5;
    --primary-soft: rgba(63, 126, 232, .12);
    --success: #43b581;
    --danger: #df6671;
    --warning: #d4a94d;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow: 0 22px 60px rgba(0, 0, 0, .28);
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

html[dir="rtl"] body {
    font-family: Tahoma, Arial, system-ui, sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.016) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.016) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 72%);
    z-index: -1;
}

button,
input,
select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1160px, calc(100% - 40px));
    margin-inline: auto;
}

.nav {
    min-height: 72px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(11, 14, 18, .94);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 1.7px;
    font-size: 17px;
    flex-shrink: 0;
}

.brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
    letter-spacing: 0;
    font-size: 14px;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    color: var(--muted);
    font-size: 13px;
    flex: 1;
}

.nav-links a {
    transition: color .18s ease;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-tools,
.auth-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-control {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 8px 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
}

html[dir="rtl"] .language-control {
    padding: 0 10px 0 8px;
}

.language-icon {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted-2);
}

.language-select {
    appearance: none;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
    padding: 0 2px;
}

.hero-shell {
    border-bottom: 1px solid var(--border-soft);
    background: linear-gradient(180deg, rgba(25, 31, 39, .55), rgba(11, 14, 18, 0));
}

.hero-layout {
    min-height: 610px;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr);
    gap: 64px;
    align-items: center;
    padding-block: 86px;
}

.hero {
    max-width: 720px;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    margin-bottom: 16px;
    border: 1px solid rgba(63, 126, 232, .28);
    border-radius: 999px;
    background: rgba(63, 126, 232, .08);
    color: #8fb8f5;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .85px;
    text-transform: uppercase;
}

.eyebrow {
    color: #7fa8e8;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.65px;
}

.hero h1,
.auth-intro h1,
.panel-hero h1 {
    margin: 14px 0 18px;
    letter-spacing: -2.6px;
    line-height: 1.04;
}

.hero h1 {
    font-size: clamp(42px, 6.4vw, 70px);
    max-width: 760px;
}

.hero p,
.auth-intro > p,
.panel-hero p {
    color: var(--muted);
    line-height: 1.75;
    font-size: 16px;
}

.hero p {
    max-width: 650px;
}

.actions,
.panel-hero-actions,
.activation-buttons,
.account-actions,
.telegram-strip-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.actions {
    margin-top: 30px;
}

.button {
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.button:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
}

.button.secondary {
    background: var(--surface);
    border-color: var(--border);
    color: #d6dde5;
}

.button.secondary:hover {
    background: var(--surface-2);
    border-color: #35404d;
}

.button.small {
    min-height: 37px;
    padding: 0 13px;
    font-size: 12px;
}

.button.compact {
    width: 100%;
    margin-top: 8px;
}

.button.full {
    width: 100%;
}

button:disabled {
    opacity: .55;
    cursor: default;
    transform: none !important;
}

.hero-meta {
    margin-top: 26px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.hero-meta strong {
    color: #cdd6df;
}

.hero-meta a:hover,
.text-link:hover,
.footer-links a:hover,
.help a:hover {
    color: var(--text);
}

.meta-divider {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #4e5965;
}

.hero-console {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #0d1116;
    box-shadow: var(--shadow);
}

.console-head {
    height: 52px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 18px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.console-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
}

.console-status {
    margin-inline-start: auto;
    color: #78cda7;
    font-size: 10px;
    letter-spacing: 1px;
}

.console-body {
    padding: 10px;
}

.console-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 19px 16px;
    border-bottom: 1px solid var(--border-soft);
}

.console-row:last-child {
    border-bottom: 0;
}

.console-row > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.console-label {
    color: var(--muted-2);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.console-row strong {
    font-size: 13px;
    font-weight: 700;
}

.console-number {
    color: #394554;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
}

.section {
    padding-block: 72px;
}

.divider-section {
    border-top: 1px solid var(--border-soft);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 25px;
    margin-bottom: 26px;
}

.section-heading.compact {
    max-width: 720px;
}

.section-heading h2,
.section-title h2 {
    margin: 8px 0 7px;
    font-size: clamp(27px, 4vw, 34px);
    letter-spacing: -1.2px;
}

.section-heading p,
.section-title p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.grid,
.purchase-grid,
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.card,
.purchase-card,
.stat,
.form-card,
.activation-panel,
.account-card,
.telegram-strip {
    border: 1px solid var(--border);
    background: var(--surface);
}

.card {
    min-height: 185px;
    border-radius: 16px;
    padding: 25px;
}

.card-index {
    color: #4b5968;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}

.card h3 {
    margin: 35px 0 10px;
    font-size: 18px;
}

.card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
    font-size: 13px;
}

.purchase-card {
    min-height: 250px;
    border-radius: 17px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

.purchase-card.featured {
    border-color: rgba(63, 126, 232, .5);
    background: linear-gradient(180deg, rgba(63, 126, 232, .08), var(--surface) 50%);
}

.option-icon {
    min-width: 44px;
    width: fit-content;
    height: 34px;
    padding-inline: 10px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1b2430;
    border: 1px solid #2c3847;
    color: #a9c4ec;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .7px;
}

.option-copy {
    flex: 1;
}

.option-overline {
    display: block;
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.35px;
    margin-bottom: 7px;
}

.purchase-card h3 {
    margin: 0 0 9px;
    font-size: 20px;
}

.purchase-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.text-link {
    color: #8eb7f4;
    font-size: 12px;
    font-weight: 750;
    transition: color .18s ease;
}

.footer {
    margin-top: 54px;
    padding: 32px 0;
    border-top: 1px solid var(--border-soft);
    color: var(--muted-2);
    font-size: 11px;
}

.footer-inner,
.footer-inner > div,
.footer-links {
    display: flex;
    align-items: center;
}

.footer-inner {
    justify-content: space-between;
    gap: 20px;
}

.footer-inner > div,
.footer-links {
    gap: 14px;
}

.footer strong {
    color: #bbc5cf;
    letter-spacing: 1px;
}

/* Authentication */
.auth-layout {
    min-height: calc(100vh - 72px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(400px, .8fr);
    gap: 80px;
    align-items: center;
    padding-block: 70px;
}

.auth-intro {
    max-width: 630px;
}

.auth-intro h1 {
    font-size: clamp(38px, 5vw, 58px);
}

.auth-side-links {
    margin-top: 32px;
    display: grid;
    gap: 10px;
    max-width: 480px;
}

.auth-side-links > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    color: var(--muted);
    transition: border-color .18s ease, background .18s ease;
}

.auth-side-links > a:hover {
    border-color: var(--border);
    background: var(--surface);
}

.auth-side-links > a > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.auth-side-links strong {
    color: #d9e0e7;
    font-size: 12px;
}

.auth-side-links small {
    font-size: 11px;
}

.mini-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #2c3847;
    background: #18212b;
    color: #90b5ea;
    font-size: 9px;
    font-weight: 850;
}

.auth-card-wrap {
    width: 100%;
}

.form-card {
    width: 100%;
    max-width: 520px;
    margin-inline-start: auto;
    padding: 30px;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.form-heading {
    margin-bottom: 25px;
}

.form-heading h2 {
    margin: 7px 0 0;
    font-size: 28px;
    letter-spacing: -1px;
}

.field {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #c8d0d8;
    font-size: 12px;
    font-weight: 700;
}

input {
    width: 100%;
    height: 49px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #0d1116;
    outline: 0;
    color: var(--text);
    font-size: 14px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

input:focus {
    border-color: #477ecf;
    box-shadow: 0 0 0 3px rgba(63, 126, 232, .10);
}

.help {
    margin-top: 7px;
    color: var(--muted-2);
    font-size: 11px;
    line-height: 1.55;
}

.help.centered {
    margin: 18px 0 0;
    text-align: center;
}

.help a {
    color: #8eb7f4;
    font-weight: 700;
}

.alert {
    display: none;
    margin-top: 15px;
    padding: 12px 13px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.55;
}

.alert.show {
    display: block;
}

.alert.error {
    background: rgba(223,102,113,.08);
    border: 1px solid rgba(223,102,113,.24);
    color: #efa1a8;
}

.alert.success {
    background: rgba(67,181,129,.08);
    border: 1px solid rgba(67,181,129,.23);
    color: #8bd3b2;
}

/* Customer panel */
.panel-page {
    padding-top: 34px;
    padding-bottom: 72px;
}

.panel-hero {
    min-height: 245px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 34px;
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #141a21, #0f1318);
    margin-bottom: 20px;
}

.panel-hero > div:first-child {
    max-width: 690px;
}

.panel-hero h1 {
    font-size: clamp(34px, 5vw, 50px);
}

.dashboard-grid {
    margin-bottom: 26px;
}

.stat {
    padding: 20px;
    border-radius: 14px;
}

.stat-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.stat-value {
    margin-top: 8px;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1.2px;
}

.panel-section {
    margin-top: 52px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 20px;
}

.panel-purchase-grid .purchase-card {
    min-height: 280px;
}

.telegram-strip {
    margin-top: 14px;
    padding: 18px 20px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.telegram-strip > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.telegram-strip-label {
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.1px;
}

.telegram-strip strong {
    font-size: 13px;
}

.activation-panel {
    max-width: 760px;
    padding: 26px;
    border-radius: 17px;
}

.activation-step {
    width: 100%;
}

.plan {
    margin: 21px 0;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: #0d1116;
}

.plan-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 0;
    font-size: 13px;
}

.plan-row span:first-child {
    color: var(--muted);
}

.success-box {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border-radius: 13px;
    background: rgba(67,181,129,.07);
    border: 1px solid rgba(67,181,129,.18);
    margin-bottom: 17px;
}

.success-box h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.success-box p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.success-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(67,181,129,.14);
    color: #83d0ad;
    font-size: 19px;
    font-weight: 900;
}

.hidden {
    display: none !important;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: start;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
    font-size: 12px;
}

.table th {
    color: var(--muted);
    font-weight: 700;
    background: #0f1419;
}

.table tr:last-child td {
    border-bottom: 0;
}

.status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.status.SUCCESS {
    color: #83d0ad;
    background: rgba(67,181,129,.10);
}

.status.FAILED {
    color: #eca0a8;
    background: rgba(223,102,113,.10);
}

.status.RUNNING,
.status.QUEUED {
    color: #9fc0ef;
    background: rgba(63,126,232,.12);
}

.account-card {
    padding: 22px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.account-card h3 {
    margin: 6px 0 5px;
}

.account-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 980px) {
    .nav-links {
        display: none;
    }

    .hero-layout,
    .auth-layout {
        grid-template-columns: 1fr;
        gap: 44px;
    }

    .hero-layout {
        padding-block: 64px;
    }

    .hero-console {
        max-width: 650px;
    }

    .auth-layout {
        align-items: start;
        padding-block: 56px;
    }

    .form-card {
        margin-inline-start: 0;
    }
}

@media (max-width: 800px) {
    .grid,
    .purchase-grid,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .panel-hero,
    .section-title,
    .account-card,
    .telegram-strip {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel-hero {
        padding: 27px;
    }

    .section {
        padding-block: 58px;
    }
}

@media (max-width: 620px) {
    .container {
        width: min(100% - 26px, 1160px);
    }

    .nav {
        min-height: 64px;
    }

    .nav-inner {
        gap: 10px;
    }

    .brand span:last-child {
        display: none;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
    }

    .auth-nav .button.small {
        min-height: 36px;
        padding: 0 10px;
        font-size: 11px;
    }

    .language-control {
        height: 36px;
    }

    .hero-layout {
        min-height: auto;
        padding-block: 50px;
        gap: 34px;
    }

    .hero h1,
    .auth-intro h1,
    .panel-hero h1 {
        letter-spacing: -1.8px;
    }

    .hero h1 {
        font-size: 40px;
    }

    .hero p,
    .auth-intro > p,
    .panel-hero p {
        font-size: 14px;
    }

    .actions,
    .panel-hero-actions,
    .activation-buttons,
    .account-actions {
        width: 100%;
    }

    .actions .button,
    .panel-hero-actions .button,
    .activation-buttons .button,
    .account-actions .button {
        flex: 1 1 auto;
    }

    .hero-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .meta-divider {
        display: none;
    }

    .auth-layout {
        min-height: auto;
        padding-block: 42px;
    }

    .form-card,
    .activation-panel {
        padding: 20px;
    }

    .panel-page {
        padding-top: 22px;
    }

    .panel-hero {
        padding: 23px;
    }

    .panel-section {
        margin-top: 42px;
    }

    .telegram-strip-actions {
        flex-direction: column;
        gap: 8px;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}
