/**
 * Auth pages — cross-browser layout and form compatibility.
 * Targets Chrome, Firefox, Safari (incl. iOS), Edge, and legacy flexbox engines.
 */

html.auth-html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.auth-page {
    margin: 0;
}

.auth-split {
    width: 100%;
}

/* Desktop: 50/50 columns even when CSS grid is unavailable */
@media (min-width: 901px) {
    .auth-split-brand,
    .auth-split-form {
        -webkit-box-flex: 1;
        -ms-flex: 1 1 50%;
        flex: 1 1 50%;
        width: 50%;
        max-width: 50%;
    }
}

.auth-split-brand {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    background-color: #1f3a5f;
}

.auth-split-form {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    background-color: #f4f7fb;
}

.auth-split-features li {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

/* gap fallback for browsers without flex gap */
.auth-split-features li i {
    -ms-flex-negative: 0;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

@supports (gap: 0.75rem) {
    .auth-split-features li i {
        margin-right: 0;
    }
}

.auth-page .auth-split-brand h2 {
    font-size: 1.65rem;
}

@supports (font-size: clamp(1rem, 2vw, 2rem)) {
    .auth-page .auth-split-brand h2 {
        font-size: clamp(1.65rem, 3vw, 2.15rem);
    }
}

.auth-card,
.login-card {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: none;
    border: none;
}

.auth-page .auth-card .btn-primary,
.auth-page .login-form .btn-primary {
    background-color: #1F3A5F;
    border-color: #142A47;
    color: #fff;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.auth-page .auth-card .btn-primary:hover,
.auth-page .login-form .btn-primary:hover {
    background-color: #142A47;
    border-color: #142A47;
}

.auth-page .form-group input.form-control,
.auth-page .login-form input[type="email"],
.auth-page .login-form input[type="password"],
.auth-page .login-form input[type="text"] {
    font-size: 16px;
    line-height: 1.4;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 6px;
}

.auth-page .landing-brand.light,
.auth-page .landing-brand.light .sidebar-brand-text {
    color: #fff;
}

/* Mobile: stack panels */
@media (max-width: 900px) {
    .auth-split {
        display: -webkit-box !important;
        display: -ms-flexbox !important;
        display: flex !important;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -ms-flex-wrap: nowrap;
        flex-wrap: nowrap;
    }

    .auth-split-brand,
    .auth-split-form {
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
    }

    .auth-split-brand {
        padding: 2rem 1.5rem;
    }

    .auth-split-form {
        padding: 1.5rem;
    }

    .auth-card,
    .login-card {
        padding: 1.75rem 1.25rem;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .auth-page *,
    .auth-page *::before,
    .auth-page *::after {
        -webkit-animation-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        -webkit-transition-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
