#initial-loader {
    position: fixed;
    inset: 0;
    background: #020617;
    /* Matches your --bg */
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 🛡️ ELITE MASTER CLOAK: Zero-Flicker System */
#login-screen,
#landing-page {
    display: none;
}

#main-dashboard {
    display: none !important;
    /* 🔒 Hard-lock the dashboard until Firebase is ready */
}

/* Ensure the app-container doesn't show before it's ready */
.app-interface {
    display: none;
}

/* FINSTACK PRO | MASTER STYLESHEET
    Interface: Elite Financial Intelligence
*/

:root {
    --primary: #6366f1;
    --success: #10b981;
    --danger: #f43f5e;
    --bg: #020617;
    --card: #0f172a;
    --text: #f1f5f9;
    --border: #1e293b;
    --mono: 'Roboto Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 🚀 LANDING PAGE / HERO SECTION */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: radial-gradient(circle at 0% 0%, #1e1b4b 0%, #020617 100%);
    text-align: center;
}

.hero-content {
    max-width: 800px;
}

.badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid var(--primary);
    display: inline-block;
    margin-bottom: 25px;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 20px;
    color: white;
}

.hero-title span {
    background: linear-gradient(90deg, #6366f1, #10b981);
    -webkit-background-clip: text;
    /* Vendor prefix */
    background-clip: text;
    /* ✅ ADD THIS LINE (The Standard) */
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 60px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    border-top: 1px solid var(--border);
    padding-top: 40px;
}

.stat-item strong {
    display: block;
    font-size: 1.5rem;
    color: white;
}

.stat-item span {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
}

/* 🔒 LOGIN GATE - AUTH SCREENS */
.login-gate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #1e1b4b, #020617);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 2000;
}

.glass-pro {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 35px;
    padding: 35px;
    width: 90%;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.app-icon-glow {
    width: 65px;
    height: 65px;
    background: var(--primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 0 35px var(--primary);
    color: white;
    font-weight: 900;
    font-size: 1.5rem;
}

.pro-title {
    font-weight: 800;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.pro-title span {
    color: var(--primary);
}

.input-group-pro {
    text-align: left;
    margin-bottom: 15px;
}

.input-group-pro label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 5px;
}

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

.eye-btn-pro {
    position: absolute;
    right: 15px;
    cursor: pointer;
    color: #94a3b8;
    padding: 5px;
}

/* 👤 DASHBOARD UI */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 25px 25px 120px;
    min-height: 100vh;
    /* Ensures the dark background covers the whole screen */
    background: var(--bg);
}

.avatar-container {
    position: relative;
    /* THIS IS THE ANCHOR */
    width: 55px;
    /* Increased size slightly for better elite look */
    height: 55px;
    margin-right: 15px;
    /* Centers it in the profile section */
    cursor: pointer;
}

.avatar-neon {
    width: 100%;
    height: 100%;
    background: var(--primary);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    box-shadow: 0 0 15px var(--primary);
    background-size: cover;
    overflow: hidden;
}

/* 📸 CAMERA OVERLAY FIX */
.camera-overlay {
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: var(--card);
    border: 1px solid var(--bg);
    /* Creates a "gap" effect from the avatar */
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.u-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.glass-nav-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 420px;
    height: 80px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 28px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.nav-item {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
}

.nav-item.active {
    color: var(--primary);
    transform: translateY(-5px);
}

.nav-item span {
    font-size: 0.55rem;
    font-weight: 800;
    margin-top: 4px;
    text-transform: uppercase;
}

/* 🃏 CARD SYSTEM */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 25px;
    margin-bottom: 25px;
    transition: 0.3s;
}

.wealth-terminal {
    background: linear-gradient(135deg, #0f172a, #000);
    border: 1.5px solid var(--primary) !important;
    text-align: center;
    overflow: hidden;
    position: relative;
}

.shimmer::after {
    content: "";
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    animation: shimmer 5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translate(-30%, -30%);
    }

    100% {
        transform: translate(30%, 30%);
    }
}

.mono-glow {
    font-family: var(--mono);
    color: var(--success);
    font-size: 2.1rem;
    font-weight: 700;
}

.summary-grid-pro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.sum-card-pro {
    background: var(--card);
    padding: 15px;
    border-radius: 20px;
    border: 1px solid var(--border);
    text-align: center;
}

.sum-card-pro span {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #94a3b8;
}

.sum-card-pro p {
    font-weight: 800;
    margin: 5px 0 0;
}

.plus {
    color: var(--success);
}

.minus {
    color: var(--danger);
}

/* 📊 TAX GRID & TABLES */
.tax-grid-res {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.tax-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 15px;
    border: 1px solid var(--border);
    text-align: center;
}

.tax-box span {
    font-size: 0.6rem;
    color: #94a3b8;
    text-transform: uppercase;
}

/* 🎓 ACCA & ROADMAP */
.level-box {
    background: rgba(255, 255, 255, 0.02);
    padding: 20px;
    border-radius: 25px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
}

.l-tag {
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: block;
}

.p-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.acca-check {
    accent-color: var(--success);
    width: 18px;
    height: 18px;
}

/* 🎓 ACCA PROGRESS BAR ENHANCEMENT (FULL WIDTH) */
#exam-overall-progress {
    width: 100%;
    height: 12px;
    appearance: none;
    border-radius: 10px;
    overflow: hidden;
    background: var(--border);
    margin-bottom: 15px;
    border: none;
}

