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

:root {
    --bg:        #091540;
    --bg-2:      #0d1f5c;
    --blue-1:    #1a4db3;
    --blue-2:    #1d5cd4;
    --blue-3:    #2a72f5;
    --accent:    #4a8fff;
    --card:      rgba(255,255,255,0.07);
    --card-b:    rgba(255,255,255,0.11);
    --card-h:    rgba(255,255,255,0.11);
    --text:      #ffffff;
    --text-2:    rgba(255,255,255,0.62);
    --text-3:    rgba(255,255,255,0.32);
    --green:     #3de8a0;
    --red:       #ff6b6b;
    --gold:      #ffd166;
    --nav-h:     64px;
    --safe-b:    env(safe-area-inset-bottom, 0px);
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Background layers (real DOM elements, never pseudo) ── */
.bg-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    /* Always behind .app — DOM order + z-index guarantee this */
    z-index: 0;
}

.bg-layer-gradient {
    background:
        radial-gradient(ellipse 120% 80% at 0% 0%,   #1a4db3 0%, transparent 60%),
        radial-gradient(ellipse 80%  80% at 100% 100%, #0d2d8a 0%, transparent 55%),
        radial-gradient(ellipse 60%  60% at 50% 40%,  #112070 0%, transparent 70%),
        linear-gradient(170deg, #091540 0%, #0c1b52 40%, #0e2264 70%, #091540 100%);
}

.bg-layer-pattern {
    opacity: 0.08;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='540' height='540'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='55' cy='55' r='15'/%3E%3Cpath d='M44 59l23-11-6 22-5-7zm0 0l9 4'/%3E%3Cpath d='M158 58Q158 41 170 40Q182 41 182 58L178 64 170 62 162 64Z'/%3E%3Ccircle cx='165' cy='50' r='2.5'/%3E%3Ccircle cx='175' cy='50' r='2.5'/%3E%3Cpath d='M166 60Q170 63 174 60'/%3E%3Ccircle cx='295' cy='50' r='13'/%3E%3Cpath d='M288 65Q286 58 291 55h8Q304 58 302 65'/%3E%3Cpath d='M291 64l-2 6m12-6l2 6'/%3E%3Crect x='407' y='32' width='26' height='26' rx='7'/%3E%3Ccircle cx='420' cy='45' r='7'/%3E%3Ccircle cx='428' cy='37' r='2' fill='%23fff'/%3E%3Cpath d='M14 143L36 167M36 143L14 167'/%3E%3Ccircle cx='140' cy='158' r='15'/%3E%3Cpath d='M128 151Q140 147 152 151M130 158Q140 155 150 158M132 165Q140 162 148 165'/%3E%3Cpath d='M275 142h-6c-4 0-6 3-6 7v19h8v-11h4l2-6h-6v-3c0-2 1-3 3-3h2z'/%3E%3Ccircle cx='385' cy='158' r='15'/%3E%3Ccircle cx='379' cy='155' r='2.5'/%3E%3Ccircle cx='391' cy='155' r='2.5'/%3E%3Cpath d='M378 163Q385 169 392 163'/%3E%3Ccircle cx='385' cy='141' r='3'/%3E%3Cpath d='M385 144l3 7'/%3E%3Crect x='492' y='142' width='26' height='26' rx='5'/%3E%3Cline x1='499' y1='153' x2='499' y2='162'/%3E%3Ccircle cx='499' cy='149' r='1.2' fill='%23fff'/%3E%3Cpath d='M503 156q0-4 4-4t4 4v6h-4'/%3E%3Cpath d='M67 253c0-7 5-11 11-10-3 3-2 8 1 9 3-3 8-5 11-2 2 5 0 14-4 17-2 2-5 1-7 0-2 1-5 2-7 0-3-2-5-7-5-14z'/%3E%3Cpath d='M75 243c0-3 2-6 5-6'/%3E%3Crect x='175' y='257' width='30' height='22' rx='6'/%3E%3Cpath d='M186 261l13 7-13 7z'/%3E%3Cpath d='M317 243v20a7 7 0 1 1-6-7v-8c5 1 9 4 11 6V243z'/%3E%3Cpath d='M430 253c0-7 5-14 11-14 6 0 9 4 9 8h-5c0-2-1-3-4-3-3 0-5 4-5 9s2 9 6 9c3 0 5-2 5-5h-6v-4h11v13h-4l-1-3c-1 2-4 4-7 4-8 0-10-7-10-14z'/%3E%3Ccircle cx='105' cy='373' r='14'/%3E%3Cpath d='M95 377l21-10-5 20-4-6zm0 0l9 4'/%3E%3Cpath d='M208 382Q208 366 220 365Q232 366 232 382L228 387 220 385 212 387Z'/%3E%3Ccircle cx='215' cy='373' r='2.5'/%3E%3Ccircle cx='225' cy='373' r='2.5'/%3E%3Cpath d='M216 380Q220 383 224 380'/%3E%3Ccircle cx='335' cy='373' r='14'/%3E%3Cpath d='M323 366Q335 362 347 366M325 372Q335 369 345 372M327 378Q335 376 343 378'/%3E%3Crect x='443' y='358' width='24' height='24' rx='6'/%3E%3Ccircle cx='455' cy='370' r='6'/%3E%3Ccircle cx='462' cy='363' r='1.8' fill='%23fff'/%3E%3Cpath d='M19 463L41 487M41 463L19 487'/%3E%3Ccircle cx='150' cy='471' r='12'/%3E%3Cpath d='M143 484Q141 477 146 474h8Q159 477 157 484'/%3E%3Cpath d='M280 461h-6c-4 0-6 3-6 7v17h8v-11h4l2-6h-6v-3c0-2 1-2 3-2h2z'/%3E%3Ccircle cx='390' cy='477' r='14'/%3E%3Ccircle cx='384' cy='474' r='2.5'/%3E%3Ccircle cx='396' cy='474' r='2.5'/%3E%3Cpath d='M383 482Q390 488 397 482'/%3E%3Ccircle cx='390' cy='461' r='3'/%3E%3Cpath d='M390 464l3 7'/%3E%3Crect x='497' y='461' width='26' height='26' rx='5'/%3E%3Cline x1='504' y1='472' x2='504' y2='481'/%3E%3Ccircle cx='504' cy='468' r='1.2' fill='%23fff'/%3E%3Cpath d='M508 475q0-4 4-4t4 4v6h-4'/%3E%3Ccircle cx='130' cy='130' r='2'/%3E%3Ccircle cx='450' cy='120' r='1.5'/%3E%3Ccircle cx='250' cy='200' r='2'/%3E%3Ccircle cx='30' cy='305' r='1.5'/%3E%3Ccircle cx='480' cy='310' r='2'/%3E%3Ccircle cx='200' cy='440' r='1.5'/%3E%3Ccircle cx='430' cy='440' r='2'/%3E%3Ccircle cx='320' cy='310' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 540px 540px;
    animation: patternDrift 70s linear infinite;
}

@keyframes patternDrift {
    from { background-position: 0 0; }
    to   { background-position: 480px 240px; }
}

.bg-layer-glow::before,
.bg-layer-glow::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}
.bg-layer-glow::before {
    top: -100px; left: -100px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(42,114,245,0.18) 0%, transparent 65%);
    animation: glowPulse 6s ease-in-out infinite;
}
.bg-layer-glow::after {
    bottom: -80px; right: -80px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(26,77,179,0.15) 0%, transparent 65%);
    animation: glowPulse 8s ease-in-out infinite reverse;
}
@keyframes glowPulse {
    0%,100% { opacity: 0.7; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.08); }
}

