:root {
    color-scheme: light;
    --auth-blue: #2569a9;
    --auth-blue-dark: #154d83;
    --auth-orange: #df7029;
    --auth-ink: #25333d;
    --auth-muted: #697780;
    --auth-line: #d8e0e4;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--auth-ink);
    background: #edf3f5;
    font-synthesis: none;
}

* { box-sizing: border-box; }
.ui-preferences { position: fixed; z-index: 5; top: 16px; right: 18px; display: flex; align-items: center; gap: 7px; }
.ui-preferences button { height: 38px; min-width: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #d9e1dd; border-radius: 20px; padding: 0 9px; color: #2e3a49; background: #fff; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.ui-preferences button:hover { border-color: var(--auth-orange); color: #bd5618; }
.ui-preferences .theme-toggle { width: 38px; padding: 0; }
.ui-preferences svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-moon { display: none; }
html[data-theme="dark"] { color-scheme: dark; --auth-blue: #8cb9df; --auth-orange: #df7029; }
html[data-theme="dark"] .ui-preferences button { border-color: #344151; color: #e8efea; background: #1e2630; }
html[data-theme="dark"] .theme-sun { display: none; }
html[data-theme="dark"] .theme-moon { display: block; }
html[data-theme="dark"] body.auth-page { color: #e7edf5; background: #06172b; }
html[data-theme="dark"] .auth-shell { border-color: #263a52; background: #0c2038; box-shadow: 0 18px 54px #0006; }
html[data-theme="dark"] .auth-brand { background: #10263d; }
html[data-theme="dark"] .auth-brand-wordmark { filter: brightness(1.16); }
html[data-theme="dark"] .auth-brand p { color: #c6d5e5; }
html[data-theme="dark"] .auth-form-panel { color: #e7eeea; }
html[data-theme="dark"] .auth-heading h1 { color: #f0f4f1; }
html[data-theme="dark"] .auth-heading p { color: #a9b8ca; }
html[data-theme="dark"] .auth-form label { color: #d3ddd7; }
html[data-theme="dark"] .auth-form input, html[data-theme="dark"] .auth-form select { border-color: #3d4d60; color: #eef3ef; background: #12171d; }
html[data-theme="dark"] .auth-footer { border-color: #263a52; color: #a9b8ca; }
html[data-theme="dark"] .auth-notice { border-color: #354b65; color: #c3d4e9; background: #142b45; }
body.auth-page { min-width: 320px; min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 28px; background: linear-gradient(135deg, #eaf1f9 0%, #f6f8f8 52%, #f3f7e8 100%); }
.auth-shell { width: min(880px, 100%); min-height: 510px; display: grid; grid-template-columns: .92fr 1.08fr; overflow: hidden; border: 1px solid #d5dce4; border-radius: 5px; background: #fff; box-shadow: 0 18px 54px #1e355017; }
.auth-brand { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 48px 38px; background: #eaf1f9; }
.auth-brand::before { position: absolute; top: 0; right: 0; left: 0; height: 5px; background: var(--auth-orange); content: ""; }
.auth-brand-lockup { display: flex; align-items: center; justify-content: center; }
.auth-brand-wordmark { display: block; width: min(245px, 100%); aspect-ratio: 5.87 / 1; object-fit: contain; }
.auth-brand p { max-width: 250px; margin: 16px auto 0; color: var(--auth-blue); font-size: 13px; font-weight: 450; line-height: 1.6; text-align: center; }
.auth-brand-rule { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 34px; }
.auth-brand-rule i { width: 7px; height: 7px; border-radius: 50%; background: var(--auth-orange); }
.auth-brand-rule i:nth-child(2) { width: 31px; border-radius: 4px; background: #aeb5bd; }
.auth-form-panel { display: flex; flex-direction: column; justify-content: center; padding: 52px clamp(24px, 4vw, 48px); }
.auth-login-avatar { display: block; width: 96px; height: auto; aspect-ratio: 160 / 170; object-fit: contain; }
.auth-heading { display: flex; justify-content: center; margin-bottom: 26px; }
.auth-eyebrow { color: var(--auth-orange-dark, #bd5618); font-size: 10px; font-weight: 700; letter-spacing: 1.1px; }
.auth-heading h1 { margin: 8px 0 0; color: #242f3d; font-size: 27px; font-weight: 650; line-height: 1.2; }
.auth-heading p { margin: 7px 0 0; color: var(--auth-muted); font-size: 13px; }
.auth-error { margin: -10px 0 18px; border: 1px solid #e8c4bd; border-left: 3px solid #b64437; padding: 10px 12px; color: #873a31; background: #fcf4f2; font-size: 12px; line-height: 1.45; }
.auth-form { display: flex; flex-direction: column; }
.auth-form > div:not([hidden]) { display: contents; }
[hidden] { display: none !important; }
.auth-form label { margin: 0 0 6px; color: #444f5d; font-size: 12px; font-weight: 650; }
.auth-form input, .auth-form select { width: 100%; height: 41px; margin: 0 0 17px; border: 1px solid #cbd1d9; border-radius: 3px; padding: 0 11px; outline: none; color: #263240; background: #fff; font: inherit; font-size: 13px; }
#username { text-transform: uppercase; }
.auth-form input:focus { border-color: var(--auth-blue); box-shadow: 0 0 0 3px #2569a91c; }
.auth-form select:focus { border-color: var(--auth-blue); box-shadow: 0 0 0 3px #2569a91c; }
.auth-notice { margin: -10px 0 18px; border: 1px solid #cbd8e9; border-left: 3px solid var(--auth-blue); padding: 10px 12px; color: #344e6d; background: #f1f5fa; font-size: 12px; line-height: 1.45; }
.auth-submit { min-height: 42px; margin-top: 5px; border: 1px solid #bd5618; border-radius: 3px; color: #fff; background: var(--auth-orange); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; }
.auth-submit:hover { background: #bd5618; }
.branch-login-help { margin: -10px 0 0; color: var(--auth-muted); font-size: 11px; line-height: 1.45; }
.auth-footer { margin-top: 27px; border-top: 1px solid #e5e8ec; padding-top: 14px; color: #848d98; font-size: 10px; }

@media (max-width: 640px) {
    body.auth-page { padding: 64px 14px 14px; }
    .auth-shell { width: min(430px, 100%); min-height: 0; grid-template-columns: 1fr; }
    .auth-brand { min-height: 155px; padding: 25px 27px; }
    .auth-brand-wordmark { width: min(220px, 100%); }
    .auth-brand p { margin-top: 8px; font-size: 11px; }
    .auth-brand-rule { display: none; }
    .auth-form-panel { padding: 30px 24px; }
    .auth-login-avatar { width: 76px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
