/* ===========================
   1. GLOBAL VARIABLES & RESET
   =========================== */
:root {
    --primary-purple: #a855f7;
    --secondary-purple: #7c3aed;
    --dark-purple: #5b21b6;
    --cyber-pink: #ec4899;
    --cyber-blue: #3b82f6;
    --dark-bg: #0a0118;
    --card-bg: rgba(20, 5, 40, 0.6);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --glow-purple: rgba(168, 85, 247, 0.5);
    --success-green: #4ade80; /* New variable for success messages */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: #fff;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    height: 100vh;
    width: 100vw;
}

/* ===========================
   2. BACKGROUND ANIMATIONS
   =========================== */
.animated-background {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background: 
        radial-gradient(circle at 10% 20%, rgba(168,85,247,0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(236,72,153,0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(59,130,246,0.1) 0%, transparent 50%);
    background-color: var(--dark-bg);
}

.grid-overlay {
    position: absolute; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(168,85,247,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168,85,247,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, var(--primary-purple), transparent); top: -200px; left: -200px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, var(--cyber-pink), transparent); bottom: -150px; right: -150px; animation-delay: 5s; }
.orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, var(--cyber-blue), transparent); top: 50%; left: 50%; animation-delay: 10s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, -100px) scale(1.1); }
    66% { transform: translate(-100px, 100px) scale(0.9); }
}

.gaming-background {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: hidden;
}

.floating-gaming-icon {
    position: absolute;
    font-size: 3rem;
    color: var(--primary-purple);
    opacity: 0.12;
    animation: floatAround 20s ease-in-out infinite;
    text-shadow: 0 0 20px var(--glow-purple);
}

.icon-1 { top: 10%; left: 10%; animation-delay: 0s; animation-duration: 15s; }
.icon-2 { top: 20%; left: 80%; animation-delay: 2s; animation-duration: 18s; }
.icon-3 { top: 60%; left: 20%; animation-delay: 4s; animation-duration: 20s; }
.icon-4 { top: 70%; left: 80%; animation-delay: 1s; animation-duration: 16s; }
.icon-5 { top: 40%; left: 50%; animation-delay: 3s; animation-duration: 17s; }

@keyframes floatAround {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 0.08; }
    25% { transform: translate(30px, -50px) rotate(90deg) scale(1.2); opacity: 0.15; }
    50% { transform: translate(-20px, -100px) rotate(180deg) scale(1.1); opacity: 0.12; }
    75% { transform: translate(-50px, -50px) rotate(270deg) scale(1.3); opacity: 0.18; }
}

/* ===========================
   3. LAYOUT & CARD STYLES
   =========================== */
.hero-section {
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 5vh 0;
}

.cyber-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2.5rem 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 500px; /* Desktop Width */
    max-width: 92%;
    text-align: center;
    z-index: 10;
    margin: auto;
}

/* Desktop Hover Effects */
.cyber-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 50px var(--glow-purple);
}

.card-border {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border: 1.5px solid rgba(168, 85, 247, 0.28);
    border-radius: 15px;
    pointer-events: none;
}

.card-glow {
    position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, var(--glow-purple), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.cyber-card:hover .card-glow { opacity: 0.32; }

/* Corners */
.card-corner {
    position: absolute; width: 20px; height: 20px;
    border: 2px solid var(--primary-purple);
}
.card-corner.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.card-corner.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.card-corner.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.card-corner.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

/* SHARED ICONS (Login & Forgot) */
.login-icon, .forgot-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-purple), var(--dark-purple));
    border-radius: 14px;
    font-size: 2rem;
    color: white;
    position: relative;
    box-shadow: 0 8px 25px var(--glow-purple);
}

.icon-pulse {
    position: absolute; width: 100%; height: 100%;
    border: 2px solid var(--primary-purple);
    border-radius: 14px;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.3); opacity: 0; }
}

h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, white, var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-subtitle, .forgot-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* ===========================
   4. INPUTS & FLOATING LABELS
   =========================== */
.cyber-input-group {
    position: relative;
    margin-bottom: 1.5rem;
    text-align: left;
}

.cyber-input {
    width: 100%;
    background: rgba(20,5,40,0.5);
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 8px;
    padding: 0.9rem;
    padding-right: 2.5rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.cyber-input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 20px var(--glow-purple);
}

.cyber-label {
    position: absolute;
    top: 0.9rem;
    left: 0.9rem;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.3s ease;
    pointer-events: none;
}

.cyber-input:focus + .cyber-label,
.cyber-input:not(:placeholder-shown) + .cyber-label {
    top: -0.65rem;
    left: 0.7rem;
    font-size: 0.75rem;
    color: var(--primary-purple);
    background: var(--dark-bg);
    padding: 0 0.4rem;
}

