:root {
  color-scheme: dark;
  --bg: #070707;
  --surface: #11100f;
  --surface-strong: #181512;
  --line: rgba(242, 238, 232, .12);
  --text: #f2eee8;
  --muted: #a89f94;
  --faint: #746e67;
  --orange: #ff7518;
  --orange-press: #e86108;
  font-family: "Noto Sans SC", "PingFang SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(520px 340px at 50% -60px, rgba(255, 117, 24, .15), transparent 66%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.auth-shell {
  min-height: var(--app-viewport-height, 100dvh);
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
}

.auth-card { width: min(100%, 393px); }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.brand__mark { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; }
.brand__wordmark { width: 112px; height: auto; object-fit: contain; }

.auth-heading { margin-bottom: 28px; }
.eyebrow { margin: 0 0 10px !important; color: var(--orange) !important; font-size: 10px !important; letter-spacing: .16em; }
.auth-heading h1 { margin: 0 0 10px; font-size: 28px; line-height: 1.25; letter-spacing: -.02em; }
.auth-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

.auth-message {
  margin: -8px 0 18px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 117, 24, .28);
  border-radius: 12px;
  background: rgba(255, 117, 24, .08);
  color: #ffc18f;
  font-size: 12px;
  line-height: 1.55;
}
.auth-message.is-error { border-color: rgba(255, 92, 72, .36); background: rgba(255, 92, 72, .08); color: #ffb0a6; }

.social-auth { display: grid; gap: 10px; }
.social-button {
  min-height: 52px;
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  width: 100%;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font-weight: 560;
  cursor: pointer;
}
.social-button::after { content: "›"; color: var(--faint); font-size: 24px; font-weight: 300; }
.social-button:active { background: var(--surface-strong); transform: scale(.995); }
.social-button__mark {
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; font-size: 13px; font-weight: 750;
}
.social-button__mark--wechat { background: #07c160; color: #fff; font-size: 11px; }

.divider { display: flex; align-items: center; gap: 13px; margin: 24px 0 20px; color: var(--faint); font-size: 11px; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }

#phone-form label, #code-form label, .legacy-access label { display: block; margin: 0 0 8px; color: var(--muted); font-size: 12px; }
#phone, #verification-code, #legacy-password {
  width: 100%; height: 52px; border: 1px solid var(--line); border-radius: 14px;
  padding: 0 15px; outline: 0; background: #0e0d0c; color: var(--text); font-size: 15px;
}
#phone:focus, #verification-code:focus, #legacy-password:focus { border-color: rgba(255,117,24,.72); box-shadow: 0 0 0 3px rgba(255,117,24,.1); }
#phone::placeholder, #verification-code::placeholder, #legacy-password::placeholder { color: #5f5a54; }
.phone-field { position: relative; }
.phone-prefix { position: absolute; left: 15px; top: 0; height: 52px; display: grid; place-items: center; color: var(--text); font-size: 14px; }
#phone { padding-left: 50px; }
#verification-code { margin-bottom: 16px; font-size: 22px; letter-spacing: .24em; font-variant-numeric: tabular-nums; }
.code-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.code-heading strong, .code-heading span { display: block; }
.code-heading strong { font-size: 16px; }
.code-heading span { margin-top: 4px; color: var(--faint); font-size: 11px; }
#change-phone { min-height: 44px; border: 0; background: transparent; color: var(--orange); font-size: 12px; }
.field-hint { min-height: 18px; margin: 8px 2px 15px; color: var(--faint); font-size: 11px; line-height: 1.55; }

.primary-action {
  width: 100%; min-height: 54px; border: 0; border-radius: 17px;
  background: var(--orange); color: #140b05; font-size: 16px; font-weight: 750; cursor: pointer;
}
.primary-action:active { background: var(--orange-press); }
.primary-action:disabled, .social-button:disabled { opacity: .48; cursor: wait; }
.text-action { width: 100%; min-height: 44px; margin-top: 8px; border: 0; background: transparent; color: #d7cfc5; font-size: 13px; cursor: pointer; }

.legal-copy { margin: 18px 12px 0; color: #625c55; text-align: center; font-size: 10px; line-height: 1.65; }
.legacy-access { margin-top: 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11px; }
.legacy-access summary { min-height: 44px; display: grid; place-items: center; cursor: pointer; }
#legacy-form { padding: 6px 0 0; }
.legacy-field { position: relative; }
.legacy-field input { padding-right: 62px !important; }
#toggle-password { position: absolute; inset: 4px 5px 4px auto; width: 52px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
#legacy-submit { width: 100%; min-height: 46px; margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); }

footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; color: #4f4a45; font-size: 9px; letter-spacing: .04em; }
.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-height: 720px) {
  .auth-shell { place-items: start center; padding-top: max(14px, env(safe-area-inset-top)); }
  .brand { margin-bottom: 22px; }
  .auth-heading { margin-bottom: 20px; }
  .auth-heading h1 { font-size: 25px; }
  .social-button { min-height: 48px; }
  .divider { margin: 18px 0 15px; }
  footer { margin-top: 18px; }
}
