/* =======================================================
   LOGIN/SIGNUP MODAL - INDUSTRIAL PREMIUM DESIGN (2026)
   ======================================================= */

/* --- Core Modal Overlay --- */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    /* Slightly darker for contrast */
    backdrop-filter: blur(16px) saturate(180%);
    /* Heavy premium blur */
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* --- The Industrial Glass Container --- */
.auth-modal-container {
    position: relative;
    max-width: 1000px;
    width: 90%;
    /* max-height: 85vh;  Let content dictate height to avoid scroll within modal if possible, or keep it */
    height: auto;
    max-height: 90vh;

    background: #FFFFFF;
    /* Fallback */
    background: rgba(255, 255, 255, 0.85);
    /* Light mode premium glass */
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);

    /* Industrial Border Logic */
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    /* Large smooth corners */

    /* Deep Elevated Shadow */
    box-shadow:
        0 25px 50px -12px rgba(15, 23, 42, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    /* Inner highlight */

    overflow: hidden;
    /* For the split layout */
    transform: scale(0.95) translateY(10px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    /* Elegant spring */

    display: flex;
    /* Ensure split layout works */
    flex-direction: column;
}

/* Dark Mode Override */
html.dark .auth-modal-container {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.auth-modal-overlay.active .auth-modal-container {
    transform: scale(1) translateY(0);
}

/* --- Close Button (Floating) --- */
.auth-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 50;
    /* Above everything */
    color: #64748B;
}

html.dark .auth-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94A3B8;
}

.auth-modal-close:hover {
    background: #FF4444;
    /* Destructive action hint */
    color: white;
    transform: rotate(90deg);
    border-color: transparent;
}

/* --- Split Layout --- */
.auth-modal-split {
    display: grid;
    grid-template-columns: 45% 55%;
    /* Asymmetric split for modern look */
    height: 100%;
    min-height: 600px;
    /* Minimum height for strict presence */
}

/* --- Left Side: The "Vision" Slider --- */
.auth-modal-slider {
    position: relative;
    background: #0F172A;
    /* Fallback */
    overflow: hidden;
}

/* The Background Image/Graphic */
.auth-modal-slider::before {
    content: '';
    position: absolute;
    inset: 0;
    /* Abstract Tech Gradient/Mesh */
    background:
        radial-gradient(circle at 10% 20%, rgba(92, 95, 238, 0.4) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(14, 165, 233, 0.4) 0%, transparent 40%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    opacity: 0.9;
    z-index: 1;
}

/* Grid Overlay */
.auth-modal-slider::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 2;
    pointer-events: none;
}

/* Slider Track */
.auth-slider-track {
    position: relative;
    z-index: 10;
    height: 100%;
    width: 100%;
}

.auth-slider-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Align left for industrial feel */
    justify-content: center;
    padding: 4rem;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.auth-slider-slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Icon Box */
.auth-slide-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    color: #38BDF8;
    /* Sky Blue */
}

/* Typography */
.auth-slide-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: white;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.auth-slide-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #94A3B8;
    /* Slate 400 */
    max-width: 90%;
}

/* Indicators */
.auth-slider-indicators {
    position: absolute;
    bottom: 3rem;
    left: 4rem;
    display: flex;
    gap: 0.75rem;
    z-index: 20;
}

