/* ==========================================================================
   SUPREMACY EDU - PREMIUM AUTHENTICATION UI
   ========================================================================== */

:root {
    --bg-main: #050a14;        /* Darker, analytical background matching dashboard */
    --bg-card: rgba(15, 23, 42, 0.85); /* Deep slate card */
    --primary: #38bdf8;        /* Vivid analytical blue/cyan */
    --primary-hover: #0284c7;  
    --success: #4ade80;        /* Gamification green */
    --text-main: #f8fafc;      
    --text-muted: #94a3b8;     
    --border-color: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(0, 0, 0, 0.2);
    --error-bg: rgba(239, 68, 68, 0.1);
    --error-text: #f87171;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body.auth-page {
    min-height: 100vh;
    background: var(--bg-main);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08), transparent 35%),
        radial-gradient(circle at 85% 30%, rgba(74, 222, 128, 0.05), transparent 35%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* --- The Main Auth Card --- */
.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.auth-card h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    color: white;
}

.auth-card p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 25px;
    text-align: center;
}

/* --- Form Inputs --- */
.input-group {
    margin-bottom: 16px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 14px;
    transition: var(--transition);
}

.input-group input::placeholder {
    color: #475569;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
    background: rgba(15, 23, 42, 0.9);
}

/* --- Buttons --- */
.primary-btn {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    background: var(--primary);
    color: #050a14;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
    transition: var(--transition);
    margin-top: 10px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    background: var(--primary-hover);
    color: white;
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

/* --- Links & Footer --- */
.auth-link-container {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-link-container a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    margin-left: 5px;
}

.auth-link-container a:hover {
    color: white;
    text-decoration: underline;
}

.forgot-pwd-link {
    display: block;
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: -8px;
    margin-bottom: 16px;
    text-decoration: none;
}
.forgot-pwd-link:hover { color: var(--primary); }

/* ==========================================================================
   MILESTONE 3: DASHBOARD SHELL & NAVIGATION
   ========================================================================== */

/* --- Layout Architecture --- */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-main);
}

/* --- Sidebar (Desktop) --- */
.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 50;
}

.brand-header {
    font-size: 20px;
    font-weight: 800;
    color: white;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

/* Profile Widget inside Sidebar */
.profile-widget {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
}

.profile-widget h3 {
    font-size: 16px;
    color: white;
    margin-bottom: 12px;
}

.phone-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 8px;
}

.edit-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    padding: 4px;
}

.edit-btn:hover { color: white; transform: scale(1.1); }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item:hover, .nav-item.active {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
}

/* --- Main Content Area --- */
.main-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}

.top-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(5, 10, 20, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-title {
    font-size: 20px;
    color: white;
    font-weight: 700;
}

/* --- The Small Wallet (Top Right) --- */
.small-wallet-btn {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.2), rgba(20, 184, 166, 0.2));
    border: 1px solid rgba(74, 222, 128, 0.4);
    padding: 8px 16px;
    border-radius: 30px;
    color: var(--success);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.small-wallet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.2);
}

/* --- Dashboard Grid & Cards --- */
.dashboard-container {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.generated-code-box {
    background: rgba(56, 189, 248, 0.1);
    border: 1px dashed var(--primary);
    padding: 10px 20px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 10px;
}

.plan-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 15px;
    text-transform: uppercase;
    background: var(--success);
    color: #0f172a;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card span {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card strong {
    color: white;
    font-size: 32px;
    font-weight: 700;
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-muted);
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 16px;
    color: white;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* --- Modals (Small Wallet & Editing) --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 10, 20, 0.9);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

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

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.lock-icon {
    font-size: 40px;
    text-align: center;
    margin-bottom: 15px;
    display: block;
}

/* --- Mobile Specific Styles (Option B) --- */
.mobile-bottom-nav { display: none; }
.mobile-profile-header { display: none; }

@media (max-width: 768px) {
    .sidebar { display: none; } /* Hide desktop sidebar */
    
    .app-layout { flex-direction: column; }
    
    .top-navbar { padding: 15px 20px; }
    
    .dashboard-container {
        padding: 20px;
        padding-bottom: 100px; /* Space for bottom nav */
    }
    
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--border-color);
        padding: 12px 0;
        z-index: 100;
        padding-bottom: env(safe-area-inset-bottom, 12px);
    }
    
    .mobile-nav-item {
        color: var(--text-muted);
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 11px;
        gap: 4px;
    }
    
    .mobile-nav-item.active { color: var(--primary); }
    .mobile-nav-item svg { width: 20px; height: 20px; }
    
    /* Dedicated Mobile Profile Modal Additions */
    .mobile-profile-header {
        display: block;
        text-align: center;
        margin-bottom: 20px;
    }
}
/* Package Layout Styles */
.package-section { margin-bottom: 30px; text-align: left; }
.package-title { color: white; font-size: 18px; font-weight: bold; margin-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 8px; }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; }

.pkg-card { 
    background: rgba(15, 23, 42, 0.6); 
    border: 1px solid rgba(255,255,255,0.05); 
    padding: 24px; 
    border-radius: 12px; 
    transition: all 0.3s ease;
}
.pkg-card:hover { border-color: #38bdf8; transform: translateY(-3px); background: rgba(15, 23, 42, 0.9); }

.pkg-price { color: #38bdf8; font-size: 28px; font-weight: bold; margin-bottom: 10px; }

.tag-non-ref { color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); font-size: 10px; padding: 3px 8px; border-radius: 4px; display: inline-block; margin-bottom: 15px; font-weight: bold; letter-spacing: 0.5px; background: rgba(239, 68, 68, 0.05);}
.tag-ref { color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.3); font-size: 10px; padding: 3px 8px; border-radius: 4px; display: inline-block; margin-bottom: 15px; font-weight: bold; letter-spacing: 0.5px; background: rgba(74, 222, 128, 0.05);}

.pkg-desc { color: #94a3b8; font-size: 13px; margin-bottom: 20px; }

/* Receipt Modal Specifics */
.receipt-box {
    background: rgba(56, 189, 248, 0.1);
    border: 1px dashed #38bdf8;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}
.receipt-code { font-size: 32px; font-weight: 800; color: white; letter-spacing: 2px; margin-top: 10px;}

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

.toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--primary);
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    min-width: 250px;
    max-width: 400px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

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

.toast.error { border-left-color: var(--error-text); }
.toast.error .toast-icon { color: var(--error-text); }

.toast-icon { font-size: 18px; }