/* Main sign-in: keep both themes and their interactive states in one palette. */
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow, .afxc-registration-notice) {
    color-scheme: light;
    --auth-page: #edf2fa;
    --auth-card: #ffffff;
    --auth-control: #f4f7fc;
    --auth-focus: #ffffff;
    --auth-line: #bdcbe0;
    --auth-line-soft: #dce5f3;
    --auth-text: #172338;
    --auth-muted: #53647e;
    --auth-link: #184caa;
    --auth-button: #1749ad;
    --auth-button-hover: #123b8e;
    --auth-ring: #2563eb;
    --auth-note: #ecf3ff;
    --auth-alert: #fff2d9;
    --auth-alert-text: #624010;
    --auth-invalid: #ac2838;
    color: var(--auth-text);
    background: var(--auth-page) !important;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) :is(.auth-shell, .auth-form-wrapper) {
    background: var(--auth-page) !important;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .auth-box {
    width: 100%;
    max-width: 520px;
    padding: clamp(24px, 3vw, 42px) !important;
    border: 1px solid var(--auth-line-soft) !important;
    border-radius: 28px !important;
    background: var(--auth-card) !important;
    color: var(--auth-text);
    box-shadow: 0 14px 45px rgb(13 33 66 / 8%) !important;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .auth-logo-wrap {
    min-height: 0 !important;
    margin-bottom: 23px !important;
    padding-bottom: 17px !important;
    border-color: var(--auth-line-soft) !important;
    mix-blend-mode: normal !important;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .auth-logo-wrap::after {
    color: var(--auth-muted);
    border-color: var(--auth-line-soft);
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) :is(.auth-title, .section-label, .form-label) {
    color: var(--auth-text);
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) :is(.auth-subtitle, .auth-legal, .passkey-divider, .control-icon, .password-toggle) {
    color: var(--auth-muted);
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) :is(.auth-kicker, .forgot-link, .access-note i) {
    color: var(--auth-link);
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .forgot-link:hover { text-decoration: underline; }
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .account-toggle {
    background: var(--auth-control);
    border-color: var(--auth-line);
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .account-toggle__btn { color: var(--auth-muted); }
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .account-toggle__pill { background: var(--auth-button); }
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .account-toggle__btn.active { color: #fff; }
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .form-control.auth-control {
    min-height: 50px;
    background: var(--auth-control) !important;
    border-color: var(--auth-line) !important;
    color: var(--auth-text) !important;
    caret-color: var(--auth-text);
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .form-control.auth-control::placeholder {
    color: var(--auth-muted) !important;
    opacity: 1;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .form-control.auth-control:focus {
    background: var(--auth-focus) !important;
    border-color: var(--auth-ring) !important;
    box-shadow: none;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .form-control.auth-control:is(.is-invalid, [aria-invalid="true"]) {
    border-color: var(--auth-invalid) !important;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .form-control.auth-control.is-valid {
    border-color: var(--auth-valid, #2b7954) !important;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .password-toggle {
    min-width: 44px;
    min-height: 44px;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) :is(a, button, input):focus-visible {
    outline: 2px solid var(--auth-ring);
    outline-offset: 3px;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .btn-auth {
    color: #fff !important;
    background: var(--auth-button) !important;
    border: 1px solid transparent !important;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .btn-auth:hover:enabled {
    background: var(--auth-button-hover) !important;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .btn-passkey {
    color: var(--auth-text) !important;
    background: var(--auth-control) !important;
    border-color: var(--auth-line) !important;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .btn-passkey:hover:enabled {
    border-color: var(--auth-ring) !important;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .passkey-divider::before,
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .passkey-divider::after {
    background: var(--auth-line-soft);
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .access-note {
    background: var(--auth-note) !important;
    border-color: var(--auth-line-soft) !important;
    color: var(--auth-muted);
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .alert-warning {
    color: var(--auth-alert-text);
    background: var(--auth-alert);
    border-color: currentColor;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .visual-footer :is(.feature-list li, .visual-domain),
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .mobile-hero__footer {
    color: #f5f8ff;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .visual-footer .feature-list li {
    background: #203f7f !important;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .visual-domain {
    background: #203f7f;
    padding: 4px 9px;
    border-radius: 6px;
}
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .mobile-hero {
    background: linear-gradient(125deg, #143670, #2257ac) !important;
}
@media (prefers-color-scheme: dark) {
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow, .afxc-registration-notice) {
        color-scheme: dark;
        --auth-page: #111722;
        --auth-card: #192231;
        --auth-control: #222e41;
        --auth-focus: #27364d;
        --auth-line: #647894;
        --auth-line-soft: #374761;
        --auth-text: #eff4ff;
        --auth-muted: #b8c6db;
        --auth-link: #a7c7ff;
        --auth-button: #2454b3;
        --auth-button-hover: #2c60c1;
        --auth-ring: #8bb7ff;
        --auth-note: #263651;
        --auth-alert: #382d20;
        --auth-alert-text: #ffdb9a;
        --auth-invalid: #ff9ca9;
        --auth-valid: #86e4b9;
    }
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .auth-logo {
        filter: brightness(0) invert(1) !important;
        mix-blend-mode: normal !important;
    }
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .auth-visual {
        background-color: #132b5d !important;
        background-image: linear-gradient(145deg, #142958, #1b4498 57%, #2163a0) !important;
    }
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow, .afxc-registration-notice).is-institutional .auth-visual {
        background-image: linear-gradient(145deg, #141d36, #2a407a 60%, #364e89) !important;
    }
}
@media (max-width: 900px) {
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .auth-box {
        padding: clamp(18px, 5vw, 27px) !important;
        border-radius: 23px !important;
    }
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .auth-logo-wrap {
        margin-bottom: 17px !important;
        padding-bottom: 12px !important;
    }
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .auth-title { font-size: clamp(23px, 6.4vw, 31px); }
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .auth-subtitle { margin-bottom: 0; }
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .account-toggle__btn { min-height: 44px; }
}
/* Keep the mobile sign-in actions within easy reach. */
@media (max-width: 767px) {
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .mobile-hero {
        display: block;
        min-height: 0 !important;
        padding: 14px 18px !important;
    }
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .mobile-hero__copy strong {
        margin: 3px 0 0;
        font-size: 20px;
    }
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) :is(.mobile-hero__copy p, .mobile-hero__footer, .mobile-hero__visual) {
        display: none;
    }
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .auth-logo-wrap .auth-logo {
        max-height: 42px !important;
    }
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .auth-box .auth-header { margin-bottom: 18px; }
    body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .account-toggle__btn { padding-inline: 5px; }
}
/* Mobile hero ink stays legible over its blue background in either appearance. */
body:is(.auth-page.afxc-login, .auth-page.afxc-auth-flow) .mobile-hero :is(.mobile-hero__copy strong, .mobile-hero__status) {
    color: #f5f8ff !important;
    -webkit-text-fill-color: currentColor;
}

/* The access forms use an icon next to each field. */
body.auth-page.afxc-auth-flow .auth-input-group .auth-input-icon {
    background: var(--auth-control) !important;
    color: var(--auth-muted) !important;
    border-color: var(--auth-line) !important;
    border-inline-end: 0 !important;
    border-radius: 12px 0 0 12px !important;
}
body.auth-page.afxc-auth-flow .auth-input-group .form-control.auth-control {
    min-inline-size: 0;
    border-radius: 0 12px 12px 0 !important;
}
body.auth-page.afxc-auth-flow .auth-input-group:focus-within .auth-input-icon {
    background: var(--auth-focus) !important;
    border-color: var(--auth-ring) !important;
    color: var(--auth-link) !important;
}
body.auth-page.afxc-auth-flow :is(.auth-submit, .expired-action) {
    min-height: 44px;
    background: var(--auth-button) !important;
    color: #fff !important;
    border: 1px solid transparent !important;
}
body.auth-page.afxc-auth-flow :is(.auth-submit, .expired-action):hover:not(:disabled) {
    background: var(--auth-button-hover) !important;
}
body.auth-page.afxc-auth-flow :is(.security-note, .sponsor-card, .institutional-box, .expired-icon) {
    background: var(--auth-note) !important;
    border-color: var(--auth-line-soft) !important;
    color: var(--auth-text) !important;
}
body.auth-page.afxc-auth-flow :is(.sponsor-card strong, .expired-title, .form-check-label, .password-toggle-copy strong) {
    color: var(--auth-text) !important;
}
body.auth-page.afxc-auth-flow :is(.login-line, .register-line, .sponsor-card__copy span, .expired-text, .password-toggle-copy small) {
    color: var(--auth-muted) !important;
}
body.auth-page.afxc-auth-flow :is(.back-link, .login-line a, .register-line a, .security-note i, .sponsor-card__icon, .password-tooltip, .institutional-box :is(a, strong, i)) {
    color: var(--auth-link) !important;
}
body.auth-page.afxc-auth-flow :is(.back-link, .login-line a, .register-line a):hover {
    text-decoration: underline;
}
body.auth-page.afxc-auth-flow .sponsor-card__icon {
    background: var(--auth-control) !important;
    border: 1px solid var(--auth-line-soft);
}
body.auth-page.afxc-auth-flow .sponsor-card__copy {
    min-inline-size: 0;
    overflow-wrap: anywhere;
}
body.auth-page.afxc-auth-flow .auth-links {
    border-color: var(--auth-line-soft) !important;
}
body.auth-page.afxc-auth-flow .form-check {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-inline-start: 0;
}
body.auth-page.afxc-auth-flow .form-check .form-check-input {
    float: none;
    flex: 0 0 auto;
    margin: 0;
    background-color: var(--auth-control) !important;
    border-color: var(--auth-line) !important;
}
body.auth-page.afxc-auth-flow .form-check .form-check-input:checked {
    background-color: var(--auth-button) !important;
    border-color: var(--auth-ring) !important;
}
body.auth-page.afxc-auth-flow .password-switch-ui {
    background-color: var(--auth-control) !important;
    border: 1px solid var(--auth-line);
}
body.auth-page.afxc-auth-flow .password-switch input:checked + .password-switch-ui {
    background-color: var(--auth-button) !important;
}
body.auth-page.afxc-auth-flow .password-switch input:focus-visible + .password-switch-ui {
    outline: 2px solid var(--auth-ring);
    outline-offset: 3px;
}
body.auth-page.afxc-auth-flow .auth-box .alert-danger {
    color: var(--auth-invalid) !important;
    background: var(--auth-control) !important;
    border-color: var(--auth-invalid) !important;
}
body.afxc-registration-notice {
    background: var(--auth-page) !important;
}
body.afxc-registration-notice .access-card {
    background: var(--auth-card) !important;
    border-color: var(--auth-line-soft) !important;
    color: var(--auth-text) !important;
}
body.afxc-registration-notice .access-card h1 {
    color: var(--auth-text) !important;
}
body.afxc-registration-notice .access-card :is(p, .access-note) {
    color: var(--auth-muted) !important;
    border-color: var(--auth-line-soft) !important;
}
body.afxc-registration-notice .access-symbol {
    background: var(--auth-button) !important;
    color: #fff !important;
}
@media (max-width: 767px) {
    body.auth-page.afxc-auth-flow .auth-input-group .auth-input-icon {
        width: 40px;
        min-width: 40px;
        flex: 0 0 40px;
    }
    body.auth-page.afxc-auth-flow .auth-input-group .form-control.auth-control {
        font-size: 16px !important;
        padding-inline: 10px !important;
    }
}

body.auth-page.afxc-auth-flow .institutional-box {
    overflow-wrap: anywhere;
}
