/* Login page — family adapter
 *
 * Loaded after `uds-runner-family.css`. Owns Login-only layout, the
 * primary-CTA teal fill (the only earned Login-local variant), and the
 * reduced-motion suppression. Every rule is scoped under `body.login` so the
 * adapter cannot leak into other family surfaces.
 *
 * Tracker: docs/active/LOGIN_FAMILY_MIGRATION_2026_05_09.md
 */

/* =====================================================================
 * Box-sizing reset (Login is a single-purpose page; the family CSS does
 * not enforce a global box-sizing reset, so we declare it here for the
 * Login subtree only.)
 * ===================================================================== */

body.login,
body.login *,
body.login *::before,
body.login *::after {
    box-sizing: border-box;
}

/* =====================================================================
 * Page canvas
 * ===================================================================== */

body.login {
    margin: 0;
    min-height: 100vh;
    background: var(--runner-family-bg, #f6f8fa);
    color: var(--runner-family-text);
    font-family: var(--runner-family-font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 0.88rem;
    line-height: 1.5;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: grid;
    place-items: center;
}

body.login .login-main {
    width: 100%;
    max-width: 28rem;
    padding: 2rem 1.25rem;
    display: grid;
    place-items: center;
}

/* =====================================================================
 * Surface card — runner-family-surface with family radius + shadow
 * ===================================================================== */

body.login .login-container {
    width: 100%;
    padding: 2.25rem 2rem 1.75rem;
    border-radius: var(--runner-family-radius-shell, 16px);
    box-shadow: var(--runner-family-shadow-xs, 0 1px 4px rgba(42, 63, 95, 0.06));
    text-align: center;
    display: grid;
    gap: 1.25rem;
}

/* =====================================================================
 * U mark — non-anchored brand element on login (no /portal link since
 * the user is unauthenticated). Decision recorded in tracker Phase 1.6.
 * ===================================================================== */

body.login .login-logo {
    display: inline-grid;
    place-items: center;
    margin: 0 auto;
    cursor: default;
}

body.login .login-logo-mark {
    width: 44px;
    height: 44px;
}

body.login .login-logo-mark img {
    width: 100%;
    height: 100%;
    display: block;
}

/* =====================================================================
 * Typography
 * ===================================================================== */

body.login .login-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--runner-family-text);
    letter-spacing: 0;
}

body.login .login-subtitle {
    margin: -0.5rem 0 0;
    font-size: var(--runner-family-cell-label-size, 0.8rem);
    font-weight: 500;
    line-height: 1.4;
    color: var(--runner-family-muted, #5e6c84);
    letter-spacing: 0;
}

/* =====================================================================
 * Primary CTA — Login-local teal fill on top of runner-family-action-button
 *
 * Earned local variant: the single-CTA primary-fill pattern is unique to
 * login. `runner-family-action-button` carries the family chrome (focus
 * ring, transitions, padding rhythm); `login-cta-primary` adds the teal
 * fill. White text on `--runner-family-primary-dark` clears WCAG AA
 * contrast; hover and active states reuse the family `ease`.
 * ===================================================================== */

body.login .login-cta-primary.runner-family-action-button {
    width: 100%;
    min-height: 44px;
    padding: 0.625rem 1.1rem;
    border: 1px solid var(--runner-family-primary-dark, #008486);
    border-radius: var(--runner-family-radius-control, 10px);
    background: var(--runner-family-primary-dark, #008486);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    transition: background var(--runner-family-transition-standard, 0.18s ease),
                border-color var(--runner-family-transition-standard, 0.18s ease),
                box-shadow var(--runner-family-transition-standard, 0.18s ease),
                transform var(--runner-family-transition-fast, 0.12s ease);
}

body.login .login-cta-primary.runner-family-action-button:hover {
    background: var(--runner-family-primary, #00a4a6);
    border-color: var(--runner-family-primary, #00a4a6);
    box-shadow: 0 1px 4px rgba(0, 132, 134, 0.18);
}

body.login .login-cta-primary.runner-family-action-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 132, 134, 0.22);
}

body.login .login-cta-primary.runner-family-action-button:active {
    transform: scale(0.985);
}

body.login .login-cta-primary svg {
    width: 18px;
    height: 18px;
    opacity: 0.92;
}

/* =====================================================================
 * Local-login note
 * ===================================================================== */

body.login .local-login-note {
    margin: 0;
    font-size: var(--runner-family-cell-label-size, 0.74rem);
    line-height: 1.4;
    color: var(--runner-family-muted, #5e6c84);
}

body.login .local-login-note[hidden] {
    display: none;
}

/* =====================================================================
 * Error message — family alert on top of family state-message rhythm
 * ===================================================================== */

body.login .error-message {
    display: none;
    margin: 0;
    padding: 0.7rem 0.9rem;
    text-align: left;
    font-size: 0.82rem;
    line-height: 1.45;
}

body.login .error-message.show {
    display: block;
}

/* =====================================================================
 * Security footer
 * ===================================================================== */

body.login .security-section {
    margin: 0.5rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--runner-family-border, #dde4eb);
}

body.login .security-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: var(--runner-family-cell-label-size, 0.74rem);
    color: var(--runner-family-muted, #5e6c84);
    letter-spacing: 0;
}

body.login .security-info svg {
    width: 14px;
    height: 14px;
    color: var(--runner-family-primary-dark, #008486);
    opacity: 0.9;
}

/* =====================================================================
 * Mobile (390 / 360)
 * ===================================================================== */

@media (max-width: 480px) {
    body.login .login-main {
        padding: 1.25rem 0.875rem;
    }
    body.login .login-container {
        padding: 1.75rem 1.25rem 1.25rem;
    }
    body.login .login-title {
        font-size: 1rem;
    }
}

/* =====================================================================
 * Reduced motion (Phase 2.3)
 * ===================================================================== */

@media (prefers-reduced-motion: reduce) {
    body.login *,
    body.login *::before,
    body.login *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
