:root {
    color-scheme: light;
    --bg: #fbfbfd;
    --panel: #ffffff;
    --panel2: #f6f7fa;
    --border: #e5e8ee;
    --border-light: #d3d8e2;
    --text: #12151c;
    --muted: #636d7e;
    --accent: #4f6bff;
    --accent2: #8b5cf6;
    --accent-green: #1a9c5e;
    --danger: #d92d20;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 8px 30px rgba(16,19,28,0.08);
    --header-bg: rgba(255,255,255,0.72);
    --glow1: rgba(79,107,255,0.04);
    --glow2: rgba(139,92,246,0.03);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #06090d;
        --panel: #121826;
        --panel2: #161d2e;
        --border: #232c3d;
        --border-light: #2e3850;
        --text: #eef2f8;
        --muted: #8b96a8;
        --accent: #5b8cff;
        --accent2: #8b5cf6;
        --accent-green: #35c17b;
        --danger: #f0655c;
        --shadow: 0 8px 30px rgba(0,0,0,0.35);
        --header-bg: rgba(6,9,13,0.72);
        --glow1: rgba(91,140,255,0.09);
        --glow2: rgba(139,92,246,0.06);
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #06090d;
    --panel: #121826;
    --panel2: #161d2e;
    --border: #232c3d;
    --border-light: #2e3850;
    --text: #eef2f8;
    --muted: #8b96a8;
    --accent: #5b8cff;
    --accent2: #8b5cf6;
    --accent-green: #35c17b;
    --danger: #f0655c;
    --shadow: 0 8px 30px rgba(0,0,0,0.35);
    --header-bg: rgba(6,9,13,0.72);
    --glow1: rgba(91,140,255,0.09);
    --glow2: rgba(139,92,246,0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background:
        radial-gradient(900px 500px at 15% -10%, var(--glow1), transparent 60%),
        radial-gradient(700px 500px at 100% 0%, var(--glow2), transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px 80px; }

header.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 4px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    margin: 0 -4px;
}
header.top.scrolled { border-bottom-color: var(--border); }
header.top a.brand {
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.03em;
}
nav { display: flex; align-items: center; gap: 22px; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.15s; }
nav a:hover { color: var(--text); }
nav a.btn { color: var(--bg); }
.theme-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--panel2);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover { border-color: var(--border-light); transform: translateY(-1px); }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
}
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

h1 { font-size: 3.6rem; line-height: 1.03; margin: 0.35em 0 0.3em; letter-spacing: -0.04em; font-weight: 800; }
h1 .muted { color: var(--muted); }
h2 { font-size: 1.5rem; margin-top: 2.6em; letter-spacing: -0.02em; font-weight: 800; }
h3 { letter-spacing: -0.01em; }
p.lead { color: var(--muted); font-size: 1.15rem; max-width: 620px; }

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--panel2);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    margin-top: 28px;
}

.hero-actions { display: flex; gap: 12px; margin: 28px 0 14px; flex-wrap: wrap; }
.trust-line { color: var(--muted); font-size: 0.82rem; margin: 0 0 20px; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 40px 0 48px; }
@media (max-width: 640px) { .stats-row { grid-template-columns: 1fr; } }
.stats-row .stat h4 { font-size: 1.02rem; font-weight: 700; margin: 12px 0 4px; letter-spacing: -0.01em; }
.stats-row .stat p { color: var(--muted); font-size: 0.86rem; margin: 0; }
.stats-row .stat .icon {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--panel2); border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
}

.demo-widget {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 44px 0;
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
@media (max-width: 720px) {
    .demo-widget { flex-direction: column; }
    .demo-arrow { transform: rotate(90deg); }
}
.demo-panel { flex: 1; min-width: 0; }
.demo-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.demo-arrow { color: var(--muted); font-size: 1.4rem; flex: none; }

.telegram-bubble {
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.tg-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    font-size: 0.85rem; font-weight: 600;
    border-bottom: 1px solid var(--border);
    background: rgba(41,171,226,0.08);
}
.tg-dot { width: 8px; height: 8px; border-radius: 50%; background: #29abe2; flex: none; }
.telegram-bubble pre {
    margin: 0; padding: 14px;
    font-family: "Inter", sans-serif;
    font-size: 0.92rem; line-height: 1.6;
    white-space: pre-wrap;
    color: var(--text);
}

.mt5-ticket {
    background: var(--panel2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 14px;
}
.mt5-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}
.mt5-row:last-of-type { border-bottom: none; }
.mt5-row span { color: var(--muted); }
.mt5-row strong.sell { color: var(--danger); }
.mt5-status {
    margin-top: 8px; padding: 10px 0 4px;
    border-top: 1px solid var(--border);
    color: var(--accent-green);
    font-size: 0.85rem; font-weight: 600;
}

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 28px 0; }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } h1 { font-size: 2.1rem; } }

