:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #1d1d1f;
  background: #f3f6fb;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: #f3f6fb; }
button, input { font: inherit; }
button { cursor: pointer; }

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 420px);
  padding: 38px 40px 40px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.14), 0 3px 12px rgba(15, 23, 42, 0.06);
  transition: opacity 160ms ease, transform 160ms ease;
}

.auth-checking .auth-card { opacity: 0; transform: translateY(6px); pointer-events: none; }
.auth-checking .auth-loading { display: block; }
.auth-loading {
  display: none;
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  color: #64748b;
  font-size: 14px;
}

.auth-brand { text-align: center; margin-bottom: 30px; }
.auth-brand h1 { margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -0.03em; }
.auth-brand p { margin: 8px 0 0; color: #64748b; font-size: 14px; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 12px;
  background: #f1f3f6;
}

.auth-tab {
  border: 0;
  border-radius: 9px;
  padding: 9px 12px;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 600;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.auth-tab.is-active {
  color: #0879e8;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.auth-tab:focus-visible, .auth-submit:focus-visible, input:focus-visible {
  outline: 3px solid rgba(8, 121, 232, 0.24);
  outline-offset: 2px;
}

.auth-field { margin-bottom: 12px; }
.auth-field[hidden] { display: none; }

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #dfe3e8;
  border-radius: 12px;
  padding: 10px 13px;
  color: #1f2937;
  background: #fff;
  font-size: 15px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder { color: #8a94a3; }
.auth-password-input::placeholder { font-size: 12px; }
input:focus { border-color: #1687ef; box-shadow: 0 0 0 3px rgba(22, 135, 239, 0.1); outline: none; }

.auth-submit {
  width: 100%;
  min-height: 44px;
  margin-top: 1px;
  border: 0;
  border-radius: 22px;
  padding: 10px 16px;
  color: #fff;
  background: #0879e8;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(8, 121, 232, 0.18);
  transition: background 150ms ease, transform 120ms ease, opacity 150ms ease;
}

.auth-submit:hover { background: #066bcf; }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { cursor: wait; opacity: 0.62; }

.auth-error {
  margin: 12px 0 0;
  color: #dc2626;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.auth-noscript {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  color: #b91c1c;
  font-size: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  .auth-shell { padding: 16px; }
  .auth-card { padding: 30px 22px 28px; border-radius: 22px; }
  .auth-brand { margin-bottom: 24px; }
  .auth-brand h1 { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
