/*
 * Sign-in pages (Login, Lockout). Everything is scoped under .auth-page so the admin theme
 * (style.min.css) and the other Identity pages are unaffected.
 */
.auth-page {
    --auth-bg: #f4f6f8;
    --auth-bg-wash: #e3f2f5;
    --auth-surface: #ffffff;
    --auth-border: #e3e7ec;
    --auth-control-border: #c4cbd3;
    --auth-control-border-hover: #8d98a5;
    --auth-text: #1f2d3a;
    --auth-muted: #5b6672;
    --auth-accent: #0b8494;
    --auth-accent-hover: #096e7b;
    --auth-danger: #b42318;
    --auth-danger-bg: #fef3f2;
    --auth-danger-border: #fecdca;
    --auth-focus: #0b8494;
    --auth-radius: 6px;
    --auth-control-height: 44px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px 24px;
    background:
        radial-gradient(1200px 600px at 50% -10%, var(--auth-bg-wash) 0%, rgba(227, 242, 245, 0) 70%),
        var(--auth-bg);
    color: var(--auth-text);
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    box-sizing: border-box;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -8px rgba(16, 24, 40, 0.12);
    padding: 40px;
}

.auth-logo {
    display: block;
    height: 40px;
    width: auto;
    max-width: 100%;
    margin: 0 auto 32px;
}

.auth-title {
    margin: 0 0 8px;
    font-family: "Poppins", "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 24px;
    line-height: 32px;
    font-weight: 600;
    color: var(--auth-text);
    text-align: center;
}

.auth-subtitle {
    margin: 0 0 32px;
    color: var(--auth-muted);
    font-size: 14px;
    text-align: center;
}

/* Error summary */
.auth-alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--auth-danger-border);
    border-radius: var(--auth-radius);
    background: var(--auth-danger-bg);
    color: var(--auth-danger);
    font-size: 14px;
}

.auth-alert ul {
    margin: 0;
    padding-left: 18px;
}

.auth-alert ul:has(> li:only-child) {
    padding-left: 0;
    list-style: none;
}

/* Work-account (single sign-on) button: provider logos at the left, label centered */
.auth-sso-button {
    position: relative;
    display: block;
    width: 100%;
    height: var(--auth-control-height);
    padding: 0 96px;
    border: 1px solid var(--auth-control-border);
    border-radius: var(--auth-radius);
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    color: var(--auth-text);
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.auth-sso-button:hover {
    border-color: var(--auth-control-border-hover);
    background: #f8fafb;
}

.auth-provider-logos {
    position: absolute;
    top: 50%;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(-50%);
}

.auth-provider-logos svg {
    display: block;
}

.auth-hint {
    margin: 8px 0 0;
    color: var(--auth-muted);
    font-size: 13px;
    text-align: center;
}

/* "or" divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 16px;
    color: var(--auth-muted);
    font-size: 13px;
    text-transform: lowercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--auth-border);
}

/* Username and password */
.auth-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    border: 0;
    border-radius: var(--auth-radius);
    background: transparent;
    color: var(--auth-accent);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.auth-toggle:hover {
    text-decoration: underline;
}

.auth-toggle-chevron {
    transition: transform 0.15s ease;
}

.auth-toggle[aria-expanded="true"] .auth-toggle-chevron {
    transform: rotate(180deg);
}

/* The page script adds [hidden] when the panel starts collapsed, so without JavaScript the form stays visible. */
.auth-password-panel[hidden] {
    display: none;
}

.auth-password-panel {
    padding-top: 16px;
}

.auth-field {
    margin: 0 0 16px;
}

.auth-label {
    display: block;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-input {
    display: block;
    width: 100%;
    height: var(--auth-control-height);
    padding: 8px 12px;
    border: 1px solid var(--auth-control-border);
    border-radius: var(--auth-radius);
    background: #ffffff;
    color: var(--auth-text);
    font: inherit;
}

.auth-input:hover {
    border-color: var(--auth-control-border-hover);
}

.auth-input:focus {
    border-color: var(--auth-focus);
    outline: none;
    box-shadow: 0 0 0 3px rgba(11, 132, 148, 0.2);
}

.auth-input.input-validation-error {
    border-color: var(--auth-danger);
}

/* Shown for context, not edited (e.g. the account email on Set password). */
.auth-input[readonly],
.auth-input[readonly]:hover,
.auth-input[readonly]:focus {
    border-color: var(--auth-border);
    background: var(--auth-bg);
    color: var(--auth-muted);
    box-shadow: none;
    cursor: default;
}

.auth-field-hint {
    display: block;
    margin-top: 4px;
    color: var(--auth-muted);
    font-size: 13px;
}

.auth-password-wrap {
    position: relative;
}

.auth-password-wrap .auth-input {
    padding-right: 72px;
}

.auth-reveal {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    padding: 4px 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--auth-accent);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.auth-field-error {
    display: block;
    margin-top: 4px;
    color: var(--auth-danger);
    font-size: 13px;
}

.auth-field-error:empty {
    display: none;
}

.auth-submit {
    display: block;
    width: 100%;
    height: var(--auth-control-height);
    margin: 8px 0 0;
    border: 0;
    border-radius: var(--auth-radius);
    background: var(--auth-accent);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.auth-submit:hover {
    background: var(--auth-accent-hover);
}

/* A link that does the page's main action looks like the primary button. */
a.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

a.auth-submit:hover {
    color: #ffffff;
    text-decoration: none;
}

.auth-sso-button:disabled,
.auth-submit:disabled {
    opacity: 0.7;
    cursor: progress;
}

.auth-link {
    color: var(--auth-accent);
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-forgot {
    margin: 16px 0 0;
    font-size: 14px;
    text-align: center;
}

.auth-body-text {
    margin: 0 0 16px;
    color: var(--auth-muted);
    text-align: center;
}

/* Below the card: support and copyright */
.auth-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
    margin: 24px 0 0;
    color: var(--auth-muted);
    font-size: 13px;
    text-align: center;
}

.auth-page :is(button, a, input):focus-visible {
    outline: 2px solid var(--auth-focus);
    outline-offset: 2px;
}

.auth-page .auth-input:focus-visible {
    outline: none;
}

@media (max-width: 480px) {
    .auth-page {
        padding-top: 24px;
        justify-content: flex-start;
    }

    .auth-card {
        padding: 32px 24px 24px;
    }

    /* Too narrow to keep the label centered beside absolutely placed logos: flow them inline. */
    .auth-sso-button {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 0 12px;
    }

    .auth-provider-logos {
        position: static;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page * {
        transition: none !important;
    }
}
