:root {
  --bg: #050c16;
  --panel: #0b182b;
  --panel-2: #0e1d33;
  --line: rgba(126, 160, 211, .17);
  --line-strong: rgba(80, 132, 244, .52);
  --text: #f3f7ff;
  --muted: #8ea1bc;
  --muted-2: #657993;
  --blue: #3977ff;
  --blue-2: #21b8ff;
  --green: #2fd19a;
  --red: #ff526b;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  background:
    radial-gradient(circle at 16% 8%, rgba(43, 113, 255, .18), transparent 31%),
    radial-gradient(circle at 88% 92%, rgba(31, 198, 211, .08), transparent 28%),
    var(--bg);
}
button, input { font: inherit; }
button { color: inherit; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(460px, 1.08fr) minmax(480px, .92fr);
  overflow: hidden;
}

.brand-pane {
  position: relative;
  min-height: 100vh;
  padding: clamp(34px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(13, 30, 52, .94), rgba(5, 13, 24, .93)),
    var(--bg);
  isolation: isolate;
}

.brand-pane::before {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(44, 111, 255, .22), rgba(29, 75, 165, .07) 44%, transparent 69%);
  filter: blur(1px);
  z-index: -1;
}

.brand-lockup, .mobile-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  position: relative;
  background: linear-gradient(145deg, #31d4ff, #3473ff 55%, #6b55ff);
  box-shadow: 0 0 32px rgba(60, 128, 255, .38);
}

.brand-mark::before {
  content: "";
  width: 23px;
  height: 23px;
  border: 2px solid rgba(255, 255, 255, .94);
  transform: rotate(30deg) skewY(-10deg);
  border-radius: 4px;
}

.brand-mark.small { width: 34px; height: 34px; border-radius: 9px; }
.brand-mark.small::before { width: 17px; height: 17px; }
.brand-name { font-size: 21px; line-height: 1; font-weight: 850; letter-spacing: 1.2px; }
.brand-subtitle { margin-top: 6px; color: #8193ad; font-size: 12px; }

.brand-copy { max-width: 650px; margin: auto 0; padding: 70px 0 100px; }
.eyebrow {
  margin: 0 0 14px;
  color: #77a4ff;
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.brand-copy h1 {
  max-width: 590px;
  margin: 0;
  font-size: clamp(42px, 4.6vw, 72px);
  line-height: 1.08;
  letter-spacing: -.04em;
}
.brand-copy > p:last-child {
  max-width: 560px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 430px;
}
.brand-grid span {
  height: 5px;
  border-radius: 999px;
  background: rgba(83, 132, 226, .16);
  overflow: hidden;
  position: relative;
}
.brand-grid span::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-105%);
  background: linear-gradient(90deg, transparent, #4b84ff, transparent);
  animation: scan 4.5s ease-in-out infinite;
}
.brand-grid span:nth-child(2)::after { animation-delay: .35s; }
.brand-grid span:nth-child(3)::after { animation-delay: .7s; }
.brand-grid span:nth-child(4)::after { animation-delay: 1.05s; }
@keyframes scan { 0%, 26% { transform: translateX(-105%); } 62%, 100% { transform: translateX(105%); } }

.form-pane {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px;
}

.login-card {
  width: min(100%, 456px);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(14, 31, 53, .98), rgba(8, 20, 36, .98));
  box-shadow: 0 30px 100px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .025);
}
.login-header h2 { margin: 0; font-size: 30px; letter-spacing: -.02em; }
.login-header > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.mobile-brand { display: none; margin-bottom: 31px; }
.mobile-brand strong { letter-spacing: 1px; }
form { margin-top: 31px; }
.field + .field { margin-top: 20px; }
.field label { display: block; margin: 0 0 9px; color: #b7c7db; font-size: 13px; font-weight: 650; }
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  color: var(--text);
  background: rgba(5, 15, 27, .7);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field input::placeholder { color: #60728a; }
.field input:hover { border-color: rgba(104, 143, 205, .3); }
.field input:focus {
  border-color: #4b83ff;
  background: rgba(7, 19, 34, .88);
  box-shadow: 0 0 0 3px rgba(57, 119, 255, .14);
}
.field input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 82, 107, .1); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 52px; }
.password-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #7488a3;
  background: transparent;
  cursor: pointer;
}
.password-toggle:hover, .password-toggle:focus-visible { color: #dbe8fb; background: rgba(72, 111, 173, .13); outline: 0; }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.field-error { min-height: 17px; margin: 6px 0 0; color: #ff8395; font-size: 11px; }
.form-status {
  display: none;
  min-height: 42px;
  margin-top: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 82, 107, .27);
  border-radius: 9px;
  color: #ff9aaa;
  background: rgba(110, 27, 42, .24);
  font-size: 12px;
  line-height: 1.6;
}
.form-status.visible { display: block; }
.form-status.success { border-color: rgba(47, 209, 154, .28); color: #7ce5bd; background: rgba(14, 91, 69, .23); }
.submit-button {
  width: 100%;
  height: 48px;
  margin-top: 14px;
  border: 1px solid #5b89ff;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: white;
  background: linear-gradient(135deg, #316aee, #4b76ff);
  box-shadow: 0 13px 31px rgba(43, 97, 222, .28);
  cursor: pointer;
  font-weight: 760;
  transition: transform .16s ease, filter .16s ease, opacity .16s ease;
}
.submit-button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.submit-button:focus-visible { outline: 3px solid rgba(95, 143, 255, .25); outline-offset: 2px; }
.submit-button:disabled { cursor: wait; opacity: .72; transform: none; }
.button-spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
.submit-button.loading .button-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-footer {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(126, 160, 211, .1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 11px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(47, 209, 154, .55); }

@media (max-width: 980px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-pane { display: none; }
  .form-pane { padding: 24px; }
  .mobile-brand { display: flex; }
}

@media (max-width: 520px) {
  .form-pane { align-items: stretch; padding: 0; }
  .login-card {
    width: 100%;
    min-height: 100vh;
    padding: 32px 24px;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: none;
    background: linear-gradient(180deg, rgba(12, 28, 49, .96), rgba(5, 13, 24, .98));
  }
}

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