/* Standalone authentication; replaces all three legacy auth layers. */

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

body.auth-body {
    min-height: 100vh;
    margin: 0;
    color: var(--v5-ink-strong);
    background: var(--v5-canvas);
    font-family: var(--v5-font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(3.5rem, 11vh, 5.75rem) 1.25rem 1rem;
}

.auth-login-wrap {
    width: min(462px, 100%);
    margin: 0 auto;
}

.auth-header {
    margin: 0 0 1.75rem;
    text-align: center;
}

.auth-header h1 {
    margin: 0 0 .75rem;
    color: #091a35;
    font-size: clamp(1.75rem, 3vw, 2rem);
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: -.04em;
}

.auth-header p {
    margin: 0;
    color: var(--v5-muted);
    font-size: .96rem;
    line-height: 1.5;
}

.auth-card {
    width: 100%;
    padding: 2.35rem 1.95rem 2.25rem;
    border: 1px solid var(--v5-line);
    border-radius: var(--v5-radius);
    background: var(--v5-surface);
    box-shadow: var(--v5-shadow);
}

.auth-form .form-label {
    margin-bottom: .45rem;
    color: #162a48;
    font-size: .8rem;
    font-weight: 700;
}

.auth-form .form-control {
    min-height: 49px;
    padding: .75rem .85rem;
    border: 1px solid var(--v5-line);
    border-radius: 8px;
    color: var(--v5-ink-strong);
    background: #fff;
    font-size: .92rem;
    box-shadow: none;
}

.auth-form .form-control:hover { border-color: var(--v5-line-strong); }

.auth-form .form-control:focus {
    border-color: var(--v5-blue);
    box-shadow: 0 0 0 3px var(--v5-blue-soft);
    outline: 0;
}

.auth-password-field { position: relative; }

.auth-password-field .form-control { padding-right: 3rem; }

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: .75rem;
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #7d838b;
    transform: translateY(-50%);
    cursor: pointer;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color: #526073;
    background: #f1f4f8;
    outline: 2px solid var(--v5-blue);
    outline-offset: 3px;
}

.auth-form .form-check {
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    gap: .55rem;
    padding-left: 0;
}

.auth-form .form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
    float: none;
    margin: 0;
    border: 1px solid var(--v5-line-strong);
    border-radius: 4px;
    box-shadow: none;
}

.auth-form .form-check-input:focus {
    border-color: var(--v5-blue);
    box-shadow: 0 0 0 3px var(--v5-blue-soft);
}

.auth-form .form-check-input:checked {
    border-color: var(--v5-blue);
    background-color: var(--v5-blue);
}

.auth-form .form-check-label {
    margin: 0;
    color: #23364f;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-auth-primary {
    min-height: 49px;
    border: 1px solid var(--v5-blue);
    border-radius: 8px;
    background: var(--v5-blue);
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    box-shadow: none;
}

.btn-auth-primary:hover,
.btn-auth-primary:focus,
.btn-auth-primary:active {
    border-color: var(--v5-blue-deep);
    background: var(--v5-blue-deep);
    color: #fff;
}

.btn-auth-primary:focus-visible { box-shadow: 0 0 0 3px var(--v5-blue-soft); }

.auth-passkey-link {
    display: block;
    width: 100%;
    margin-top: .9rem;
    padding: .65rem .5rem;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: #687b99;
    font-size: .78rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.auth-passkey-link:hover,
.auth-passkey-link:focus-visible {
    color: var(--v5-blue);
    text-decoration: underline;
    outline: 2px solid var(--v5-blue);
    outline-offset: 3px;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin-bottom: 1rem;
    padding: .78rem .85rem;
    border: 1px solid #efc3c3;
    border-radius: 8px;
    background: #fff5f5;
    color: var(--v5-danger);
    font-size: .8rem;
    line-height: 1.45;
}

.auth-passkey-error {
    margin-top: .45rem;
    color: var(--v5-danger);
    font-size: .76rem;
    line-height: 1.4;
    text-align: center;
}

.auth-help {
    margin-top: .55rem;
    color: var(--v5-muted);
    font-size: .76rem;
    line-height: 1.5;
}

.auth-cancel {
    color: var(--v5-muted);
    font-size: .8rem;
    font-weight: 600;
}

.auth-cancel:hover { color: var(--v5-ink-strong); }

.auth-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    color: #92a0bc;
    font-size: .72rem;
    line-height: 1;
    text-align: center;
}

.auth-footer strong {
    color: #5c6f92;
    font-weight: 700;
}

/* Two-factor challenge uses the same visual language as the login screen. */
.auth-card--challenge { padding-top: 2.1rem; }

@media (max-width: 575.98px) {
    .auth-page { padding: 2.4rem 1rem 1rem; }
    .auth-header { margin-bottom: 1.35rem; }
    .auth-card { padding: 1.65rem 1.25rem 1.5rem; }
    .auth-footer { padding-top: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto;
        transition-duration: .01ms;
        animation-duration: .01ms;
    }
}

.auth-eyebrow { display: inline-block; padding: 6px 10px; margin-bottom: 16px; background: var(--v5-navy); color: white; border-radius: 7px; font-size: 12px; }
.auth-form .form-control.is-invalid { border-color: var(--v5-danger); }