.card {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 24px;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--border-light); box-shadow: var(--shadow); }
.card.featured { background: var(--text); border-color: var(--text); }
.card.featured, .card.featured .price, .card.featured h3 { color: var(--bg); }
.card.featured p, .card.featured ul li { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.card.featured .price span { color: color-mix(in srgb, var(--bg) 55%, transparent); }
.card.featured .btn { background: var(--bg); color: var(--text); }
.card .ribbon {
    position: absolute; top: -11px; left: 24px;
    background: var(--accent);
    color: #fff; font-size: 0.72rem; font-weight: 700;
    padding: 4px 12px; border-radius: 999px;
}
.card h3 { margin-top: 4px; font-size: 1.15rem; }
.card .price { font-size: 2.2rem; font-weight: 800; margin: 10px 0; letter-spacing: -0.03em; }
.card .price span { font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.card p { color: var(--muted); font-size: 0.92rem; }
.card ul { color: var(--text); padding-left: 0; list-style: none; margin: 16px 0; }
.card ul li { padding-left: 26px; position: relative; margin: 9px 0; font-size: 0.9rem; color: var(--muted); }
.card ul li::before {
    content: "✓";
    position: absolute; left: 0; top: 0;
    width: 18px; height: 18px;
    color: var(--accent-green);
    font-weight: 800; font-size: 0.8rem;
}
.card.featured ul li::before { color: var(--accent-green); }
.card .btn { width: 100%; text-align: center; margin-top: 6px; }

.btn {
    display: inline-block;
    background: var(--text);
    color: var(--bg);
    border: none;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); opacity: 0.92; }
.btn.secondary {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text);
}
.btn.secondary:hover { background: var(--panel2); box-shadow: none; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 7px 14px; font-size: 0.83rem; }

form.stack { display: flex; flex-direction: column; gap: 16px; max-width: 520px; }
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
input, select, textarea {
    width: 100%;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(91,140,255,0.18);
}
textarea { min-height: 120px; font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; }
.hint { color: var(--muted); font-size: 0.8rem; margin-top: 3px; }

.duration-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.duration-option {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.duration-option input { position: absolute; opacity: 0; }
.duration-option span { font-size: 0.8rem; color: var(--muted); }
.duration-option strong { font-size: 1.05rem; }
.duration-option em { font-style: normal; font-size: 0.72rem; color: var(--accent-green); font-weight: 600; }
.duration-option:has(input:checked) { border-color: var(--text); background: var(--panel2); }

table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: rgba(255,255,255,0.02); }

.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; }
.badge.pending_payment, .badge.pending, .badge.awaiting_config { background: #3a2f14; color: #e0b64c; }
.badge.paid, .badge.configured, .badge.confirmed { background: #16324a; color: #6cb3ff; }
.badge.provisioned { background: #16324a; color: #6cb3ff; }
.badge.active { background: #123a25; color: var(--accent-green); }
.badge.stopped, .badge.failed, .badge.expired { background: #3a1616; color: #e08a86; }

.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 14px; margin: 14px 0; }
.kv div:nth-child(odd) { color: var(--muted); font-size: 0.88rem; }

.steps { margin: 28px 0; position: relative; }
.step { display: flex; gap: 18px; padding-bottom: 30px; position: relative; }
.step:last-child { padding-bottom: 0; }
.step::before {
    content: "";
    position: absolute; left: 18px; top: 40px; bottom: 0;
    width: 1px;
    background: linear-gradient(var(--border-light), transparent);
}
.step:last-child::before { display: none; }
.step .num {
    flex: none;
    width: 37px; height: 37px;
    border-radius: 50%;
    background: var(--text);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem; color: var(--bg);
}
.step .body h4 { margin: 4px 0 4px; font-size: 1rem; }
.step .body p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin: 18px 0; }
.error { color: var(--danger); font-size: 0.9rem; }
.qr-box img { background: #fff; padding: 10px; border-radius: 8px; }
code.wallet { background: var(--panel); border: 1px solid var(--border); padding: 8px 10px; border-radius: 6px; display: inline-block; }

.legal h2 { font-size: 1.1rem; margin-top: 1.8em; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 1.3em; color: var(--muted); }
.legal li { margin: 4px 0; }
.legal a { color: var(--accent); }
.legal .updated { margin-top: -0.4em; }
.callout { background: var(--panel); border: 1px solid var(--danger); border-radius: 10px; padding: 16px 18px; margin: 20px 0; }
.callout strong { color: var(--danger); }

.checkbox-line { display: flex; align-items: flex-start; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.checkbox-line input { width: auto; margin-top: 3px; }
.checkbox-line a { color: var(--accent); }

footer.legal-footer {
    border-top: 1px solid var(--border);
    margin-top: 60px;
    padding-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
footer.legal-footer a { color: var(--muted); text-decoration: none; font-size: 0.8rem; transition: color 0.15s; }
footer.legal-footer a:hover { color: var(--text); }
