/* ==========================================================================
   VPN Tunnel Injector - Design System & Custom Properties
   ========================================================================== */
:root {
    /* Color Palette */
    --bg-dark: #090d16;
    --bg-card: rgba(18, 26, 43, 0.6);
    --bg-card-hover: rgba(28, 38, 62, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(0, 242, 254, 0.3);
    
    /* Neon Accents */
    --cyan-primary: #00f2fe;
    --cyan-secondary: #4facfe;
    --emerald-primary: #10b981;
    --emerald-glow: rgba(16, 185, 129, 0.4);
    --amber-connecting: #f59e0b;
    --amber-glow: rgba(245, 158, 11, 0.4);
    --red-disconnected: #ef4444;
    --red-glow: rgba(239, 68, 68, 0.3);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Shadows & Glows */
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glow-cyan: 0 0 25px rgba(0, 242, 254, 0.35);
    --glow-emerald: 0 0 30px rgba(16, 185, 129, 0.45);
    --glow-amber: 0 0 25px rgba(245, 158, 11, 0.4);
    --glow-red: 0 0 20px rgba(239, 68, 68, 0.25);

    /* Typography & Radius */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Background Ambient Glows */
.bg-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: floatOrb 18s infinite alternate ease-in-out;
}

.orb-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #00f2fe 0%, #4facfe 100%);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #10b981 0%, #059669 100%);
    bottom: -150px;
    right: -100px;
    animation-delay: -6s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #7c3aed 0%, #4f46e5 100%);
    top: 40%;
    left: 60%;
    animation-delay: -12s;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.4;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.1); }
    100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* Glassmorphism Panel Base */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-glass);
    border-radius: var(--radius-lg);
}

/* Layout App Container */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    padding: 20px;
    margin: 0 auto;
}

/* View Transition System */
.view {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.view.active-view {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   AUTHENTICATION VIEW (Login / Sign Up)
   ========================================================================== */
#auth-view {
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 40px);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.brand-header {
    text-align: center;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.brand-logo.sm {
    font-size: 20px;
    gap: 10px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-logo span {
    color: var(--text-primary);
    white-space: nowrap;
}

.brand-logo strong {
    background: linear-gradient(135deg, var(--cyan-primary), var(--cyan-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.brand-tagline {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 6px;
}

/* Auth Tabs Toggle */
.auth-tabs {
    position: relative;
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 4px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 0;
    cursor: pointer;
    z-index: 2;
    transition: color var(--transition-fast);
}

.tab-btn.active {
    color: var(--text-primary);
}

.tab-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(79, 172, 254, 0.2));
    border: 1px solid rgba(0, 242, 254, 0.4);
    border-radius: var(--radius-sm);
    transition: transform var(--transition-bounce);
    z-index: 1;
}

.auth-tabs[data-active="signup"] .tab-indicator {
    transform: translateX(100%);
}

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

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

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

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-wrapper input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px 12px 42px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrapper input:focus {
    border-color: var(--cyan-primary);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:focus ~ .input-icon {
    color: var(--cyan-primary);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    transition: color var(--transition-fast);
}

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

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 26px;
    cursor: pointer;
    color: var(--text-secondary);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--cyan-primary);
}

.checkbox-container input:checked ~ .checkmark {
    background: linear-gradient(135deg, var(--cyan-primary), var(--cyan-secondary));
    border-color: transparent;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.forgot-link, .checkbox-container a {
    color: var(--cyan-primary);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.forgot-link:hover, .checkbox-container a:hover {
    text-decoration: underline;
}

/* Primary Button */
.btn-primary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: linear-gradient(135deg, var(--cyan-primary), var(--cyan-secondary));
    border: none;
    border-radius: var(--radius-md);
    padding: 14px;
    color: #040914;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 242, 254, 0.3);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(0, 242, 254, 0.45);
}

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

.auth-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ==========================================================================
   DASHBOARD VIEW
   ========================================================================== */
#dashboard-view {
    gap: 20px;
}

/* Header */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-status-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--emerald-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 6px 14px;
    border-radius: var(--radius-full);
}

.user-status-tag.expired-tag {
    color: var(--red-disconnected);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.user-status-tag.expired-tag strong {
    color: var(--red-disconnected);
}

.expired-dot {
    background-color: var(--red-disconnected) !important;
    box-shadow: 0 0 8px var(--red-disconnected) !important;
}

/* Subscription modal must render above everything */
.subscription-backdrop {
    z-index: 9999;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--emerald-primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--emerald-primary);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--red-disconnected);
}

/* Dashboard Content Layout */
.dash-content {
    width: 100%;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}

/* Main Control Card */
.main-vpn-card {
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 480px;
    position: relative;
}

/* Status Pill */
.vpn-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all var(--transition-normal);
}

