:root {
    color-scheme: light dark;
    --auth-page: #f7f6f3;
    --auth-surface: #ffffff;
    --auth-text: #242824;
    --auth-muted: #656b64;
    --auth-border: #e3e5df;
    --auth-input-border: #969f95;
    --auth-focus: #426347;
    --auth-primary: #252e26;
    --auth-primary-text: #ffffff;
    --auth-inset: #f2f3ef;
}
@media (prefers-color-scheme: dark) {
    :root { --auth-page: #151815; --auth-surface: #1d221d; --auth-text: #f1f2eb; --auth-muted: #b4bcaf; --auth-border: #3d473c; --auth-input-border: #84917e; --auth-focus: #bbd8ad; --auth-primary: #e1e9d9; --auth-primary-text: #1d281d; --auth-inset: #272e25; }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100vh; min-height: 100dvh; background: var(--auth-page); color: var(--auth-text); font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden], .hidden { display: none !important; }
.auth-header { max-width: 1440px; margin: auto; padding: 28px 42px; display: flex; align-items: center; gap: 13px; }
.auth-wordmark { font-size: 25px; font-weight: 750; letter-spacing: -1.5px; }
.auth-brand-label { max-width: 150px; padding-left: 13px; border-left: 1px solid var(--auth-border); color: var(--auth-muted); font-size: 11px; line-height: 1.5; }
.auth-main { min-height: calc(100dvh - 152px); display: grid; align-content: center; padding: 28px 24px 52px; }
.auth-card, #loginForm, #otpForm { width: 100%; max-width: 440px; margin: 0 auto; padding: 36px 38px; background: var(--auth-surface); border: 1px solid var(--auth-border); border-radius: 12px; }
#loginBOX, #otpBOX { width: 100%; }
.auth-steps { padding: 0 0 26px; margin: 0 0 28px; border-bottom: 1px solid var(--auth-border); display: flex; gap: 24px; list-style: none; color: var(--auth-muted); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.auth-steps li { display: flex; align-items: center; gap: 8px; }
.auth-steps b { display: inline-grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--auth-border); border-radius: 4px; font-weight: 500; letter-spacing: 0; }
.auth-steps .current { color: var(--auth-text); }
.auth-steps .current b { background: var(--auth-primary); color: var(--auth-primary-text); border-color: var(--auth-primary); }
.auth-eyebrow { margin: 0 0 9px; color: var(--auth-muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; color: var(--auth-text); font-family: Georgia, 'Times New Roman', serif; font-weight: 400; letter-spacing: -.035em; line-height: 1.1; }
h1, h3 { font-size: 36px; }
.auth-intro { margin: 15px 0 26px; color: var(--auth-muted); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.auth-intro strong { color: var(--auth-text); font-weight: 600; }
.auth-field { margin: 21px 0 0; }
label { display: block; margin: 0 0 9px; color: var(--auth-text); font-size: 13px; font-weight: 600; }
input:not([type=hidden]) { display: block; width: 100%; min-height: 49px; padding: 12px 13px; background: var(--auth-surface); color: var(--auth-text); border: 1px solid var(--auth-input-border); border-radius: 6px; font-size: 16px; line-height: 1.4; }
input::placeholder { color: var(--auth-muted); opacity: 1; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 3px; }
input[aria-invalid=true] { border-color: #bd5250; }
.password-field { position: relative; }
.password-field input { padding-right: 66px; }
.password-toggle { position: absolute; top: 0; right: 3px; height: 49px; min-width: 58px; padding: 0 9px; background: transparent; color: var(--auth-muted); border: 0; border-radius: 5px; font-size: 12px; font-weight: 600; }
.button { display: block; width: 100%; min-height: 49px; padding: 13px 14px; margin: 25px 0 0; background: var(--auth-primary); color: var(--auth-primary-text); border: 1px solid var(--auth-primary); border-radius: 6px; text-align: center; font-size: 14px; line-height: 1.4; font-weight: 600; box-shadow: none; }
.button * { color: inherit; -webkit-text-fill-color: currentColor; }
.button:hover { filter: brightness(.92); }
.button:disabled { cursor: wait; opacity: .62; }
.button.secondary-button { background: transparent; color: var(--auth-text); border-color: var(--auth-border); }
.button.secondary-button:disabled { cursor: not-allowed; }
.auth-caption { margin: 15px 0 0; color: var(--auth-muted); text-align: center; font-size: 12px; line-height: 1.6; }
.auth-message { margin: 16px 0; padding: 11px 13px; border-radius: 6px; background: var(--auth-inset); color: var(--auth-text); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.auth-error { background: #fdebec; color: #8c302e; }
.auth-success { background: #edf3ec; color: #346538; }
#otp_code { height: 72px; padding: 12px 5px 12px 16px; font-family: 'SF Mono', Consolas, monospace; font-size: 30px; font-weight: 500; letter-spacing: .38em; text-align: center; }
#otp_code::placeholder { opacity: .42; }
#otpCodeHint { display: block; margin: 10px 0 0; color: var(--auth-muted); font-size: 12px; line-height: 1.6; }
.otp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 11px; }
.otp-actions .button { margin: 0; min-height: 44px; font-size: 12px; padding: 11px 7px; }
.otp-actions.single-action { grid-template-columns: 1fr; }
.otp-wait-heading { display: flex; align-items: center; gap: 6px; }
#otpCooldownTimer { font-size: 12px; font-weight: 600; }
#otpCooldownReason { display: block; margin-top: 3px; color: var(--auth-muted); font-size: 11px; }
.otp-wait-track { height: 2px; margin-top: 9px; overflow: hidden; background: var(--auth-border); }
.otp-wait-fill { height: 100%; width: 100%; transform-origin: left; background: var(--auth-focus); }
.auth-footer { padding: 0 20px 24px; color: var(--auth-muted); text-align: center; font-size: 11px; line-height: 1.5; }
#accessDeniedMessage { margin: auto; }
#modalitemchagepass { max-width: 440px; }
@media (prefers-color-scheme: dark) {
    .auth-error { background: #412725; color: #ffd1cb; }
    .auth-success { background: #243a29; color: #cce5c3; }
}
@media (max-width: 520px) {
    .auth-header { padding: 23px 24px; }
    .auth-main { padding: 14px 16px 32px; min-height: calc(100dvh - 133px); }
    .auth-card, #loginForm, #otpForm { padding: 29px 24px; }
    h1, h3 { font-size: 33px; }
}
@media (max-width: 350px) {
    .auth-main { padding-left: 10px; padding-right: 10px; }
    .auth-card, #loginForm, #otpForm { padding: 25px 18px; }
    .auth-steps { gap: 15px; }
    #otp_code { font-size: 28px; letter-spacing: .3em; }
}
@media (max-height: 680px) { .auth-main { align-content: start; } }
@media (prefers-reduced-motion: no-preference) {
    .button { transition: filter .15s, opacity .15s; }
    .button:active { transform: translateY(1px); }
}
