/* ==========================================================================
   Auth Pages Styles (Premium Glassmorphism + Houdini Border Animation)
   ========================================================================== */

/* Load global styles for navbar consistency */
@import url("../css/main.css");
@import url("../css/layout.css");
@import url("../css/components.css");
@import url("../css/responsive.css");

/**
  Browser should support Houdini API for smooth variable animation
*/
@property --gradient-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

:root {
    --bg-background: #050a18;
    --clr-card: rgba(255, 255, 255, 0.05);
    --clr-card-border: rgba(255, 255, 255, 0.1);
    
    /* Animation Colors - Matching the image's blue/cyan theme */
    --clr-1: #0061ff; 
    --clr-2: #60efff; 
    --clr-3: #0061ff;
    
    --text-white: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --input-bg: rgba(0, 30, 60, 0.4);
    --accent-blue: #0077ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    width: 100%;
    margin: 0;
    background-color: var(--bg-background);
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* ==========================================================================
   Auth Pages Navbar Redesign (Ultra-Clear & Premium)
   ========================================================================== */

.navbar {
    background: rgba(10, 20, 45, 0.7) !important; 
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.4), 
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    padding: 0.6rem 1rem !important;
}

/* 1. Global Nav Link Visibility Fix (Override main.css black text) */
body .navbar .nav-link,
body .desktop-nav .nav-link,
body .navbar-container .nav-link,
.nav-link {
    color: #ffffff !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    letter-spacing: 1px !important;
    padding: 0.6rem 1.4rem !important;
    border-radius: 999px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* 2. Hover State: Pure White Background, Black Text */
body .navbar .nav-link:hover,
body .desktop-nav .nav-link:hover,
.nav-link:hover {
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: 0 8px 15px rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-2px) !important;
    text-shadow: none !important;
}

/* 3. Logo Branding Pill (Matching User Image) */
.navbar-container .logo {
    background: rgba(255, 255, 255, 0.15) !important;
    padding: 0.5rem 1.8rem !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
}

.navbar-container .logo:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
}

.navbar-container .logo rmc-logo {
    filter: brightness(1.2) drop-shadow(0 0 5px rgba(255,255,255,0.3)) !important;
}

/* 4. Auth Buttons in Navbar (SIGN IN / SIGN UP) - Glassy Pill Redesign */
.auth-nav .btn-elegant {
    border-radius: 999px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    background: rgba(220, 220, 225, 0.45) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(0, 0, 0, 0.5) !important;
    color: #000000 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
}

.auth-nav .btn-elegant:hover {
    background: rgba(220, 220, 225, 0.65) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2) !important;
    color: #000000 !important;
}

/* Explicitly override both variants to use the same glassy theme */
.auth-nav .btn-elegant-outline,
.auth-nav .btn-elegant-primary {
    background: rgba(220, 220, 225, 0.45) !important;
    border: 1px solid rgba(0, 0, 0, 0.5) !important;
    color: #000000 !important;
}

.auth-nav .btn-elegant-primary:hover {
    background: #00d2ff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(0, 210, 255, 0.4) !important;
}

/* Mobile Nav Link Consistency for Auth Pages */
.mobile-nav-link {
    color: #ffffff !important;
    border-radius: 12px !important;
    padding: 1rem 2rem !important;
    transition: all 0.3s ease !important;
    font-weight: 600 !important;
}

.mobile-nav-link:hover {
    background: #ffffff !important;
    color: #000000 !important;
}

/* Background Aesthetics */
.auth-video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1; /* As requested */
    opacity: 0.5; /* As requested */
    pointer-events: none;
}

.auth-page-bg {
    display: none; /* Hide previous gradient bg to let video show */
}

.glow-spot {
    position: absolute;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.1;
    z-index: -1;
}

.spot-1 {
    top: -10%;
    right: -10%;
    background: var(--clr-1);
}

.spot-2 {
    bottom: -10%;
    left: -10%;
    background: var(--clr-2);
}

/* Main Wrapper for Centering Card */
.auth-main {
    display: flex;
    align-items: flex-start; /* Changed from center to prevent overlay issues */
    justify-content: center;
    width: 100%;
    min-height: 100vh; /* Changed from height to allow scrolling */
    padding: 120px 1.5rem 3rem; /* Increased top padding to clear navbar */
    position: relative;
    z-index: 1;
}

/* Glassmorphic Card */
.auth-card {
    position: relative;
    z-index: 1; /* As requested */
    width: 100%;
    max-width: 360px; /* Reduced size */
    padding: 2rem; /* Reduced padding */
    background-color: var(--clr-card);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5);
}

