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

/* --- 1. CSS Variables for Easy Theming --- */
:root {
    --bg-main: #0f172a;        /* Deep slate background */
    --bg-card: rgba(30, 41, 59, 0.75); /* Translucent dark card */
    --primary: #3b82f6;        /* Bright Blue */
    --primary-hover: #2563eb;  /* Deeper Blue */
    --text-main: #f8fafc;      /* Crisp white text */
    --text-muted: #94a3b8;     /* Slate grey text */
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.6);
    --error-bg: rgba(239, 68, 68, 0.1);
    --error-text: #f87171;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 2. Global Resets & Body --- */
* {
    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(37, 99, 235, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(37, 99, 235, 0.1), transparent 25%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Hide main website header if it bleeds over */
body.auth-page header {
    background: transparent !important;
    box-shadow: none !important;
    position: absolute;
    top: 30px;
    left: 30px;
    width: auto;
}

/* --- 3. Back Button --- */
.back-btn {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(4px);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-4px);
}

/* --- 4. The Glassmorphism Card --- */
.login-card,
.signup-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: 24px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    
    /* Entrance Animation */
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* --- 5. Typography --- */
.login-card h2,
.signup-card h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: -0.5px;
}

.login-card p,
.signup-card p {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 30px;
    text-align: center;
}

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

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

.input-group input::placeholder {
    color: #64748b;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: rgba(15, 23, 42, 0.8);
}

/* Specifically for RDE Codes - Forces Uppercase visually */
#regRdeCode, #rde-code {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
#regRdeCode::placeholder, #rde-code::placeholder {
    text-transform: none;
    font-weight: normal;
    letter-spacing: normal;
}

/* --- 7. Checkboxes & Links --- */
.options {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* --- 8. Buttons --- */
.primary-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

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

/* 🔒 The Strict Lock State */
.btn-locked, 
.primary-btn:disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* --- 9. Toggle Switch (Login Page) --- */
.role-toggle { 
    display: flex; 
    background: rgba(0, 0, 0, 0.2); 
    border-radius: 30px; 
    padding: 6px; 
    margin-bottom: 30px; 
    position: relative; 
    border: 1px solid var(--border-color); 
}
.role-toggle input { display: none; }
.role-toggle label { 
    flex: 1; 
    text-align: center; 
    padding: 10px; 
    cursor: pointer; 
    z-index: 2; 
    color: var(--text-muted); 
    font-weight: 600; 
    font-size: 14px;
    transition: var(--transition); 
}
.slider { 
    position: absolute; 
    top: 6px; 
    left: 6px; 
    width: calc(50% - 6px); 
    height: calc(100% - 12px); 
    background: var(--primary); 
    border-radius: 24px; 
    z-index: 1; 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

#role-referrer:checked ~ .label-referrer { color: white; }
#role-referrer:checked ~ .slider { transform: translateX(0); }
#role-rde:checked ~ .label-rde { color: white; }
#role-rde:checked ~ .slider { transform: translateX(100%); }

/* --- 10. Footer Links & Errors --- */
.signup, .login-link {
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

.signup a, .login-link a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.signup a:hover, .login-link a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

#errorMessage {
    background: var(--error-bg) !important;
    color: var(--error-text) !important;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* --- 11. Responsive Design --- */
@media (max-width: 480px) {
    .login-card, .signup-card {
        padding: 30px 24px;
        border-radius: 20px;
    }
    .login-card h2, .signup-card h2 {
        font-size: 24px;
    }
    body.auth-page header {
        top: 15px;
        left: 15px;
    }
}

/* =========================
   STEP 2: PLAN SELECTION GRID
   ========================= */
.hidden-step {
    display: none !important;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px; /* For scrollbar */
}

/* Custom scrollbar for the plans grid */
.plans-grid::-webkit-scrollbar { width: 6px; }
.plans-grid::-webkit-scrollbar-track { background: transparent; }
.plans-grid::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

.plan-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.plan-card:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary);
    transform: translateY(-3px);
}

.plan-card h3 {
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--text-main);
}

.plan-card .price {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
}

/* Custom Badges for Plans */
.plan-card h3 { display: none; } /* Hide old titles */

.plan-card .price {
    font-size: 24px;
    margin-bottom: 8px;
}

.share-badge {
    background: rgba(16, 185, 129, 0.2); /* Emerald green tint */
    color: #34d399;
    font-size: 13px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 5px;
}

.refundable-tag {
    color: #fbbf24; /* Amber/Yellow text */
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    letter-spacing: 0.5px;
}
