/* 
   AUTH CUSTOM CSS - Galaxy & Premium Login 
   Updated for Dark Mode Readability & Responsiveness
*/

:root {
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-blue: #00d2ff;
    --accent-purple: #9d50bb;
    --accent-btn: linear-gradient(90deg, #9d50bb 0%, #6e48aa 50%, #00d2ff 100%);
    --accent-glow: rgba(0, 210, 255, 0.2);
}

/* Force Dark Theme Base for Auth Pages */
body.auth-page {
    background-color: #030712 !important;
    color: #ffffff !important;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "Inter", sans-serif;
    color-scheme: dark;

    /* Force Dark Design Tokens regardless of light-mode class */
    --bg: #0b0d11 !important;
    --text: #e8eef9 !important;
    --muted: #b7c0d8 !important;
    --card: #121621 !important;
    --glass: rgba(255, 255, 255, 0.06) !important;
    --border: rgba(255, 255, 255, 0.12) !important;
}

/* Force Navbar to remain readable in Dark/Auth mode */
body.auth-page .navbar .nav-link,
body.auth-page .navbar .navbar-brand,
body.auth-page .navbar .navbar-brand span,
body.auth-page .navbar .btn-outline-primary {
    color: #ffffff !important;
    opacity: 0.9;
}

body.auth-page .navbar .btn-outline-primary {
    border-color: rgba(255, 255, 255, 0.5) !important;
}

body.auth-page .navbar .btn-outline-primary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

body.auth-page .navbar .nav-link:hover {
    color: var(--accent) !important;
    opacity: 1;
}

/* Hide theme toggle or any light-mode specific indicators on auth pages if they look bad */
body.auth-page .theme-toggle {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* CRITICAL: Reset Main Layout Spacing designed for standard pages */
body.auth-page main {
    margin: 0 !important;
    padding: 0 !important;
}

/* CRITICAL: Navbar Overrides for Visibility on Dark Background */
body.auth-page .navbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.auth-page .navbar-brand,
body.auth-page .navbar-brand span {
    color: #ffffff !important;
}

body.auth-page .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
}

body.auth-page .nav-link:hover,
body.auth-page .nav-link.active {
    color: var(--accent-blue) !important;
}

body.auth-page .navbar-toggler {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

body.auth-page .navbar-toggler i {
    color: #fff !important;
}

/* Galaxy Background Animation */
.galaxy-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    overflow: hidden;
}

.nebula {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(
            circle at 70% 30%,
            rgba(138, 43, 226, 0.15),
            transparent 40%
        ),
        radial-gradient(
            circle at 20% 70%,
            rgba(0, 210, 255, 0.15),
            transparent 40%
        );
    filter: blur(80px);
}

/* Stars Animation */
@keyframes animStar {
    from {
        transform: translateY(0px);
    }
    to {
        transform: translateY(-2000px);
    }
}

#stars,
#stars2,
#stars3 {
    width: 1px;
    height: 1px;
    background: transparent;
    box-shadow:
        120px 200px #fff,
        800px 400px #fff,
        200px 300px #fff,
        600px 800px #fff,
        1000px 200px #fff;
    animation: animStar 50s linear infinite;
}

#stars::after,
#stars2::after,
#stars3::after {
    content: " ";
    position: absolute;
    top: 2000px;
    width: 1px;
    height: 1px;
    background: transparent;
    box-shadow: inherit;
}

#stars2 {
    width: 2px;
    height: 2px;
    animation: animStar 100s linear infinite;
}
#stars3 {
    width: 3px;
    height: 3px;
    animation: animStar 150s linear infinite;
}

/* Premium Auth Container - Standard for simple pages (Forgot Password, etc.) */
.auth-container-premium {
    min-height: 80vh;
    padding-top: 60px; /* Pushed absolutely to the top */
    padding-bottom: 50px;
}

/* Responsive Layout Fixes */
.login-split-container {
    display: flex;
    min-height: 100vh;
    padding-top: 0; /* Handled by children flex-start */
}

.login-form-side {
    flex: 1;
    display: block;
    padding: 60px 2rem 0; /* 60px top (navbar), 0 bottom to let content dictate size */
    z-index: 10;
}

/* Force first child to have no top margin to ensure tightness */
.login-form-side > *,
.login-image-side > * {
    margin-top: 0 !important;
}

.login-image-side {
    flex: 1.2;
    display: block;
    padding: 60px 3rem 0; /* 60px top, 0 bottom */
    position: relative;
    text-align: left;
}

.login-image-side::before {
    content: "";
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 2px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
}

/* Glass Card Refinement */
.glass-login-card {
    background: rgba(20, 20, 30, 0.4);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 40px;
    padding: clamp(2rem, 4vw, 2.5rem); /* Reduced internal padding */
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8);
}

.auth-brand-logo {
    margin-top: 0 !important; /* Force tight alignment */
    margin-bottom: 0.5rem !important; /* Collapse large bootstrap mb-5 completely */
    padding-bottom: 0 !important;
}

.auth-brand-logo h2 {
    color: #ffffff !important;
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
    margin-bottom: 0 !important;
}

/* Hard target the title div Container */
.glass-login-card > .text-center.mb-5 {
    margin-bottom: 1.5rem !important;
}

