:root {
    --primary: #D91CF5;
    --primary-2: #20BFFB;
    --gradient: linear-gradient(90deg, #D91CF5, #20BFFB);
    --bg: #1B1B1B;
    --card: #323232;
    --text: #FFFFFF;
    --muted: rgba(255,255,255,0.55);
    --border: rgba(255,255,255,0.1);
    --error: #ff6b6b;
    --success: #4ade80;
    --radius: 30px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
html { scroll-behavior: smooth; }

/* ===== TOPBAR ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 32px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    gap: 18px;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 40px; }
.topbar nav a, .topbar nav .user-name { margin-left: 16px; text-decoration: none; color: var(--muted); }
.topbar nav a.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    opacity: 1;
}
.topbar nav a.btn-primary:visited,
.topbar nav a.btn-primary:hover,
.topbar nav a.btn-primary:active {
    color: #fff !important;
    -webkit-text-fill-color: #fff;
}
.topbar nav .user-name { color: var(--muted); }
.landing-header {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
    align-items: center;
    gap: 18px;
}
.landing-nav {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: center;
}
.landing-nav a {
    margin-left: 0 !important;
    white-space: nowrap;
}
.landing-cta {
    grid-column: 3;
    justify-self: end;
    margin-left: 0 !important;
}
.landing-menu-toggle {
    grid-column: 2;
    display: none;
}
.landing-menu-icon {
    position: relative;
    width: 16px;
    height: 16px;
    display: inline-block;
}
.landing-menu-icon::before,
.landing-menu-icon::after {
    content: "";
    position: absolute;
    top: 7px;
    width: 10px;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
    transition: transform 0.25s ease;
}
.landing-menu-icon::before {
    left: 0;
    transform: rotate(45deg);
}
.landing-menu-icon::after {
    right: 0;
    transform: rotate(-45deg);
}

/* ===== CONTAINER ===== */
.container { max-width: 1000px; margin: 32px auto; padding: 0 24px; }

/* ===== CARDS ===== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
}
.card.narrow { max-width: 440px; margin: 64px auto; }
.card h1, .card h2 { margin-top: 0; }
.card h2 { font-size: 20px; }

/* ===== FORMS ===== */
form label { display: block; margin-bottom: 18px; color: var(--muted); font-size: 14px; font-weight: 500; }
form input, form select {
    display: block;
    width: 100%;
    padding: 12px 18px;
    margin-top: 6px;
    background: #252525;
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 15px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}
form input::placeholder { color: rgba(255,255,255,0.3); }
form input:focus, form select:focus { border-color: var(--primary); }
form select option { background: #323232; }

/* ===== BUTTONS ===== */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 11px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.2s, border-color 0.2s;
}
.btn-primary {
    background: var(--gradient);
    color: #fff !important;
    -webkit-text-fill-color: #fff;
    opacity: 1;
}
.btn-primary:visited,
.btn-primary:hover,
.btn-primary:active {
    color: #fff !important;
    -webkit-text-fill-color: #fff;
}
.auth-register-btn,
.auth-register-btn:visited,
.auth-register-btn:hover,
.auth-register-btn:active {
    color: #fff !important;
    -webkit-text-fill-color: #fff;
}
.btn-primary:hover { filter: brightness(0.98); }
.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    margin-left: 12px;
}
.btn-secondary:hover { border-color: var(--primary); }
.big { padding: 14px 32px; font-size: 17px; }
.full { width: 100%; text-align: center; }

.link-btn {
    background: none; border: none; color: var(--muted); cursor: pointer;
    font: inherit; text-decoration: underline; margin-left: 16px; padding: 0;
}

/* ===== ALERTS ===== */
.alert { padding: 14px 20px; border-radius: 16px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: rgba(255,107,107,0.15); color: var(--error); border: 1px solid rgba(255,107,107,0.3); }
.alert-info { background: rgba(32,191,251,0.1); color: var(--primary-2); border: 1px solid rgba(32,191,251,0.2); }
.alert-success { background: rgba(74,222,128,0.1); color: var(--success); border: 1px solid rgba(74,222,128,0.2); }

.muted { color: var(--muted); }
.center { text-align: center; }

/* ===== REF BOX ===== */
.ref-links-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.ref-link-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ref-link-card h2 {
    margin: 2px 0 0;
    line-height: 1.15;
}
.ref-link-card .muted {
    margin: 0;
}
.ref-link-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}
.ref-link-kicker {
    margin: 0;
    color: var(--primary-2);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}
