/* login.css - Consolidated styles for Login and Register pages.
   Includes split-screen layout, category pills, and mobile enhancements.
*/

/* =========================================
   1. LAYOUT STRUCTURE
   ========================================= */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: #ffffff;
    overflow: hidden;
    position: relative;
}

/* --- Left Side (Form) --- */
.auth-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 60px;
    max-width: 600px;
    background: #ffffff;
    position: relative;
    z-index: 2;
}

/* Messages in auth pages */
.auth-content .messages-container {
    align-items: stretch;
    padding: 0;
    margin-bottom: 20px;
    width: 100%;
    max-width: 400px;
}

.auth-content .messages-container .alert {
    width: 100%;
    max-width: none;
}

/* --- Right Side (Brand/Visual) --- */
.auth-banner {
    flex: 1.2;
    background-color: #FFF8E1;
    background-image: radial-gradient(circle at top right, #fff3cd 0%, #fff8e1 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    overflow: hidden;
}

/* Decorative shapes for the banner (Desktop only) */
.auth-banner::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(60px);
}

.auth-banner::after {
    content: '';
    position: absolute;
    bottom: -5%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: var(--nav-text-color);
    border-radius: 50%;
    opacity: 0.05;
    filter: blur(40px);
}

/* =========================================
   2. COMPONENTS (Pills, Forms, Typography)
   ========================================= */
.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 800;
    color: var(--nav-text-color);
    text-decoration: none;
    margin-bottom: 40px;
}

.auth-logo span {
    color: var(--primary-color);
    font-size: 28px;
}

.auth-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--nav-text-color);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 16px;
    color: var(--secondary-color);
    line-height: 1.5;
}

.category-pill {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--category-bg);
    color: var(--category-text);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid var(--category-border);
    cursor: default;
}

.auth-form {
    width: 100%;
    max-width: 400px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--nav-text-color);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    background-color: #ffffff;
    transition: all 0.2s ease;
    color: var(--text-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.15);
    outline: none;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary-color);
    padding: 0;
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: var(--nav-text-color);
}

.btn-auth {
    width: 100%;
    height: 48px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
}

/* Google Auth button */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: #ffffff !important;
    color: #3c4043 !important;
    border: 1px solid #dadce0 !important;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
    margin-top: 12px;
}

.btn-google:hover {
    background-color: #f8f9fa !important;
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.30), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: #9aa0a6;
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dadce0;
}

.auth-divider::before {
    margin-right: .5em;
}

.auth-divider::after {
    margin-left: .5em;
}

.auth-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 14px;
    color: var(--secondary-color);
    max-width: 400px;
}

.auth-link {
    color: var(--nav-text-color);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.auth-link:hover {
    border-bottom-color: var(--primary-color);
    color: var(--primary-hover-color);
}

.forgot-password {
    display: block;
    text-align: right;
    font-size: 13px;
    margin-top: 8px;
    color: var(--secondary-color);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.htmx-indicator {
    display: none;
}

.htmx-request.htmx-indicator {
    display: flex;
}

/* =========================================
   3. BANNER CONTENT (Right Side)
   ========================================= */
.banner-content {
    position: relative;
    max-width: 440px;
    text-align: center;
    z-index: 1;
}

.banner-quote {
    font-size: 24px;
    font-weight: 600;
    color: var(--nav-text-color);
    line-height: 1.4;
    margin-bottom: 24px;
    font-style: italic;
}

.banner-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
    text-align: left;
    transform: rotate(-2deg);
    border: 1px solid rgba(0, 0, 0, 0.03);
    animation: float 6s ease-in-out infinite;
}

.banner-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.banner-card-vendor {
    font-weight: 700;
    color: #343a40;
}

.banner-card-amount {
    font-weight: 700;
    color: var(--danger-color);
}

.banner-user {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.banner-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #dee2e6;
    border-radius: 50%;
    font-weight: 700;
    color: #495057;
}

.banner-user-info {
    text-align: left;
}

.banner-user-name {
    font-size: 14px;
    font-weight: 700;
    color: #343a40;
}

.banner-user-role {
    font-size: 12px;
    color: #6c757d;
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(-2deg);
    }
    50% {
        transform: translateY(-15px) rotate(-1deg);
    }
    100% {
        transform: translateY(0px) rotate(-2deg);
    }
}

/* =========================================
   4. MOBILE ENHANCEMENTS & ANIMATIONS
   ========================================= */
@media (max-width: 900px) {

    .auth-wrapper {
        /* Background glow from top to bottom */
        background: linear-gradient(180deg, rgba(255, 193, 7, 0.08) 0%, rgba(255, 255, 255, 1) 100%);
        position: relative;
        flex-direction: column; /* Stack components vertically */
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Clean up previous blob effects */
    .auth-wrapper::before, .auth-wrapper::after {
        display: none !important;
    }

    .auth-content {
        padding: 40px 20px;
        background: transparent !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        max-width: 100%;
        flex: none; /* Let it take its natural height */
    }

    .auth-logo {
        /* Simple centered logo */
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 40px !important;
        justify-content: center;
        width: 100%;
    }

    .auth-header {
        text-align: center;
        margin-bottom: 32px;
    }

    .auth-title {
        font-size: 30px;
        color: var(--nav-text-color);
        background: none !important;
        -webkit-text-fill-color: initial !important;
        letter-spacing: -1px;
    }

    .auth-form {
        background: white;
        padding: 30px 24px;
        border-radius: 20px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
        margin: 0 auto;
        width: 100%;
        max-width: 400px;
    }

    .auth-footer {
        margin-top: 24px;
        background: rgba(255, 255, 255, 0.5);
        padding: 15px;
        border-radius: 12px;
        width: 100%;
        text-align: center;
    }

    /* Mobile Banner Overrides: Show below the form */
    .auth-banner {
        display: flex !important; /* Force visible */
        flex: none;
        background: transparent;
        padding: 15px 20px;
        width: 100%;
        justify-content: center;
        overflow: hidden; /* Prevent animation overflow */
    }

    .auth-banner::before, .auth-banner::after {
        display: none; /* Remove desktop-only decorative elements */
    }

    .banner-content {
        max-width: 100%;
        width: 100%;
    }

    .banner-card {
        max-width: 100%;
        box-sizing: border-box;
        transform: none; /* Remove desktop rotation for better mobile fit */
        animation: float-mobile 6s ease-in-out infinite;
        margin: 0 auto 30px auto;
    }

    .banner-quote {
        font-size: 18px;
        color: var(--secondary-color);
    }
}

@keyframes float-mobile {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Entrance Animations */
.auth-content > * {
    animation: slideUp 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-logo {
    animation-delay: 0.1s;
}

.auth-header {
    animation-delay: 0.2s;
}

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

.auth-footer {
    animation-delay: 0.4s;
}