/**
 * Unified auth screens: login, MFA, email OTP, choose 2FA
 * Centered card on dark gradient background
 */

:root {
    --auth-bg: #0f172a;
    --auth-bg-glow: #1e3a5f;
    --auth-primary: #0070b8;
    --auth-primary-dark: #005a94;
    --auth-green: #00b034;
    --auth-gold: #f9a61a;
    --auth-card: #ffffff;
    --auth-text: #1a2332;
    --auth-muted: #64748b;
    --auth-input-bg: #f1f5f9;
    --auth-border: #e2e8f0;
    --auth-danger-bg: #fef2f2;
    --auth-danger-text: #b91c1c;
    --auth-info-bg: #eff6ff;
    --auth-info-text: #1e40af;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body.cpo-auth-screen {
    height: 100%;
    margin: 0;
}

body.cpo-auth-screen {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--auth-text);
    background: var(--auth-bg);
}

.cpo-auth-screen-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(30, 58, 95, 0.55) 0%, transparent 70%),
        var(--auth-bg);
}

.cpo-auth-screen-card {
    width: 100%;
    max-width: 420px;
    background: var(--auth-card);
    border-radius: 16px;
    padding: 2.25rem 2rem 2rem;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 25px 50px rgba(0, 0, 0, 0.35),
        0 8px 16px rgba(0, 0, 0, 0.2);
}

.cpo-auth-screen-logo {
    display: block;
    height: 48px;
    width: auto;
    margin: 0 auto 1.25rem;
}

.cpo-auth-screen-brand {
    margin: 0 0 0.35rem;
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
    color: var(--auth-text);
    line-height: 1.25;
}

.cpo-auth-screen-heading {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    color: var(--auth-text);
}

.cpo-auth-screen-subtitle {
    margin: 0 0 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: center;
    color: var(--auth-muted);
}

.cpo-auth-screen-body {
    margin-top: 0;
}

.cpo-auth-screen-body > p.text-muted,
.cpo-auth-screen-body > p.cpo-auth-muted {
    font-size: 0.875rem;
    color: var(--auth-muted);
    text-align: center;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.cpo-auth-alert {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.45;
    position: relative;
    padding-right: 2rem;
}

.cpo-auth-alert--info {
    background: var(--auth-info-bg);
    color: var(--auth-info-text);
}

.cpo-auth-alert--danger {
    background: var(--auth-danger-bg);
    color: var(--auth-danger-text);
}

.cpo-auth-alert--success {
    background: #ecfdf5;
    color: #065f46;
}

.cpo-auth-alert--warning {
    background: #fffbeb;
    color: #92400e;
}

.cpo-auth-alert .cpo-auth-alert-close {
    position: absolute;
    top: 0.5rem;
    right: 0.65rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.5;
    cursor: pointer;
    color: inherit;
    padding: 0;
}

.cpo-auth-alert .cpo-auth-alert-close:hover {
    opacity: 1;
}

.cpo-auth-field {
    margin-bottom: 1.25rem;
}

.cpo-auth-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 0.4rem;
}

.cpo-auth-field .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    background: var(--auth-input-bg);
    color: var(--auth-text);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.cpo-auth-field .form-control:focus {
    outline: none;
    background: #fff;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(0, 112, 184, 0.15);
}

.cpo-auth-field .form-control.text-center {
    letter-spacing: 0.2em;
    font-weight: 600;
}

.cpo-auth-password-wrap {
    position: relative;
}

.cpo-auth-password-wrap .form-control {
    padding-right: 3rem;
}

.cpo-auth-password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cpo-auth-password-toggle:hover {
    color: var(--auth-primary);
    background: rgba(0, 112, 184, 0.06);
}

.cpo-auth-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.35rem;
}

.cpo-auth-check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--auth-primary);
}

.cpo-auth-check label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--auth-muted);
    margin: 0;
    cursor: pointer;
}

.cpo-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(180deg, #0082d4 0%, var(--auth-primary) 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 112, 184, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
}

.cpo-auth-btn:hover {
    color: #fff;
    background: linear-gradient(180deg, var(--auth-primary) 0%, var(--auth-primary-dark) 100%);
    box-shadow: 0 6px 18px rgba(0, 112, 184, 0.4);
    transform: translateY(-1px);
}

.cpo-auth-btn--secondary {
    background: #fff;
    color: var(--auth-primary);
    border: 1px solid var(--auth-border);
    box-shadow: none;
}

.cpo-auth-btn--secondary:hover {
    background: var(--auth-input-bg);
    color: var(--auth-primary-dark);
    transform: translateY(-1px);
}

.cpo-auth-btn--lg {
    padding: 0.9rem 1.25rem;
    font-size: 1rem;
}

.cpo-auth-btn + .cpo-auth-btn {
    margin-top: 0.75rem;
}

.cpo-auth-divider {
    border: none;
    border-top: 1px solid var(--auth-border);
    margin: 1.5rem 0;
}

.cpo-auth-link {
    display: block;
    text-align: center;
    font-size: 0.875rem;
    color: var(--auth-primary);
    text-decoration: none;
    margin-top: 1rem;
}

.cpo-auth-link:hover {
    color: var(--auth-primary-dark);
    text-decoration: underline;
}

.cpo-auth-link--block {
    margin-top: 0.5rem;
}

.cpo-auth-footer-text {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--auth-muted);
    margin: 1rem 0 0;
}

.cpo-auth-screen-body hr {
    border: none;
    border-top: 1px solid var(--auth-border);
    margin: 1.25rem 0;
}

.cpo-auth-screen-body .small {
    font-size: 0.8125rem;
}

.cpo-auth-screen-body code {
    font-size: 0.9em;
    background: var(--auth-input-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.cpo-auth-screen-body ul {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.cpo-auth-qr {
    text-align: center;
    margin: 1rem 0;
}

.cpo-auth-qr img {
    border-radius: 8px;
    border: 1px solid var(--auth-border);
}

.cpo-auth-recovery-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.cpo-auth-recovery-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--auth-border);
    text-align: center;
}

.cpo-auth-recovery-list li:last-child {
    border-bottom: none;
}

@media (max-width: 480px) {
    .cpo-auth-screen-card {
        padding: 2rem 1.35rem 1.75rem;
    }
}
