:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #63706b;
  --line: #dce4e0;
  --surface: #ffffff;
  --accent: #087f67;
  --accent-dark: #05624f;
  --danger: #b42318;
  --soft: #f2f7f5;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #eaf1ee; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(8, 127, 103, .13), transparent 34rem),
    linear-gradient(160deg, #f7faf9 0%, #e8f0ed 100%);
}

button, input { font: inherit; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; }
.auth-card {
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid rgba(23, 32, 29, .1);
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 70px rgba(28, 54, 46, .14);
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 34px; }
.auth-brand span {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  color: #fff; background: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .02em;
}
.auth-brand strong { font-size: 17px; letter-spacing: -.02em; }
.eyebrow { margin: 0 0 9px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(27px, 7vw, 36px); line-height: 1.12; letter-spacing: -.04em; }
.intro { margin: 14px 0 28px; color: var(--muted); font-size: 14px; line-height: 1.7; }
form { display: grid; gap: 12px; }
label { margin-top: 4px; font-size: 13px; font-weight: 700; }
input {
  width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); background: #fff; outline: none; transition: border-color .16s, box-shadow .16s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(8, 127, 103, .12); }
.password-row { position: relative; }
.password-row input { padding-right: 66px; }
.text-button {
  position: absolute; top: 7px; right: 7px; height: 36px; padding: 0 10px; border: 0; border-radius: 9px;
  color: var(--accent); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700;
}
.text-button:hover { background: var(--soft); }
.primary-button {
  min-height: 50px; margin-top: 8px; padding: 0 18px; border: 0; border-radius: 12px;
  color: #fff; background: var(--accent); cursor: pointer; font-weight: 800; box-shadow: 0 10px 24px rgba(8, 127, 103, .2);
}
.primary-button:hover { background: var(--accent-dark); }
.primary-button:disabled { cursor: wait; opacity: .6; }
.message { margin: 0; padding: 11px 12px; border-radius: 10px; color: var(--danger); background: #fff0ee; font-size: 13px; line-height: 1.5; }
.message.success { color: #07634f; background: #e9f7f2; }
.hidden { display: none !important; }
.setup-notice { margin-top: 18px; padding: 15px; border: 1px solid #e7d6a0; border-radius: 12px; background: #fff9e8; }
.setup-notice strong { font-size: 13px; }
.setup-notice p { margin: 7px 0 0; color: #6d5c2b; font-size: 12px; line-height: 1.6; }
code { word-break: break-all; font-family: ui-monospace, Consolas, monospace; }
.footnote, .hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.footnote { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.hint { margin: -4px 0 2px; }
.status-row { display: flex; justify-content: space-between; margin: 0 0 18px; padding: 13px 14px; border-radius: 12px; background: var(--soft); font-size: 13px; }
.status-row strong { color: var(--accent); }

@media (max-width: 520px) {
  .auth-shell { align-items: stretch; padding: 0; }
  .auth-card { min-height: 100vh; padding: 28px 22px; border: 0; border-radius: 0; box-shadow: none; }
  .auth-brand { margin-bottom: 42px; }
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --ink: #e9f2ee; --muted: #9daba5; --line: #34443e; --surface: #17201d; --soft: #202d29; }
  html { background: #0e1513; }
  body { background: radial-gradient(circle at 15% 10%, rgba(16, 150, 121, .18), transparent 32rem), #0e1513; }
  .auth-card { background: rgba(23, 32, 29, .96); border-color: rgba(255,255,255,.08); }
  input { color: var(--ink); background: #111a17; }
  .message { background: #3a201e; }
  .message.success { background: #163229; }
  .setup-notice { border-color: #5d512d; background: #292515; }
  .setup-notice p { color: #d0c18a; }
}