.status-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Status: Disconnected */
.vpn-status-pill.disconnected {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red-disconnected);
}

.vpn-status-pill.disconnected .status-indicator-dot {
    background: var(--red-disconnected);
    box-shadow: 0 0 8px var(--red-disconnected);
}

/* Status: Connecting / Fetching / Synchronizing */
.vpn-status-pill.connecting,
.vpn-status-pill.fetching,
.vpn-status-pill.synchronizing {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--amber-connecting);
}

.vpn-status-pill.connecting .status-indicator-dot,
.vpn-status-pill.fetching .status-indicator-dot,
.vpn-status-pill.synchronizing .status-indicator-dot {
    background: var(--amber-connecting);
    box-shadow: 0 0 10px var(--amber-connecting);
    animation: blink 0.7s infinite alternate;
}

/* Status: Connected */
.vpn-status-pill.connected {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--emerald-primary);
}

.vpn-status-pill.connected .status-indicator-dot {
    background: var(--emerald-primary);
    box-shadow: 0 0 10px var(--emerald-primary);
}

@keyframes blink {
    0% { opacity: 0.2; }
    100% { opacity: 1; }
}

/* Center Power Switch Component */
.vpn-switch-container {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

/* Pulse Rings */
.pulse-rings {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    opacity: 0;
    transition: all var(--transition-normal);
}

/* Disconnected Ring Pulse */
.pulse-rings.disconnected .ring-1 {
    border-color: rgba(239, 68, 68, 0.35);
    inset: -12px;
    opacity: 1;
    animation: ringPulseRed 2.5s infinite ease-in-out;
}

.pulse-rings.disconnected .ring-2 {
    border-color: rgba(239, 68, 68, 0.18);
    inset: -24px;
    opacity: 1;
    animation: ringPulseRed 2.5s infinite ease-in-out 0.4s;
}

/* Connecting / Fetching / Synchronizing Ring Animation */
.pulse-rings.connecting .ring,
.pulse-rings.fetching .ring,
.pulse-rings.synchronizing .ring,
.vpn-switch-container.connecting .ring,
.vpn-switch-container.fetching .ring,
.vpn-switch-container.synchronizing .ring {
    border-color: var(--amber-connecting);
    animation: ringExpand 2s infinite ease-out;
}

.pulse-rings.connecting .ring-1,
.pulse-rings.fetching .ring-1,
.pulse-rings.synchronizing .ring-1,
.vpn-switch-container.connecting .ring-1,
.vpn-switch-container.fetching .ring-1,
.vpn-switch-container.synchronizing .ring-1 { animation-delay: 0s; }

.pulse-rings.connecting .ring-2,
.pulse-rings.fetching .ring-2,
.pulse-rings.synchronizing .ring-2,
.vpn-switch-container.connecting .ring-2,
.vpn-switch-container.fetching .ring-2,
.vpn-switch-container.synchronizing .ring-2 { animation-delay: 0.6s; }

.pulse-rings.connecting .ring-3,
.pulse-rings.fetching .ring-3,
.pulse-rings.synchronizing .ring-3,
.vpn-switch-container.connecting .ring-3,
.vpn-switch-container.fetching .ring-3,
.vpn-switch-container.synchronizing .ring-3 { animation-delay: 1.2s; }

/* Connected Ring Glow */
.pulse-rings.connected .ring-1,
.vpn-switch-container.connected .ring-1 {
    border-color: rgba(16, 185, 129, 0.4);
    inset: -12px;
    opacity: 1;
    animation: ringPulseGreen 2.5s infinite ease-in-out;
}

.pulse-rings.connected .ring-2,
.vpn-switch-container.connected .ring-2 {
    border-color: rgba(16, 185, 129, 0.2);
    inset: -24px;
    opacity: 1;
    animation: ringPulseGreen 2.5s infinite ease-in-out 0.4s;
}

@keyframes ringExpand {
    0% {
        transform: scale(0.85);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

@keyframes ringPulseRed {
    0% {
        transform: scale(0.98);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.85;
    }
    100% {
        transform: scale(0.98);
        opacity: 0.3;
    }
}

@keyframes ringPulseGreen {
    0% {
        transform: scale(0.98);
        opacity: 0.35;
    }
    50% {
        transform: scale(1.06);
        opacity: 0.9;
    }
    100% {
        transform: scale(0.98);
        opacity: 0.35;
    }
}

/* Power Button */
.vpn-power-btn {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: linear-gradient(145deg, #182238, #0e1424);
    border: 3px solid var(--border-color);
    padding: 12px;
    cursor: pointer;
    outline: none;
    position: relative;
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.1);
    transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.power-btn-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(10, 15, 26, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background var(--transition-normal);
}

.power-icon {
    width: 60px;
    height: 60px;
    color: var(--text-muted);
    transition: color var(--transition-normal), filter var(--transition-normal);
}

/* Button State: Disconnected (Pulsing Red) */
.vpn-power-btn.disconnected {
    border-color: var(--red-disconnected);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.45), 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: pulseRedButton 2.2s infinite ease-in-out;
}

.vpn-power-btn.disconnected .power-btn-inner {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.14) 0%, rgba(10, 15, 26, 0.9) 80%);
}

.vpn-power-btn.disconnected .power-icon {
    color: var(--red-disconnected);
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.65));
}

