:root {
  font-family: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #35405a;
  background: #f7f8fe;
  font-synthesis: none;
  --primary: #4362ff;
  --primary-deep: #314bd9;
  --line: #ced5eb;
  --text: #1c2540;
  --muted: #64708b;
  --danger: #c93636;
}

* { box-sizing: border-box; letter-spacing: 0; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #f7f8fe; font-size: 14px; line-height: 1.45; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
[hidden] { display: none !important; }

.login-topbar {
  height: 64px;
  background: #4362ff;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .08);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(100%, 1280px);
  height: 64px;
  margin: 0 auto;
  padding: 0 20px;
}
.brand strong { color: #ffffff; font-size: 16px; line-height: 1.2; font-weight: 650; white-space: nowrap; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #ffffff;
  background: rgba(255, 255, 255, .2);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .16);
}
.brand-mark svg { width: 21px; height: 21px; fill: currentColor; }

.login-main {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 64px);
  padding: 44px 20px 96px;
}
.login-card {
  width: min(100%, 400px);
  padding: 31px 32px 32px;
  background: #ffffff;
  border: 1px solid #e3e7f4;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .07);
}
.login-heading { margin-bottom: 25px; }
.login-heading h1 { margin: 0; color: var(--text); font-size: 23px; line-height: 1.35; font-weight: 650; }
.login-heading p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
#login-form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span:first-child { color: #374151; font-size: 13px; font-weight: 600; }
.field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field input:hover { border-color: #b7c1cc; }
.field input:focus { border-color: #4362ff; box-shadow: 0 0 0 3px rgba(67, 98, 255, .14); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 46px; }
.password-toggle {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #718096;
  background: transparent;
  border: 0;
  border-radius: 5px;
}
.password-toggle:hover { color: var(--primary-deep); background: #f3f5ff; }
.password-toggle:focus-visible, .login-submit:focus-visible { outline: 2px solid #8b9cff; outline-offset: 2px; }
.password-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle .eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }
.login-error { margin: -3px 0 0; color: var(--danger); font-size: 13px; }
.login-submit {
  height: 44px;
  margin-top: 2px;
  color: #ffffff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(67, 98, 255, .22);
  font-weight: 600;
  transition: background .16s ease, border-color .16s ease, opacity .16s ease;
}
.login-submit:hover { background: var(--primary-deep); border-color: var(--primary-deep); }
.login-submit:disabled { cursor: default; opacity: .68; }

@media (max-width: 520px) {
  .login-topbar, .brand { height: 60px; }
  .brand { padding: 0 16px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .login-main { min-height: calc(100vh - 60px); padding: 28px 15px 64px; align-items: start; }
  .login-card { padding: 25px 20px 24px; }
  .login-heading h1 { font-size: 21px; }
}

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