.ref-link-badge {
    flex-shrink: 0;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(32,191,251,0.12);
    border: 1px solid rgba(32,191,251,0.28);
    color: var(--primary-2);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.ref-link-badge-secondary {
    background: rgba(217,28,245,0.12);
    border-color: rgba(217,28,245,0.3);
    color: #e768fa;
}
.ref-box {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 16px 0 0;
}
.ref-box input {
    width: 100%;
    min-width: 0;
    padding: 13px 18px;
    background: #252525;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: monospace;
    color: var(--text);
}
.ref-box .btn-primary {
    width: 100%;
    text-align: center;
    margin: 0;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
}
.stat-card.highlight {
    background: linear-gradient(135deg, rgba(217,28,245,0.2), rgba(32,191,251,0.2));
    border-color: rgba(217,28,245,0.4);
}
.stat-value { font-size: 28px; font-weight: 700; }
.stat-card.highlight .stat-value {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ===== TABLES ===== */
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
    text-align: left;
    padding: 13px 10px;
    border-bottom: 1px solid var(--border);
}
table.data th { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 600; letter-spacing: 0.05em; }
table.data tr:last-child td { border-bottom: none; }

/* ===== FOOTER ===== */
.footer { text-align: center; padding: 32px 16px; color: var(--muted); }

/* ===== BRAND GRADIENT TEXT ===== */
.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nowrap { white-space: nowrap; }

/* ===== LK SIDEBAR ===== */
.lk-layout { display: flex; gap: 24px; align-items: flex-start; }
.lk-sidebar {
    width: 230px; flex-shrink: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 14px;
    position: sticky; top: 24px;
}
.lk-user-info {
    display: flex; align-items: center; gap: 12px;
    padding: 0 8px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}
.lk-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--gradient);
    color: white; font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; text-transform: uppercase;
}
.lk-user-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.lk-user-email { font-size: 12px; color: var(--muted); word-break: break-all; }
.lk-nav { display: flex; flex-direction: column; gap: 4px; }
.lk-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 16px;
    text-decoration: none; color: var(--muted);
    font-size: 15px; transition: all 0.15s;
}
.lk-nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.lk-nav-item.active {
    background: linear-gradient(135deg, rgba(217,28,245,0.15), rgba(32,191,251,0.15));
    color: var(--text); font-weight: 600;
}
.lk-nav-item.active svg { stroke: url(#grad) var(--primary); }
.lk-content { flex: 1; min-width: 0; }
.lk-content h1 { margin-top: 0; }

/* ===== HERO ===== */
.hero { text-align: center; padding: 80px 24px; width: min(100vw - 48px, 1500px); margin: 0 calc(50% - min(50vw, 750px)); }
.hero h1 { font-size: clamp(34px, 3.1vw, 56px); margin: 0 0 16px; white-space: nowrap; }
.hero p { font-size: 18px; color: var(--muted); margin-bottom: 36px; }
.how { padding: 36px 44px; }
.how.card { padding: 36px 44px; }
.how h2 { margin-bottom: 16px; }
.how ol { font-size: 17px; line-height: 2; color: var(--muted); }

/* ===== MAIN TEST LANDING ===== */
.main-test {
    width: min(1180px, calc(100vw - 48px));
    margin: 0 0 32px 50%;
    transform: translateX(-50%);
}
.mt-hero {
    min-height: 520px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 28px;
    align-items: center;
    padding: 74px 0 56px;
}
.mt-hero h1 {
    font-size: clamp(44px, 6.2vw, 82px);
    line-height: 0.96;
    margin: 0 0 26px;
    max-width: 920px;
}
.mt-lead {
    max-width: 720px;
    color: rgba(255,255,255,0.72);
    font-size: clamp(18px, 2vw, 25px);
    line-height: 1.42;
    margin: 0 0 34px;
}
.mt-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.mt-actions .btn-secondary {
    margin-left: 0;
}
.mt-hero-panel {
    background:
        radial-gradient(circle at 20% 0%, rgba(217,28,245,0.25), transparent 34%),
        radial-gradient(circle at 100% 80%, rgba(32,191,251,0.20), transparent 38%),
        var(--card);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.28);
}
.mt-panel-number {
    display: inline-block;
    font-size: 78px;
    line-height: 0.9;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.mt-panel-title {
    margin-top: 14px;
    font-size: 24px;
    font-weight: 800;
}
.mt-hero-panel p {
    color: var(--muted);
    margin: 14px 0 0;
}
.mt-proof-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 86px;
}
.mt-proof-grid div {
    min-height: 132px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255,255,255,0.045);
}
.mt-proof-grid strong {
    display: block;
    font-size: 28px;
    line-height: 1.1;
    margin-bottom: 9px;
}
.mt-proof-grid span {
    display: block;
    color: var(--muted);
    font-size: 14px;
}
.mt-section {
    margin-bottom: 92px;
    scroll-margin-top: 96px;
}
.mt-section h2,
.mt-final h2 {
    font-size: clamp(32px, 4vw, 54px);
    line-height: 1.04;
    margin: 0 0 26px;
}
.mt-section p,
.mt-final p {
    color: rgba(255,255,255,0.66);
    font-size: 18px;
    margin: 0 0 16px;
}
.mt-split {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
    gap: 28px;
    align-items: start;
}
.mt-service-list,
.mt-benefits,
.mt-audience-grid {
    display: grid;
    gap: 12px;
}
.mt-service-list div,
.mt-benefits div,
.mt-audience-grid div {
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.045);
    border-radius: 22px;
    padding: 20px 22px;
}
.mt-service-list div {
    min-height: 74px;
}
.mt-service-list h3 {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.2;
}
.mt-service-list p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}
.mt-timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    position: relative;
}
.mt-step {
    min-height: 260px;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--card);
}
.mt-step span {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gradient);
    font-weight: 800;
    font-size: 20px;
    margin-bottom: 28px;
}
.mt-step h3,
.mt-benefits h3 {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.15;
}
.mt-step p,
.mt-benefits p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}
.mt-audience-grid {
    grid-template-columns: repeat(4, 1fr);
}
.mt-audience-grid div {
    min-height: 150px;
    font-size: 18px;
    font-weight: 700;
}
.mt-final {
    text-align: center;
    padding: 58px 28px;
    border-radius: 30px;
    border: 1px solid rgba(217,28,245,0.28);
    background:
        radial-gradient(circle at 50% 0%, rgba(217,28,245,0.18), transparent 38%),
        rgba(255,255,255,0.045);
}
.mt-final p {
    max-width: 680px;
    margin: 0 auto 30px;
}