/* ── Loading ──────────────────────────────────── */
.fullscreen-loader {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}
.fullscreen-loader.hidden { display: none; }

.loader-ring {
    position: absolute;
    width: 80px; height: 80px;
    border: 2px solid rgba(74,143,255,0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-logo {
    width: 56px; height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--blue-2), var(--blue-3));
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 900; color: #fff;
    letter-spacing: -1px;
    box-shadow: 0 0 40px rgba(42,114,245,0.5);
    animation: logoPulse 2.5s ease-in-out infinite;
    font-style: italic;
}

.loader-text {
    margin-top: 56px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-3);
    letter-spacing: 3px;
    text-transform: uppercase;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes logoPulse {
    0%,100% { box-shadow: 0 0 28px rgba(42,114,245,0.45); }
    50%      { box-shadow: 0 0 56px rgba(42,114,245,0.75); }
}

/* ── App shell ────────────────────────────────── */
.app {
    position: fixed; inset: 0; z-index: 1;
    display: flex; flex-direction: column;
}
.app.hidden { display: none; }

/* ── Tab content ──────────────────────────────── */
.tab-content { display: none; flex: 1; position: relative; overflow: hidden; }
.tab-content.active { display: flex; flex-direction: column; }

/* ── Scroll ───────────────────────────────────── */
.page-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 14px calc(var(--nav-h) + var(--safe-b) + 16px);
    -webkit-overflow-scrolling: touch;
}
.page-scroll::-webkit-scrollbar { display: none; }

