/* =====================================================
   AUTH PAGES - Modern Design
   ===================================================== */

/* ===== BACKGROUND ===== */
.content:has(.car_banner) {
    min-height: 100vh;
}

.car_banner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f0fdf4 0%, #e2e8f0 50%, #f0fdf4 100%);
    padding: 20px;
    margin: 0;
    position: relative;
    overflow: hidden;
}

/* Decorative background shapes */
.car_banner::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(22, 163, 74, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.car_banner::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(22, 163, 74, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Floating decorative background pattern - applied to car_banner background */
.car_banner {
    background:
        /* Top-left circle */
        radial-gradient(circle at 10% 15%, rgba(22, 163, 74, 0.07) 0%, transparent 40%),
        /* Bottom-right circle */
        radial-gradient(circle at 90% 85%, rgba(22, 163, 74, 0.05) 0%, transparent 35%),
        /* Center-left accent */
        radial-gradient(circle at 5% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 30%),
        /* Top-right accent */
        radial-gradient(circle at 85% 10%, rgba(34, 197, 94, 0.05) 0%, transparent 25%),
        /* Subtle dot grid pattern */
        radial-gradient(circle, rgba(22, 163, 74, 0.04) 1px, transparent 1px),
        /* Base gradient */
        linear-gradient(135deg, #f0fdf4 0%, #e2e8f0 50%, #f0fdf4 100%);
    background-size:
        100% 100%,
        100% 100%,
        100% 100%,
        100% 100%,
        32px 32px,
        100% 100%;
}

/* ===== AUTH CARD ===== */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid #e8eeeb;
    padding: 40px 36px;
    animation: authFadeIn 0.4s ease;
    position: relative;
    z-index: 1;
}

.auth-card.auth-card--wide {
    max-width: 580px;
}

/* ===== LOGO ===== */
.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.auth-logo img {
    height: 48px;
    width: auto;
}

/* ===== TITLE ===== */
.auth-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    text-align: center;
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}

.auth-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    margin: 0 0 28px;
    font-weight: 500;
}

/* ===== FORM INPUTS ===== */
.auth-field {
    margin-bottom: 16px;
}

.auth-field-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.auth-input-wrap {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #0f172a;
    background: #f8fafc;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}

.auth-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.auth-input:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
    background: #ffffff;
}

/* Password toggle */
.auth-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px;
    color: #94a3b8;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.auth-pw-toggle:hover {
    color: #16a34a;
}

.auth-pw-toggle img {
    width: 18px;
    height: 18px;
}

/* Error messages */
.auth-err {
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: right;
    display: block;
    margin-top: 4px;
}

/* For backwards compat with existing err_msg class */
.err_msg {
    color: #ef4444 !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    float: right !important;
    padding: 2px 0 8px 0 !important;
}

.loginerr_msg {
    color: #ef4444 !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    float: right !important;
}

/* ===== SELECT DROPDOWNS ===== */
.auth-select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #0f172a;
    background: #f8fafc;
    transition: all 0.2s ease;
    font-family: inherit;
    appearance: none;
    cursor: pointer;
}

.auth-select:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
    outline: none;
    background: #ffffff;
}

/* ===== REMEMBER ME ===== */
.auth-remember {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    margin-top: 2px;
}

.auth-remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.auth-remember-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #16a34a;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.auth-remember-text {
    font-size: 0.83rem;
    font-weight: 500;
    color: #64748b;
}

