/* The sign-in pages run on the same system as the dashboards: Barlow, one blue
   accent, and role tokens rather than literal hex. The faces are the same files
   the cashier loads, so a counter machine downloads them once. */
@font-face {
    font-family: "Barlow";
    src: url("../assets/fonts/barlow-latin-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Barlow";
    src: url("../assets/fonts/barlow-latin-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Barlow";
    src: url("../assets/fonts/barlow-latin-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Barlow";
    src: url("../assets/fonts/barlow-latin-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Barlow carries no peso sign, so the stack falls back to Segoe UI for that one
   glyph - the same arrangement the dashboards use. */
:root {
    --auth-font: "Barlow", "Segoe UI", system-ui, sans-serif;

    --page-bg: #0f1115;
    --panel-bg: #171a20;
    --panel-soft: #1e222a;
    --brand-bg: #12151b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-text: #86adff;
    --accent-soft: #1b2a45;
    --accent-ring: rgba(96, 145, 255, 0.35);
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-muted: #9aa3b2;
    --border: #2a2f38;
    --border-strong: #3a414c;
    --field-bg: #1e222a;
    --danger: #f87171;
    --danger-soft: #3a1d1d;
    --success: #4ade80;
    --success-soft: #16301f;
    --shadow-raised: 0 18px 48px rgba(0, 0, 0, 0.45);

    /* The brand panel is dark in both themes, so what sits on it reads from
       these rather than from the page's ink. */
    --on-brand: #f3f4f6;
    --on-brand-muted: #9aa3b2;
    --on-brand-accent: #86adff;
    --on-brand-line: rgba(243, 244, 246, 0.14);

    color-scheme: dark;
}

/* The counter's own machine decides the theme, and an explicit attribute can
   pin it for a screenshot or a future in-page switch. */
@media (prefers-color-scheme: light) {
    :root:not([data-color-scheme="dark"]) {
        --page-bg: #f3f4f6;
        --panel-bg: #ffffff;
        --panel-soft: #f7f8fa;
        --brand-bg: #111827;
        --accent-text: #1d4ed8;
        --accent-soft: #eaf1fe;
        --accent-ring: rgba(37, 99, 235, 0.22);
        --text-primary: #111827;
        --text-secondary: #374151;
        --text-muted: #5d6878;
        --border: #e3e6eb;
        --border-strong: #cdd2da;
        --field-bg: #ffffff;
        --danger: #b42318;
        --danger-soft: #fdecea;
        --success: #137a3a;
        --success-soft: #e7f6ec;
        --shadow-raised: 0 18px 48px rgba(16, 24, 40, 0.16);

        color-scheme: light;
    }
}

:root[data-color-scheme="light"] {
    --page-bg: #f3f4f6;
    --panel-bg: #ffffff;
    --panel-soft: #f7f8fa;
    --brand-bg: #111827;
    --accent-text: #1d4ed8;
    --accent-soft: #eaf1fe;
    --accent-ring: rgba(37, 99, 235, 0.22);
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #5d6878;
    --border: #e3e6eb;
    --border-strong: #cdd2da;
    --field-bg: #ffffff;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --success: #137a3a;
    --success-soft: #e7f6ec;
    --shadow-raised: 0 18px 48px rgba(16, 24, 40, 0.16);

    color-scheme: light;
}

/* design-system.css still feeds a few shared pieces on these pages; point its
   names at this system so nothing resolves to the older sky blue. */
:root {
    --fc-font-sans: var(--auth-font);
    --fc-brand: var(--accent);
    --fc-brand-hover: var(--accent-hover);
    --fc-bg: var(--page-bg);
    --fc-surface: var(--panel-bg);
    --fc-sidebar: var(--brand-bg);
    --fc-field: var(--field-bg);
    --fc-border: var(--border);
    --fc-text: var(--text-primary);
    --fc-text-secondary: var(--text-secondary);
    --fc-text-muted: var(--text-muted);
    --fc-danger: var(--danger);
    --fc-success: var(--success);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--auth-font);
    font-size: 15px;
    line-height: 1.45;
    background: var(--page-bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* The parts a browser draws for us still belong to the design. */
::selection {
    background: var(--accent-soft);
    color: var(--text-primary);
}

:root {
    scrollbar-color: var(--border-strong) transparent;
}

input,
button,
a {
    font-family: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.login-card {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    overflow: hidden;
    border: none;
    border-radius: 0;
    background: var(--panel-bg);
    box-shadow: none;
    animation: loginEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes loginEnter {
    from {
        opacity: 0.4;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-panel {
    position: relative;
    min-height: 100%;
    padding: clamp(34px, 5vw, 72px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(34px, 7vh, 72px);
    background: var(--brand-bg);
    transition: background 0.25s ease;
    isolation: isolate;
}

.brand-logo-large,
.logo {
    width: 148px;
    height: 148px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    background: #0f1b2f;
    box-shadow: var(--shadow-raised);
    color: var(--accent);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.02em;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.brand-logo-large img,
.logo img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    border-radius: 50%;
}

.brand-logo-large:hover,
.logo:hover {
    transform: translateY(-2px);
}

/* Transparent FORGECAST mark on the login screen. */
.brand-panel .brand-logo-large {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.brand-panel .brand-logo-large img {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: contain;
}

.form-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(42px, 7vw, 96px);
    background: var(--panel-bg);
}

.form-panel form {
    max-width: 440px;
    width: 100%;
}

.form-header {
    margin-bottom: 32px;
    max-width: 440px;
    width: 100%;
}

.form-header h2,
.recovery-card h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
}

.form-header p,
.recovery-card > p {
    margin: 12px 0 0;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.55;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
}

.input-wrapper,
.password-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    color: var(--text-muted);
    pointer-events: none;
}

input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--field-bg);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.input-wrapper input {
    padding-left: 46px;
}

.password-wrapper input {
    padding-right: 48px;
}

input::placeholder {
    color: var(--text-muted);
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
    background: var(--field-bg);
    transform: translateY(-1px);
}

#username::-webkit-calendar-picker-indicator {
    display: none !important;
    opacity: 0;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

input.error {
    border-color: var(--danger);
    background: var(--danger-soft);
}

.password-toggle {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.password-toggle:hover {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-primary);
    transform: translateY(-50%) scale(1.04);
}

.eye-icon {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
}

.error-message {
    display: block;
    min-height: 16px;
    margin-top: 6px;
    color: var(--danger);
    font-size: 12px;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 4px 0 26px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    border: 1px solid #334155;
    border-radius: 6px;
    background: var(--field-bg);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    border-color: var(--accent);
    background: var(--accent);
    transform: scale(1.02);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: "✓";
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
}

.forgot-password,
.recovery-actions a {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.forgot-password:hover,
.recovery-actions a:hover {
    color: var(--accent-text);
}

.login-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.02em;
    transition: background 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}

.login-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px var(--accent-ring);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
}

.login-btn.login-btn-success {
    background: var(--accent-hover);
    box-shadow: 0 10px 24px var(--accent-ring);
}

.login-error {
    margin-top: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--danger);
    border-radius: 11px;
    background: var(--danger-soft);
    color: var(--danger);
    animation: feedbackIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* The hidden attribute has to outrank the class above, or an error box
   that is hidden in the markup renders anyway - empty, with just its
   icon. An inline style still wins over this, so a script may show the
   box either way. */
.login-error[hidden] {
    display: none;
}

@keyframes feedbackIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-icon {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--danger);
    color: var(--panel-bg);
    font-size: 12px;
    font-weight: 700;
}

.error-text {
    color: var(--danger);
    font-size: 13px;
    line-height: 1.4;
}

/* Recovery page support */
body:has(.recovery-container) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.recovery-card {
    width: 100%;
    min-height: auto;
    display: block;
    padding: 42px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-bg);
    box-shadow: var(--shadow-raised);
}

.recovery-card .logo {
    width: 60px;
    height: 60px;
    margin-bottom: 22px;
    border-radius: 50%;
    font-size: 24px;
}

.change-password-shell {
    padding: 24px;
}

.change-password-card {
    width: min(100%, 520px);
    min-height: auto;
    display: block;
    padding: 38px;
}

.change-password-card .login-form-panel,
.change-password-card form {
    width: 100%;
}

.change-password-card .form-header {
    margin-bottom: 26px;
}

.change-password-card .form-header h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 24px;
    line-height: 1.15;
    font-weight: 800;
}

.change-password-card .form-header p {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 15px;
}

.change-password-card .login-btn {
    margin-top: 8px;
}

.recovery-step {
    display: none;
}

.recovery-step.active {
    display: block;
}

.forgot-feedback {
    min-height: 18px;
    margin: 14px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

.forgot-feedback.success {
    color: var(--success);
}

.forgot-feedback.error {
    color: var(--danger);
}

.recovery-actions {
    margin-top: 20px;
    text-align: center;
}

@media (max-width: 900px) {
    .login-card {
        grid-template-columns: 1fr;
        max-width: 560px;
        min-height: auto;
        border: 1px solid var(--border);
        border-radius: 16px;
    }

    .brand-panel {
        min-height: 360px;
    }

    .form-panel {
        padding: 42px;
    }
}

@media (max-width: 560px) {
    .login-shell {
        padding: 18px;
    }

    .login-card {
        min-height: auto;
    }

    .brand-panel {
        padding: 32px 22px 24px;
    }

    .brand-logo-large {
        width: 112px;
        height: 112px;
        font-size: 28px;
    }

    .form-header h2,
    .recovery-card h2 {
        font-size: 24px;
    }

    .form-panel,
    .recovery-card {
        padding: 30px 22px;
    }

    .login-options {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Flat split-screen login based on the selected reference. */
body.login-page {
    background: var(--page-bg);
    color: var(--text-primary);
}

body.login-page .login-shell {
    min-height: 100vh;
    padding: 0;
    background: var(--page-bg);
}

body.login-page .login-card {
    width: 100%;
    min-height: 100vh;
    grid-template-columns: minmax(420px, .95fr) minmax(520px, 1.05fr);
    border: 0;
    border-radius: 0;
    background: var(--panel-bg);
    box-shadow: none;
    animation: none;
}

body.login-page .brand-panel {
    min-height: 100vh;
    justify-content: space-between;
    gap: 40px;
    padding: clamp(42px, 5vw, 70px) clamp(42px, 5vw, 72px) 38px;
    overflow: hidden;
    border-right: 1px solid var(--on-brand-line);
    background: var(--brand-bg);
    color: var(--on-brand);
    isolation: auto;
}

body.login-page .login-brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
}

body.login-page .brand-panel .brand-logo-large {
    /* Asked bigger for the defense. The lockup is a flex row, so the basis has to
       move with the box or the mark keeps its old track. */
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
}

body.login-page .brand-panel .brand-logo-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.login-page .login-brand-wordmark {
    display: grid;
    gap: 3px;
}

body.login-page .login-brand-wordmark strong {
    display: flex;
    align-items: baseline;
    font-size: clamp(20px, 2vw, 24px);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1;
}

body.login-page .login-brand-wordmark strong span:first-child {
    color: var(--on-brand);
}

body.login-page .login-brand-wordmark strong span:last-child {
    color: var(--accent);
}

body.login-page .login-brand-wordmark small {
    color: var(--on-brand-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
}

body.login-page .login-brand-message {
    position: relative;
    width: 100%;
    max-width: 550px;
    padding-left: 44px;
}

body.login-page .login-brand-message h1 {
    margin: 0;
    color: var(--on-brand);
    /* Measured on the real page at 1920 and 1500: the panel is 903px wide and
       798px tall, and 40px leaves the slogan at three balanced lines with room to
       spare on both. 28px looked like body copy next to the mark. */
    font-size: clamp(28px, 3.2vw, 40px);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    text-wrap: balance;
}

body.login-page .login-brand-message h1 span {
    color: var(--accent);
}

body.login-page .login-brand-message p {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 0;
    color: var(--on-brand-muted);
    font-size: 15px;
    letter-spacing: .04em;
}

body.login-page .login-brand-message p span {
    color: var(--on-brand-accent);
    font-size: 20px;
}

body.login-page .login-version {
    margin: 0;
    padding-top: 20px;
    border-top: 1px solid var(--on-brand-line);
    color: var(--on-brand-muted);
    font-size: 12px;
    text-align: center;
}

body.login-page .form-panel {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: clamp(32px, 5vw, 64px);
    background: var(--page-bg);
}

body.login-page .form-panel form,
body.login-page .form-header {
    width: 100%;
    max-width: 480px;
}

body.login-page .form-header {
    margin-bottom: 22px;
}

body.login-page .form-header h2 {
    color: var(--text-primary);
    font-size: clamp(24px, 3vw, 28px);
    font-weight: 700;
    letter-spacing: -.035em;
}

body.login-page .form-header p {
    margin-top: 8px;
    color: var(--text-secondary);
    max-width: 390px;
    font-size: 15px;
    font-weight: 400;
}

body.login-page .form-group {
    margin-bottom: 12px;
}

body.login-page .form-group > label {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .03em;
}

body.login-page .input-icon {
    left: 16px;
    color: var(--text-muted);
}

body.login-page .input-icon svg {
    width: 20px;
    height: 20px;
}

body.login-page .input-wrapper input {
    height: 48px;
    padding-left: 46px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    background: var(--field-bg);
    color: var(--text-primary);
    font-size: 15px;
    box-shadow: none;
    transform: none;
}

body.login-page .password-wrapper input {
    padding-right: 52px;
}

body.login-page .input-wrapper input:focus {
    border-color: var(--accent);
    background: var(--field-bg);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-ring);
    transform: none;
}

body.login-page .input-wrapper input.error {
    border-color: var(--danger);
    background: var(--danger-soft);
}

body.login-page .password-toggle {
    width: 44px;
    height: 44px;
    border-radius: 9px;
    color: var(--text-muted);
}

body.login-page .password-toggle:hover {
    background: var(--fc-surface-raised);
    color: var(--text-primary);
    transform: translateY(-50%);
}

body.login-page .error-message {
    min-height: 14px;
    margin-top: 4px;
    color: var(--danger);
}

body.login-page .login-options {
    margin: 0 0 18px;
}

body.login-page .checkbox-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-right: 4px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

body.login-page .checkbox-label input[type="checkbox"] {
    display: block;
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    opacity: 0;
}

body.login-page .checkbox-label input[type="checkbox"]:focus-visible + .checkmark {
    outline: 3px solid var(--accent-ring);
    outline-offset: 2px;
}

body.login-page .checkmark {
    width: 18px;
    height: 18px;
    border-color: var(--fc-border-strong);
    border-radius: 6px;
    background: var(--field-bg);
}

body.login-page .checkbox-label input[type="checkbox"]:checked + .checkmark {
    border-color: var(--accent);
    background: var(--accent);
    transform: none;
}

body.login-page .checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: "\2713";
    color: #ffffff;
}

body.login-page .forgot-password {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--accent-text);
    font-size: 14px;
    font-weight: 600;
}

body.login-page .forgot-password:hover {
    color: var(--accent-hover);
}

body.login-page .forgot-password:focus-visible,
body.login-page .password-toggle:focus-visible,
body.login-page .login-btn:focus-visible {
    outline: 3px solid var(--accent-ring);
    outline-offset: 3px;
}

body.login-page .login-btn {
    height: 48px;
    border-radius: 11px;
    background: var(--accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: none;
    transform: none;
}

body.login-page .login-btn:hover {
    background: var(--accent-hover);
    box-shadow: none;
    transform: none;
}

body.login-page .login-btn:disabled {
    background: var(--accent-hover);
    cursor: wait;
    opacity: 1;
}

body.login-page .login-btn.login-btn-success {
    background: var(--success);
    box-shadow: none;
}

body.login-page .login-error {
    border-color: var(--danger);
    border-radius: 11px;
    background: var(--danger-soft);
    color: var(--danger);
}

body.login-page .error-text {
    color: inherit;
}

@media (min-width: 801px) and (max-height: 720px) {
    body.login-page .brand-panel {
        padding-block: 30px 24px;
    }

    body.login-page .login-brand-message h1 {
        font-size: 28px;
    }

    body.login-page .login-brand-message p {
        margin-top: 14px;
    }

    body.login-page .form-panel {
        padding-block: 24px;
    }

    body.login-page .form-header {
        margin-bottom: 18px;
    }
}

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

@media (max-width: 980px) {
    body.login-page .login-card {
        grid-template-columns: minmax(320px, .8fr) minmax(460px, 1.2fr);
    }

    body.login-page .login-brand-message {
        padding-left: 34px;
    }

    body.login-page .login-brand-message h1 {
        font-size: 24px;
    }
}

@media (max-width: 800px) {
    body.login-page .login-shell {
        align-items: stretch;
    }

    body.login-page .login-card {
        max-width: none;
        grid-template-columns: 1fr;
        border: 0;
        border-radius: 0;
    }

    body.login-page .brand-panel {
        min-height: auto;
        gap: 34px;
        padding: 28px clamp(22px, 7vw, 52px) 32px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    body.login-page .login-brand-message {
        max-width: 560px;
        padding-left: 32px;
    }

    body.login-page .login-brand-message h1 {
        font-size: clamp(24px, 7vw, 28px);
    }

    body.login-page .login-version {
        display: none;
    }

    body.login-page .form-panel {
        min-height: auto;
        padding: 34px clamp(20px, 6vw, 46px) 44px;
    }
}

@media (max-width: 520px) {
    body.login-page .login-brand-lockup {
        gap: 10px;
    }

    body.login-page .brand-panel .brand-logo-large {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    body.login-page .login-brand-wordmark strong {
        font-size: 20px;
    }

    body.login-page .login-brand-wordmark small {
        font-size: 12px;
    }

    body.login-page .login-brand-message {
        padding-left: 0;
    }
    body.login-page .login-brand-message h1 {
        font-size: 24px;
    }

    body.login-page .login-brand-message p {
        font-size: 14px;
    }

    body.login-page .form-panel {
        padding: 28px 18px 36px;
    }

    body.login-page .form-header h2 {
        font-size: 24px;
    }

    body.login-page .login-options {
        align-items: center;
        flex-direction: row;
    }

}

/* Flat Forgecast account recovery flow. */
body.recovery-page {
    background: var(--page-bg);
    color: var(--text-primary);
}

.recovery-page .recovery-shell {
    width: 100%;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: clamp(32px, 6vw, 72px) 22px;
}

.recovery-page .recovery-content {
    width: 100%;
    max-width: 590px;
}

.recovery-page .recovery-brand-lockup {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 46px;
}

.recovery-page .recovery-brand-lockup > img {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    object-fit: contain;
}

.recovery-page .recovery-wordmark {
    display: grid;
    gap: 3px;
}

.recovery-page .recovery-wordmark strong {
    display: flex;
    align-items: baseline;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1;
}

.recovery-page .recovery-wordmark strong span:first-child {
    color: var(--text-primary);
}

.recovery-page .recovery-wordmark strong span:last-child {
    color: var(--accent);
}

.recovery-page .recovery-wordmark small {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
}

.recovery-page .recovery-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    gap: 9px;
    justify-content: center;
    width: 100%;
    margin: 16px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--fc-duration-fast) var(--fc-ease-standard);
}

.recovery-page .recovery-back::before {
    width: 7px;
    height: 7px;
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
    content: "";
    transform: rotate(45deg);
}

.recovery-page .recovery-back:hover {
    color: var(--accent-hover);
}

.recovery-page .recovery-back:focus-visible,
.recovery-page .password-toggle:focus-visible,
.recovery-page .login-btn:focus-visible {
    outline: 3px solid var(--accent-ring);
    outline-offset: 3px;
}

.recovery-page .recovery-heading {
    margin-bottom: 28px;
}

.recovery-page .recovery-heading h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(24px, 4vw, 28px);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.15;
}

.recovery-page .recovery-heading > p:last-child {
    max-width: 570px;
    margin: 11px 0 0;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
}

.recovery-page .cashier-recovery-note {
    display: grid;
    gap: 3px;
    margin: -8px 0 20px;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.recovery-page .cashier-recovery-note strong {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

.recovery-page .recovery-step {
    width: 100%;
}

.recovery-page .form-group {
    margin-bottom: 14px;
}

.recovery-page .form-group label {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.recovery-page .form-group input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    background: var(--field-bg);
    color: var(--text-primary);
    font-size: 15px;
    box-shadow: none;
    transform: none;
}

.recovery-page .password-wrapper input {
    padding-right: 52px;
}

.recovery-page .form-group input::placeholder {
    color: var(--text-muted);
}

.recovery-page .form-group input:focus {
    border-color: var(--accent);
    outline: 3px solid var(--accent-ring);
    outline-offset: 0;
    background: var(--fc-surface-raised);
    box-shadow: none;
    transform: none;
}

.recovery-page .password-toggle {
    width: 44px;
    height: 44px;
    border-radius: 9px;
    color: var(--text-muted);
}

.recovery-page .password-toggle:hover {
    background: var(--fc-surface-raised);
    color: var(--text-primary);
    transform: translateY(-50%);
}

.recovery-page .login-btn {
    height: 48px;
    margin-top: 4px;
    border-radius: 11px;
    background: var(--accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: none;
    transform: none;
}

.recovery-page .login-btn:hover {
    background: var(--accent-hover);
    box-shadow: none;
    transform: none;
}

.recovery-page .login-btn:disabled {
    background: var(--accent-hover);
    cursor: wait;
    opacity: 1;
}

.recovery-page .forgot-feedback {
    min-height: 20px;
    margin: 12px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.recovery-page .forgot-feedback.success {
    color: var(--success);
}

.recovery-page .forgot-feedback.error {
    color: var(--danger);
}

.password-setup-page .password-setup-feedback {
    align-items: center;
    margin: 0 0 10px;
}

.password-setup-page .error-message {
    min-height: 14px;
    margin-top: 4px;
    color: var(--danger);
}

@media (max-width: 620px) {
    .recovery-page .recovery-shell {
        place-items: start center;
        padding: 28px 18px 40px;
    }

    .recovery-page .recovery-brand-lockup {
        margin-bottom: 34px;
    }

    .recovery-page .recovery-heading {
        margin-bottom: 24px;
    }

    .recovery-page .recovery-heading h1 {
        font-size: 24px;
    }
}

@media (max-width: 380px) {
    .recovery-page .recovery-wordmark strong {
        font-size: 20px;
    }

    .recovery-page .recovery-wordmark small {
        font-size: 12px;
    }

    .recovery-page .recovery-heading h1 {
        font-size: 28px;
    }
}

/* Dedicated MFA sign-in step. */
body.mfa-verification-page {
    background: var(--page-bg);
}

.mfa-verification-page .mfa-verification-shell {
    width: 100%;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

.mfa-verification-page .mfa-verification-panel {
    width: 100%;
    max-width: 480px;
}

.mfa-verification-page .mfa-verification-heading {
    margin-bottom: 20px;
}

.mfa-verification-page .mfa-verification-heading > p:first-child {
    margin-bottom: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.mfa-verification-page .mfa-verification-heading h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(24px, 4vw, 28px);
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.18;
}

.mfa-verification-page .mfa-verification-heading > p:last-child {
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
}

.mfa-verification-page .mfa-verification-code {
    margin-bottom: 14px;
}

.mfa-verification-page .mfa-verification-code label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.mfa-verification-page .mfa-verification-code input {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    background: var(--field-bg);
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: .32em;
    text-align: center;
}

.mfa-verification-page .mfa-verification-code input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.mfa-verification-page .mfa-verification-code input:focus {
    border-color: var(--accent);
    outline: 3px solid var(--accent-ring);
    outline-offset: 0;
    background: var(--fc-surface-raised);
    box-shadow: none;
    transform: none;
}

.mfa-verification-page .mfa-verification-code input.error {
    border-color: var(--danger);
}

.mfa-verification-page .login-btn {
    margin-top: 0;
}

.mfa-verification-page .mfa-verification-actions {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 16px;
}

.mfa-verification-page .mfa-verification-actions button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--accent-text);
    background: transparent;
    color: var(--accent-text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.mfa-verification-page .mfa-verification-actions button:hover {
    color: var(--accent-hover);
}

.mfa-verification-page .mfa-verification-actions button:disabled {
    color: var(--text-muted);
    cursor: wait;
}

.mfa-verification-page .mfa-verification-actions button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.mfa-verification-page .login-error {
    margin-top: 22px;
}

@media (max-width: 620px) {
    .mfa-verification-page .mfa-verification-shell {
        padding: 28px 18px;
    }

    .mfa-verification-page .mfa-verification-code input {
        height: 56px;
        font-size: 20px;
    }
}