/* ── Glass card ───────────────────────────────── */
.glass-card {
    background: var(--card);
    border: 1px solid var(--card-b);
    border-radius: 18px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

/* ── Page header ──────────────────────────────── */
.page-header { padding: 22px 4px 14px; }

.page-title {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -1px;
    color: #fff;
    text-shadow: 0 2px 24px rgba(42,114,245,0.3);
}

.page-desc { font-size: 14px; color: var(--text-2); margin-top: 4px; }

/* ── HOME: hero ───────────────────────────────── */
.home-hero { padding: 28px 4px 18px; }

.hero-logo {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 10px;
    line-height: 1;
}

.hero-logo-vpn {
    font-size: 52px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: -2px;
    color: #fff;
    text-shadow: 0 0 40px rgba(42,114,245,0.6), 0 2px 0 rgba(0,0,0,0.3);
    line-height: 1;
}

.hero-logo-brand {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 3.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    margin-top: 2px;
    padding-left: 3px;
}

.hero-title {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -1.5px;
    color: #fff;
    line-height: 1.15;
    text-shadow: 0 2px 32px rgba(42,114,245,0.3);
}

.hero-sub { font-size: 15px; color: var(--text-2); margin-top: 6px; }

/* ── HOME: status card ────────────────────────── */
.status-card {
    background: linear-gradient(135deg, rgba(26,77,179,0.45), rgba(13,29,92,0.55));
    border: 1px solid rgba(74,143,255,0.28);
    border-radius: 22px;
    padding: 20px;
    margin-bottom: 12px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 4px 32px rgba(26,77,179,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}

.status-card-header { display: flex; align-items: center; gap: 14px; }

.status-icon-wrap {
    width: 50px; height: 50px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--blue-2), var(--blue-3));
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(42,114,245,0.4);
}

.status-label { font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; }
.status-value { font-size: 19px; font-weight: 900; margin-top: 3px; letter-spacing: -0.5px; }

.status-badge {
    margin-left: auto;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.3px;
}
.status-badge.active  { background: rgba(61,232,160,0.15); color: var(--green); border: 1px solid rgba(61,232,160,0.3); }
.status-badge.expired { background: rgba(255,107,107,0.15); color: var(--red);   border: 1px solid rgba(255,107,107,0.3); }
.status-badge.none    { background: rgba(255,255,255,0.06); color: var(--text-2); border: 1px solid rgba(255,255,255,0.1); }

.status-progress-wrap { margin-top: 16px; }
.status-progress-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow: hidden; }
.status-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--blue-3), var(--green));
    transition: width 1s cubic-bezier(0.22,1,0.36,1);
    box-shadow: 0 0 10px rgba(61,232,160,0.4);
}
.status-progress-label { display: flex; justify-content: space-between; margin-top: 7px; font-size: 12px; color: var(--text-2); }

/* ── HOME: stats row ──────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 20px; }

.stat-chip {
    background: var(--card);
    border: 1px solid var(--card-b);
    border-radius: 16px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: transform 0.15s, border-color 0.15s;
}
.stat-chip:active { transform: scale(0.94); border-color: rgba(74,143,255,0.3); }
.stat-chip-val { font-size: 24px; font-weight: 900; color: #fff; letter-spacing: -1px; }
.stat-chip-lbl { font-size: 10px; color: var(--text-2); margin-top: 5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── HOME: section title ──────────────────────── */
.section-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 10px;
}