/* ===== BUTTONS ===== */
.auth-btn {
    width: 100%;
    padding: 13px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-btn--primary {
    background: linear-gradient(135deg, #15803d, #16a34a);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.2);
}

.auth-btn--primary:hover {
    background: linear-gradient(135deg, #14532d, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3);
}

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

.auth-btn--secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #e2e8f0;
}

.auth-btn--secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Keep existing btn_green for backwards compat */
.login_button,
.signup_button {
    background: linear-gradient(135deg, #15803d, #16a34a) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 13px 24px !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.2) !important;
    transition: all 0.2s ease !important;
}

.login_button:hover,
.signup_button:hover {
    background: linear-gradient(135deg, #14532d, #15803d) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.3) !important;
}

/* ===== AUTH LINKS ===== */
.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.auth-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: #16a34a;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-link:hover {
    color: #15803d;
}

.auth-link i {
    font-size: 0.8rem;
}

.auth-footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.auth-footer-text a {
    color: #16a34a;
    font-weight: 700;
    text-decoration: none;
}

.auth-footer-text a:hover {
    color: #15803d;
}

/* ===== DIVIDER ===== */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider span {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== OTP INPUTS ===== */
.auth-otp-wrap {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 24px 0 16px;
}

.auth-otp-wrap .otp-box {
    width: 56px;
    height: 56px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    background: #f8fafc;
    color: #0f172a;
    transition: all 0.2s ease;
    margin: 0;
}

.auth-otp-wrap .otp-box:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
    background: #ffffff;
}

.auth-otp-wrap .otp-box.empty {
    border-color: #cbd5e1;
}

.auth-otp-err {
    color: #ef4444;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    display: block;
    margin-bottom: 16px;
}

/* ===== OTP BUTTONS ===== */
.auth-otp-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.auth-otp-actions .btn {
    flex: 1;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    padding: 12px 20px;
}

#resendBtn {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
}

#resendBtn:hover:not(:disabled) {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

#resendBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-disabled {
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

.btn-enabled {
    background: #3b82f6 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    opacity: 1 !important;
}

.btn-enabled:hover {
    background: #2563eb !important;
}

/* ===== FORM ROW (for signup 2-col) ===== */
.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-form-row .auth-field {
    margin-bottom: 4px;
}

/* ===== INPUT BOX (backwards compat) ===== */
.input_box {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 0.9rem;
    font-weight: 500;
    color: #0f172a;
    background: #f8fafc;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
    margin: 6px 0;
}

.input_box::placeholder {
    color: #94a3b8;
    font-weight: 400;
    font-size: 0.85rem;
}

.input_box:focus {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
    background: #ffffff;
    outline: none !important;
}

.form-control:focus {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1) !important;
}

/* ===== CARD OVERRIDES ===== */
#main_card {
    border-radius: 20px !important;
    border: 1px solid #e8eeeb !important;
    background: #ffffff !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden;
}

#main_card .card-body {
    padding: 36px !important;
}

.card-title {
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em;
}

/* ===== PASSWORD TOGGLE ===== */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.toggle-password-1,
.toggle-password {
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

.toggle-password-1:hover,
.toggle-password:hover {
    color: #16a34a;
}

.input-with-icon {
    position: relative;
    width: 100%;
}

.input-with-icon .toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

.input-with-icon .toggle-password:hover {
    color: #16a34a;
}

/* ===== AUTH MAIN (backwards compat) ===== */
.auth_main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh !important;
}

/* ===== SIGNUP LINK COLORS ===== */
.signup_here,
.login_here {
    color: #16a34a !important;
    font-weight: 700;
    transition: color 0.2s;
}

.signup_here:hover,
.login_here:hover {
    color: #15803d !important;
}

/* ===== SIGNUP SPECIFIC ===== */
.resend_button {
    padding: 12px 20px !important;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resend_button:hover {
    background: #e2e8f0;
}

.new_active {
    opacity: 0.5;
    pointer-events: none !important;
}

.hidden {
    display: none;
}

/* ===== SELECT2 OVERRIDES ===== */
.select2-container--default .select2-selection--single {
    height: auto !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    background: #f8fafc !important;
    font-family: inherit;
    transition: all 0.2s ease;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--single:hover {
    border-color: #16a34a !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 24px !important;
    font-size: 0.9rem !important;
    color: #0f172a !important;
    padding: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #94a3b8 !important;
    font-size: 0.85rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    display: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    display: none !important;
}

.select2-dropdown {
    border-radius: 10px !important;
    border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden;
}

.select2-container--default .select2-results__option {
    padding: 10px 14px !important;
    font-size: 0.88rem !important;
    color: #475569 !important;
    transition: all 0.15s ease;
}

.select2-container--default .select2-results__option--highlighted,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #f0fdf4 !important;
    color: #16a34a !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 10px 14px !important;
    font-size: 0.88rem !important;
    outline: none !important;
    box-shadow: none !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Dropdown icon for selects */
.dropdown-container {
    position: relative;
    width: 100%;
}

.dropdown-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 12px;
    z-index: 1;
}

/* ===== ANIMATION ===== */
@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .car_banner {
        padding: 12px;
    }

    .auth-card {
        padding: 28px 24px;
    }

    #main_card .card-body {
        padding: 24px !important;
    }

    .auth-form-row {
        grid-template-columns: 1fr;
    }

    .auth-otp-wrap .otp-box {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }

    .auth-otp-actions {
        flex-direction: column;
    }

    .auth-links {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 450px) {
    #main_card {
        width: 100% !important;
        margin: 0 !important;
    }

    .auth-otp-wrap .otp-box {
        width: 44px;
        height: 44px;
        font-size: 1rem;
        gap: 8px;
    }

    .auth-otp-wrap {
        gap: 8px;
    }
}

@media (min-width: 576px) {
    #main_card {
        min-width: 400px;
    }
}