/* ===== POLICY ===== */
.policy-page {
    max-width: 860px;
    margin: 48px auto;
}
.policy-page h1 {
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1;
    margin: 0 0 24px;
}
.policy-page h2 {
    margin: 34px 0 14px;
    font-size: 24px;
}
.policy-page p,
.policy-page li {
    color: rgba(255,255,255,0.68);
}
.policy-page a { color: var(--primary-2); }
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.checkbox-label input {
    width: auto;
    margin: 3px 0 0;
    flex-shrink: 0;
}
.checkbox-label a { color: var(--primary-2); }
.captcha-box {
    width: 100%;
    min-height: 100px;
    margin: 14px 0 18px;
    overflow: hidden;
}

/* ===== ADMIN ===== */
.admin-wrap { max-width: 1150px; margin: 32px auto; padding: 0 24px; }
.balance-pos { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 700; }
.no-req { color: var(--error); font-size: 13px; }
.badge { display:inline-block; padding:3px 10px; border-radius:99px; font-size:12px; font-weight:600; }
.badge-green { background:rgba(74,222,128,0.15); color:var(--success); border:1px solid rgba(74,222,128,0.3); }
.payout-form { display:flex; gap:6px; align-items:center; }
.payout-form input {
    width: 100px; padding: 7px 12px;
    background: #252525; border: 1px solid var(--border);
    border-radius: 12px; color: var(--text); font-size: 14px;
}
.payout-form button {
    padding: 7px 14px; border-radius: 12px; border: none;
    background: var(--gradient); color: white;
    font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.payout-form button:hover { opacity: 0.85; }

@media (max-width: 700px) {
    .container {
        margin: 24px auto;
        padding: 0 16px;
    }
    .card {
        padding: 22px;
        border-radius: 22px;
    }
    .card.narrow {
        max-width: none;
        margin: 32px auto;
    }
    .lk-layout { flex-direction: column; }
    .lk-sidebar { width: 100%; position: static; }
    .ref-links-grid { grid-template-columns: 1fr; }
    .ref-link-head { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .hero { width: auto; margin: 0; padding: 64px 0; }
    .hero h1 { font-size: 34px; white-space: normal; }
    .hero .btn-primary,
    .hero .btn-secondary {
        display: flex;
        align-items: center;
        justify-content: center;
        width: min(100%, 300px);
        margin: 0 auto 12px;
    }
    .hero .btn-secondary { margin-left: auto; }
    .how { padding: 28px 24px; }
    .how.card { padding: 28px 24px; }
    .topbar {
        position: sticky;
        top: 0;
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        justify-content: space-between;
        align-items: center;
        min-height: 70px;
        padding: 14px 16px;
        gap: 8px;
    }
    .topbar .brand {
        grid-column: 1;
        justify-self: start;
    }
    .landing-header {
        display: contents;
    }
    .landing-menu-toggle {
        grid-column: 2;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        justify-self: center;
        border: 1px solid var(--border);
        background: rgba(255,255,255,0.04);
        color: var(--text);
        border-radius: 999px;
        padding: 10px 18px;
        font: inherit;
        font-weight: 700;
        cursor: pointer;
    }
    .landing-menu-toggle[aria-expanded="true"] .landing-menu-icon::before {
        transform: translateX(3px) rotate(45deg);
    }
    .landing-menu-toggle[aria-expanded="true"] .landing-menu-icon::after {
        transform: translateX(-3px) rotate(-45deg);
    }
    .landing-nav {
        position: fixed;
        left: 50%;
        right: auto;
        top: 82px;
        z-index: 120;
        width: min(calc(100vw - 32px), 520px);
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: 22px;
        background: rgba(50,50,50,0.98);
        box-shadow: 0 24px 60px rgba(0,0,0,0.35);
        opacity: 0;
        transform: translate(-50%, -8px);
        pointer-events: none;
        visibility: hidden;
        transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    }
    .landing-nav.open {
        opacity: 1;
        transform: translate(-50%, 0);
        pointer-events: auto;
        visibility: visible;
    }
    .landing-nav a {
        padding: 12px 14px;
        border-radius: 14px;
        color: var(--text);
        text-align: center;
    }
    .landing-nav a:hover {
        background: rgba(255,255,255,0.06);
    }
    .landing-cta {
        grid-column: 3;
        justify-self: end;
        padding: 9px 16px;
        font-size: 14px;
    }
    .main-test {
        width: min(100%, calc(100vw - 32px));
    }
    .mt-hero {
        min-height: auto;
        grid-template-columns: 1fr;
        padding: 48px 0 34px;
    }
    .mt-hero h1 {
        font-size: 44px;
    }
    .mt-lead {
        font-size: 18px;
    }
    .mt-actions .btn-primary,
    .mt-actions .btn-secondary {
        width: 100%;
        text-align: center;
        margin-left: 0;
    }
    .mt-hero-panel {
        padding: 26px;
    }
    .mt-proof-grid,
    .mt-timeline,
    .mt-audience-grid,
    .mt-split {
        grid-template-columns: 1fr;
    }
    .mt-proof-grid,
    .mt-section {
        margin-bottom: 58px;
    }
    .mt-step {
        min-height: auto;
    }
    .mt-audience-grid div {
        min-height: auto;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 12px;
    }
    .card {
        padding: 18px 10px;
    }
}

/* ===== FOOTER SOCIALS ===== */
.footer-socials { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 32px;
    border-radius: var(--radius);
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    color: white;
    min-width: 200px;
    transition: opacity 0.2s, transform 0.15s;
    letter-spacing: 0.02em;
}
.social-btn:hover { opacity: 0.88; transform: translateY(-2px); }
.social-tg { background: #2AABEE; }
.social-max { background: linear-gradient(135deg, #4FC3F7 0%, #7B1FA2 100%); }
