:root {
    --charcoal: #36454f;
    --charcoal-dark: #2b383f;
    --gold: #c8a53b;
    --gold-dark: #9a7b20;
    --cream: #f5e9d1;
    --white: #fff;
    --muted: #718087;
    --line: #e7decc;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; color: var(--charcoal); background: var(--cream); font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
button, input { font: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(200, 165, 59, .5); outline-offset: 3px; }
svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(390px, .85fr) minmax(520px, 1.15fr); }
.brand-panel { min-height: 100vh; padding: 36px clamp(34px, 5vw, 72px); position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--charcoal-dark); color: #fff; }
.brand-decoration { position: absolute; border: 1px solid rgba(200, 165, 59, .16); border-radius: 50%; pointer-events: none; }
.decoration-one { width: 420px; height: 420px; right: -220px; top: -130px; box-shadow: 0 0 0 58px rgba(200, 165, 59, .035), 0 0 0 116px rgba(200, 165, 59, .025); }
.decoration-two { width: 280px; height: 280px; left: -180px; bottom: -120px; box-shadow: 0 0 0 52px rgba(200, 165, 59, .03); }
.login-brand, .mobile-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.login-logo { width: 48px; height: 48px; padding: 6px; display: grid; place-items: center; border: 1px solid rgba(200, 165, 59, .55); border-radius: 12px; background: var(--cream); box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.login-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.login-brand > span:last-child, .mobile-brand > span:last-child { display: grid; }
.login-brand strong, .mobile-brand strong { font-size: 20px; letter-spacing: -.3px; }
.login-brand small, .mobile-brand small { margin-top: 3px; color: #c8bfae; font-size: 11px; }
.brand-message { width: min(500px, 100%); margin: auto 0; position: relative; z-index: 1; }
.brand-eyebrow { margin: 0 0 13px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.brand-message h1 { margin: 0; max-width: 510px; font-size: clamp(34px, 3.6vw, 50px); line-height: 1.08; letter-spacing: -1.5px; }
.brand-message > p:nth-child(3) { max-width: 470px; margin: 19px 0 0; color: #d3cab9; font-size: 14px; line-height: 1.65; }
.brand-features { margin-top: 34px; display: grid; gap: 18px; }
.brand-features > div { display: flex; align-items: flex-start; gap: 12px; }
.brand-features > div > span { flex: 0 0 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(200, 165, 59, .22); border-radius: 9px; background: rgba(200, 165, 59, .1); color: var(--gold); }
.brand-features svg { width: 17px; }
.brand-features p { margin: 0; display: grid; gap: 4px; }
.brand-features strong { font-size: 12px; }
.brand-features small { color: #aa9f89; font-size: 11px; }
.brand-footer { position: relative; z-index: 1; padding-top: 22px; display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid rgba(255, 255, 255, .08); color: #aa9f89; font-size: 10px; }
.brand-footer strong { color: #d3cab9; }

.form-panel { min-height: 100vh; padding: 36px 28px; display: grid; place-items: center; background: #fff; }
.form-wrap { width: min(410px, 100%); }
.mobile-brand { display: none; margin-bottom: 42px; }
.mobile-brand small { color: var(--muted); }
.form-heading > p, .reset-eyebrow { margin: 0 0 11px; color: var(--gold-dark); font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.form-heading h2 { margin: 0; color: var(--charcoal-dark); font-size: clamp(28px, 3vw, 34px); letter-spacing: -.8px; }
.form-heading > span { margin-top: 8px; display: block; color: var(--muted); font-size: 13px; }
.login-form { margin-top: 30px; display: grid; }
.login-form > label, .reset-dialog label { margin-bottom: 7px; color: var(--charcoal); font-size: 11px; font-weight: 750; letter-spacing: .5px; text-transform: uppercase; }
.login-form .password-label { margin-top: 18px; }
.login-input { height: 48px; position: relative; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; transition: .15s ease; }
.login-input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 165, 59, .15); }
.login-input > svg { width: 17px; margin-left: 14px; color: #8c969b; }
.login-input input { min-width: 0; flex: 1; height: 100%; padding: 0 13px; border: 0; outline: 0; background: transparent; color: var(--charcoal-dark); font-size: 14px; }
.login-input input::placeholder, .reset-dialog input::placeholder { color: #a6adb0; }
.password-toggle { width: 44px; height: 100%; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.password-toggle svg { width: 17px; grid-area: 1 / 1; }
.password-toggle .eye-closed { display: none; }
.password-toggle.visible .eye-open { display: none; }
.password-toggle.visible .eye-closed { display: block; }
.password-help-row { margin-top: 7px; display: flex; justify-content: flex-end; }
.password-help-row button { padding: 5px 0; border: 0; background: transparent; color: #7b6118; font-size: 12px; font-weight: 700; cursor: pointer; }
.login-button { height: 48px; margin-top: 17px; padding: 0 17px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--gold); border-radius: 9px; background: var(--gold); color: var(--charcoal-dark); font-size: 13px; font-weight: 800; cursor: pointer; box-shadow: 0 7px 20px rgba(200, 165, 59, .22); transition: .15s ease; }
.login-button:hover { background: #b9952f; transform: translateY(-1px); }
.login-button:disabled, .pwa-install-button:disabled, .reset-dialog button:disabled { opacity: .62; cursor: wait; transform: none; }
.login-button svg { width: 17px; transition: transform .15s ease; }
.login-button:hover svg { transform: translateX(3px); }
.login-status { display: none; margin-top: 16px; padding: 10px 12px; border: 1px solid #d8b8b1; border-radius: 8px; background: #f8efed; color: #7f382f; font-size: 12px; line-height: 1.45; }
.login-status.visible { display: block; }

.pwa-install-card { margin-top: 18px; padding: 13px; display: grid; gap: 11px; border: 1px solid #d7e4df; border-radius: 10px; background: #f2f8f5; }
.pwa-install-heading { display: flex; align-items: center; gap: 10px; }
.pwa-install-heading > div { min-width: 0; display: grid; gap: 3px; }
.pwa-install-heading strong { color: var(--charcoal-dark); font-size: 12px; }
.pwa-install-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.pwa-install-icon { flex: 0 0 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; background: #dcece5; color: #356b58; }
.pwa-install-icon svg { width: 17px; }
.pwa-install-button { min-height: 41px; padding: 0 13px; border: 1px solid #b9d2c7; border-radius: 8px; background: #fff; color: #315f50; font-size: 12px; font-weight: 800; cursor: pointer; }
.pwa-install-button:hover { border-color: #6d9e8b; background: #f9fcfa; }
.ios-install-help { padding: 12px; border: 1px solid #dfc982; border-radius: 8px; outline: 0; background: #fbf5e8; }
.ios-install-help strong { color: #5f4c16; font-size: 12px; }
.ios-install-help ol { margin: 9px 0 0; padding-left: 20px; color: #66737a; font-size: 11px; line-height: 1.55; }
.ios-install-help li + li { margin-top: 4px; }
.pwa-install-status { margin: 0; color: #66737a; font-size: 11px; line-height: 1.4; }
.pwa-install-status:empty { display: none; }
.security-note { margin-top: 18px; padding: 12px 13px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--line); border-radius: 9px; background: #faf7f1; }
.security-note svg { flex: 0 0 16px; width: 16px; color: var(--gold-dark); }
.security-note p { margin: 0; display: grid; gap: 3px; }
.security-note strong { font-size: 12px; }
.security-note span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.form-footer { margin-top: 27px; color: #7d888d; font-size: 11px; text-align: center; }

.reset-modal { position: fixed; inset: 0; z-index: 100; padding: 18px; display: grid; place-items: center; }
.reset-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(43, 56, 63, .72); backdrop-filter: blur(4px); cursor: default; }
.reset-dialog { width: min(420px, 100%); position: relative; padding: 31px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 16px; background: #fff; box-shadow: 0 26px 80px rgba(43, 56, 63, .32); animation: modal-enter .18s ease-out; }
@keyframes modal-enter { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.reset-close { width: 36px; height: 36px; position: absolute; top: 14px; right: 14px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.reset-close:hover { border-color: var(--gold); color: var(--charcoal-dark); }
.reset-icon { width: 44px; height: 44px; margin-bottom: 20px; display: grid; place-items: center; border-radius: 11px; background: #fbf5e8; color: var(--gold-dark); }
.reset-icon svg { width: 21px; }
.reset-dialog h2 { margin: 0; color: var(--charcoal-dark); font-size: 25px; letter-spacing: -.5px; }
.reset-dialog > p:not(.reset-eyebrow) { margin: 9px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.reset-dialog form { display: grid; }
.reset-dialog input { height: 45px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; outline: 0; color: var(--charcoal-dark); }
.reset-dialog input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 165, 59, .14); }
.reset-dialog form button { height: 44px; margin-top: 16px; border: 1px solid var(--gold); border-radius: 9px; background: var(--gold); color: var(--charcoal-dark); font-size: 12px; font-weight: 800; cursor: pointer; }
.reset-message { display: none; margin: 0 0 16px; padding: 10px 12px; border-radius: 8px; font-size: 12px; line-height: 1.45; }
.reset-message.visible { display: block; }
.reset-message.success { border: 1px solid #b9d2c7; background: #f2f8f5; color: #315f50; }
.reset-message.error { border: 1px solid #d8b8b1; background: #f8efed; color: #7f382f; }

@media (max-width: 850px) {
    .login-shell { display: block; }
    .brand-panel { display: none; }
    .form-panel { min-height: 100vh; padding: 32px 22px; background: linear-gradient(150deg, #fff 0%, #faf7f1 100%); }
    .mobile-brand { display: flex; }
}

@media (max-width: 440px) {
    .form-panel { align-items: start; padding: 24px 18px 30px; }
    .mobile-brand { margin-bottom: 34px; }
    .form-heading h2 { font-size: 27px; }
    .reset-modal { padding: 0; }
    .reset-dialog { min-height: 100vh; display: grid; align-content: center; border: 0; border-radius: 0; }
}

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