/* ── HOME: quick actions ──────────────────────── */
.quick-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }

.qa-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--card);
    border: 1px solid var(--card-b);
    border-radius: 18px;
    cursor: pointer;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.qa-card:active { transform: scale(0.97); border-color: rgba(74,143,255,0.25); background: var(--card-h); }

.qa-icon {
    width: 42px; height: 42px;
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.qa-title { flex: 1; font-size: 15px; font-weight: 800; }
.qa-arrow { font-size: 22px; color: var(--text-3); }

/* ── HOME: promo banner ───────────────────────── */
.promo-banner {
    display: flex;
    align-items: center;
    padding: 17px 20px;
    background: linear-gradient(135deg, rgba(255,209,102,0.12), rgba(255,160,30,0.08));
    border: 1px solid rgba(255,209,102,0.22);
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.15s;
    margin-bottom: 8px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}
.promo-banner:active { transform: scale(0.97); }
.promo-banner-text { flex: 1; }
.promo-banner-title { font-size: 15px; font-weight: 900; }
.promo-banner-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.promo-banner-arrow { font-size: 22px; color: var(--gold); font-weight: 700; }

/* ── Bottom nav ───────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(var(--nav-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    display: flex;
    align-items: stretch;
    background: rgba(7,13,42,0.88);
    border-top: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    z-index: 100;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s;
    padding-bottom: 4px;
    position: relative;
    letter-spacing: 0.2px;
}
.nav-btn .nav-ico { width: 22px; height: 22px; transition: transform 0.25s cubic-bezier(0.34,1.5,0.64,1); }
.nav-btn.active { color: #fff; }
.nav-btn.active .nav-ico { transform: scale(1.18) translateY(-2px); filter: drop-shadow(0 0 6px rgba(74,143,255,0.7)); }
.nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 32px; height: 2.5px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--blue-3), var(--accent));
    box-shadow: 0 0 10px rgba(74,143,255,0.6);
}

/* ── Configurator ─────────────────────────────── */
.configurator { display: flex; flex-direction: column; gap: 12px; }
.config-section { padding: 18px; }
.config-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.config-label-text { font-size: 13px; font-weight: 800; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.6px; }
.config-value { font-size: 28px; font-weight: 900; color: #fff; letter-spacing: -1px; }

.custom-range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.12); outline: none; }
.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-2), var(--blue-3));
    border: 3px solid #fff;
    box-shadow: 0 2px 12px rgba(42,114,245,0.55);
    cursor: pointer;
    transition: transform 0.15s;
}
.custom-range::-webkit-slider-thumb:active { transform: scale(1.2); }
.custom-range::-moz-range-thumb { width:26px;height:26px;border-radius:50%;background:linear-gradient(135deg,var(--blue-2),var(--blue-3));border:3px solid #fff;cursor:pointer; }

.range-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); font-weight: 700; margin-top: 7px; }