/* SHARP 2px Border Animation Effect */
.auth-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    padding: 2px;
    border-radius: inherit;
    background: conic-gradient(
        from var(--gradient-angle),
        transparent 0%,
        var(--clr-1) 25%,
        var(--clr-2) 50%,
        var(--clr-3) 75%,
        transparent 100%
    );
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: rotate 4s linear infinite;
    z-index: -1;
}

/* Outer Glow */
.auth-card::after {
    content: "";
    position: absolute;
    inset: -5px;
    background: inherit; /* Fallback */
    background: conic-gradient(
        from var(--gradient-angle),
        transparent,
        var(--clr-1),
        var(--clr-2),
        var(--clr-3),
        transparent
    );
    filter: blur(20px);
    opacity: 0.3;
    z-index: -2;
    border-radius: inherit;
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    0% { --gradient-angle: 0deg; }
    100% { --gradient-angle: 360deg; }
}

/* Header Circle */
.auth-header {
    margin-bottom: 1.5rem; /* Reduced margin */
}

.circle-icon {
    width: 60px; /* Reduced size */
    height: 60px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.circle-icon i {
    width: 24px;
    height: 24px;
    color: var(--text-white);
    opacity: 0.8;
}

/* Form Styles */
.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Reduced gap to minimize whitespace */
}

/* Ensure Icons stay INSIDE the boxes by making the group the visual container */
.input-group {
    position: relative !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.85) !important; /* Lighter background for black text contrast */
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 14px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

.input-group:focus-within {
    border-color: var(--accent-blue) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 8px 25px rgba(0, 97, 255, 0.15) !important;
}

/* Target ONLY the primary icon on the left (direct child) */
.input-group > i,
.input-group > svg:not(.password-toggle svg) {
    position: absolute !important;
    left: 1.15rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #000000 !important; /* Solid black icon */
    stroke: #000000 !important; /* Ensure SVG stroke is also black */
    width: 18px !important;
    height: 18px !important;
    pointer-events: none !important;
    z-index: 5 !important;
    margin: 0 !important;
}

.floating-label {
    position: absolute !important;
    left: 2.8rem !important; /* Reduced gap - closer to icon */
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 0.92rem !important;
    color: rgba(0, 0, 0, 0.5) !important; /* Dark label */
    pointer-events: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 10 !important;
    background: transparent !important;
    padding: 0 5px !important;
    white-space: nowrap !important;
}

/* Floating Animation States (High Contrast) */
.auth-input:focus + .floating-label,
.auth-input:not(:placeholder-shown) + .floating-label {
    top: 5px !important;
    left: 1rem !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #000000 !important; /* Pure black for float state */
    background: #ffffff !important; /* White background to cut-out border */
    transform: translateY(-100%) !important;
    opacity: 1 !important;
}

.auth-input {
    flex: 1 !important;
    width: 100% !important;
    padding: 1.1rem 1rem 0.9rem 2.8rem !important; /* Adjusted for tighter gap */
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    color: #000000 !important; /* Pure black text */
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    outline: none !important;
    box-shadow: none !important;
}

.auth-input::placeholder {
    color: rgba(0, 0, 0, 0.3) !important;
}

/* Row (Checkbox + Link) */
.auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    width: 100%;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    cursor: pointer;
}

.remember-me input {
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.forgot-link {
    color: var(--text-muted);
    text-decoration: none;
    font-style: italic;
}

.forgot-link:hover {
    color: var(--text-white);
}

/* Login Button - Glassy Pill Redesign */
.auth-btn {
    width: 100%;
    padding: 1rem;
    margin-top: 1.5rem !important;
    background: rgba(220, 220, 225, 0.6) !important; /* Silver literal glass */
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border: 1.5px solid rgba(0, 0, 0, 0.8) !important;
    border-radius: 999px !important; /* Proper pill shape */
    color: #000000 !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
}

.auth-btn:hover {
    background: rgba(240, 240, 255, 0.9) !important;
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3) !important;
    color: #000000 !important;
}

.auth-btn:active {
    transform: translateY(0) scale(0.98) !important;
}

/* Visibility Toggle Styles */
.password-toggle {
    position: absolute !important;
    right: 1.15rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    color: #000000 !important; /* Solid black to match the other icons */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 15 !important;
    transition: all 0.2s ease !important;
    outline: none !important;
}

.password-toggle:hover {
    color: var(--accent-blue) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.password-toggle i,
.password-toggle svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2 !important;
}

/* Ensure password inputs have enough space for the eye icon */
.input-group input[id*="pass"],
.input-group input[id*="confirm"] {
    padding-right: 3.5rem !important;
}

/* Card Footer (Signup Option) */
.auth-card-footer {
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.auth-card-footer a {
    color: var(--text-white);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.5rem;
    transition: border-bottom 0.2s ease;
}

.auth-card-footer a:hover {
    border-bottom: 1px solid var(--text-white);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .auth-card {
        padding: 2.5rem 1.5rem;
    }
}
