:root {
  color-scheme: light;
  --navy: #0c2037;
  --navy-soft: #173b5e;
  --blue: #2676db;
  --blue-strong: #155eb7;
  --text: #152941;
  --muted: #687b91;
  --line: #d7e2ed;
  --surface: #fff;
  --canvas: #edf3f8;
  --danger: #b72d38;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--text); background: var(--canvas); font: 14px/1.55 "Segoe UI", system-ui, "Microsoft YaHei UI", sans-serif; }
button, input { font: inherit; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(520px, 1.08fr) minmax(480px, .92fr); }

.brand-panel { position: relative; min-height: 100vh; overflow: hidden; padding: 46px 58px; color: #fff; background: radial-gradient(circle at 82% 16%, rgba(62,139,222,.27), transparent 32%), linear-gradient(145deg, #091a2e, var(--navy-soft)); }
.brand-panel::before { content: ""; position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom right, #000, transparent 72%); }
.brand-content { position: relative; z-index: 2; height: calc(100vh - 92px); display: flex; flex-direction: column; }
.brand-lockup { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 750; letter-spacing: .4px; }
.brand-mark { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); color: #fff; }
.brand-message { margin: auto 0; max-width: 570px; }
.eyebrow { margin: 0 0 11px; color: #77b6ff; font-size: 12px; font-weight: 750; letter-spacing: 1.5px; }
.brand-message h1 { margin: 0; font-size: clamp(38px, 4vw, 62px); line-height: 1.15; letter-spacing: -1.5px; }
.brand-message > p:last-child { max-width: 510px; margin: 25px 0 0; color: #b9cee1; font-size: 16px; line-height: 1.85; }
.brand-features { display: flex; align-items: center; gap: 13px; color: #a9c4db; font-size: 13px; }
.brand-features i { width: 4px; height: 4px; border-radius: 50%; background: #4b91df; }
.route-art { position: absolute; right: -25px; bottom: 12%; width: min(46vw, 590px); opacity: .18; }
.route-art svg { width: 100%; overflow: visible; }
.route-art path { fill: none; stroke: #78b7ff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.route-art .ghost-route { stroke-dasharray: 9 12; opacity: .55; }
.route-art circle { fill: #102d4a; stroke: #9bcdff; stroke-width: 3; }
.route-art text { fill: #fff; font-size: 14px; font-weight: 800; text-anchor: middle; dominant-baseline: central; }

.login-panel { min-height: 100vh; display: grid; place-items: center; padding: 44px; background: radial-gradient(circle at 100% 0, #fff 0, transparent 32%), var(--canvas); }
.login-card { width: min(430px, 100%); }
.mobile-brand { display: none; }
.login-card header { margin-bottom: 32px; }
.login-card header h2 { margin: 0; font-size: 34px; letter-spacing: -.6px; }
.login-card header > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 7px; color: #405771; font-weight: 650; }
.control { min-height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid #c9d7e5; border-radius: 11px; background: var(--surface); box-shadow: 0 4px 14px rgba(18,49,80,.03); transition: border-color .16s, box-shadow .16s; }
.control:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(38,118,219,.12); }
.control > span { color: #7b91a8; font-size: 12px; }
.control input { width: 100%; min-width: 0; height: 48px; border: 0; outline: 0; color: var(--text); background: transparent; }
.control input::placeholder { color: #98a8b8; }
.control button { border: 0; padding: 5px 2px; color: var(--blue-strong); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.error-message { min-height: 22px; margin: -5px 0 9px; color: var(--danger); font-size: 13px; }
.submit-button { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(115deg, var(--blue), #1766c4); box-shadow: 0 10px 24px rgba(31,105,196,.25); font-weight: 750; cursor: pointer; transition: transform .16s, box-shadow .16s; }
.submit-button:hover { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(31,105,196,.3); }
.submit-button:disabled { opacity: .7; cursor: wait; transform: none; }
.submit-button.loading b { animation: pulse 1s ease-in-out infinite; }
.login-card footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
#serverStatus { display: inline-flex; align-items: center; gap: 7px; }
#serverStatus i { width: 7px; height: 7px; border-radius: 50%; background: #9aa9b7; }
#serverStatus.ok i { background: #18a56f; box-shadow: 0 0 0 4px rgba(24,165,111,.12); }
#serverStatus.error i { background: var(--danger); }

@keyframes pulse { 50% { transform: translateX(4px); } }

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .login-panel { padding: 28px; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 54px; font-size: 17px; font-weight: 750; }
  .mobile-brand .brand-mark { background: var(--navy); }
}

@media (max-width: 520px) {
  .login-panel { place-items: start center; padding: 24px 20px; }
  .mobile-brand { margin-bottom: 40px; }
  .login-card header h2 { font-size: 29px; }
  .login-card footer { flex-direction: column; }
}

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