/* === Login === */

.login_page_shell {
    --login-primary: #273444;
    --login-primary-strong: #111827;
    --login-text: #1f2733;
    --login-muted: #6b7280;
    --login-border: #e5e7eb;
    --login-soft: #f6f7f9;
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 100vh;
    padding: clamp(1rem, 4vw, 3rem);
    box-sizing: border-box;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.mcnoc_auth_page {
    overflow-x: hidden;
    background: #f6f7f9;
}

html.mcnoc_auth_document {
    margin-top: 0 !important;
    background: #f6f7f9;
}

body.mcnoc_auth_page #wpadminbar,
body.mcnoc_auth_page .menuwrapper,
body.mcnoc_auth_page .sitewrapper > header,
body.mcnoc_auth_page .sitewrapper > footer {
    display: none !important;
}

body.mcnoc_auth_page .sitewrapper,
body.mcnoc_auth_page .sitewrapper > main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box;
}

.login_form {
    width: 100%;
    max-width: 440px;
    padding: clamp(1.25rem, 5vw, 2.25rem);
    border: 1px solid var(--login-border);
    border-radius: 12px;
    margin: 0;
    color: var(--login-text);
    background: #fff;
    box-shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
    box-sizing: border-box;
}

.login_form__header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.login_form__logo {
    display: block;
    width: min(100%, 310px);
    height: auto;
    margin: 0 auto 1.25rem;
}

.login_form h1 {
    padding: 0;
    margin: 0;
    color: var(--login-text);
    font-size: clamp(1.55rem, 5vw, 1.9rem);
    font-weight: 700;
    line-height: 1.2;
    text-transform: none;
}

.login_form .login_form__intro {
    padding: 0;
    margin: 0.45rem 0 0;
    color: var(--login-muted);
    font-size: 0.88rem;
}

.login_field {
    margin-bottom: 1rem;
}

.login_form .login_field label {
    display: block;
    width: auto;
    padding: 0;
    margin-bottom: 0.35rem;
    color: var(--login-text);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
}

.login_form .login_field input {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--login-border);
    border-radius: 7px;
    color: var(--login-text);
    background: #fff;
    box-sizing: border-box;
    font: 400 1rem/1.25 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login_form .login_field input:focus {
    border-color: var(--login-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 52, 68, 0.14);
}

.login_form .login_field input:-webkit-autofill,
.login_form .login_field input:-webkit-autofill:hover,
.login_form .login_field input:-webkit-autofill:focus {
    border-color: var(--login-border);
    -webkit-text-fill-color: var(--login-text);
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    caret-color: var(--login-text);
}

.login_submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border: 1px solid var(--login-primary);
    border-radius: 7px;
    color: #fff;
    background: var(--login-primary);
    font: 600 0.9rem/1 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.login_submit:hover {
    border-color: var(--login-primary-strong);
    background: var(--login-primary-strong);
}

.login_submit:focus-visible,
.sso_button:focus-visible {
    outline: 2px solid rgba(39, 52, 68, 0.4);
    outline-offset: 2px;
}

.login_submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.login_submit.is_loading i {
    animation: login-pulse 800ms ease-in-out infinite alternate;
}

@keyframes login-pulse {
    to { opacity: 0.35; }
}

.login_error,
.sso_error_banner {
    padding: 0.7rem 0.8rem;
    border: 1px solid #fecaca;
    border-radius: 7px;
    margin-bottom: 1rem;
    color: #b42318;
    background: #fef2f2;
    font-size: 0.82rem;
    line-height: 1.4;
    text-align: left;
}

.login_error[hidden] {
    display: none;
}

/* === SSO Login Buttons === */

.sso_divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: var(--login-muted);
    font-size: 0.75rem;
}

.sso_divider::before,
.sso_divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--login-border);
}

.sso_divider span {
    padding: 0 1em;
}

.sso_buttons { display: grid; gap: 0.65rem; }

.sso_button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0.65rem 1rem;
    border-radius: 7px;
    font: 600 0.85rem/1 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease;
    box-sizing: border-box;
}

.sso_button:hover {
    text-decoration: none;
}

.sso_button_microsoft {
    background: #fff;
    color: var(--login-text);
    border: 1px solid var(--login-border);
}

.sso_button_google {
    background: #fff;
    color: var(--login-text);
    border: 1px solid var(--login-border);
}

