:root {
  color-scheme: light;
  font: 16px/1.5 Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #152640;
  background: #f4f7fb;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }

.login-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
}

.brand-panel {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding: clamp(40px, 6.4vw, 104px);
  isolation: isolate;
  background:
    linear-gradient(165deg, #071739e8 4%, #102d7380 47%, #0a2b6352 90%),
    url("/login-design/background.jpg") 38% center / cover no-repeat,
    #102b64;
  color: #fff;
}

.brand-copy { margin-top: clamp(22px, 9vh, 116px); }
.brand-copy h2 {
  font-size: clamp(34px, 3.6vw, 54px);
  font-weight: 720;
  letter-spacing: -.035em;
  line-height: 1.1;
  margin: 0 0 18px;
}
.brand-copy p {
  color: #e3eafa;
  font-size: clamp(15px, 1.35vw, 19px);
  margin: 0;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(32px, 5vw, 84px);
  padding-top: max(clamp(32px, 5vw, 84px), calc((100svh - 420px) / 2));
  background: radial-gradient(ellipse at 100% 0, #ecf3ff, transparent 55%), #fbfcfe;
}
.form-card {
  width: min(100%, 420px);
  margin-inline: auto;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid #dee7f3;
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 16px 42px #172c5310, 0 2px 6px #172c5307;
}
.intro, form { width: 100%; }
.mark { display: none; }
.intro { margin-bottom: 27px; }
.intro h1 {
  margin: 0 0 7px;
  font-size: clamp(28px, 2.6vw, 35px);
  line-height: 1.15;
  letter-spacing: -.028em;
}
.intro p { color: #51647f; margin: 0; }

form { display: grid; gap: 8px; }
label { font-size: .92rem; font-weight: 650; }
input {
  min-width: 0;
  width: 100%;
  padding: 12px 13px 12px 40px;
  min-height: 50px;
  border: 1px solid #bccbdf;
  background: #fff;
  border-radius: 9px;
  color: #152640;
}
.input-shell { position: relative; }
.username-field { margin-bottom: 9px; }
.field-icon, .password-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.field-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #607895;
  pointer-events: none;
}
.password-field input { padding-inline-end: 54px; }
.password-toggle {
  position: absolute;
  inset: 3px 3px 3px auto;
  min-width: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #234d92;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 620;
}
.password-toggle:hover { background: #edf4ff; }
.password-toggle[data-visible="false"] .eye-slash { display: none; }
button[type="submit"] {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  margin-top: 2px;
  background: #2057b5;
  border: 0;
  border-radius: 9px;
  color: white;
  font-weight: 690;
  cursor: pointer;
}
button[type="submit"]:hover:not(:disabled) { background: #184695; }
button[type="submit"]:disabled { cursor: wait; opacity: .78; }
form[aria-busy="true"] button[type="submit"]::before {
  content: "";
  position: absolute;
  top: calc(50% - 7px);
  left: calc(50% - 55px);
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff75;
  border-top-color: white;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  form[aria-busy="true"] button[type="submit"]::before { animation: none; }
}
:focus-visible { outline: 3px solid #3476db; outline-offset: 2px; }
.alert {
  margin: 0;
  padding: 10px 12px;
  font-size: .92rem;
  color: #8b2632;
  background: #fff0f1;
  border: 1px solid #efc4c8;
  border-radius: 8px;
}
.form-actions { display: grid; gap: 5px; scroll-margin-block: 8px; }
.feedback-slot { min-height: 46px; }
.alert[hidden] { display: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .brand-panel { padding: 26px clamp(22px, 7vw, 48px); background-position: center, center 47%; }
  .brand-copy { margin-top: 0; }
  .brand-copy h2 { font-size: 26px; margin: 0; }
  .brand-copy p { display: none; }
  .login-panel { justify-content: flex-start; padding: 29px clamp(22px, 7vw, 48px); }
  .form-card { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  .intro { margin-bottom: 24px; }
}

@media (max-width: 760px) and (max-height: 480px) {
  .brand-panel { padding-block: 9px; }
  .brand-copy h2 { font-size: 18px; }
  .login-panel { padding-block: 14px; }
  .intro { margin-bottom: 13px; }
  .intro h1 { font-size: 23px; }
  #login-title + p { display: none; }
  form { gap: 6px; }
  .username-field { margin-bottom: 4px; }
}
body.compact-login .brand-panel { padding-block: 9px; }
body.compact-login .brand-copy h2 { font-size: 18px; }
body.compact-login .login-panel { padding-block: 14px; }
body.compact-login .intro { margin-bottom: 13px; }
body.compact-login .intro h1 { font-size: 23px; }
body.compact-login #login-title + p { display: none; }
body.compact-login form { gap: 6px; }
body.compact-login .username-field { margin-bottom: 4px; }
