/* Login screen: Figma node 81:674 ("themed-login-page", 1440x900). */
@font-face { font-family: "Instrument Serif"; src: url("../fonts/InstrumentSerif-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/InstrumentSerif-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
/* Static Instrument Sans cuts named by the Figma text styles (Regular, Medium, SemiBold). They are hinted, so
   12-14px text keeps even letter spacing on Windows, unlike the unhinted variable font. */
@font-face { font-family: "Instrument Sans"; src: url("../fonts/InstrumentSans-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/InstrumentSans-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/InstrumentSans-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface-page); color: var(--text-default); font: 400 var(--font-size-base)/1.5 "Instrument Sans", sans-serif; }
a { color: var(--primary-700); }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--border-interactive); outline-offset: 4px; }

/* Layout: 694px form column + 746px preview column at the 1440px reference. */
.auth-shell { display: grid; grid-template-columns: 48.2% 51.8%; min-height: 100svh; }
.auth-form-panel { display: flex; padding: 64px clamp(32px, 6.95vw, 100px); }
/* Figma 81:674: top-aligned; header to form 64px, form to footer 120px. */
.auth-content { display: flex; flex-direction: column; gap: 64px; width: 100%; max-width: 100%; }
.auth-footer { margin-top: 56px; }

/* Header: logo mark, then title group (32px apart). */
.auth-heading { display: flex; flex-direction: column; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; height: 36px; align-self: flex-start; color: var(--brand-ink); text-decoration: none; }
.brand-mark { display: block; transform: scaleX(-1); }
.brand-wordmark { font: 400 30px/normal "Instrument Serif", serif; white-space: nowrap; }
.brand-wordmark em { font-style: italic; }
.auth-title { display: flex; flex-direction: column; gap: 12px; }
h1 { margin: 0; color: var(--primary-900); font: 400 42px/normal "Instrument Serif", serif; }
.auth-title p { margin: 0; color: var(--text-muted); font-size: var(--font-size-sm); line-height: 1.5; }

/* Form body: 20px between fields, accessory row, and button. */
.login-form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { color: var(--text-muted); font-size: var(--font-size-sm); font-weight: 500; line-height: 1; }
.input-wrap { position: relative; }
.input-icon { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); pointer-events: none; }
.input-wrap input { display: block; width: 100%; padding: 12px 14px 12px 42px; border: 1px solid var(--border-default); border-radius: var(--radius-control); color: var(--text-default); background: var(--surface-default); font-size: var(--font-size-sm); line-height: 1.5; }
.input-wrap input::placeholder { color: var(--text-muted); opacity: 1; }
.input-wrap input:hover { border-color: var(--border-strong); }
.input-wrap input:focus { border-color: var(--border-interactive); }
.input-wrap input.input-validation-error { border-color: var(--status-danger); }

/* Accessory row. Hit areas extend to 44px with negative margins so the visual row stays compact. */
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.remember { display: flex; align-items: center; gap: 8px; padding-block: 14px; margin-block: -14px; cursor: pointer; color: var(--text-muted); font-size: var(--font-size-sm); font-weight: 500; line-height: 1; }
.remember input { appearance: none; flex: none; width: 16px; height: 16px; margin: 0; border: 1.5px solid var(--border-default); border-radius: 3px; background: var(--surface-default) center / 10px 10px no-repeat; cursor: pointer; }
.remember input:checked { background-image: url("../branding/login/icon-check.svg"); }
.remember input:focus-visible { outline-offset: 2px; }
.account-help { text-align: right; }
.account-help summary { padding-block: 14px; margin-block: -14px; color: var(--primary-700); font-size: var(--font-size-sm); font-weight: 500; line-height: 1; cursor: pointer; list-style: none; }
.account-help summary::-webkit-details-marker { display: none; }
.account-help summary:hover { text-decoration: underline; }
.account-help p { max-width: 230px; margin: 20px 0 0 auto; color: var(--text-muted); font-size: var(--font-size-xs); line-height: 1.5; }

/* Primary button (Figma "Block / Button"), one step darker than Figma for AA contrast.
   Hover/pressed/loading are not defined in Figma. */
.login-button { display: flex; align-items: center; justify-content: center; gap: var(--button-gap); width: 100%; height: var(--button-height-md); padding-inline: var(--button-padding-inline); border: 0; border-radius: var(--button-radius); color: var(--button-primary-text); background: var(--button-primary-bg); font-size: var(--font-size-base); font-weight: 500; line-height: 1; cursor: pointer; }
.login-button:hover { background: var(--primary-800); }
.login-button:active { background: var(--primary-900); }
.login-button:disabled { background: var(--primary-800); cursor: wait; }
.spinner { display: none; width: 16px; height: 16px; border: 2px solid var(--primary-400); border-top-color: var(--button-primary-text); border-radius: 50%; animation: spin .8s linear infinite; }
.login-button:disabled .spinner { display: inline-block; }
.validation-summary-valid { display: none; }
.validation-summary-errors { padding: 12px 16px; border: 1px solid var(--status-danger); border-radius: var(--radius-control); background: var(--accent-50); color: var(--accent-600); font-size: var(--font-size-sm); }
.validation-summary ul { margin: 0; padding-left: 18px; }

/* Footer prompt (styled as Figma "Signup-Prompt"). */
.auth-footer p { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; color: var(--text-muted); font-size: var(--font-size-sm); line-height: 1.5; }
.auth-footer span { color: var(--primary-700); font-weight: 500; }

/* Preview column. */
.auth-story { display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 64px; background: var(--primary-900); color: var(--brand-frost); }
.version-badge { align-self: flex-start; padding: 6px 12px; border-radius: 100px; color: var(--accent-200); background: var(--primary-800); font-size: var(--font-size-xs); font-weight: 500; line-height: 1; letter-spacing: .02em; text-transform: uppercase; }
.story-mockup { position: relative; width: 100%; aspect-ratio: 618 / 454; overflow: hidden; }
.story-mockup img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Figma "Edge Fade" layers: 88px sides, 48px top, 44px bottom. */
.story-mockup::after { content: ""; position: absolute; inset: 0; pointer-events: none; background:
    linear-gradient(to right, #0f5257, rgba(15, 82, 87, .38) 72%, rgba(15, 82, 87, 0)) left / 88px 100% no-repeat,
    linear-gradient(to left, #0f5257, rgba(15, 82, 87, .38) 72%, rgba(15, 82, 87, 0)) right / 88px 100% no-repeat,
    linear-gradient(to bottom, #0f5257, rgba(15, 82, 87, .38) 72%, rgba(15, 82, 87, 0)) top / 100% 48px no-repeat,
    linear-gradient(to top, #0f5257, rgba(15, 82, 87, .38) 72%, rgba(15, 82, 87, 0)) bottom / 100% 44px no-repeat; }
.story-copy { display: flex; flex-direction: column; gap: 16px; }
.story-copy h2 { margin: 0; font: 400 clamp(32px, 3.34vw, 48px)/1.1 "Instrument Serif", serif; }
/* Pill and body colors are lighter than Figma (accent-400, primary-400) to meet WCAG AA. */
.story-copy p { margin: 0; color: var(--primary-200); font-size: var(--font-size-sm); line-height: 1.5; }

.skip-link { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 8px 16px; background: var(--surface-default); transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1100px) { .auth-form-panel, .auth-story { padding-block: 48px; } .auth-story { padding-inline: 32px; } }
@media (max-width: 800px) { .auth-shell { display: block; } .auth-story { display: none; } .auth-form-panel { justify-content: center; min-height: 100svh; padding: 40px 24px; } h1 { font-size: 36px; } }
@media (max-width: 360px) { .auth-form-panel { padding-inline: 20px; } h1 { font-size: 32px; } .login-options { gap: 8px; } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
