/* ==========================================================================
   🎨 VPN ONLINE - PREMIUM FUTURISTIC STYLESHEET (v5.0.0)
   Based on new format: Dark Theme with Video Background & Glassmorphism
   ========================================================================== */

:root {
    /* Core tokens from new format */
    --bg: #07050f;
    --surface: #120c24;
    --text: #f5f2ff;
    --text-muted: #9c93be;
    --accent: #a66bff;
    --accent-2: #7c3aed;
    --on-accent: #ffffff;
    --border: rgba(166, 107, 255, 0.22);
    
    /* Extended cabinet UI tokens */
    --surface-card: rgba(18, 12, 36, 0.78);
    --surface-input: rgba(7, 5, 15, 0.7);
    --border-hover: rgba(166, 107, 255, 0.5);
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --video-overlay: radial-gradient(rgba(0, 0, 0, 0.35) 1px, transparent 1px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    font-family: 'Manrope', 'Inter', sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all var(--transition-fast);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.screen {
    position: relative;
    width: 100%;
    min-height: 100dvh;
    min-height: 100svh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   🎬 VIDEO BACKGROUND & SCRIM
   ========================================================================== */
.bg-video {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    background: #0a0b10;
}

.bg-video video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0.85;
}

@media (max-width: 899px) {
    .bg-video video {
        object-fit: cover;
        transform: translate(-50%, -50%) scale(1.0);
    }
}

.scrim-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 160px;
    background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 85%, transparent), transparent);
    z-index: 1;
    pointer-events: none;
}

/* ==========================================================================
   🚀 TOP NAV
   ========================================================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left));
    transition: background 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.brand svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.brand-word {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: var(--text);
    white-space: nowrap;
    letter-spacing: -0.3px;
}

.brand-word span {
    font-weight: 400;
    color: var(--accent);
}

.nav-links {
    display: none;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 100px;
    background: color-mix(in srgb, var(--surface) 75%, transparent);
    border: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 11px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 15%, transparent);
}

.nav-links a svg,
.nav-links a i {
    width: 14px;
    height: 14px;
    font-size: 14px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-links a.cta {
    color: var(--on-accent);
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    box-shadow: 0 4px 15px rgba(166, 107, 255, 0.35);
}

.nav-links a.cta:hover {
    color: var(--on-accent);
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    opacity: 0.92;
    transform: translateY(-1px);
}

@media (min-width: 900px) and (max-width: 1340px) {
    .nav-links {
        gap: 4px;
        padding: 6px 8px;
    }
    .nav-links a {
        padding: 9px 13px;
        font-size: 13px;
        gap: 6px;
    }
    .nav-links a svg {
        width: 15px;
        height: 15px;
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge-nav {
    display: none;
    align-items: center;
    gap: 10px;
    background: color-mix(in srgb, var(--surface) 75%, transparent);
    border: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 6px 6px 6px 14px;
    border-radius: 100px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

body:has(#cabinet-screen.active) .user-badge-nav {
    display: flex;
}

.user-email-pill {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout-nav {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-logout-nav:hover {
    background: var(--color-danger);
    color: #fff;
    transform: scale(1.05);
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--surface) 75%, transparent);
    border: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.menu-toggle:hover {
    transform: scale(1.05);
}

.menu-toggle svg {
    width: 18px;
    height: 18px;
    stroke: var(--text);
}

@media (min-width: 900px) {
    .nav-links {
        display: flex;
    }
    .menu-toggle {
        display: none;
    }
}

/* ==========================================================================
   📱 SLIDE-IN MENU PANEL
   ========================================================================== */
.menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    height: 100svh;
    width: min(340px, 86vw);
    background: var(--surface);
    border-left: 1px solid var(--border);
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: max(18px, env(safe-area-inset-top)) 18px 18px;
    overflow-y: auto;
    box-shadow: -15px 0 35px rgba(0, 0, 0, 0.5);
}

body.menu-open .menu-backdrop {
    opacity: 1;
    pointer-events: auto;
}

body.menu-open .menu-panel {
    transform: translateX(0);
}

