:root {
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --line: rgba(0, 0, 0, 0.09);
  --line-strong: #d2d2d7;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --danger: #d70015;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 5%, rgba(255, 255, 255, 0.98) 0, rgba(255, 255, 255, 0) 31rem),
    radial-gradient(circle at 12% 88%, rgba(0, 113, 227, 0.045), transparent 24rem),
    var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-shell {
  width: min(100% - 36px, 430px);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px 0 26px;
}

.login-brand {
  display: grid;
  justify-items: center;
  gap: 5px;
  margin-bottom: 22px;
  text-align: center;
}

.login-brand strong {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.login-brand span {
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.015em;
}

.login-card {
  padding: 34px 32px 28px;
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-radius: 28px;
  background: var(--surface);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.025),
    0 24px 70px rgba(0, 0, 0, 0.075);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
}

.login-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 15px;
  color: var(--blue);
  background: #eef5ff;
}

.login-icon svg {
  width: 24px;
  height: 24px;
}

.login-eyebrow {
  margin: 0 0 9px;
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-align: center;
}

.login-card h1 {
  margin: 0;
  font-size: 29px;
  font-weight: 680;
  line-height: 1.2;
  letter-spacing: -0.04em;
  text-align: center;
}

.login-intro {
  max-width: 310px;
  margin: 12px auto 27px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
  text-align: center;
}

.field-label {
  display: block;
  margin: 0 0 8px 2px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.password-field {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 5px 7px 5px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-solid);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.password-field:focus-within {
  border-color: rgba(0, 113, 227, 0.68);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.password-field.has-error {
  border-color: rgba(215, 0, 21, 0.55);
  box-shadow: 0 0 0 4px rgba(215, 0, 21, 0.08);
}

#password {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 16px;
  letter-spacing: 0.03em;
}

#password::placeholder {
  color: #a1a1a6;
  letter-spacing: 0;
}

.visibility-button {
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--text-secondary);
  background: transparent;
  font-size: 11px;
  transition: color 150ms ease, background 150ms ease;
}

.visibility-button:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.045);
}

.login-message {
  min-height: 18px;
  margin: 7px 2px 5px;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.5;
}

.login-submit {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--blue);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.login-submit:hover {
  background: var(--blue-hover);
}

.login-submit:active {
  transform: scale(0.988);
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.submit-arrow {
  font-size: 17px;
  font-weight: 400;
  transform: translateY(-1px);
}

.session-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
  color: var(--text-tertiary);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.session-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.12);
}

.login-footer {
  padding: 24px 0 0;
  color: var(--text-tertiary);
  font-size: 10px;
  text-align: center;
}

@media (max-width: 480px) {
  .login-shell {
    width: min(100% - 24px, 430px);
    padding-top: 28px;
  }

  .login-card {
    padding: 30px 22px 24px;
    border-radius: 24px;
  }

  .login-card h1 {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
