/* Shared presentation for sign-in, identity verification and password recovery. */
.login-page {
    --login-ink: #102e49;
    --login-muted: #62778b;
    --login-accent: #087a9c;
    --login-line: #d7e3ed;
    margin: 0;
    color: var(--login-ink);
    background: #0b2e49;
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.login-page *,
.login-page *::before,
.login-page *::after { box-sizing: border-box; }
.login-page :where(button, input) { font: inherit; }
.login-page button,
.login-page a { -webkit-tap-highlight-color: transparent; }
.login-page a { text-decoration: none; }
.login-page button { cursor: pointer; }
.login-page button:disabled { cursor: default; }
.login-page :focus-visible { outline: 3px solid #1394be; outline-offset: 4px; }
.login-page [hidden] { display: none !important; }

.login-page .skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 20;
    padding: 12px 16px;
    border-radius: 8px;
    color: #fff;
    background: var(--login-ink);
    transform: translateY(-160%);
}
.login-page .skip-link:focus { transform: none; }

.login-shell {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 40px 24px;
    background: radial-gradient(ellipse at 12% 0%, #178aab70, transparent 52%),
        radial-gradient(ellipse at 100% 90%, #199ea454, transparent 50%),
        linear-gradient(135deg, #09233d, #114d69 58%, #0b2e49);
}
.login-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at 95% 12%, transparent 0 190px, #a6e4f214 191px 192px, transparent 193px 240px, #a6e4f20c 241px 242px, transparent 243px),
        radial-gradient(circle at 4% 95%, transparent 0 160px, #a6e4f212 161px 162px, transparent 163px),
        radial-gradient(#b4e5f019 1px, transparent 1px);
    background-size: auto, auto, 28px 28px;
}

.login-panel {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
    width: min(100%, 980px);
    border: 1px solid #d6e6f0;
    border-radius: 24px;
    background: #f4f9fd;
    box-shadow: 0 28px 80px -24px #041b3599, 0 0 0 8px #d9f3ff08;
    animation: login-arrive 360ms ease-out both;
}

.login-scene {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 23px 0 0 23px;
    background: #123e5b;
}
.login-scene__image { position: absolute; inset: 0; z-index: -2; }
.login-scene__image img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.login-scene::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, #092f4526 10%, #082c46eb 100%);
}
.login-scene__caption { position: absolute; inset: auto 40px 44px; color: #fff; }
.login-scene__eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.login-scene__caption p { margin: 18px 0 24px; font-size: 38px; line-height: 1.2; font-weight: 600; letter-spacing: -.04em; }
.login-scene__line { display: block; width: 40px; height: 3px; border-radius: 3px; background: #6ad2e6; }

.login-card { min-width: 0; padding: 36px 40px 24px; border-radius: 0 23px 23px 0; background: linear-gradient(155deg, #fafdff, #edf5fb); }
.login-card__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.login-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--login-ink); }
.login-brand img { display: block; width: 40px; height: auto; flex: none; }
.login-brand strong { display: block; font-size: 19px; font-weight: 700; letter-spacing: -.035em; }
.login-brand small { display: block; margin-top: 2px; color: var(--login-muted); font-size: 11px; }
.login-home { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; color: var(--login-muted); font-size: 12px; }
.login-home:hover { color: var(--login-accent); }
.login-home i { font-size: 11px; }
.login-heading { margin: 30px 0 24px; }
.login-heading h1 { margin: 0; font-size: clamp(26px, 3vw, 30px); line-height: 1.2; font-weight: 700; letter-spacing: -.04em; }
.login-description { margin: 12px 0 0; color: #526c82; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.login-description strong { color: var(--login-ink); font-weight: 600; }
.login-form { display: grid; gap: 18px; }
.login-field { display: grid; gap: 8px; min-width: 0; }
.login-field label { font-size: 13px; font-weight: 600; line-height: 1.4; }
.login-input {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 50px;
    padding: 0 4px 0 15px;
    border: 1px solid var(--login-line);
    border-radius: 10px;
    background: #ffffffd9;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.login-input:focus-within { border-color: var(--login-accent); background: #fff; box-shadow: 0 0 0 3px #087a9c14; }
.login-input:has([aria-invalid='true']) { border-color: #c65a64; }
.login-input > i { flex: none; width: 16px; color: #70869a; text-align: center; font-size: 15px; }
.login-input input { width: 100%; min-width: 0; min-height: 48px; padding: 12px 0; border: 0; outline: none; color: var(--login-ink); background: transparent; font-size: 16px; line-height: 1.4; }
.login-page .login-input input:focus-visible { outline: none; }
.login-input input::placeholder { color: #778a9d; opacity: 1; font-size: 14px; }
.login-password-toggle { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 7px; color: var(--login-muted); background: transparent; }
.login-password-toggle:hover { color: var(--login-accent); background: #edf4f8; }
.login-options { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; margin-top: -5px; font-size: 12px; }
.login-remember { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: #526a80; cursor: pointer; }
.login-remember input { width: 17px; height: 17px; margin: 0; accent-color: #10547b; cursor: pointer; }
.login-options > a { display: inline-flex; align-items: center; min-height: 44px; color: #07658a; font-weight: 500; }
.login-options > a:hover { text-decoration: underline; text-underline-offset: 3px; }
.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    width: 100%;
    min-height: 50px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 600;
    transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.login-button--primary { color: #fff; background: #104d74; box-shadow: 0 4px 10px #104d741a; }
.login-button--primary:hover:not(:disabled) { background: #0b3c5d; box-shadow: 0 5px 14px #104d7429; }
.login-button--primary > i { font-size: 13px; }
.login-button:active:not(:disabled) { transform: translateY(1px); }
.login-actions { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 12px; align-items: start; }
.login-button--passkey { width: 54px; height: 50px; padding: 0; border-color: #aacfdc; background: #e4f2f8; color: #28516f; }
.login-button--passkey > i { color: #087a9c; font-size: 25px; }
.login-button--passkey:hover:not(:disabled) { background: #d2eaf4; border-color: #68aec4; box-shadow: 0 3px 10px #104d7415; }
.login-button:disabled { opacity: .7; }
.login-button[data-loading='true'] { cursor: wait; }
.login-button[data-loading='true'] > i { animation: login-spin 850ms linear infinite; }
.login-support { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0 5px; margin-top: 24px; padding-top: 16px; border-top: 1px solid #dbe6ef; color: var(--login-muted); font-size: 12px; }
.login-support a { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; color: var(--login-muted); font-size: 12px; }
.login-support a:hover { color: var(--login-accent); }
.login-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* One notice layout for server validation, session messages and passkey feedback. */
.login-page .auth-notice {
    --notice-ink: #1e6084;
    --notice-bg: #eff7fc;
    --notice-border: #c8e3f0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    margin-bottom: 18px;
    padding: 13px 14px;
    border: 1px solid var(--notice-border);
    border-left: 3px solid var(--notice-ink);
    border-radius: 10px;
    color: var(--notice-ink);
    background: var(--notice-bg);
    font-size: 13px;
    line-height: 1.6;
    animation: login-notice-arrive 200ms ease-out both;
}
.login-page .auth-notice[data-tone='success'] { --notice-ink: #17634e; --notice-bg: #edf8f2; --notice-border: #c7e7d5; }
.login-page .auth-notice[data-tone='warning'] { --notice-ink: #835713; --notice-bg: #fffaeb; --notice-border: #eedda9; }
.login-page .auth-notice[data-tone='error'] { --notice-ink: #a33142; --notice-bg: #fff2f4; --notice-border: #f1cbd2; }
.login-page .auth-notice__icon { flex: none; padding-top: 1px; }
.login-page .auth-notice__message { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.login-page .auth-notice__close { display: grid; place-items: center; flex: 0 0 44px; min-height: 44px; margin: -11px -12px -11px 0; border: 0; border-radius: 7px; background: transparent; color: inherit; }
.login-page .auth-notice__close:hover { background: #102e490a; }
.login-actions .auth-notice { grid-column: 1 / -1; margin-bottom: 0; }
.login-page .login-toast { position: fixed; top: max(16px, env(safe-area-inset-top)); left: 50%; z-index: 10; width: max-content; max-width: calc(100% - 32px); box-shadow: 0 8px 28px #163c5924; translate: -50% 0; transition: opacity 180ms ease, transform 180ms ease; }
.login-toast.is-leaving { opacity: 0; transform: translateY(-8px); }

/* Compact flow controls; the server still owns validation, expiry and resend limits. */
.login-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: #486a83; font-size: 11px; font-weight: 600; }
.login-progress ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; width: 76px; margin: 0; padding: 0; list-style: none; }
.login-progress li { height: 4px; border-radius: 4px; background: #cedfea; }
.login-progress li.is-complete { background: #60a8b9; }
.login-progress li[aria-current='step'] { background: #087a9c; }
.login-hint { margin: 0; color: #587187; font-size: 12px; line-height: 1.6; }
.login-input--code { min-height: 62px; padding-right: 16px; }
.login-input--code input { min-height: 60px; text-align: center; font-family: ui-monospace, monospace; font-size: 24px; font-weight: 600; letter-spacing: .35em; }
.login-input--code input::placeholder { font-size: inherit; letter-spacing: inherit; color: #8a9eaf; }
.login-requirements { display: flex; gap: 10px; margin: 0; padding: 12px 14px; border-radius: 10px; color: #365f7b; background: #e3eff7; font-size: 12px; line-height: 1.65; }
.login-requirements > i { flex: none; padding-top: 3px; color: var(--login-accent); }
.login-secondary-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 14px; }
.login-secondary-actions--center { justify-content: center; }
.login-text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 8px 0; border: 0; border-radius: 4px; background: transparent; color: #07658a; font-size: 12px; font-weight: 500; }
.login-text-button:hover:not(:disabled) { color: #103e5e; text-decoration: underline; text-underline-offset: 3px; }
.login-text-button:disabled { color: #697f91; }
.login-text-button b { font-weight: 600; font-variant-numeric: tabular-nums; }

@keyframes login-arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes login-notice-arrive { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes login-spin { to { transform: rotate(360deg); } }

@media (max-width: 959px) {
    .login-panel { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
    .login-scene { display: none; }
    .login-card { padding: 30px 32px 20px; border-radius: 23px; }
}

@media (max-width: 480px) {
    .login-shell { padding: 24px 16px max(24px, env(safe-area-inset-bottom)); }
    .login-panel { border-radius: 20px; }
    .login-card { padding: 26px 22px 16px; border-radius: 19px; }
    .login-brand strong { font-size: 18px; }
    .login-brand img { width: 36px; }
    .login-heading { margin: 26px 0 22px; }
    .login-form { gap: 16px; }
    .login-options { column-gap: 8px; }
    .login-support { margin-top: 20px; padding-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .login-page *, .login-page *::before, .login-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
