:root {
  color-scheme: dark;
  --bg: #0c0d0c;
  --panel: #121411;
  --card: #171917;
  --card-soft: #1d201c;
  --text: #f1f0e9;
  --muted: #999d94;
  --border: rgba(255, 255, 255, 0.09);
  --accent: #ff8a00;
  --accent-strong: #e87800;
  --danger: #ff8c81;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #e9ece4;
  --panel: #dce2d4;
  --card: #f7f8f3;
  --card-soft: #ecefe8;
  --text: #171a16;
  --muted: #6d7368;
  --border: rgba(23, 26, 22, 0.12);
  --accent: #e87800;
  --accent-strong: #c96500;
  --danger: #bd4037;
  --shadow: 0 28px 80px rgba(44, 53, 37, 0.15);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; font-family: "Manrope", system-ui, sans-serif; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.page-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.05fr) minmax(500px, .95fr); }
.brand-panel { position: relative; min-height: 100vh; overflow: hidden; display: flex; flex-direction: column; padding: 42px 54px 48px; background: var(--panel); border-right: 1px solid var(--border); }
.brand-panel::before { content: ""; position: absolute; width: 650px; height: 650px; left: -180px; bottom: -290px; border-radius: 50%; background: radial-gradient(circle, rgba(255,138,0,.16), transparent 64%); pointer-events: none; }
.brand-panel::after { content: ""; position: absolute; inset: 0; opacity: .22; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 50px 50px; mask-image: linear-gradient(to bottom, black, transparent 80%); }
.topbar { position: relative; z-index: 2; display: flex; justify-content: flex-end; align-items: center; }
.theme-toggle { width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--text); background: rgba(255,255,255,.035); transition: .25s ease; }
.theme-toggle:hover { border-color: rgba(255,138,0,.5); transform: rotate(8deg); }
.theme-toggle svg { position: absolute; width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; transition: .25s; }
.theme-toggle .sun { opacity: 0; transform: scale(.5) rotate(-30deg); }
[data-theme="light"] .theme-toggle .moon { opacity: 0; transform: scale(.5) rotate(30deg); }
[data-theme="light"] .theme-toggle .sun { opacity: 1; transform: scale(1) rotate(0); }
.hero-copy { position: relative; z-index: 1; margin: auto 0; max-width: 620px; padding: 45px 0; animation: rise .7s ease both; }
.hero-logo { display: block; width: min(420px, 76%); max-height: 290px; margin: 0 auto 34px; object-fit: contain; object-position: center; filter: drop-shadow(0 18px 26px rgba(0,0,0,.18)); }
.eyebrow { margin: 0 0 20px; display: flex; align-items: center; gap: 9px; color: var(--muted); text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: 2.1px; }
.eyebrow span { width: 22px; height: 1px; background: var(--accent); }
h1 { margin: 0; font-size: clamp(48px, 5.2vw, 79px); line-height: .98; letter-spacing: -4.5px; font-weight: 700; }
h1 em { color: var(--accent); font-style: normal; font-weight: 500; }
.hero-description { margin: 30px 0 0; max-width: 500px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.login-panel { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 50px clamp(44px, 7vw, 110px) 24px; background: var(--bg); }
.login-card { width: min(100%, 430px); margin: auto; animation: rise .7s .12s ease both; }
.mobile-logo { display: none; width: 150px; height: 112px; margin: 0 auto 28px; object-fit: contain; }
.login-heading h2 { margin: 0; font-size: clamp(31px, 3.3vw, 43px); line-height: 1.14; letter-spacing: -2px; }
.login-heading > p:last-child { margin: 12px 0 38px; color: var(--muted); font-size: 14px; }
.field-group { margin-bottom: 20px; }
.field-group label, .label-row { font-size: 12px; font-weight: 700; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
.input-wrap { position: relative; margin-top: 9px; }
.input-wrap > svg { position: absolute; top: 50%; left: 16px; width: 17px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.6; pointer-events: none; }
.input-wrap input { width: 100%; height: 54px; border: 1px solid var(--border); border-radius: 11px; outline: none; padding: 0 48px; color: var(--text); background: var(--card); font-size: 13px; transition: border .2s, box-shadow .2s, transform .2s; }
.input-wrap input::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.input-wrap input:focus { border-color: color-mix(in srgb, var(--accent) 65%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.field-group.invalid input { border-color: var(--danger); }
.field-error { display: block; min-height: 15px; margin-top: 5px; color: var(--danger); font-size: 10px; }
.password-toggle { position: absolute; top: 50%; right: 10px; width: 34px; height: 34px; transform: translateY(-50%); border: 0; cursor: pointer; display: grid; place-items: center; color: var(--muted); background: transparent; }
.password-toggle svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.password-toggle.active::after { content: ""; position: absolute; width: 21px; height: 1px; background: currentColor; transform: rotate(-45deg); }
.remember { width: fit-content; display: flex; align-items: center; gap: 9px; color: var(--muted); cursor: pointer; font-size: 11px; }
.remember input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox { width: 17px; height: 17px; border: 1px solid var(--border); border-radius: 5px; display: grid; place-items: center; background: var(--card); }
.checkbox svg { width: 12px; fill: none; stroke: #17200f; stroke-width: 2.2; opacity: 0; }
.remember input:checked + .checkbox { border-color: var(--accent); background: var(--accent); }
.remember input:checked + .checkbox svg { opacity: 1; }
.remember input:focus-visible + .checkbox { outline: 2px solid var(--accent); outline-offset: 2px; }
.submit-button { width: 100%; height: 55px; margin-top: 27px; border: 0; border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; color: #1b1107; background: var(--accent); font-weight: 800; font-size: 13px; box-shadow: 0 9px 28px rgba(255,138,0,.14); transition: .2s ease; }
.submit-button:hover { background: var(--accent-strong); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(255,138,0,.22); }
.submit-button:active { transform: translateY(0); }
.submit-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; }
.submit-button:hover svg { transform: translateX(3px); }
.submit-button.loading { opacity: .75; pointer-events: none; }
.form-status { min-height: 18px; margin: 12px 0 0; text-align: center; color: var(--accent); font-size: 11px; }
footer { display: flex; justify-content: space-between; width: min(100%, 530px); margin: 60px auto 0; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: 1.3px; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
@media (max-width: 900px) {
  .page-shell { grid-template-columns: 1fr; }
  .brand-panel { min-height: 460px; padding: 30px 32px; }
  .hero-copy { padding: 75px 0 45px; }
  h1 { letter-spacing: -3px; }
  .login-panel { min-height: auto; padding: 70px 32px 25px; }
}
@media (max-width: 600px) {
  .brand-panel { min-height: 66px; padding: 14px 20px; background: var(--bg); border: 0; }
  .brand-panel::before, .brand-panel::after, .hero-copy { display: none; }
  .theme-toggle { width: 40px; height: 40px; }
  .login-panel { min-height: calc(100svh - 66px); justify-content: flex-start; padding: 24px 20px 18px; }
  .login-card { margin: 0 auto; }
  .mobile-logo { display: block; }
  .login-heading .eyebrow { margin-bottom: 16px; }
  .login-heading h2 { letter-spacing: -1.5px; }
  footer { margin-top: auto; padding-top: 50px; }
}
@media (max-width: 380px), (max-height: 720px) and (max-width: 600px) {
  .mobile-logo { width: 105px; height: 78px; margin-bottom: 14px; }
  .login-heading > p:last-child { margin-bottom: 24px; }
  .field-group { margin-bottom: 12px; }
  .submit-button { margin-top: 18px; }
  footer { padding-top: 28px; }
}