.input-line {
    position: absolute; bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--primary-purple);
    transition: width 0.3s ease;
}

.cyber-input:focus ~ .input-line { width: 100%; }

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
    font-size: 1rem;
    z-index: 10;
}
.password-toggle:hover { color: var(--primary-purple); }

select.cyber-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="16" viewBox="0 0 24 24" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
    cursor: pointer;
}

/* ===========================
   5. LOGIN OPTIONS
   =========================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    width: 100%;
}

.cyber-checkbox {
    display: flex; align-items: center; cursor: pointer;
    position: relative; padding-left: 28px;
    user-select: none; transition: color 0.3s;
}
.cyber-checkbox:hover { color: white; }
.cyber-checkbox input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark {
    position: absolute; top: 0; left: 0; height: 18px; width: 18px;
    background-color: rgba(20,5,40,0.5);
    border: 1px solid rgba(168, 85, 247, 0.5);
    border-radius: 4px; transition: all 0.3s;
}
.cyber-checkbox:hover input ~ .checkmark { border-color: var(--primary-purple); box-shadow: 0 0 5px var(--glow-purple); }
.cyber-checkbox input:checked ~ .checkmark { background-color: var(--primary-purple); border-color: var(--primary-purple); }
.checkmark:after { content: ""; position: absolute; display: none; }
.cyber-checkbox input:checked ~ .checkmark:after { display: block; }
.cyber-checkbox .checkmark:after {
    left: 6px; top: 2px; width: 4px; height: 9px;
    border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.forgot-link {
    color: var(--text-secondary); text-decoration: none;
    transition: all 0.3s; border-bottom: 1px solid transparent;
}
.forgot-link:hover {
    color: var(--primary-purple); border-bottom-color: var(--primary-purple);
    text-shadow: 0 0 8px var(--glow-purple);
}

.divider {
    display: flex; align-items: center; text-align: center;
    margin: 1.5rem 0; color: var(--text-secondary);
    font-size: 0.85rem; font-weight: 600; letter-spacing: 1px;
}
.divider::before, .divider::after {
    content: ''; flex: 1; border-bottom: 1px solid rgba(168,85,247,0.3);
}
.divider span {
    padding: 0 15px; background: var(--dark-bg); border-radius: 4px;
}

/* ===========================
   6. FORGOT PASSWORD SPECIFIC
   =========================== */
/* Gaming Quote Box */
.gaming-quote {
    margin: 1rem 0 2rem 0;
    padding: 1rem;
    background: rgba(168, 85, 247, 0.05);
    border-left: 3px solid var(--primary-purple);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    border-radius: 0 8px 8px 0;
}
.gaming-quote i { opacity: 0.5; font-size: 0.8rem; margin: 0 5px; color: var(--primary-purple); }
.gaming-quote p { display: inline; }

/* Back to Login Link */
.back-to-login {
    margin-top: 1.5rem;
    text-align: center;
}
.back-to-login a {
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
}
.back-to-login a:hover {
    color: var(--primary-purple);
    transform: translateX(-5px);
    text-shadow: 0 0 8px var(--glow-purple);
}

/* Success Message */
.success-message {
    display: none; /* Toggled by JS usually */
    background: rgba(74, 222, 128, 0.1);
    color: var(--success-green);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(74, 222, 128, 0.3);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    align-items: center;
    gap: 0.5rem;
}

/* Forgot Button Style from previous step */
.forgot-pass-btn {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid var(--primary-purple);
    color: var(--text-secondary);
    padding: 6px 15px; border-radius: 6px;
    text-decoration: none; font-size: 0.85rem; font-weight: 600;
    transition: all 0.3s ease; display: inline-block; letter-spacing: 0.5px;
}
.forgot-pass-btn:hover {
    background: var(--primary-purple); color: white;
    box-shadow: 0 0 15px var(--glow-purple); transform: translateY(-2px);
    border-color: var(--primary-purple);
}

/* ===========================
   7. SIGNUP SPECIFIC (OTP)
   =========================== */
.otp-email-group .cyber-input,
#otpBox .cyber-input { padding-right: 120px; }

.send-otp-btn, #resendOtpBtn {
    position: absolute; right: 6px; top: 6px; bottom: 6px;
    background: linear-gradient(135deg, var(--primary-purple), var(--dark-purple));
    border: 1px solid var(--primary-purple); color: white;
    border-radius: 6px; padding: 0 15px; font-size: 0.75rem; font-weight: 700;
    cursor: pointer; z-index: 5; transition: all 0.3s ease;
    text-transform: uppercase; letter-spacing: 0.5px;
    font-family: 'Rajdhani', sans-serif;
    display: flex; align-items: center; justify-content: center; min-width: 100px;
}
.send-otp-btn:hover, #resendOtpBtn:not(:disabled):hover {
    box-shadow: 0 0 10px var(--glow-purple); transform: scale(1.02);
}
.send-otp-btn:disabled, #resendOtpBtn:disabled {
    background: #1a1a2e; border-color: #333; color: #666; cursor: not-allowed;
    box-shadow: none; transform: none;
}
#otpTimer {
    position: absolute; bottom: -18px; right: 0;
    font-size: 0.7rem; color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif; letter-spacing: 0.5px;
}