.auth-brand-logo img {
    max-height: 50px; /* Refined size */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

.auth-brand-logo h2 {
    color: #ffffff !important;
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

.login-title-premium {
    font-size: clamp(1.8rem, 4vw, 2.2rem);
    font-weight: 800;
    margin-bottom: 0 !important; /* Force collapse gap to subtitle */
    color: #ffffff;
    line-height: 1.2;
    min-height: 2.5rem; /* For typing effect jumping */
}

.login-subtitle-premium {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 0 !important; /* Remove gap below subtitle if any */
}

/* Typing Effect Cursor */
.typing-text::after {
    content: "|";
    animation: blink 0.7s infinite;
    margin-left: 5px;
    color: var(--accent-blue);
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Social Login Circles */
.social-login-container {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.social-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-btn:hover {
    background: rgba(0, 210, 255, 0.15);
    border-color: rgba(0, 210, 255, 0.6);
    color: #00d2ff;
    transform: translateY(-5px) scale(1.1);
    box-shadow:
        0 0 20px rgba(0, 210, 255, 0.35),
        0 10px 20px rgba(0, 0, 0, 0.4);
}

.social-btn:hover i {
    color: #00d2ff !important;
}

/* Feature Mini Grid Refinement - Hidden per user request */
.features-mini-grid {
    display: none !important;
}

.feature-mini-item {
    display: none !important;
}

.feature-mini-item i {
    width: 45px;
    height: 45px;
    background: rgba(0, 210, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    font-size: 1.2rem;
}

.feature-mini-item span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Input Styling Fixes */
.premium-input-group {
    position: relative;
    margin-bottom: 20px;
}

.premium-input-group i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    z-index: 5;
}

.premium-input {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    padding: 18px 25px 18px 55px !important;
    border-radius: 18px !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
}

.premium-input:focus {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: none !important;
}

.premium-input:focus + i {
    color: var(--accent-blue);
}

.forgot-password-inline {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: var(--accent-blue);
    text-decoration: none;
    z-index: 10;
    opacity: 0.8;
}

.forgot-password-inline:hover {
    opacity: 1;
}

.btn-premium-login {
    background: var(--accent-btn) !important;
    border: none !important;
    border-radius: 18px !important;
    padding: 16px !important;
    font-weight: 700 !important;
    font-size: 1.2rem !important;
    color: #fff !important;
    width: 100%;
    margin-top: 10px;
    transition: all 0.3s ease !important;
    box-shadow: 0 10px 20px rgba(157, 80, 187, 0.3) !important;
}

.btn-premium-login:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 15px 30px rgba(157, 80, 187, 0.4) !important;
}

/* Footer Fixes for Dark Context */
/* Footer & Navbar Force Dark */
body.auth-page .footer-modern,
body.auth-page footer {
    background: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
}

body.auth-page .footer-modern *,
body.auth-page footer * {
    color: rgba(255, 255, 255, 0.7) !important;
}

body.auth-page .footer-modern .text-info,
body.auth-page .footer-modern a:hover,
body.auth-page footer .text-info,
body.auth-page footer a:hover {
    color: var(--accent-blue) !important;
}

body.auth-page .footer-modern a {
    transition: all 0.3s ease;
}

body.auth-page .footer-logo-text,
body.auth-page .footer-title {
    color: #fff !important;
    font-weight: 700;
}

body.auth-page .navbar {
    background: rgba(0, 0, 0, 0.2) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}
body.auth-page .footer-modern .footer-text,
body.auth-page .footer-modern .footer-contact-list span,
body.auth-page .footer-modern .footer-copyright-text p,
body.auth-page .footer-modern .footer-links a,
body.auth-page .footer-modern .footer-links a i {
    color: rgba(255, 255, 255, 0.9) !important;
}

body.auth-page .footer-modern .footer-links a:hover {
    color: var(--accent-blue) !important;
}

body.auth-page .footer-wave-transition {
    display: none !important; /* Hide wave to avoid clash with galaxy bg */
}

body.auth-page #back-to-top,
body.auth-page #dha-chatbot-container,
body.auth-page .chatbot-toggle-btn,
body.auth-page .chatbot-window {
    display: none !important;
}

@media (max-width: 1199px) {
    .login-image-side {
        flex: 1;
    }
}

@media (max-width: 991px) {
    .login-split-container {
        position: relative;
        flex-direction: column;
        padding-top: 80px !important; /* Increased to clear absolute navbar */
        min-height: 100vh;
    }
    .login-image-side {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        padding: 0;
        z-index: 1; /* Above galaxy-bg (-1) but below form (10) */
        opacity: 0.4; /* Increased from 0.25 for better visibility */
        pointer-events: none;
        overflow: hidden;
    }
    /* Ensure AOS doesn't hide background on mobile */
    .login-image-side [data-aos] {
        opacity: 1 !important;
        transform: translate(0) scale(1) !important;
        transition: none !important;
    }
    .illustration-title,
    .illustration-content .lead,
    .features-mini-grid {
        display: none !important;
    }
    .mockup-container {
        margin: 0 !important;
        transform: scale(1.1); /* Slightly smaller to fit mobile width better */
        width: 100%;
        display: flex;
        justify-content: center;
    }
    .mockup-img {
        max-width: 90% !important; /* Take more width on mobile */
        height: auto;
        filter: blur(1px) drop-shadow(0 0 30px rgba(0, 210, 255, 0.4));
    }
    .login-form-side {
        position: relative;
        z-index: 10;
        padding: 1rem;
        min-height: calc(100vh - 80px); /* Fill screen but allow navbar space */
        background: transparent !important; /* Ensure form side doesn't hide background */
    }
}

@media (max-width: 575px) {
    .login-split-container {
        padding-top: 70px !important;
    }
    .auth-container-premium {
        padding-top: 80px !important; /* Increased to clear absolute navbar */
        padding-bottom: 20px !important;
        min-height: auto !important;
    }
    .glass-login-card {
        padding: 1.5rem;
        border-radius: 24px;
    }
    .login-title-premium {
        font-size: 1.5rem;
        min-height: 2.5rem;
    }
    .auth-brand-logo img {
        max-height: 45px;
    }
}
