/* === FUTURISTIC LOGIN STYLE === */

:root {
    --neon-cyan: #00f3ff;
    --neon-blue: #0066ff;
    --deep-space: #050510;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(0, 243, 255, 0.2);
    --text-primary: #e0e0e0;
}

body {
    background-color: var(--deep-space);
    font-family: 'Rajdhani', sans-serif;
    color: var(--text-primary);
    overflow: hidden;
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1a1a2e 0%, #000000 100%);
}

/* === BACKGROUND ANIMATION === */
.background-anim span {
    position: absolute;
    bottom: -50px;
    background: transparent;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 15px var(--neon-cyan), inset 0 0 10px var(--neon-cyan);
    width: 20px;
    height: 20px;
    animation: floating 15s infinite linear;
    opacity: 0;
    z-index: 0;
}

.background-anim span:nth-child(1) {
    left: 10%;
    width: 80px;
    height: 80px;
    animation-delay: 0s;
    animation-duration: 25s;
}

.background-anim span:nth-child(2) {
    left: 20%;
    width: 20px;
    height: 20px;
    animation-delay: 2s;
    animation-duration: 12s;
}

.background-anim span:nth-child(3) {
    left: 35%;
    width: 60px;
    height: 60px;
    animation-delay: 4s;
}

.background-anim span:nth-child(4) {
    left: 50%;
    width: 40px;
    height: 40px;
    animation-delay: 0s;
    animation-duration: 18s;
}

.background-anim span:nth-child(5) {
    left: 65%;
    width: 20px;
    height: 20px;
    animation-delay: 0s;
}

.background-anim span:nth-child(6) {
    left: 80%;
    width: 90px;
    height: 90px;
    animation-delay: 3s;
    animation-duration: 35s;
}

.background-anim span:nth-child(7) {
    left: 90%;
    width: 30px;
    height: 30px;
    animation-delay: 1s;
    animation-duration: 15s;
}

@keyframes floating {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    20% {
        opacity: 0.3;
    }

    80% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(-120vh) rotate(720deg);
        opacity: 0;
    }
}

/* === LOGIN CONTAINER === */
.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.login-box {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: 15px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
    margin: auto;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    animation: scanline 3s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* === HEADERS === */
.logo-area {
    margin-bottom: 2rem;
    position: relative;
}

.login-logo {
    width: 110px;
    height: 110px;
    object-fit: cover;
    margin-bottom: 15px;
    mix-blend-mode: screen;
    border-radius: 50%;
    animation: floatLogo 4s ease-in-out infinite;
}

@keyframes floatLogo {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }

    100% {
        transform: translateY(0);
    }
}

