:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8f9fb;
  --border: rgba(15, 23, 42, 0.085);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --blue: #2563eb;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --shadow-card: 0 18px 44px -22px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.04);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(15, 23, 42, 0.04), transparent 70%), var(--bg);
  color: var(--text);
  font: 400 14px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

h1, p { margin: 0; }
a { color: inherit; text-decoration: none; }

.auth-shell {
  width: min(100%, 404px);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 28px 24px;
  box-shadow: var(--shadow-card);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #0f172a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
}

.dot { color: var(--muted); font-weight: 400; }

.auth-head {
  margin-top: 24px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
}

h1 {
  margin-top: 6px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.auth-desc {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.auth-error {
  margin-top: 16px;
  padding: 10px 13px;
  border-radius: 9px;
  background: var(--danger-soft);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #991b1b;
  font-size: 13px;
  font-weight: 500;
}

.auth-form {
  margin-top: 22px;
  display: grid;
  gap: 16px;
}

.field-group {
  display: grid;
  gap: 6px;
}

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-wrap input {
  padding-right: 58px;
}

.pw-toggle {
  position: absolute;
  right: 6px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: 500 12px/1 var(--sans);
  cursor: pointer;
}

.pw-toggle:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.btn-submit {
  margin-top: 4px;
  width: 100%;
  height: 44px;
  border: 1px solid #0f172a;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font: 600 14px/1 var(--sans);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
}

.btn-submit:hover { background: #1e293b; border-color: #1e293b; }
.btn-submit:active { transform: translateY(0.5px); }
.btn-submit:disabled { opacity: 0.55; cursor: not-allowed; }

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.auth-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--faint);
}

.home-link {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.home-link:hover { color: var(--text); }

@media (max-width: 420px) {
  .auth-card { padding: 24px 20px 20px; }
  .auth-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
}
