@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    --bg:       #0b0c0f;
    --bg2:      #111318;
    --bg3:      #181b22;
    --border:   rgba(255,255,255,0.07);
    --border2:  rgba(255,255,255,0.12);
    --text:     #e8eaf0;
    --muted:    #6b7280;
    --accent:   #4f8ef7;
    --accent2:  #7c3aed;
    --green:    #22c55e;
    --red:      #ef4444;
    --amber:    #f59e0b;
    --radius:   14px;
    --radius-sm: 8px;
    --shadow:   0 8px 32px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── NOISE TEXTURE OVERLAY ── */
body::before {
    content: '';
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 0;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3 { font-family: 'DM Serif Display', serif; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; font-family: 'DM Sans', sans-serif; font-weight: 600; }

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.8; }

/* ── LAYOUT ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.wrapper { position: relative; z-index: 1; }

/* ── NAV ── */
.nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(11,12,15,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.nav-logo {
    font-family: 'DM Serif Display', serif;
    font-size: 1.4rem;
    color: var(--text);
    display: flex; align-items: center; gap: 10px;
}
.nav-logo svg { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 8px; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px; font-weight: 500;
    cursor: pointer; border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: #3b7ef5; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(79,142,247,0.35); }
.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border2);
}
.btn-ghost:hover { background: var(--bg3); border-color: var(--border2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--radius); }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ── CARDS ── */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}
.card-sm { padding: 20px; }

