/* ==========================================================================
   PREMIUM AUTHENTICATION PAGE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --auth-bg-dark: #12141D;
    --auth-panel-bg: #FFFFFF;
    --auth-input-bg: #F7FAFC;
    --auth-border-color: #E2E8F0;
    --auth-text-light: #A0AEC0;
    --auth-text-dark: #2D3748;
    --auth-brand-primary: #005A9C;
    --auth-brand-secondary: #004070;
}

body, html {
    height: 100%;
}

body.auth-page {
    background-color: var(--auth-bg-dark); 
}

.auth-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    position: relative;
}

/* ==========================================================================
   DESKTOP STYLES (Applies to screens > 992px)
   ========================================================================== */

.back-to-app-button {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 10;
    color: #FFFFFF;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.back-to-app-button i {
    margin-right: 8px;
}

.back-to-app-button:hover {
    background-color: rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
}

.auth-panel-left {
    flex: 1 1 55%;
    background: url('https://images.unsplash.com/photo-1552519507-da3b142c6e3d?q=80&w=2070&auto=format&fit=crop') no-repeat center center;
    background-size: cover;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 50px;
}

.brand-overlay {
    z-index: 2;
    background: linear-gradient(to top, rgba(18, 20, 29, 0.8), rgba(18, 20, 29, 0.2));
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 50px;
}

.logo-desktop {
    display: block;
}

.logo-mobile {
    display: none;
}

.auth-panel-left .logo-img {
    height: 40px;
    filter: brightness(0) invert(1); /* Makes the logo white */
}

.brand-tagline h1 {
    font-family: 'Poppins', sans-serif;
    color: #FFFFFF;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -1px;
    max-width: 500px;
    margin-bottom: 15px;
}

.brand-tagline p {
    color: var(--auth-text-light);
    font-size: 20px;
    max-width: 450px;
    font-weight: 500;
}

.auth-panel-right {
    flex: 1 1 45%;
    background-color: var(--auth-panel-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 32px;
    font-weight: 600;
    color: var(--auth-text-dark);
    margin-bottom: 10px;
}

.form-header p {
    color: var(--auth-text-light);
    font-size: 16px;
    font-weight: 500;
}

.input-group {
    display: block; 
    position: relative;
    margin-bottom: 25px;
}

.input-group-stacked {
    display: none; 
}

.input-group i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--auth-text-light);
    font-size: 16px;
    transition: color 0.3s ease;
}

.input-group input {
    width: 100%;
    padding: 18px 20px 18px 50px;
    border-radius: 10px;
    border: 1px solid var(--auth-border-color);
    background-color: var(--auth-input-bg);
    font-size: 16px;
    font-weight: 500;
    color: var(--auth-text-dark);
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: var(--auth-text-light);
    font-weight: 400;
}

.input-group input:focus {
    outline: none;
    border-color: var(--auth-brand-primary);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.1);
}

.input-group input:focus ~ i {
    color: var(--auth-brand-primary);
}

.form-options {
    display: flex;
    justify-content: flex-end;
    margin-top: -15px; 
    margin-bottom: 30px; 
}

.forgot-password {
    color: var(--auth-brand-primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.forgot-password:hover {
    text-decoration: underline;
}

.auth-button {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 10px;
    background-image: linear-gradient(to right, var(--auth-brand-secondary), var(--auth-brand-primary));
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 5px 15px rgba(0, 90, 156, 0.2);
}

.auth-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 90, 156, 0.3);
}

.form-footer {
    text-align: center;
    margin-top: 40px;
    color: var(--auth-text-light);
}

.form-footer a {
    color: var(--auth-brand-primary);
    font-weight: 700;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

.social-login-divider, .social-login-buttons {
    display: none; 
}

.auth-error-message {
    background-color: #fff5f5;
    color: #c53030;
    border: 1px solid #fecaca;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 15px;
}

.hidden {
    display: none !important;
}


/* ==========================================================================
   MOBILE STYLES (CarFax Inspired - Applies to screens <= 992px)
   ========================================================================== */
@media (max-width: 992px) {
    body.auth-page {
        background-color: var(--auth-panel-bg);
    }

    .auth-container {
        flex-direction: column;
    }

    .back-to-app-button {
        color: var(--auth-text-dark);
        background-color: transparent;
        top: 20px;
        right: 20px;
        padding: 5px;
        backdrop-filter: none;
    }

    .back-to-app-button:hover {
        background-color: var(--auth-input-bg);
    }
    
    .auth-panel-left {
        display: none; 
    }

    .auth-panel-right {
        padding: 20px;
        align-items: flex-start;
    }
    
    .auth-form-container {
        margin-top: 60px;
    }

    .logo-desktop {
        display: none;
    }

    .logo-mobile {
        display: block;
        text-align: center;
        margin-bottom: 40px;
    }

    .logo-mobile .logo-img {
        height: 35px;
        filter: none; 
    }

    .form-header {
        text-align: left;
        margin-bottom: 30px;
    }

    .form-header h2 {
        font-size: 28px;
    }
    
    /* --- FIX START: FORCE MAIN INPUTS TO SHOW ON MOBILE --- */
    .input-group {
        display: block; 
        width: 100%;
    }
    /* --- FIX END --- */

    .input-group-stacked {
        display: none; 
    }

    .form-options {
        justify-content: flex-start; /* Left-aligns the link */
        margin-top: -10px; 
        margin-bottom: 25px; 
    }

    .auth-button {
        margin-top: 0; 
    }

    .social-login-divider {
        display: flex;
        align-items: center;
        text-align: center;
        color: var(--auth-text-light);
        margin: 30px 0;
    }
    .social-login-divider::before,
    .social-login-divider::after {
        content: '';
        flex: 1;
        border-bottom: 1px solid var(--auth-border-color);
    }
    .social-login-divider:not(:empty)::before {
        margin-right: .5em;
    }
    .social-login-divider:not(:empty)::after {
        margin-left: .5em;
    }

    .social-login-buttons {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .social-button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 15px;
        border: 1px solid var(--auth-border-color);
        border-radius: 8px;
        font-size: 16px;
        font-weight: 500;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }

    .social-button i {
        font-size: 20px;
        margin-right: 12px;
    }

    .social-button.apple {
        background-color: #000000;
        color: #FFFFFF;
        border-color: #000000;
    }

    .social-button.google {
        background-color: #FFFFFF;
        color: var(--auth-text-dark);
    }

    .social-button.google:hover {
        background-color: var(--auth-input-bg);
    }

    .form-footer {
        margin-top: 30px;
    }
}