.sso_button_microsoft:hover,
.sso_button_google:hover {
    border-color: #cbd5e1;
    color: var(--login-primary);
    background: var(--login-soft);
}

.sso_button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.mfa_validate_form {
    width: 100%;
    max-width: 410px;
}

.login_form .mfa_code_input,
.mfa_code_input {
    min-height: 52px;
    text-align: center;
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    letter-spacing: 0.35em;
}

.mfa_setup_card {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: min(100%, 680px) !important;
    padding: clamp(1rem, 4vw, 2rem);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 12px 36px rgba(16, 24, 40, 0.08);
    box-sizing: border-box;
}

.mfa_setup_card h2 {
    margin-top: 0;
    text-align: center;
}

.mfa_setup_qr {
    display: block;
    width: min(220px, 70vw);
    height: auto;
    margin: 1rem auto;
}

.mfa_setup_secret {
    display: inline-block;
    max-width: 100%;
    margin-top: 0.5rem;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.08em;
}

.mfa_setup_form {
    display: grid;
    justify-items: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.mfa_setup_form label {
    color: #1f2733;
    font-weight: 600;
    text-align: center;
}

.mfa_setup_form .mfa_code_input {
    width: min(100%, 240px);
    padding: 0.65rem;
    border: 1px solid #d5dae1;
    border-radius: 7px;
    box-sizing: border-box;
}

.mfa_setup_submit.mcnoc_button {
    min-height: 44px;
    padding: 0.65rem 1.25rem;
    border: 1px solid #273444;
    border-radius: 7px;
    margin: 0;
    color: #fff;
    background: #273444;
    box-shadow: none;
}

@media (max-width: 520px) {
    ._liftoff_login_ main {
        padding-top: 0;
    }

    .login_page_shell {
        min-height: 100vh;
        padding: 0.75rem;
    }

    .login_form {
        width: 100% !important;
        max-width: 100%;
        padding: 1.25rem;
        border-radius: 10px;
        box-shadow: none;
    }

    .login_form__logo {
        width: min(100%, 250px);
    }

    .mfa_setup_page {
        padding: 0.75rem !important;
    }

    .mfa_setup_card {
        padding: 1rem;
        border-radius: 10px;
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login_submit.is_loading i {
        animation: none;
    }
}

/* === SSO Settings Section === */

.sso_linked_badge {
    display: inline-block;
    background: #e6f4ea;
    color: #1e7e34;
    padding: 0.2em 0.6em;
    border-radius: 3px;
    font-size: 0.85em;
    margin-left: 0.5em;
}

.sso_unlinked_badge {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    padding: 0.2em 0.6em;
    border-radius: 3px;
    font-size: 0.85em;
    margin-left: 0.5em;
}

.sso_provider_row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8em 0;
    border-bottom: 1px solid #eee;
}

.sso_provider_info {
    display: flex;
    align-items: center;
    gap: 0.8em;
}

.sso_provider_info svg {
    width: 24px;
    height: 24px;
}

/* === Dark Mode === */

.liftoff_dark .sso_divider {
    color: #777;
}

.liftoff_dark .sso_divider::before,
.liftoff_dark .sso_divider::after {
    border-bottom-color: #444;
}

.liftoff_dark .sso_button_microsoft {
    background: #222;
    border-color: #444;
}

.liftoff_dark .sso_button_google {
    background: #333;
    color: #ddd;
    border-color: #555;
}

.liftoff_dark .sso_error_banner {
    background: #3d1c1c;
    border-color: #c5293d;
}

.liftoff_dark .login_form {
    --login-text: #f3f4f6;
    --login-muted: #9ca3af;
    --login-border: #374151;
    --login-soft: #1f2937;
    background: #171717;
    box-shadow: none;
}

.liftoff_dark .login_form .login_field input {
    color: #f3f4f6;
    background: #222;
}

.liftoff_dark .login_form__logo {
    padding: 0.65rem;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

.liftoff_dark .login_error {
    border-color: #7f1d1d;
    color: #fecaca;
    background: #3d1c1c;
}

.liftoff_dark .sso_linked_badge {
    background: #1e3a1e;
    color: #6fcf6f;
}

.liftoff_dark .sso_unlinked_badge {
    background: #333;
    color: #999;
}

.liftoff_dark .sso_provider_row {
    border-bottom-color: #444;
}
