.auth-page {
    color-scheme: light;
    --page-bg: #edf1f6;
    --surface: #fff;
    --text: #18243a;
    --text-muted: #4b5d75;
    --input-bg: #f7f9fc;
    --border: #8595ab;
    --brand: #244ba0;
    --action-hover: #193e8c;
    --on-action: #fff;
    --notice-bg: #dde8f9;
    --notice-text: #263f65;
    --error-bg: #fae7e7;
    --error-text: #8d292c;

    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    background: var(--page-bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 2rem 1rem;
    line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
    .auth-page {
        color-scheme: dark;
        --page-bg: #101826;
        --surface: #192437;
        --text: #eef3fd;
        --text-muted: #b6c4d9;
        --input-bg: #131e30;
        --border: #728198;
        --brand: #adc6ff;
        --action-hover: #c4d5fb;
        --on-action: #152644;
        --notice-bg: #233755;
        --notice-text: #d5e3fc;
        --error-bg: #482d37;
        --error-text: #ffd8d9;
    }
}

.auth-page::before {
    display: none;
}

.auth-page > :is(.auth-frame, .container) {
    width: 100%;
    max-width: 29rem;
}

.auth-page .flash {
    padding: 0.75rem 1rem;
    background: var(--notice-bg);
    color: var(--notice-text);
    box-shadow: none;
    animation: none;
}

.auth-page .flash.error {
    background: var(--error-bg);
    color: var(--error-text);
}

.auth-panel {
    padding: 2rem;
    background: var(--surface);
    border-radius: 0.875rem;
    box-shadow: 0 10px 28px rgb(12 25 48 / 7%);
}

.auth-identity {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.375rem;
    font-size: 0.9rem;
    font-weight: 650;
}

.auth-identity img {
    flex: none;
}

.auth-panel h1 {
    margin: 0 0 0.45rem;
    color: var(--text);
    font-size: 1.75rem;
    line-height: 1.15;
    text-align: left;
    letter-spacing: -0.025em;
}

.auth-panel p {
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.auth-panel strong {
    color: var(--text);
}

.auth-form {
    margin-top: 1.25rem;
}

.auth-panel label {
    color: var(--text);
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
}

.auth-panel .auth-field-label {
    margin-bottom: 0.375rem;
    font-size: 0.9rem;
}

.auth-panel .auth-input {
    min-height: 3rem;
    padding: 0.65rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--input-bg);
    color-scheme: inherit;
    box-shadow: none;
    font-family: inherit;
    font-size: 1rem;
}

.auth-panel .auth-input:focus {
    border-color: var(--brand);
    background: var(--surface);
}

.auth-panel .mfa-code-input {
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.2em;
}

.auth-panel .mfa-trust-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-height: 2.75rem;
    margin: 0.625rem 0 0;
    font-size: 0.875rem;
}

.mfa-trust-option input {
    width: 1.125rem;
    height: 1.125rem;
    flex: none;
    accent-color: var(--brand);
}

.mfa-support-text {
    font-size: 0.8125rem;
}

#mfa-trust-help {
    margin: -0.125rem 0 1rem 1.75rem;
}

.auth-panel .auth-primary-button,
.auth-panel .mfa-resend-button {
    min-height: 2.75rem;
    margin: 0;
    padding: 0.65rem 0.85rem;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.4;
    font-weight: 650;
    box-shadow: none;
    transform: none;
    transition: none;
}

.auth-panel .auth-primary-button {
    width: 100%;
    background: var(--brand);
    color: var(--on-action);
}

.auth-panel .auth-primary-button:hover {
    background: var(--action-hover);
}

.auth-alternate-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: 0.75rem;
    margin-top: 0.375rem;
}

.auth-alternate-actions form {
    width: auto;
}

.auth-panel .mfa-resend-button,
.auth-alternate-actions a {
    padding: 0;
    width: auto;
    background: none;
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.auth-alternate-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    font-size: 0.9375rem;
}

.auth-alternate-actions :is(a, .mfa-resend-button):hover {
    color: var(--action-hover);
}

.auth-page :is(input, button, a):focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
    box-shadow: none;
}

.auth-page :is(button, label, a) {
    touch-action: manipulation;
}

.login-page .flash {
    min-height: 3.5rem;
    padding-inline-end: 3.5rem;
    border-radius: 0.375rem;
    backdrop-filter: none;
}

.login-page .flash .flash-close {
    inset: 0.375rem 0.375rem auto auto;
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0.5rem;
    background: transparent;
}

.login-page .auth-form .auth-input {
    margin-bottom: 1rem;
}

.auth-page .public-legal-links a {
    color: var(--text-muted);
    font-weight: 500;
}

@media (max-width: 30rem) {
    .auth-page {
        padding: 1.25rem 1rem;
    }

    .auth-panel {
        padding: 1.375rem;
    }
}