/* ── FORM ── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; margin-bottom: 8px;
    font-size: 13px; font-weight: 500;
    color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em;
}
.form-input {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text);
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--muted); }

/* ── BADGE ── */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 12px; font-weight: 500;
}
.badge-green { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-red   { background: rgba(239,68,68,0.12);  color: var(--red); }
.badge-amber { background: rgba(245,158,11,0.12); color: var(--amber); }
.badge-blue  { background: rgba(79,142,247,0.12); color: var(--accent); }

/* ── ALERT ── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px; margin-bottom: 20px;
    display: flex; align-items: flex-start; gap: 10px;
}
.alert-err  { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.25);  color: #fca5a5; }
.alert-ok   { background: rgba(34,197,94,0.1);  border: 1px solid rgba(34,197,94,0.25);  color: #86efac; }
.alert-info { background: rgba(79,142,247,0.1); border: 1px solid rgba(79,142,247,0.25); color: #93c5fd; }
.alert-warn { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.25); color: #fcd34d; }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ── LANDING HERO ── */
.hero {
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
}
.hero-glow {
    position: absolute; top: -100px; left: 50%;
    transform: translateX(-50%);
    width: 600px; height: 400px;
    background: radial-gradient(ellipse, rgba(79,142,247,0.12) 0%, transparent 70%);
    pointer-events: none;
}
.hero-tag {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(79,142,247,0.1);
    border: 1px solid rgba(79,142,247,0.2);
    border-radius: 99px;
    padding: 6px 16px;
    font-size: 13px; color: var(--accent);
    margin-bottom: 28px;
}
.hero h1 { margin-bottom: 20px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 520px; margin: 0 auto 40px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── FEATURES ── */
.features { padding: 80px 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 48px; }
.feature-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.feature-icon {
    width: 44px; height: 44px;
    background: rgba(79,142,247,0.1);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
    color: var(--accent);
}
.feature-card h3 { margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 14px; }

/* ── PRICING ── */
.pricing { padding: 80px 0; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 48px; }
.price-card {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}
.price-card.popular { border-color: var(--accent); background: rgba(79,142,247,0.05); }
.price-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.price-days { font-size: 2rem; font-family: 'DM Serif Display', serif; }
.price-label { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.price-amount { font-size: 1.4rem; font-weight: 600; color: var(--accent); }
.price-per { font-size: 12px; color: var(--muted); }

/* ── DASHBOARD ── */
.dashboard { padding: 40px 0 80px; }
.dashboard-grid { display: grid; grid-template-columns: 280px 1fr; gap: 24px; margin-top: 32px; }
@media(max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; } }

.sidebar { display: flex; flex-direction: column; gap: 8px; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    color: var(--muted); font-size: 14px; font-weight: 500;
    text-decoration: none; transition: all 0.15s;
    border: 1px solid transparent;
}
.sidebar-link:hover, .sidebar-link.active {
    background: var(--bg3); color: var(--text);
    border-color: var(--border);
}
.sidebar-link.active { color: var(--accent); border-color: rgba(79,142,247,0.2); }
.sidebar-link svg { flex-shrink: 0; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.stat-card .value { font-size: 1.6rem; font-family: 'DM Serif Display', serif; }
.stat-card .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── KEYS LIST ── */
.key-item {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px 24px; margin-bottom: 12px;
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.key-info { flex: 1; min-width: 200px; }
.key-name { font-weight: 600; margin-bottom: 4px; }
.key-meta { font-size: 13px; color: var(--muted); }
.key-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.config-box {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px 16px;
    font-family: 'Courier New', monospace; font-size: 12px;
    word-break: break-all; color: var(--muted);
    margin-top: 12px;
    position: relative;
}
.copy-btn {
    position: absolute; top: 8px; right: 8px;
    background: var(--bg2); border: 1px solid var(--border2);
    color: var(--text); border-radius: 6px;
    padding: 4px 10px; font-size: 12px; cursor: pointer;
    transition: all 0.15s;
}
.copy-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── AMOUNT GRID ── */
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.amount-btn {
    padding: 14px 8px; border-radius: var(--radius-sm);
    border: 1px solid var(--border2); background: var(--bg3);
    color: var(--text); font-size: 15px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; text-align: center;
}
.amount-btn:hover, .amount-btn.selected {
    border-color: var(--accent); background: rgba(79,142,247,0.1); color: var(--accent);
}

/* ── STEPS ── */
.steps { display: flex; flex-direction: column; gap: 0; }
.step { display: flex; gap: 16px; padding: 16px 0; }
.step-num {
    width: 32px; height: 32px; flex-shrink: 0;
    background: var(--accent); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; color: #fff;
}
.step-body h4 { margin-bottom: 4px; }
.step-body p { font-size: 13px; color: var(--muted); }

/* ── TG BANNER ── */
.tg-banner {
    background: linear-gradient(135deg, rgba(79,142,247,0.1), rgba(124,58,237,0.1));
    border: 1px solid rgba(79,142,247,0.2);
    border-radius: var(--radius); padding: 20px 24px;
    display: flex; align-items: center; gap: 16px; margin-bottom: 24px;
}
.tg-banner svg { color: #3b82f6; flex-shrink: 0; }
.tg-banner-text h4 { margin-bottom: 4px; }
.tg-banner-text p { font-size: 13px; color: var(--muted); }
.tg-banner .btn { margin-left: auto; flex-shrink: 0; }
@media(max-width:600px) { .tg-banner { flex-wrap: wrap; } .tg-banner .btn { margin-left: 0; } }

/* ── MODAL ── */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg2); border: 1px solid var(--border2);
    border-radius: var(--radius); padding: 32px;
    width: 100%; max-width: 480px; margin: 16px;
    animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1; }
.modal-close:hover { color: var(--text); }

/* ── FOOTER ── */
.footer {
    border-top: 1px solid var(--border); padding: 32px 0;
    color: var(--muted); font-size: 13px; text-align: center;
}

/* ── LOADING ── */
.spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TABS ── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
    padding: 10px 20px; background: none; border: none;
    color: var(--muted); font-size: 14px; font-weight: 500;
    cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -1px; transition: all 0.15s;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── UTILS ── */
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── SECTION TITLE ── */
.section-title { margin-bottom: 8px; }
.section-sub { color: var(--muted); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── PERIOD CARDS ── */
.period-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.period-card {
    padding: 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--border2); background: var(--bg3);
    cursor: pointer; transition: all 0.15s; text-align: center;
}
.period-card:hover, .period-card.selected { border-color: var(--accent); background: rgba(79,142,247,0.1); }
.period-days { font-size: 1.3rem; font-weight: 600; color: var(--text); }
.period-price { font-size: 13px; color: var(--accent); margin-top: 4px; }
.period-pday { font-size: 11px; color: var(--muted); }