.menu-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.menu-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.menu-close:hover {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
}

.menu-close svg {
    width: 16px;
    height: 16px;
    stroke: var(--text);
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    transition: background var(--transition-fast);
}

.menu-item:hover {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.menu-item .ico {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-item .ico svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent);
}

.menu-item.cta {
    margin-top: 10px;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: var(--on-accent);
    justify-content: center;
    box-shadow: 0 8px 20px rgba(166, 107, 255, 0.35);
}

.menu-item.cta .ico {
    display: none;
}

.menu-footer {
    margin-top: auto;
    padding-top: 18px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   💫 HERO SECTION
   ========================================================================== */
.hero {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: max(110px, 14vh) 20px 24px;
    gap: 16px;
}

.hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(28px, 5.5vw, 46px);
    font-weight: 700;
    color: var(--text);
    line-height: 1.12;
    max-width: 22ch;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ==========================================================================
   🎮 MAIN APP CONTAINER & SECTIONS
   ========================================================================== */
.app-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   🔐 AUTH SCREEN (LOGIN & REGISTER)
   ========================================================================== */
#auth-screen {
    display: none;
}

#auth-screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(10, 5, 20, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 20px;
    animation: fadeInScale 0.3s ease;
    overflow-y: auto;
}

/* Inner auth card */
#auth-screen .auth-inner-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 38px 34px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
    position: relative;
    margin: auto;
}

@media (max-width: 500px) {
    #auth-screen .auth-inner-card {
        padding: 24px 18px !important;
        border-radius: var(--radius-md) !important;
        box-sizing: border-box !important;
    }
    
    .auth-header {
        margin-bottom: 18px !important;
    }
    
    #auth-title {
        font-size: 21px !important;
    }
    
    .support-banner {
        font-size: 11.5px !important;
        padding: 8px 10px !important;
        margin-bottom: 14px !important;
    }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.support-banner {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 22px;
    line-height: 1.5;
    text-align: center;
    color: var(--text-muted);
}

.support-banner a {
    color: var(--text);
    font-weight: 700;
}

.support-banner a:hover {
    color: var(--accent);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.logo i {
    color: var(--accent);
    font-size: 24px;
    filter: drop-shadow(0 0 10px rgba(166, 107, 255, 0.5));
}

#auth-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

#auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 18px;
}

