:root {
            --space-dark: #030309;
            --space-card: #080817;
            --neon-cyan: #06b6d4;
            --neon-green: #10b981;
            --nebula-purple: #7c3aed;
            --nebula-pink: #ec4899;
            --text-light: #f5f5f7;
            --text-dim: #94a3b8;
            --apple-glass: rgba(255, 255, 255, 0.03);
            --apple-glass-border: rgba(255, 255, 255, 0.08);
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

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

        body {
            font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
            background-color: var(--space-dark);
            color: var(--text-light);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
        }

        /* Ambient Glow Backgrounds */
        .app-glow {
            position: absolute;
            width: 250px;
            height: 250px;
            border-radius: 50%;
            filter: blur(80px);
            opacity: 0.25;
            pointer-events: none;
            z-index: 0;
        }
        .glow-top { top: -50px; right: -50px; background: var(--neon-cyan); }
        .glow-bottom { bottom: -50px; left: -50px; background: var(--nebula-purple); }

        /* App Container Layout */
        .app-view {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            padding: 2.5rem 1.25rem 6.5rem; /* Safe padding for header and navbar */
            position: relative;
            z-index: 1;
            width: 100%;
            height: 100%;
        }

        /* Header Bar */
        .app-header {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            background: rgba(3, 3, 9, 0.8);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-bottom: 1px solid var(--apple-glass-border);
            padding: 0.8rem 1.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 100;
        }

        .app-logo {
            font-family: 'Outfit', sans-serif;
            font-size: 1.25rem;
            font-weight: 800;
            letter-spacing: -0.04em;
            color: #fff;
        }

        .app-logo span {
            background: linear-gradient(135deg, var(--neon-cyan), var(--nebula-purple));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        /* Bottom Nav Bar */
        .app-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: rgba(8, 8, 23, 0.85);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            border-top: 1px solid var(--apple-glass-border);
            display: flex;
            justify-content: space-around;
            padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
            z-index: 100;
            box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.3rem;
            color: var(--text-dim);
            font-size: 0.7rem;
            font-weight: 600;
            text-decoration: none;
            cursor: pointer;
            transition: var(--transition);
        }

        .nav-item.active {
            color: var(--neon-cyan);
            text-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
        }

        .nav-icon {
            font-size: 1.35rem;
            transition: var(--transition);
        }

        .nav-item.active .nav-icon {
            transform: scale(1.1);
        }

        /* Page View Switcher */
        .page {
            display: none;
            animation: fadeIn 0.3s ease forwards;
        }

        .page.active {
            display: block;
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Login Screen Overlay */
        .login-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background-color: var(--space-dark);
            z-index: 999;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 2.5rem;
            text-align: center;
            transition: var(--transition);
        }

        .login-logo {
            font-family: 'Outfit', sans-serif;
            font-size: 2.2rem;
            font-weight: 800;
            letter-spacing: -0.04em;
            margin-bottom: 2rem;
        }

        .login-logo span {
            background: linear-gradient(135deg, var(--neon-cyan), var(--nebula-purple));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .login-card {
            background: var(--apple-glass);
            border: 1px solid var(--apple-glass-border);
            border-radius: 24px;
            padding: 2.5rem 1.8rem;
            width: 100%;
            max-width: 380px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(15px);
        }

        .login-title {
            font-family: 'Outfit', sans-serif;
            font-size: 1.3rem;
            font-weight: 600;
            margin-bottom: 1.5rem;
        }

        .form-group {
            margin-bottom: 1.25rem;
            text-align: left;
        }

        .form-group label {
            display: block;
            font-size: 0.75rem;
            text-transform: uppercase;
            font-weight: 600;
            color: var(--text-dim);
            margin-bottom: 0.4rem;
            letter-spacing: 0.05em;
        }

        .form-control {
            width: 100%;
            background: rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            color: #fff;
            padding: 0.8rem 1rem;
            font-family: inherit;
            font-size: 0.95rem;
            outline: none;
            transition: var(--transition);
        }

        .form-control:focus {
            border-color: var(--neon-cyan);
            box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
        }

        .btn-login {
            width: 100%;
            background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--nebula-purple) 100%);
            color: #03030c;
            border: none;
            outline: none;
            padding: 0.85rem;
            border-radius: 12px;
            font-weight: 700;
            font-size: 0.95rem;
            cursor: pointer;
            transition: var(--transition);
            margin-top: 1rem;
        }

        .btn-login:hover {
            transform: scale(1.02);
        }

        .login-error {
            color: var(--nebula-pink);
            font-size: 0.85rem;
            font-weight: 600;
            margin-top: 1rem;
            display: none;
        }

        /* Glass Cards Styling */
        .glass-card {
            background: var(--apple-glass);
            border: 1px solid var(--apple-glass-border);
            border-radius: 20px;
            padding: 1.5rem;
            margin-bottom: 1.25rem;
            backdrop-filter: blur(15px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.3);
            position: relative;
            overflow: hidden;
        }

        /* Connection Status Widget */
        .status-container {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .status-info {
            text-align: left;
        }

        .status-text {
            font-family: 'Outfit', sans-serif;
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 0.2rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .status-indicator {
            width: 10px;
            height: 10px;
            background-color: var(--neon-green);
            border-radius: 50%;
            box-shadow: 0 0 10px var(--neon-green);
        }

        .status-indicator.paused {
            background-color: var(--nebula-pink);
            box-shadow: 0 0 10px var(--nebula-pink);
        }

        .status-sub {
            font-size: 0.8rem;
            color: var(--text-dim);
            font-weight: 500;
        }

        /* iOS Switch Toggle style */
        .ios-toggle {
            position: relative;
            display: inline-block;
            width: 48px;
            height: 28px;
        }

        .ios-toggle input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .ios-slider {
            position: absolute;
            cursor: pointer;
            top: 0; left: 0; right: 0; bottom: 0;
            background-color: rgba(255, 255, 255, 0.08);
            border: 1px solid var(--apple-glass-border);
            transition: .3s;
            border-radius: 34px;
        }

        .ios-slider:before {
            position: absolute;
            content: "";
            height: 22px;
            width: 22px;
            left: 2px;
            bottom: 2px;
            background: #fff;
            transition: .3s;
            border-radius: 50%;
            box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }

        input:checked + .ios-slider {
            background-color: var(--neon-green);
            border-color: transparent;
        }

        input:checked + .ios-slider:before {
            transform: translateX(20px);
        }

        /* Quick stats */
        .quick-stats {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-bottom: 1.25rem;
        }

        .stat-card {
            background: rgba(255,255,255,0.015);
            border: 1px solid var(--apple-glass-border);
            border-radius: 16px;
            padding: 1rem;
            text-align: left;
        }

        .stat-label {
            font-size: 0.65rem;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.25rem;
        }

        .stat-val {
            font-family: 'Outfit', sans-serif;
            font-size: 1.2rem;
            font-weight: 700;
        }

        /* Quick Actions Grid */
        .actions-header {
            font-size: 0.8rem;
            text-transform: uppercase;
            font-weight: 600;
            color: var(--text-dim);
            margin-bottom: 0.75rem;
            letter-spacing: 0.05em;
            text-align: left;
        }

        .actions-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.75rem;
            margin-bottom: 1.5rem;
        }

        .action-btn {
            background: var(--apple-glass);
            border: 1px solid var(--apple-glass-border);
            border-radius: 14px;
            padding: 0.8rem 0.4rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.4rem;
            color: #fff;
            font-size: 0.65rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
        }

        .action-btn:active {
            transform: scale(0.95);
            background: rgba(255,255,255,0.08);
        }

        .action-icon {
            font-size: 1.25rem;
            color: var(--neon-cyan);
        }

        /* Account Balance Widget */
        .account-card {
            background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(236, 72, 153, 0.03) 100%), var(--apple-glass);
            text-align: left;
        }

        .acc-info-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 1rem;
            border-top: 1px solid rgba(255,255,255,0.06);
            padding-top: 0.8rem;
        }

        /* Speed Test layout */
        .speedometer-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2rem;
            padding: 1rem 0;
        }

        .svg-gauge {
            width: 200px;
            height: 200px;
            transform: rotate(-90deg);
        }

        .gauge-track {
            fill: none;
            stroke: rgba(255,255,255,0.04);
            stroke-width: 10;
            stroke-linecap: round;
        }

        .gauge-value {
            fill: none;
            stroke: var(--neon-cyan);
            stroke-width: 12;
            stroke-dasharray: 440;
            stroke-dashoffset: 440; /* Starts empty */
            stroke-linecap: round;
            transition: stroke-dashoffset 0.1s ease-out;
        }

        .gauge-inner-center {
            position: absolute;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 200px;
            width: 200px;
        }

        .gauge-speed-val {
            font-family: 'Outfit', sans-serif;
            font-size: 2.4rem;
            font-weight: 800;
            color: #fff;
        }

        #speed-dl {
            color: #00e5ff !important;
            text-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
        }

        #speed-ul {
            color: #ff5e36 !important;
            text-shadow: 0 0 8px rgba(255, 94, 54, 0.2);
        }

        .gauge-speed-val.cyan {
            color: #00e5ff !important;
            text-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
        }

        .gauge-speed-val.orange {
            color: #ff5e36 !important;
            text-shadow: 0 0 15px rgba(255, 94, 54, 0.5);
        }

        .gauge-speed-label {
            font-size: 0.7rem;
            color: var(--text-dim);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        /* Payment Forms */
        .form-tabs {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
        }

        .tab-btn {
            background: rgba(255,255,255,0.02);
            border: 1px solid var(--apple-glass-border);
            color: var(--text-dim);
            padding: 0.7rem;
            border-radius: 12px;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: var(--transition);
        }

        .tab-btn.active {
            border-color: var(--neon-cyan);
            background: rgba(6, 182, 212, 0.05);
            color: var(--neon-cyan);
        }

        .btn-action-primary {
            width: 100%;
            background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--nebula-purple) 100%);
            color: #03030c;
            border: none;
            outline: none;
            padding: 0.9rem;
            border-radius: 14px;
            font-weight: 700;
            font-size: 0.95rem;
            cursor: pointer;
            transition: var(--transition);
        }

        .btn-action-primary:active {
            transform: scale(0.98);
        }

        .pay-feedback-msg {
            margin-top: 1rem;
            font-size: 0.85rem;
            color: var(--neon-cyan);
            font-weight: 600;
            display: none;
            text-align: center;
        }

        /* Settings list */
        .settings-list {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            text-align: left;
        }

        .settings-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(255,255,255,0.01);
            border: 1px solid var(--apple-glass-border);
            padding: 1rem 1.25rem;
            border-radius: 14px;
            cursor: pointer;
            transition: var(--transition);
        }

        .settings-row:active {
            background: rgba(255,255,255,0.04);
        }

        .settings-label {
            font-weight: 600;
            font-size: 0.9rem;
        }

        .settings-arrow {
            color: var(--text-dim);
        }

        /* Wifi settings overlay panel */
        .panel {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: var(--space-dark);
            z-index: 500;
            display: none;
            flex-direction: column;
            padding: 2.5rem 1.25rem 1.25rem;
            animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        }

        @keyframes slideUp {
            from { transform: translateY(100%); }
            to { transform: translateY(0); }
        }

        .panel-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            border-bottom: 1px solid rgba(255,255,255,0.08);
            padding-bottom: 1rem;
        }

        .panel-close {
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--text-dim);
        }

        /* Support ticket chat simulation */
        .chat-container {
            display: flex;
            flex-direction: column;
            height: 350px;
            border: 1px solid var(--apple-glass-border);
            border-radius: 16px;
            background: rgba(0,0,0,0.2);
            overflow: hidden;
        }

        .chat-messages {
            flex: 1;
            padding: 1rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 0.8rem;
            text-align: left;
        }

        .chat-bubble {
            max-width: 80%;
            padding: 0.7rem 1rem;
            border-radius: 16px;
            font-size: 0.85rem;
            line-height: 1.4;
        }

        .chat-bubble.bot {
            background: rgba(255,255,255,0.04);
            border: 1px solid var(--apple-glass-border);
            color: #fff;
            align-self: flex-start;
            border-bottom-left-radius: 4px;
        }

        .chat-bubble.user {
            background: linear-gradient(135deg, var(--neon-cyan), var(--nebula-purple));
            color: #03030c;
            font-weight: 500;
            align-self: flex-end;
            border-bottom-right-radius: 4px;
        }

        .chat-input-row {
            display: flex;
            border-top: 1px solid var(--apple-glass-border);
            padding: 0.5rem;
            background: rgba(0,0,0,0.3);
        }

        .chat-input {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            color: #fff;
            padding: 0.5rem 0.8rem;
            font-family: inherit;
            font-size: 0.9rem;
        }

        .btn-chat-send {
            background: var(--neon-cyan);
            border: none;
            outline: none;
            width: 34px;
            height: 34px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            justify-content: center;
            align-items: center;
            color: #03030c;
            font-weight: 700;
        }

        /* Loader Overlay for Reboot */
        .reboot-overlay {
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(3, 3, 9, 0.95);
            z-index: 1000;
            display: none;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
        }

        .spinner {
            width: 50px;
            height: 50px;
            border: 4px dashed var(--neon-cyan);
            border-radius: 50%;
            animation: spin 2s linear infinite;
            margin-bottom: 1.5rem;
        }

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

        /* Tablet & Desktop viewport constraints for premium mobile app aesthetic */
        @media (min-width: 600px) {
            body {
                align-items: center;
                background-color: #020205 !important;
                background-image: none !important;
            }
            .app-header, .app-nav, .panel, .login-overlay {
                max-width: 480px;
                left: 50% !important;
                transform: translateX(-50%);
                box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
            }
            .app-view {
                max-width: 480px;
                margin: 0 auto;
                border-left: 1px solid var(--apple-glass-border);
                border-right: 1px solid var(--apple-glass-border);
                background: var(--space-dark);
                box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
                min-height: 100vh;
            }
            #offline-banner {
                max-width: 440px;
                left: 50% !important;
                transform: translateX(-50%);
            }
        }