.vpn-power-btn.disconnected:hover {
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.7), 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(1.04);
}

@keyframes pulseRedButton {
    0% {
        box-shadow: 0 0 16px rgba(239, 68, 68, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 35px rgba(239, 68, 68, 0.7), 0 0 15px rgba(239, 68, 68, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.2);
        transform: scale(1.035);
    }
    100% {
        box-shadow: 0 0 16px rgba(239, 68, 68, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
}

/* Button State: Connecting / Fetching / Synchronizing (Pulsing Amber/Yellow) */
.vpn-power-btn.connecting,
.vpn-power-btn.fetching,
.vpn-power-btn.synchronizing {
    border-color: var(--amber-connecting);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.6), 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: pulseAmberButton 1.5s infinite ease-in-out;
}

.vpn-power-btn.connecting .power-btn-inner,
.vpn-power-btn.fetching .power-btn-inner,
.vpn-power-btn.synchronizing .power-btn-inner {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, rgba(10, 15, 26, 0.9) 80%);
}

.vpn-power-btn.connecting .power-icon,
.vpn-power-btn.fetching .power-icon,
.vpn-power-btn.synchronizing .power-icon {
    color: var(--amber-connecting);
    filter: drop-shadow(0 0 12px var(--amber-connecting));
}

@keyframes pulseAmberButton {
    0% {
        box-shadow: 0 0 18px rgba(245, 158, 11, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 40px rgba(245, 158, 11, 0.75), 0 0 18px rgba(245, 158, 11, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.2);
        transform: scale(1.035);
    }
    100% {
        box-shadow: 0 0 18px rgba(245, 158, 11, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
}

/* Button State: Connected (Pulsing Green) */
.vpn-power-btn.connected {
    border-color: var(--emerald-primary);
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.6), 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: pulseGreenButton 2.2s infinite ease-in-out;
}

.vpn-power-btn.connected .power-btn-inner {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, rgba(10, 15, 26, 0.9) 80%);
}

.vpn-power-btn.connected .power-icon {
    color: var(--emerald-primary);
    filter: drop-shadow(0 0 14px rgba(16, 185, 129, 0.85));
}

.vpn-power-btn.connected:hover {
    transform: scale(1.04);
    box-shadow: 0 0 50px rgba(16, 185, 129, 0.8);
}

@keyframes pulseGreenButton {
    0% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 45px rgba(16, 185, 129, 0.8), 0 0 20px rgba(16, 185, 129, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.2);
        transform: scale(1.035);
    }
    100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
}

/* IP Info Box */
.ip-info-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.ip-row, .duration-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ip-value {
    font-family: monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.duration-value {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--cyan-primary);
}

/* Server Selector Card */
.server-selector-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    width: 100%;
    max-width: 380px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.server-selector-card:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--cyan-primary);
    box-shadow: 0 4px 16px rgba(0, 242, 254, 0.15);
}

.server-flag {
    font-size: 26px;
    line-height: 1;
}

.server-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.server-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
}

.server-city {
    color: var(--text-secondary);
    font-weight: 400;
}

.server-latency {
    font-size: 12px;
    color: var(--emerald-primary);
    margin-top: 2px;
}