/* Select2 */
.select2-container .select2-selection--single {
    background-color: rgba(20, 5, 40, 0.5) !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
    border-radius: 8px !important; height: 52px !important;
    display: flex !important; align-items: center !important;
}
.select2-container .select2-selection--single .select2-selection__rendered {
    color: white !important; font-size: 1rem !important; padding-left: 0.9rem !important;
}
.select2-container .select2-selection--single .select2-selection__arrow { top: 12px !important; }
.select2-dropdown { background-color: var(--dark-bg) !important; border: 1px solid var(--primary-purple) !important; }
.select2-search__field { background-color: rgba(255, 255, 255, 0.05) !important; color: white !important; border-radius: 4px !important; }
.select2-results__option { color: var(--text-secondary) !important; }
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-purple) !important; color: white !important;
}
.cyber-input-group:has(.select2-container--open) .cyber-label,
.cyber-input-group:has(.select2-selection__rendered[title]) .cyber-label {
    top: -0.65rem; left: 0.7rem; font-size: 0.75rem;
    color: var(--primary-purple); background: var(--dark-bg); padding: 0 0.4rem; z-index: 2;
}

/* Strength Bar */
.password-strength { margin-top: -0.8rem; margin-bottom: 1.2rem; }
.strength-bar {
    width: 100%; height: 6px; background: rgba(168,85,247,0.2);
    border-radius: 10px; overflow: hidden; margin-bottom: 0.3rem;
}
.strength-fill {
    height: 100%; width: 0%; background: var(--primary-purple);
    transition: all 0.3s ease; border-radius: 10px;
}
.strength-text { font-size: 0.75rem; color: var(--text-secondary); text-align: center; }

/* ===========================
   8. BUTTONS & UTILS
   =========================== */
.buttons-stack { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.form-buttons { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.back-btn { flex: 1; }
.reset-btn { flex: 2; }

.cyber-btn-large {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-purple), var(--dark-purple));
    border: 2px solid var(--primary-purple);
    color: white; padding: 0.9rem 1.5rem;
    font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    cursor: pointer; box-shadow: 0 5px 20px var(--glow-purple);
    border-radius: 8px; transition: all 0.3s ease;
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.cyber-btn-large:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--glow-purple); }
.cyber-btn-large.secondary { background: transparent; border: 2px solid var(--primary-purple); box-shadow: none; }
.cyber-btn-large.secondary:hover { background: rgba(168, 85, 247, 0.1); box-shadow: 0 0 15px var(--glow-purple); }

.google-logo { height: 1.2em; width: auto; margin-right: 0.5rem; vertical-align: middle; }
.hidden { display: none; }
.inline-alert {
    border-radius: 8px; padding: 0.75rem 1rem; font-size: 0.9rem;
    display: flex; align-items: center; gap: 0.4rem;
    margin-bottom: 1rem; font-weight: 600; border: 2px solid;
    user-select: none; box-shadow: 0 0 10px rgba(255,0,0,0.5);
}
.error-alert { color: #f87171; border-color: #f87171; background: rgba(248,113,113,0.12); }

/* ===========================
   9. MEDIA QUERIES
   =========================== */
@media (max-width: 768px) {
    .cyber-card { width: 85%; padding: 2rem 1.5rem; }
    h3 { font-size: 1.5rem; }
    
    /* Icons */
    .login-icon, .forgot-icon { width: 60px; height: 60px; font-size: 1.6rem; }
    .floating-gaming-icon { font-size: 2rem; }
    .icon-3, .icon-4, .icon-5 { display: none; }
    
    /* Tablet Options */
    .form-options { justify-content: space-between; }
    
    /* DISABLE HOVER/GLOW EFFECTS ON MOBILE/TABLET */
    .cyber-card:hover { transform: none !important; box-shadow: none !important; }
    .cyber-card:hover .card-glow { opacity: 0 !important; }
}

@media (max-width: 480px) {
    .cyber-card { width: 95%; padding: 1.5rem 1rem; }
    h3 { font-size: 1.3rem; }
    .login-icon, .forgot-icon { width: 55px; height: 55px; font-size: 1.5rem; margin-bottom: 1rem; }

    /* MOBILE LAYOUT */
    .form-options {
        flex-direction: row; 
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap; 
        gap: 0.5rem;
    }
    .cyber-checkbox, .forgot-link, .forgot-pass-btn { font-size: 0.85rem; }
}