.auth-slider-dot {
    width: 3rem;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-slider-dot.active {
    background: #38BDF8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* --- Right Side: The Control Panel (Form) --- */
.auth-modal-form-container {
    padding: 0;
    /* REMOVED PADDING to allow children to handle their own padding */
    background: transparent;
    /* Rely on container background */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Changed from center to start */
    position: relative;
    overflow: hidden;
    /* Hide overflow on container, scroll content instead */
    height: 100%;
    /* Ensure it takes full height */
}

/* --- Fixed Header Section --- */
.auth-fixed-header {
    flex: 0 0 auto;
    /* Don't grow or shrink */
    background: transparent;
    padding: 4rem 4rem 1rem 4rem;
    /* Top, Right, Bottom-small, Left */
    z-index: 10;
}

/* --- Scrollable Content Section --- */
.auth-scrollable-content {
    flex: 1;
    /* Take remaining space */
    overflow-y: auto;
    /* Scrollable */
    padding: 0 4rem 4rem 4rem;
    /* Top-0, Right, Bottom, Left */

    /* Scrollbar styling for this specific area */
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

.auth-scrollable-content::-webkit-scrollbar {
    width: 6px;
}

.auth-scrollable-content::-webkit-scrollbar-track {
    background: transparent;
}

.auth-scrollable-content::-webkit-scrollbar-thumb {
    background-color: rgba(203, 213, 225, 0.5);
    border-radius: 20px;
}

.auth-scrollable-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(148, 163, 184, 0.8);
}

/* Mobile responsive fix */
@media (max-width: 1024px) {
    .auth-modal-split {
        grid-template-columns: 1fr;
    }

    .auth-modal-slider {
        display: none;
        /* Hide slider on smaller screens */
    }

    .auth-modal-form-container {
        padding: 0;
    }

    .auth-fixed-header {
        padding: 3rem 2rem 1rem 2rem;
    }

    .auth-scrollable-content {
        padding: 0 2rem 3rem 2rem;
    }
}

/* Form Header */
.auth-form-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-form-logo {
    height: 60px;
    width: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.auth-form-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #1A1C1D;
    letter-spacing: -0.03em;
}

html.dark .auth-form-title {
    color: white;
}

.auth-form-subtitle {
    color: #64748B;
    margin-top: 0.5rem;
}

/* Form Tabs (Pill Switch) */
.auth-form-tabs {
    background: #F1F5F9;
    padding: 0.25rem;
    border-radius: 9999px;
    display: flex;
    margin-bottom: 2.5rem;
    border: 1px solid #E2E8F0;
}

html.dark .auth-form-tabs {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.auth-tab-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 9999px;
    border: none;
    background: transparent;
    color: #64748B;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-tab-btn.active {
    background: white;
    color: #0F172A;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

html.dark .auth-tab-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Inputs */
.auth-form-group {
    margin-bottom: 1.5rem;
    position: relative;
    /* Adding stagger delay logic here purely by index requires nth-child on the parent, 
       but since we can't easily count all groups, we rely on the animation applied globally */
}

.auth-form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

html.dark .auth-form-label {
    color: #CBD5E1;
}

.auth-form-input {
    width: 100%;
    padding: 0.9rem 1.25rem;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    color: #0F172A;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
}

html.dark .auth-form-input {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Focus State - Electric Cobalt Glow */
.auth-form-input:focus {
    outline: none;
    border-color: #5C5FEE;
    background: white;
    box-shadow:
        0 0 0 4px rgba(92, 95, 238, 0.15),
        0 0 0 1px rgba(92, 95, 238, 0.1);
}

html.dark .auth-form-input:focus {
    background: rgba(255, 255, 255, 0.05);
}

.auth-password-wrapper {
    position: relative;
}

.auth-password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94A3B8;
    padding: 0.5rem;
}

.auth-password-toggle:hover {
    color: #5C5FEE;
}

.auth-password-toggle svg {
    width: 20px;
    height: 20px;
}

/* Submit Button - The "Hero" Action */
.auth-submit-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #5C5FEE 0%, #4F46E5 100%);
    /* Electric Cobalt */
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3), 0 2px 4px -1px rgba(79, 70, 229, 0.2);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.4);
    filter: brightness(1.1);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

/* Shimmer Overlay */
.auth-submit-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.auth-submit-btn:hover::after {
    left: 100%;
    transition: 0.5s;
}

/* Links (Forgot / Switch) */
.auth-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: #64748B;
}

.auth-checkbox-label input[type="checkbox"] {
    accent-color: #5C5FEE;
    width: 16px;
    height: 16px;
}

.auth-forgot-link,
.auth-switch-link {
    color: #5C5FEE;
    font-weight: 600;
    text-decoration: none;
}

.auth-forgot-link:hover,
.auth-switch-link:hover {
    text-decoration: underline;
}

.auth-form-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.95rem;
    color: #64748B;
}

/* Panel Visibility */
.auth-form-panel {
    display: none;
    animation: fadeInScale 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-form-panel.active {
    display: block;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animations using Stagger */
.auth-form-group,
.auth-form-row,
.auth-submit-btn {
    opacity: 0;
    animation: slideUpFade 0.5s ease forwards;
}

.auth-form-group:nth-child(1) {
    animation-delay: 0.1s;
}

.auth-form-group:nth-child(2) {
    animation-delay: 0.2s;
}

.auth-form-group:nth-child(3) {
    animation-delay: 0.3s;
}

.auth-form-row {
    animation-delay: 0.3s;
}

.auth-submit-btn {
    animation-delay: 0.4s;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}