.btn-change-server {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Side Panel Layout */
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

/* Stats Card */
.stats-card {
    padding: 22px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.download { background: rgba(0, 242, 254, 0.12); color: var(--cyan-primary); }
.stat-icon.upload { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.stat-icon.data { background: rgba(245, 158, 11, 0.12); color: var(--amber-connecting); }
.stat-icon.security { background: rgba(16, 185, 129, 0.12); color: var(--emerald-primary); }
.stat-icon.subscription-status { background: rgba(239, 68, 68, 0.12); color: var(--red-disconnected); }

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
}

.text-emerald {
    color: var(--emerald-primary);
}

/* Protocol Selector Card */
.protocol-card {
    padding: 22px;
}

.protocol-pills {
    display: flex;
    gap: 8px;
}

.proto-btn {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 4px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.proto-btn:hover {
    border-color: var(--cyan-primary);
    color: var(--text-primary);
}

.proto-btn.active {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(79, 172, 254, 0.15));
    border-color: var(--cyan-primary);
    color: var(--cyan-primary);
}

/* ==========================================================================
   SERVER SELECTION MODAL
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 15, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.modal-backdrop.active {
    opacity: 1 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

.subscription-backdrop {
    z-index: 100000 !important;
}

.modal-panel {
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: translateY(20px);
    transition: transform var(--transition-fast);
}

.modal-backdrop.active .modal-panel {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px 10px 38px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.search-box input:focus {
    border-color: var(--cyan-primary);
}

.server-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 380px;
    padding-right: 4px;
}

/* Custom Scrollbar */
.server-list::-webkit-scrollbar {
    width: 6px;
}

.server-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.server-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.server-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.server-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--cyan-primary);
}

.server-item.selected {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--cyan-primary);
}

.server-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.server-item-flag {
    font-size: 22px;
}

.server-item-info {
    display: flex;
    flex-direction: column;
}

.server-item-country {
    font-size: 14px;
    font-weight: 600;
}

.server-item-city {
    font-size: 12px;
    color: var(--text-muted);
}

.server-item-ping {
    font-size: 12px;
    color: var(--emerald-primary);
    font-weight: 600;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 280px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.info { border-left: 4px solid var(--cyan-primary); }
.toast.success { border-left: 4px solid var(--emerald-primary); }
.toast.error { border-left: 4px solid var(--red-disconnected); }

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

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* Tablets and Mobile Landscape (<900px) */
@media (max-width: 900px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }

    .main-vpn-card {
        min-height: 420px;
        padding: 30px 20px;
    }

    .vpn-switch-container {
        width: 190px;
        height: 190px;
    }

    .vpn-power-btn {
        width: 145px;
        height: 145px;
    }

    .power-icon {
        width: 50px;
        height: 50px;
    }
}

/* Mobile Screens (<576px) */
@media (max-width: 576px) {
    .app-container {
        padding: 12px;
    }

    #auth-view {
        min-height: calc(100vh - 24px);
    }

    .auth-card {
        padding: 24px 18px;
    }

    .dash-header {
        padding: 12px 16px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .brand-logo.sm {
        font-size: 15px;
        gap: 8px;
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        flex-shrink: 0;
    }

    .brand-logo.sm span {
        white-space: nowrap;
        font-size: 15px;
    }

    .brand-logo.sm strong {
        white-space: nowrap;
    }

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

    .main-vpn-card {
        padding: 24px 14px;
    }

    .vpn-switch-container {
        width: 170px;
        height: 170px;
    }

    .vpn-power-btn {
        width: 130px;
        height: 130px;
    }

    .power-icon {
        width: 44px;
        height: 44px;
    }

    .server-selector-card {
        padding: 10px 14px;
    }

    .modal-panel {
        padding: 18px;
    }
}

/* ==========================================================================
   SUBSCRIPTION RENEWAL MODAL STYLES
   ========================================================================== */
.sub-modal-panel {
    max-width: 780px;
    width: 95%;
    max-height: 90vh;
    padding: 26px 28px;
    background: rgba(14, 21, 37, 0.88);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(245, 158, 11, 0.15);
}

.sub-modal-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.sub-header-left {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding-right: 12px;
}

.sub-header-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.sub-header-text h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.sub-modal-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.45;
}

/* Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 18px 0 14px;
}

.plan-card {
    position: relative;
    background: rgba(18, 26, 43, 0.65);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.plan-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-hover);
    background: rgba(28, 38, 62, 0.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.plan-card.selected {
    border-color: var(--cyan-primary);
    background: rgba(0, 242, 254, 0.08);
    box-shadow: var(--glow-cyan);
}

.plan-tag {
    position: absolute;
    top: -11px;
    right: 14px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--radius-full);
}

.popular-tag {
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    color: #090d16;
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

.value-tag {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.plan-header {
    display: flex;
    flex-direction: column;
}

.plan-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--cyan-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.plan-name {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.plan-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 2px;
    margin-bottom: 2px;
}

.plan-currency {
    font-size: 15px;
    font-weight: 700;
    color: var(--cyan-primary);
    margin-right: 4px;
}

.plan-amount {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
}

.plan-duration {
    font-size: 12px;
    color: var(--text-secondary);
}

.plan-duration strong {
    color: var(--cyan-primary);
}

.plan-features {
    list-style: none;
    margin: 16px 0 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.plan-features li {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-select-plan {
    width: 100%;
    padding: 10px 0;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-select-plan:hover {
    background: rgba(255, 255, 255, 0.12);
}

.plan-card.selected .btn-select-plan {
    background: var(--cyan-primary);
    color: #090d16;
    border-color: var(--cyan-primary);
    font-weight: 700;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

/* Payment Step View */
.payment-step-view {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.selected-plan-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.1), rgba(79, 172, 254, 0.05));
    border: 1.5px solid var(--cyan-primary);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: var(--glow-cyan);
}

.selected-plan-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.selected-plan-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--cyan-primary);
    letter-spacing: 0.5px;
}

.selected-plan-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.selected-plan-duration-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.selected-plan-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.selected-plan-price {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--cyan-primary);
}

.btn-change-plan-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: color var(--transition-fast);
    padding: 0;
}

.btn-change-plan-link:hover {
    color: var(--cyan-primary);
}

.mpesa-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-back-plans {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    transition: color var(--transition-fast);
}

.btn-back-plans:hover {
    color: var(--text-primary);
}

/* M-Pesa Checkout Box */
.mpesa-checkout-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1.5px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin: 4px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mpesa-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mpesa-badge-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--emerald-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mpesa-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--emerald-primary);
    box-shadow: 0 0 10px var(--emerald-primary);
    animation: pulseDot 1.5s infinite;
}

.mpesa-amount-summary {
    font-size: 13px;
    color: var(--text-secondary);
}

.mpesa-amount-summary strong {
    color: var(--emerald-primary);
    font-size: 16px;
    font-family: var(--font-heading);
}

.mpesa-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.mpesa-phone-icon {
    position: absolute;
    left: 14px;
    color: var(--emerald-primary);
    pointer-events: none;
}

.mpesa-input-wrapper input {
    width: 100%;
    background: rgba(10, 15, 26, 0.9);
    border: 1.5px solid rgba(16, 185, 129, 0.35);
    border-radius: var(--radius-sm);
    padding: 12px 14px 12px 42px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition: all var(--transition-fast);
}

.mpesa-input-wrapper input:focus {
    border-color: var(--emerald-primary);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.35);
}

/* STK Prompt Screen */
.stk-prompt-screen {
    background: rgba(14, 21, 37, 0.95);
    border: 1.5px solid rgba(16, 185, 129, 0.4);
    border-radius: var(--radius-md);
    padding: 28px 20px;
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.25);
    animation: toastIn 0.3s ease;
}

.stk-prompt-icon-wrap {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.15);
    border: 1.5px solid rgba(16, 185, 129, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.stk-radar-pulse {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid var(--emerald-primary);
    animation: ringExpand 1.6s infinite ease-out;
}

.stk-prompt-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.stk-prompt-desc {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 460px;
    line-height: 1.5;
}

.stk-prompt-desc strong {
    color: var(--emerald-primary);
}

.stk-status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--emerald-primary);
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-top-color: var(--emerald-primary);
    border-radius: 50%;
    animation: spin 0.8s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-cancel-stk {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 12px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    cursor: pointer;
    margin-top: 6px;
    transition: all var(--transition-fast);
}

.btn-cancel-stk:hover {
    color: var(--red-disconnected);
    border-color: var(--red-disconnected);
}

/* Modal Footer */
.sub-modal-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.btn-renew-action {
    width: 100%;
    max-width: 360px;
    padding: 13px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.btn-renew-action:hover {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.6);
}

.sub-guarantee {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Media Query for Subscription Grid */
@media (max-width: 680px) {
    .plans-grid {
        grid-template-columns: 1fr;
        max-height: 50vh;
        overflow-y: auto;
        padding-right: 4px;
    }

    .sub-modal-panel {
        padding: 20px 16px;
    }
}