.auth-form.active {
    display: flex;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    text-align: left;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-wrapper input {
    width: 100%;
    background: var(--surface-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px 14px 44px;
    color: var(--text);
    font-size: 14.5px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.input-wrapper input:focus + i,
.input-wrapper:focus-within i {
    color: var(--accent);
}

.toggle-password {
    position: absolute !important;
    left: auto !important;
    right: 16px;
    cursor: pointer;
    pointer-events: auto !important;
}

.toggle-password:hover {
    color: var(--text) !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 24px;
    border-radius: 100px;
    font-size: 14.5px;
    font-weight: 700;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: var(--on-accent);
    box-shadow: 0 10px 25px -8px color-mix(in srgb, var(--accent) 60%, transparent);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -6px color-mix(in srgb, var(--accent) 75%, transparent);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary {
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 15px;
    font-size: 13px;
    border-radius: 100px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 6px 0;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    padding: 0 14px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.telegram-login-wrapper {
    display: flex;
    justify-content: center;
    min-height: 40px;
}

.auth-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    color: var(--text-muted);
    margin-top: 6px;
}

.auth-footer-col {
    flex-direction: column;
    gap: 8px;
}

.auth-footer a {
    color: var(--accent);
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   💻 CABINET SCREEN (ACTION GRID & DASHBOARD)
   ========================================================================== */
#cabinet-screen {
    display: none;
    width: 100%;
    animation: fadeInScale 0.35s ease;
}

#cabinet-screen.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Hidden internal navbar inside cabinet screen since we use fixed top nav */
#cabinet-screen header.navbar {
    display: none !important;
}

.support-banner-cabinet {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13.5px;
    color: var(--text);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.support-banner-cabinet a {
    color: var(--accent);
    font-weight: 700;
}

.support-banner-tagline {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Action Panel Grid right from new design */
.action-panel {
    position: relative;
    z-index: 2;
    width: 100%;
    margin: 0 auto;
}

.action-panel-inner {
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.45);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 14px;
    border-radius: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    background: color-mix(in srgb, var(--accent) 12%, var(--bg));
    border-color: var(--border-hover);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn .ico {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-btn .ico svg {
    width: 17px;
    height: 17px;
    stroke: var(--accent);
}

.action-btn.primary {
    grid-column: 1 / -1;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: var(--on-accent);
    justify-content: center;
    border: none;
    font-size: 14.5px;
    padding: 15px;
    box-shadow: 0 8px 25px -6px color-mix(in srgb, var(--accent) 65%, transparent);
}

.action-btn.primary .ico {
    display: none;
}

@media (min-width: 640px) {
    .action-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .action-btn.primary {
        grid-column: auto;
    }
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

@media (min-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 360px 1fr;
    }
}

.col-left, .col-right {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.dashboard-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 15px 40px -12px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.card-glow {
    position: absolute;
    top: 0;
    right: 0;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 70%);
    pointer-events: none;
}

.balance-info {
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}

.card-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.balance-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 34px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.balance-value .currency {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
}

.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.card-title i {
    color: var(--accent);
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: color-mix(in srgb, var(--bg) 60%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    color: var(--text);
    font-weight: 700;
}

/* Keys Table Card */
.keys-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 22px;
}

.keys-header .card-title {
    margin-bottom: 0;
}

.keys-table-container {
    width: 100%;
    overflow-x: auto;
}

.keys-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.keys-table th {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.keys-table td {
    padding: 18px 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
    vertical-align: middle;
    font-size: 14px;
}

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

.keys-table tr:hover td {
    background: color-mix(in srgb, var(--accent) 6%, transparent);
}

/* Empty State inside table */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.empty-state i {
    font-size: 42px;
    color: var(--accent);
    opacity: 0.8;
}

.empty-state p {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Key items details */
.connection-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: monospace;
    font-size: 13px;
    max-width: 260px;
    transition: all var(--transition-fast);
}

.connection-copy-btn:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 15%, var(--bg));
}

.connection-copy-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.connection-copy-btn i {
    color: var(--accent);
    flex-shrink: 0;
}

.expiry-date {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.expiry-date .date {
    font-weight: 700;
    color: var(--text);
}

.expiry-date .days-left {
    font-size: 12px;
    color: var(--text-muted);
}

.expiry-date.expired .date,
.expiry-date.expired .days-left {
    color: var(--color-danger);
}

/* ==========================================================================
   🛒 MODALS & OVERLAYS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 5, 15, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.75);
    overflow: hidden;
    animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-sm {
    max-width: 420px;
}

@keyframes modalSlideUp {
    from { transform: translateY(24px) scale(0.96); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2, .modal-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i, .modal-header h3 i {
    color: var(--accent);
}

.btn-close-modal {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-close-modal:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 15%, transparent);
}

.modal-body {
    padding: 28px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 28px;
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 50%, transparent);
}

/* Plans container inside purchase modal */
.plans-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-item,
.plan-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: color-mix(in srgb, var(--surface) 60%, transparent);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.plan-item:hover,
.plan-card:hover {
    border-color: var(--border-hover);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    transform: translateY(-2px);
}

.plan-item.active,
.plan-card.active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 22%, var(--surface));
    box-shadow: 0 0 24px -4px color-mix(in srgb, var(--accent) 60%, transparent);
    transform: scale(1.015);
}

/* Checkmark badge for active plan */
.plan-item.active::before,
.plan-card.active::before {
    content: "\f058";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: -9px;
    right: 14px;
    background: var(--accent);
    color: var(--on-accent);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.plan-item-info,
.plan-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-item-info h4,
.plan-info .plan-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.plan-item-info p,
.plan-info .plan-duration {
    font-size: 13px;
    color: var(--text-muted);
}

.plan-item-price,
.plan-price {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.plan-price .currency {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Payment Method Cards */
.payment-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pay-method-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 12px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: center;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.pay-method-card i {
    font-size: 24px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.pay-method-card:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.pay-method-card.active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, var(--bg));
    color: var(--text);
}

.pay-method-card.active i {
    color: var(--accent);
}

/* Howto Modal Tabs */
.tabs-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    flex: 0 0 auto;
    min-height: 48px;
    width: 100%;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 100px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--surface) 60%, transparent);
    border: 1.5px solid var(--border);
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
    flex: 0 0 auto;
    min-height: 38px;
    user-select: none;
    -webkit-user-select: none;
}

.tab-btn:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    border-color: var(--border-hover);
}

.tab-btn.active {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: var(--on-accent);
    border-color: transparent;
}

.tab-contents {
    flex: 1 1 auto;
    width: 100%;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.howto-steps {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.howto-steps li strong {
    color: var(--text);
}

.howto-steps ul {
    margin-top: 6px;
    padding-left: 18px;
    list-style: disc;
}

.howto-steps a {
    color: var(--accent);
    font-weight: 600;
}

.howto-steps a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   🍞 MICRO-TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 20px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-success { border-color: var(--color-success); }
.toast-success i { color: var(--color-success); }

.toast-danger { border-color: var(--color-danger); }
.toast-danger i { color: var(--color-danger); }

.toast-warning { border-color: var(--color-warning); }
.toast-warning i { color: var(--color-warning); }

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   📱 RESPONSIVE ADAPTATIONS
   ========================================================================== */
@media (max-width: 639px) {
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .keys-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .payment-methods {
        grid-template-columns: 1fr;
    }
    .keys-table thead {
        display: none;
    }
    .keys-table, .keys-table tbody, .keys-table tr, .keys-table td {
        display: block;
        width: 100%;
    }
    .keys-table tr {
        margin-bottom: 16px;
        background: color-mix(in srgb, var(--bg) 60%, transparent);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 12px;
    }
    .keys-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 4px;
        border-bottom: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
    }
    .keys-table td:last-child {
        border-bottom: none;
        padding-top: 14px;
        justify-content: flex-end;
    }
    .keys-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 12.5px;
    }
    .connection-copy-btn {
        max-width: 180px;
    }
}

/* ==========================================================================
   📱 MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 25;
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom)) 12px;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.bottom-nav-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--accent);
}

.bottom-nav-item:hover svg,
.bottom-nav-item.active svg {
    transform: scale(1.1) translateY(-1px);
    stroke: var(--accent);
}

/* Responsive bottom nav trigger */
@media (max-width: 899px) {
    body:has(#cabinet-screen.active) .mobile-bottom-nav {
        display: flex;
    }
    .menu-toggle {
        display: none !important;
    }
    body:has(#cabinet-screen.active) .screen {
        padding-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
    }
}

/* ==========================================================================
   🌓 DYNAMIC LIGHT THEME VARIABLES & TOGGLE
   ========================================================================== */
[data-theme="light"] {
    --bg: #f5f3fa;
    --surface: rgba(255, 255, 255, 0.72);
    --text: #17132b;
    --text-muted: #534c6b;
    --accent: #7c4dff;
    --accent-2: #5b2fe0;
    --on-accent: #ffffff;
    --border: rgba(124, 77, 255, 0.28);
    --border-hover: rgba(124, 77, 255, 0.48);
    --surface-card: rgba(255, 255, 255, 0.95);
    --surface-input: rgba(240, 237, 248, 0.85);
    --video-overlay: radial-gradient(rgba(255, 255, 255, 0.45) 1px, transparent 1px);
}

/* Light theme high-readability enhancements for inputs and forms */
[data-theme="light"] .auth-inner-card, 
[data-theme="light"] .modal-card {
    background: #ffffff !important;
    border: 1px solid rgba(124, 77, 255, 0.3) !important;
    box-shadow: 0 20px 50px rgba(124, 77, 255, 0.12) !important;
}

[data-theme="light"] .auth-inner-card label,
[data-theme="light"] .modal-card label {
    color: #17132b !important;
    font-weight: 700 !important;
}

[data-theme="light"] .auth-inner-card input,
[data-theme="light"] .modal-card input {
    color: #17132b !important;
    background: #f1edf8 !important;
    border: 1px solid rgba(124, 77, 255, 0.2) !important;
    font-weight: 500 !important;
}

[data-theme="light"] .auth-inner-card input::placeholder,
[data-theme="light"] .modal-card input::placeholder {
    color: #8c85a6 !important;
}

[data-theme="light"] .auth-inner-card .auth-subtitle,
[data-theme="light"] .auth-inner-card p,
[data-theme="light"] .modal-card p,
[data-theme="light"] .modal-card .modal-desc {
    color: #4a4460 !important;
}

[data-theme="light"] .auth-inner-card .auth-header h1 {
    color: #17132b !important;
}

[data-theme="light"] .auth-inner-card .auth-footer span {
    color: #534c6b !important;
}

.theme-toggle {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: color-mix(in srgb, var(--surface) 90%, transparent) !important;
    border: 1.5px solid var(--border) !important;
    color: var(--text) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all var(--transition-fast) !important;
    flex-shrink: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.theme-toggle:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background: color-mix(in srgb, var(--accent) 15%, var(--surface)) !important;
    transform: scale(1.08) !important;
}

.theme-toggle i {
    font-size: 19px !important;
}

/* ==========================================================================
   🎁 VIDEO TRIAL OVERLAY BUTTON
   ========================================================================== */
.video-trial-overlay-btn {
    position: fixed !important;
    bottom: min(38px, 4.6vh) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 25 !important;
    width: 330px !important;
    height: 64px !important;
    font-size: 17px !important;
    border-radius: 100px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    cursor: pointer !important;
    justify-content: center !important;
    
    background: rgba(166, 107, 255, 0.05) !important;
    border: 2px solid rgba(166, 107, 255, 0.3) !important;
    box-shadow: 0 0 25px rgba(166, 107, 255, 0.3) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    
    transition: all 0.3s ease !important;
}

.video-trial-overlay-btn:hover {
    background: rgba(166, 107, 255, 0.2) !important;
    border-color: rgba(166, 107, 255, 0.8) !important;
    box-shadow: 0 0 40px rgba(166, 107, 255, 0.7) !important;
    transform: translateX(-50%) scale(1.06) !important;
}

/* Hide button when overlay is open or login is shown to prevent overlaps */
body:has(.modal-overlay.active) .video-trial-overlay-btn,
body:has(#auth-screen.active) .video-trial-overlay-btn {
    opacity: 0 !important;
    pointer-events: none !important;
}

@media (max-width: 899px) {
    .video-trial-overlay-btn {
        bottom: 176px !important;
        width: 168px !important;
        height: 38px !important;
        padding: 0 !important;
        font-size: 11px !important;
        gap: 6px !important;
        border-width: 1px !important;
    }
}

/* ==========================================================================
   📱 TELEGRAM WEBAPP VIEW MODIFICATIONS
   ========================================================================== */
body.telegram-webapp .btn-logout-nav {
    display: none !important;
}

body.telegram-webapp .user-badge-nav {
    padding: 6px 14px !important;
}

body.telegram-webapp #profile-modal .modal-footer .btn-secondary {
    display: none !important;
}

/* ==========================================================================
   🔒 UNAUTHENTICATED STATE — HIDE NAV ITEMS
   ========================================================================== */
/* Hide all nav links when login screen is active */
body:has(#auth-screen.active) .nav .nav-links {
    display: none !important;
}

/* Hide user badge and logout button */
body:has(#auth-screen.active) .user-badge-nav {
    display: none !important;
}

/* Keep brand + theme toggle visible, but hide menu toggle on mobile */
body:has(#auth-screen.active) .menu-toggle {
    display: none !important;
}

/* Hide mobile bottom navigation bar */
body:has(#auth-screen.active) .mobile-bottom-nav {
    display: none !important;
}

/* Hide video trial button on auth screen */
body:has(#auth-screen.active) .video-trial-overlay-btn {
    opacity: 0 !important;
    pointer-events: none !important;
}