h2 {
    font-family: 'Orbitron', sans-serif;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 1.5rem;
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

/* === INPUTS === */
.input-group {
    position: relative;
    margin-bottom: 2rem;
    text-align: left;
}

.input-group input {
    width: 100%;
    padding: 10px 0;
    font-size: 1.1rem;
    color: #fff;
    background: transparent;
    border: none;
    border-bottom: 1px solid #555;
    outline: none;
    transition: 0.3s;
    font-family: 'Rajdhani', sans-serif;
    box-shadow: none;
    /* Remove annoying white box shadow if any */
}

/* Autofill fix to prevent white background */
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus,
.input-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0d121e inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

.input-group label {
    position: absolute;
    top: 10px;
    left: 0;
    font-size: 1rem;
    color: #e0e0e0;
    /* Much brighter for readability */
    pointer-events: none;
    transition: 0.3s;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Float label effect */
.input-group input:focus~label,
.input-group input:not(:placeholder-shown)~label,
.input-group input:-webkit-autofill~label {
    top: -20px;
    font-size: 0.75rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
}

.input-group input:focus {
    border-bottom: 1px solid var(--neon-cyan);
    box-shadow: 0 5px 10px -8px var(--neon-cyan);
}

/* === BUTTON === */
.btn-login {
    width: 100%;
    padding: 15px;
    background: transparent;
    color: var(--neon-cyan);
    border: 1px solid var(--neon-cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    text-transform: uppercase;
    margin-top: 1rem;
    border-radius: 5px;
}

.btn-login:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 20px var(--neon-cyan);
}

/* === UTILS === */
.flash-container {
    margin-bottom: 20px;
}

.flash-message {
    background: transparent;
    border: none;
    color: #ff4d4d;
    padding: 0;
    margin-bottom: 10px;
    font-size: 0.85rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    opacity: 0.8;
}

.flash-message.success {
    background: transparent;
    border: none;
    color: #00ff00;
}

.footer-links {
    margin-top: 2rem;
}

.link-recover {
    color: #e0e0e0;
    /* Brighter for readability */
    text-decoration: none;
    font-size: 0.9rem;
    /* Slightly larger */
    letter-spacing: 1px;
    transition: 0.3s;
}

.link-recover:hover {
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
}

.system-status {
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    color: #444;
    font-size: 0.7rem;
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .login-wrapper {
        padding: 15px;
        align-items: center;
    }

    .login-box {
        padding: 2rem 1.5rem;
        width: 100%;
        max-width: 100%;
    }

    .input-group input {
        font-size: 1rem;
    }
}

/* === LIGHT MODE OVERRIDES === */
body.light-mode {
    background: #f8f9fa !important;
    color: #333;
    background-image:
        radial-gradient(at 10% 10%, rgba(13, 110, 253, 0.1) 0, transparent 50%),
        radial-gradient(at 90% 90%, rgba(0, 243, 255, 0.1) 0, transparent 50%);
    background-attachment: fixed;
}

/* Re-enable and restyle floating particles for light mode */
body.light-mode .background-anim span {
    display: block;
    border: 2px solid rgba(13, 110, 253, 0.6);
    /* Darker border */
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.2);
    background: rgba(13, 110, 253, 0.15);
    /* Darker background */
}

body.light-mode .login-box {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    /* Softer shadow */
}

/* Remove dark scanline, add subtle light shimmy or just hide */
body.light-mode .login-box::before {
    background: linear-gradient(90deg, transparent, rgba(13, 110, 253, 0.4), transparent);
    opacity: 0.5;
}

body.light-mode h2 {
    color: #2c3e50;
    text-shadow: none;
    font-weight: 700;
}

/* Inputs: Light gray background, dark text */
body.light-mode .input-group input {
    color: #333;
    background: #e9ecef;
    /* Light gray */
    border-bottom: 2px solid #ced4da;
    border: 1px solid #ced4da;
    /* Full border for clarity on gray */
    border-radius: 5px;
    padding: 10px;
}

/* Fix Autofill background in light mode */
body.light-mode .input-group input:-webkit-autofill,
body.light-mode .input-group input:-webkit-autofill:hover,
body.light-mode .input-group input:-webkit-autofill:focus,
body.light-mode .input-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #e9ecef inset !important;
    /* Match light gray bg */
    -webkit-text-fill-color: #333 !important;
}

body.light-mode .input-group label {
    color: #666;
    left: 10px;
    top: 10px;
}

body.light-mode .input-group input:focus {
    border-color: #0d6efd;
    background: #e9ecef;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

body.light-mode .input-group input:focus~label,
body.light-mode .input-group input:not(:placeholder-shown)~label {
    color: #0d6efd;
    left: 10px;
    top: -22px;
    /* Adjust float position */
    font-weight: 700;
}

body.light-mode .btn-login {
    color: #0d6efd;
    border: 2px solid #0d6efd;
    font-weight: 700;
}

body.light-mode .btn-login:hover {
    background: #0d6efd;
    color: #fff;
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
}

body.light-mode .link-recover {
    color: #666;
}

body.light-mode .link-recover:hover {
    color: #0d6efd;
}

body.light-mode .system-status {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: #999;
}

/* Fix logo visibility in light mode */
body.light-mode .login-logo {
    mix-blend-mode: normal !important;
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.2));
}

/* Theme Button visibility */
body.light-mode .btn-outline-light {
    color: #555 !important;
    border-color: #ccc !important;
}

body.light-mode .btn-outline-light:hover {
    background-color: #333 !important;
    color: #fff !important;
}