.duration-tabs { display: flex; gap: 5px; background: rgba(0,0,0,0.2); border-radius: 13px; padding: 4px; }
.dur-tab {
    flex: 1; padding: 10px 4px;
    border: none; border-radius: 10px;
    background: transparent;
    color: var(--text-2);
    font-size: 12px; font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center; line-height: 1.3;
    letter-spacing: 0.2px;
}
.dur-tab.active {
    background: linear-gradient(135deg, var(--blue-2), var(--blue-3));
    color: #fff;
    box-shadow: 0 2px 12px rgba(42,114,245,0.4);
}
.dur-tab .dur-save { display: block; font-size: 10px; color: var(--gold); margin-top: 2px; }
.dur-tab.active .dur-save { color: #ffe08a; }

.price-card { padding: 26px 20px; text-align: center; position: relative; overflow: hidden; }
.price-glow {
    position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
    width: 240px; height: 200px;
    background: radial-gradient(circle, rgba(42,114,245,0.18), transparent 70%);
    pointer-events: none;
}
.price-main {
    font-size: 46px; font-weight: 900; letter-spacing: -2.5px;
    color: #fff;
    text-shadow: 0 0 40px rgba(42,114,245,0.4);
}
.price-main.animate { animation: priceUpdate 0.28s ease; }
@keyframes priceUpdate { 0%{transform:scale(1)} 40%{transform:scale(1.07)} 100%{transform:scale(1)} }

.price-per-month { font-size: 14px; color: var(--text-2); margin-top: 4px; font-weight: 600; }
.price-alts { display: flex; justify-content: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.price-alt-chip {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; padding: 5px 14px;
    font-size: 13px; color: var(--text-2); font-weight: 700;
}
.sale-badge { margin-top: 12px; padding: 7px 14px; background: rgba(255,209,102,0.1); border: 1px solid rgba(255,209,102,0.22); border-radius: 10px; font-size: 13px; font-weight: 800; color: var(--gold); }
.sale-badge.hidden { display: none; }
.price-unavailable { font-size: 14px; color: var(--text-3); padding: 16px; }

.promo-section { display: flex; flex-direction: column; gap: 8px; }
.promo-toggle { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; cursor: pointer; font-size: 14px; font-weight: 700; transition: background 0.15s; }
.promo-toggle:active { background: var(--card-h); }
.promo-arrow { font-size: 20px; color: var(--text-3); transition: transform 0.2s; }
.promo-arrow.open { transform: rotate(90deg); }

.promo-input-wrap { display: flex; gap: 8px; padding: 12px; background: var(--card); border: 1px solid var(--card-b); border-radius: 16px; backdrop-filter: blur(24px); }
.promo-input-wrap.hidden { display: none; }
.promo-input { flex:1;padding:10px 14px;background:rgba(0,0,0,0.3);border:1px solid rgba(255,255,255,0.1);border-radius:12px;color:#fff;font-size:15px;font-weight:800;text-transform:uppercase;letter-spacing:1px;outline:none;transition:border-color 0.2s; }
.promo-input:focus { border-color: var(--accent); }
.promo-input::placeholder { color: var(--text-3); text-transform: none; letter-spacing: 0; font-weight: 400; }
.promo-apply-btn { padding: 10px 18px; background: linear-gradient(135deg, var(--blue-2), var(--blue-3)); border: none; border-radius: 12px; color: #fff; font-size: 14px; font-weight: 900; cursor: pointer; transition: opacity 0.15s; }
.promo-apply-btn:active { opacity: 0.8; }
.promo-result { padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 800; }
.promo-result.hidden { display: none; }
.promo-result.success { background: rgba(61,232,160,0.1); border: 1px solid rgba(61,232,160,0.22); color: var(--green); }
.promo-result.error   { background: rgba(255,107,107,0.1); border: 1px solid rgba(255,107,107,0.22); color: var(--red); }

/* CTA button */
.cta-btn {
    width: 100%; padding: 16px;
    border: none; border-radius: 16px;
    font-size: 16px; font-weight: 900;
    cursor: pointer;
    background: linear-gradient(135deg, var(--blue-2) 0%, var(--blue-3) 100%);
    color: #fff; text-align: center;
    transition: opacity 0.15s, transform 0.15s;
    box-shadow: 0 6px 28px rgba(26,93,212,0.45);
    position: relative; overflow: hidden;
    letter-spacing: -0.3px;
}
.cta-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    animation: shimmer 3.5s ease infinite;
}
@keyframes shimmer { 0%{left:-100%} 100%{left:220%} }
.cta-btn:active { opacity: 0.88; transform: scale(0.98); }
.cta-btn:disabled { opacity: 0.28; cursor: not-allowed; transform: none; box-shadow: none; }
.cta-btn:disabled::after { display: none; }
.cta-btn.gift-cta { background: linear-gradient(135deg, #e08c00, #f5b800); box-shadow: 0 6px 28px rgba(200,130,0,0.4); }

/* ── Subscriptions ────────────────────────────── */
.subs-list { display: flex; flex-direction: column; gap: 10px; }
.sub-card {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px;
    background: var(--card); border: 1px solid var(--card-b); border-radius: 18px;
    cursor: pointer; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.sub-card:active { transform: scale(0.97); border-color: rgba(74,143,255,0.25); background: var(--card-h); }
.sub-status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 8px currentColor; }
.sub-status-dot.active  { background: var(--green); color: var(--green); }
.sub-status-dot.expired { background: var(--red);   color: var(--red); }
.sub-info { flex: 1; }
.sub-name { font-size: 15px; font-weight: 800; }
.sub-meta { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.sub-days { font-size: 14px; font-weight: 800; white-space: nowrap; color: var(--text-2); }
.sub-days.warning { color: var(--gold); }
.sub-days.danger  { color: var(--red); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty-state .cta-btn { margin-top: 20px; }

/* Sub detail */
.sub-detail-panel {
    position: absolute; inset: 0;
    background: linear-gradient(170deg, #091540 0%, #0c1b52 60%, #091540 100%);
    z-index: 10; display: flex; flex-direction: column;
    animation: slideIn 0.3s cubic-bezier(0.22,1,0.36,1);
}
.sub-detail-panel.hidden { display: none; }
@keyframes slideIn { from{transform:translateX(100%)} to{transform:translateX(0)} }

.detail-header { display: flex; align-items: center; gap: 12px; padding: 16px 16px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }

.back-icon-btn {
    width: 36px; height: 36px; border-radius: 11px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.06);
    color: var(--text); display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0; transition: background 0.15s;
}
.back-icon-btn:active { background: rgba(255,255,255,0.13); }

.detail-card { padding: 6px 0; }
.detail-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-2); font-weight: 600; }
.detail-status { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.detail-status-dot { width: 8px; height: 8px; border-radius: 50%; }
.detail-status-dot.active  { background: var(--green); }
.detail-status-dot.expired { background: var(--red); }

.link-box {
    margin: 4px 0; padding: 14px 16px;
    background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px;
    word-break: break-all; font-family: 'SF Mono','Fira Code',monospace;
    font-size: 12px; color: var(--accent); line-height: 1.5;
}

.action-btn {
    display: block; width: 100%; padding: 14px;
    border: none; border-radius: 14px; font-size: 15px; font-weight: 800;
    cursor: pointer; background: linear-gradient(135deg, var(--blue-2), var(--blue-3));
    color: #fff; text-align: center; transition: opacity 0.15s, transform 0.15s;
    box-shadow: 0 4px 20px rgba(26,93,212,0.35);
}
.action-btn:active { opacity: 0.85; transform: scale(0.98); }
.action-btn.secondary { background: var(--card); border: 1px solid var(--card-b); color: var(--text); box-shadow: none; }
.btn-row { display: flex; gap: 8px; }
.btn-row .action-btn { flex: 1; }

/* ── Referral ─────────────────────────────────── */
.ref-link-card { padding: 20px; margin-bottom: 12px; }
.ref-link-label { font-size: 11px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.ref-link-val { font-family: 'SF Mono','Fira Code',monospace; font-size: 13px; color: var(--accent); word-break: break-all; line-height: 1.5; margin-bottom: 14px; font-weight: 600; }
.ref-link-actions { display: flex; gap: 8px; }
.ref-btn { flex:1; display:flex; align-items:center; justify-content:center; gap:6px; padding:11px; border-radius:12px; font-size:13px; font-weight:800; cursor:pointer; border:none; transition:opacity 0.15s,transform 0.15s; }
.ref-btn:active { opacity: 0.8; transform: scale(0.97); }
.ref-btn-copy { background: rgba(255,255,255,0.07); color: var(--text); border: 1px solid rgba(255,255,255,0.12); }
.ref-btn-share { background: linear-gradient(135deg, var(--blue-2), var(--blue-3)); color: #fff; box-shadow: 0 4px 16px rgba(26,93,212,0.35); }

.ref-stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 20px; }
.ref-stat { padding: 16px 10px; text-align: center; }
.ref-stat-val { font-size: 24px; font-weight: 900; color: #fff; letter-spacing: -1px; }
.ref-stat-val.green { color: var(--green); }
.ref-stat-val.gold  { color: var(--gold); }
.ref-stat-lbl { font-size: 10px; color: var(--text-2); margin-top: 5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

.ref-conditions { display: flex; flex-direction: column; gap: 8px; }
.ref-cond-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.ref-cond-icon { font-size: 22px; width: 42px; height: 42px; border-radius: 12px; background: rgba(42,114,245,0.12); border: 1px solid rgba(42,114,245,0.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ref-cond-title { font-size: 14px; font-weight: 800; }
.ref-cond-desc  { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ── Referral: withdraw card ─────────────────── */
.ref-withdraw-card { padding: 18px 20px; margin-bottom: 20px; }
.ref-withdraw-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.ref-withdraw-title { font-size: 15px; font-weight: 900; }
.ref-withdraw-sub { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.ref-balance-badge { font-size: 22px; font-weight: 900; color: var(--gold); letter-spacing: -0.5px; }
.ref-withdraw-progress-wrap { margin-bottom: 14px; }
.ref-withdraw-bar { height: 6px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.ref-withdraw-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #10b981); transition: width 0.6s ease; }
.ref-withdraw-labels { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-3); }
.ref-pending-chip { color: var(--gold); font-weight: 700; }
.ref-withdraw-btn { margin-top: 0; font-size: 14px; }
.ref-withdraw-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Referral: history ───────────────────────── */
.ref-history-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.ref-history-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 28px 16px; line-height: 1.6; }
.ref-history-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.ref-history-left { display: flex; flex-direction: column; gap: 3px; }
.ref-history-type { font-size: 13px; font-weight: 800; }
.ref-history-date { font-size: 11px; color: var(--text-3); }
.ref-hold-note { color: var(--gold); margin-left: 6px; }
.ref-history-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ref-history-amount { font-size: 15px; font-weight: 900; color: var(--green); }
.ref-history-status { font-size: 11px; font-weight: 700; }
.ref-status-pending   { color: var(--gold); }
.ref-status-available { color: var(--green); }
.ref-status-withdrawn { color: var(--text-3); }

/* ── More ─────────────────────────────────────── */
.more-list { display: flex; flex-direction: column; gap: 8px; }
.more-item { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; transition: transform 0.15s, background 0.15s, border-color 0.15s; }
.more-item:active { transform: scale(0.97); background: var(--card-h); border-color: rgba(74,143,255,0.2); }
.more-icon { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; box-shadow: 0 4px 14px rgba(0,0,0,0.3); }
.more-text { flex: 1; }
.more-title { font-size: 15px; font-weight: 800; }
.more-desc  { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.more-arrow { font-size: 22px; color: var(--text-3); }

.sub-panel {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    background: linear-gradient(170deg, #091540 0%, #0c1b52 60%, #091540 100%);
    z-index: 10; animation: slideIn 0.3s cubic-bezier(0.22,1,0.36,1);
}
.sub-panel.hidden { display: none; }

.gift-intro { font-size: 14px; color: var(--text-2); margin-bottom: 16px; line-height: 1.5; text-align: center; padding: 0 4px; font-weight: 600; }

.bonus-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.bonus-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; }
.bonus-ico { font-size: 22px; width: 44px; height: 44px; border-radius: 12px; background: rgba(42,114,245,0.1); border: 1px solid rgba(42,114,245,0.18); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bonus-item b { font-size: 14px; font-weight: 800; display: block; margin-bottom: 3px; }
.bonus-item p { font-size: 12px; color: var(--text-2); line-height: 1.4; }

.help-steps { display: flex; flex-direction: column; gap: 8px; }
.help-step { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; }
.step-num { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--blue-2), var(--blue-3)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 16px; flex-shrink: 0; box-shadow: 0 4px 12px rgba(26,93,212,0.4); }
.help-step b { font-size: 14px; font-weight: 800; display: block; margin-bottom: 3px; }
.help-step p { font-size: 12px; color: var(--text-2); line-height: 1.4; margin-top: 3px; }

.apps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.app-item { display: flex; align-items: center; gap: 12px; padding: 14px; }
.app-item > span { font-size: 24px; width: 36px; text-align: center; flex-shrink: 0; }
.app-item b { font-size: 13px; font-weight: 800; display: block; }
.app-item > div > span { font-size: 11px; color: var(--text-2); }

.legal-links { display: flex; flex-direction: column; gap: 8px; }
.legal-link { display: flex; align-items: center; gap: 12px; padding: 14px 18px; text-decoration: none; color: var(--text); font-size: 14px; font-weight: 700; transition: background 0.15s; }
.legal-link:active { background: var(--card-h); }
.legal-link > span:first-child { font-size: 20px; flex-shrink: 0; }
.legal-link > span:nth-child(2) { flex: 1; }
.legal-arrow { font-size: 16px; color: var(--accent); font-weight: 900; }

/* ── Toast ────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
    left: 50%; transform: translateX(-50%) translateY(10px);
    background: rgba(9,21,64,0.95);
    border: 1px solid rgba(74,143,255,0.25);
    color: #fff; padding: 11px 24px;
    border-radius: 24px; font-size: 14px; font-weight: 800;
    opacity: 0; transition: opacity 0.25s, transform 0.25s;
    pointer-events: none; z-index: 200; white-space: nowrap;
    box-shadow: 0 4px 24px rgba(26,93,212,0.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Payment screen ───────────────────────────── */
.pay-screen {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--bg);
    display: flex;
    flex-direction: column;
}

.pay-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.pay-step {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px calc(32px + var(--safe-b));
    -webkit-overflow-scrolling: touch;
}
.pay-step::-webkit-scrollbar { display: none; }

.pay-plan-info {
    padding: 16px;
    margin-bottom: 20px;
}

.pay-methods {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pay-method-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: none;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.15s, transform 0.12s;
    border-radius: 18px;
    background: var(--card);
    border: 1px solid var(--card-b);
}
.pay-method-btn:active { transform: scale(0.97); }
.pay-method-btn:disabled { opacity: 0.5; }

.pay-method-icon { font-size: 22px; flex-shrink: 0; }

.pay-method-info { flex: 1; }
.pay-method-label { font-size: 15px; font-weight: 700; color: #fff; }
.pay-method-price { font-size: 13px; color: var(--text-2); margin-top: 2px; }

.pay-method-arrow { font-size: 22px; color: var(--text-3); }

.pay-pending-card, .pay-success-card {
    padding: 28px 20px;
    text-align: center;
    margin-bottom: 20px;
    border-radius: 22px;
}
.pay-pending-icon, .pay-success-icon { font-size: 48px; margin-bottom: 12px; }
.pay-pending-title, .pay-success-title {
    font-size: 20px; font-weight: 900; margin-bottom: 6px;
}
.pay-pending-sub { font-size: 14px; color: var(--text-2); }
.pay-amount { font-size: 28px; font-weight: 900; color: var(--accent); margin-top: 10px; }

.cta-btn-secondary {
    background: rgba(255,255,255,0.07);
    color: var(--text-2);
    box-shadow: none;
    margin-top: 10px;
}
.cta-btn-secondary:active { background: rgba(255,255,255,0.12); }

.pay-status-msg {
    text-align: center;
    font-size: 13px;
    color: var(--text-2);
    margin-top: 12px;
    min-height: 18px;
}

.pay-success-sub { font-size: 14px; color: var(--text-2); }

/* ── Fatal error overlay ──────────────────────── */
.fatal-error {
    position: fixed;
    inset: 0;
    background: #0b0d12;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 99998;
    text-align: center;
}
.fatal-error-icon { font-size: 56px; margin-bottom: 16px; }
.fatal-error-title { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.fatal-error-sub { font-size: 14px; color: #9ca3af; margin-bottom: 24px; max-width: 320px; line-height: 1.4; }
.fatal-error-btn {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    min-width: 200px;
}
.fatal-error-link {
    color: #6366f1;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
}

/* ── Utility ──────────────────────────────────── */
.hidden { display: none !important; }
.green  { color: var(--green); }
.gold   { color: var(--gold); }