#exam-overall-progress::-webkit-progress-value {
    background: linear-gradient(90deg, var(--primary), var(--success));
    box-shadow: 0 0 15px var(--success);
    transition: width 0.5s ease-in-out;
}

#exam-overall-progress::-webkit-progress-bar {
    background: var(--border);
}

/* ⌨️ INPUTS & BUTTONS */
input,
select {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    background: #020617;
    border: 1px solid var(--border);
    color: white;
    margin-bottom: 12px;
    font-family: inherit;
    outline: none;
}

input:focus {
    border-color: var(--primary);
}

.btn-primary-glow {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.btn-success-pro {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: var(--success);
    border: none;
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.btn-danger-pro {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: var(--danger);
    border: none;
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.btn-outline-pro {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: white;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

/* 📱 SMART INSTALL SHEET */
.install-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: var(--card);
    border-top: 1px solid var(--border);
    border-radius: 30px 30px 0 0;
    padding: 25px;
    z-index: 9999;
    transition: bottom 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
}

.install-sheet.show {
    bottom: 0;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: 10px;
    margin: -10px auto 20px;
}

.app-icon-small {
    width: 50px;
    height: 50px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    box-shadow: 0 0 15px var(--primary);
}

.sheet-content {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.sheet-text h3 {
    font-size: 1.1rem;
    margin: 0;
}

.sheet-text p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 4px 0 0;
}

.instruction-steps {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 15px;
    border: 1px dashed var(--border);
    font-size: 0.85rem;
}

/* 🎬 ANIMATIONS */
.view-pane {
    display: none;
}

.view-pane.active {
    display: block;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shake {
    animation: shake 0.4s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* --- 🛠️ ELITE UI STABILIZATION (FINAL POLISH) --- */

/* 1. Fix: Prevents "Required Capital" from breaking the box on phone */
#inr-sum {
    font-size: clamp(1.4rem, 7vw, 2.5rem) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
    color: var(--success);
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

/* 2. Fix: Mobile Birthday Visibility & Calendar Icon */
input[type="date"] {
    color-scheme: dark;
    /* Forces the system calendar to match your dark theme */
    background: rgba(0, 0, 0, 0.4) !important;
    color: white !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    /* Makes the calendar icon white/visible */
    opacity: 0.6;
    cursor: pointer;
}

/* 3. Fix: Professional Shake Animation for Incorrect PIN */
.shake {
    animation: professionalShake 0.4s cubic-bezier(.36, .07, .19, .97) both;
    border: 1px solid var(--danger) !important;
}

@keyframes professionalShake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* 4. Fix: Prevent horizontal "wobble" when scrolling on mobile */
.app-container,
.view-pane {
    max-width: 100%;
    overflow-x: hidden;
}

/* 🛠️ FIX: Mobile Birthday Placeholder Visibility */
input[type="date"]::before {
    content: "Select Birthday";
    color: #94a3b8;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.85rem;
}

input[type="date"]:focus::before,
input[type="date"]:not(:placeholder-shown)::before {
    display: none;
    /* Hides the text when you click or pick a date */
}