/* ============================================================
   auth.css — 登录/注册 (login & register)
   Depends on base.css tokens. Page layout + components only.
   ============================================================ */

.auth-shell {
  display: grid;
  width: min(1080px, calc(100% - 32px));
  min-height: min(680px, calc(100vh - 48px));
  margin: 24px auto;
  overflow: hidden;
  grid-template-columns: 1.05fr 0.95fr;
}

/* ---- Brand side ---- */

.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  background: var(--ink);
  color: var(--on-ink);
}

.brand-mark {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 40px;
  place-items: center;
  border: 1px solid var(--on-ink-line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.1);
  font-size: 26px;
  font-weight: 800;
}

.auth-brand .eyebrow {
  color: #93b1ed;
}

.auth-brand h1 {
  margin: 14px 0 18px;
  font-size: clamp(34px, 4.5vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.auth-brand > p {
  max-width: 480px;
  margin: 0;
  color: var(--on-ink-muted);
  font-size: var(--text-base);
  line-height: 1.8;
}

.auth-brand ul {
  display: grid;
  margin: 40px 0 0;
  padding: 0;
  gap: 14px;
  list-style: none;
  color: var(--on-ink-muted);
  font-size: var(--text-md);
}

.auth-brand li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand li span {
  color: #93b1ed;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* ---- Form side ---- */

.auth-panel {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 48px;
}

.auth-card {
  width: min(100%, 380px);
}

.auth-heading h2 {
  margin: 10px 0 6px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.auth-heading p {
  margin: 0;
  color: var(--text-muted);
}

.auth-tabs {
  margin: 30px 0 24px;
}

#authForm {
  display: grid;
  gap: 16px;
}

#authForm label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
}

.auth-captcha {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
}

.auth-captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-captcha-row img {
  width: 176px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #f6f9ff;
  object-fit: contain;
}

.auth-captcha-row button {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--primary);
  white-space: nowrap;
}

.auth-captcha-row button:disabled {
  cursor: wait;
  opacity: 0.6;
}

#authForm input {
  padding: 12px 13px;
  background: var(--surface-alt);
}

#authForm input:focus-visible {
  background: var(--surface);
}

#verificationCode {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-align: center;
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  padding: 12px;
  font-weight: 700;
}

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

.auth-secondary-actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  gap: 14px;
  flex-wrap: wrap;
}

.auth-secondary-actions button {
  min-height: 32px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: var(--text-sm);
}

.auth-secondary-actions button:hover {
  text-decoration: underline;
}

.auth-capability-note {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.6;
}

.auth-message {
  border-left: 3px solid var(--bad);
}

.auth-security {
  margin: 22px 0 0;
  color: var(--text-faint);
  font-size: var(--text-xs);
  line-height: 1.7;
  text-align: center;
}

/* ---- Cloudflare Turnstile dialog ---- */

.verification-dialog {
  width: min(420px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  box-shadow: 0 24px 70px rgba(15, 29, 55, 0.22);
}

.verification-dialog::backdrop {
  background: rgba(15, 29, 55, 0.48);
  backdrop-filter: blur(3px);
}

.verification-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.verification-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.verification-heading h2 {
  margin: 6px 0 0;
  font-size: 21px;
}

.verification-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
}

.verification-card > p {
  margin: 12px 0 18px;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.turnstile-widget {
  display: grid;
  min-height: 70px;
  place-items: center;
}

.verification-message {
  margin-top: 14px;
  color: var(--bad);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.verification-retry {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  color: var(--primary);
  font-weight: 700;
}

/* ---- Responsive ---- */

@media (max-width: 780px) {
  .auth-shell {
    width: min(100% - 20px, 560px);
    min-height: auto;
    margin: 12px auto;
    grid-template-columns: 1fr;
  }

  .auth-brand {
    padding: 32px 28px;
  }

  .auth-brand h1 {
    font-size: 30px;
  }

  .auth-brand ul {
    display: none;
  }

  .brand-mark {
    margin-bottom: 22px;
  }

  .auth-panel {
    padding: 32px 24px 40px;
  }

  .verification-card {
    padding: 20px 16px;
  }
}

/* Reference-inspired split layout. Decorative artwork is local SVG/CSS. */
body {
  min-height: 100vh;
  margin: 0;
  padding: clamp(20px, 5vh, 60px) 0;
  background: radial-gradient(ellipse at 15% 5%, #e3eeff 0, transparent 50%), radial-gradient(ellipse at 95% 95%, #e8efff, transparent 45%), #f5f8fc;
  background-repeat: no-repeat;
}
.auth-shell {
  width: min(1280px, calc(100% - 80px));
  min-height: min(780px, calc(100vh - 100px));
  margin: 0 auto;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #dfe8f5;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 80px #244b8312, 0 2px 8px #244b8306;
}
.auth-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: block;
  min-height: 720px;
  padding: 40px 42px 80px;
  background: radial-gradient(ellipse at 105% 12%, #173c81 0, transparent 52%), #07172b;
}
.auth-brand::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background-image: linear-gradient(#4380d91c 1px, transparent 1px), linear-gradient(90deg, #4380d91c 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: linear-gradient(90deg, transparent 12%, #000);
}
.auth-brand::after {
  position: absolute;
  top: 40px;
  right: 32px;
  width: 82px;
  height: 60px;
  content: "";
  opacity: .35;
  background: radial-gradient(circle, #4377f7 1.5px, transparent 2px) 0 0 / 22px 22px;
}
.auth-brand h1 {
  position: relative;
  z-index: 1;
  margin: 42px 0 0;
  color: #f5f8ff;
  font-family: "STKaiti", "KaiTi", "Kaiti SC", "Noto Serif CJK SC", serif;
  font-size: clamp(32px, 3.5vw, 50px);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: .035em;
  text-align: center;
  text-shadow: 0 2px 18px #477cff55;
}
.auth-brand .brand-caption { position: relative; z-index: 1; margin: 14px auto 0; color: #a4bcdc; font-size: 13px; letter-spacing: .08em; text-align: center; }
.brand-stroke { width: 36px; height: 2px; margin: 24px auto; background: #4387ff; box-shadow: 0 0 14px #3b83ff; }
.brand-orbit { position: absolute; z-index: -1; width: 110%; height: 100%; left: -5%; top: 140px; opacity: .8; }
.brand-signature { position: absolute; left: 42px; bottom: 28px; color: #94b1d0; font-size: 11px; letter-spacing: .13em; }
.auth-panel { padding: 64px clamp(28px, 5vw, 86px); background: linear-gradient(130deg, #fff, #fcfdff); }
.auth-card { position: relative; width: 100%; max-width: 485px; }
.auth-heading .eyebrow { display: flex; align-items: center; gap: 8px; color: #61789c; font-size: 13px; letter-spacing: .06em; }
.auth-heading .eyebrow::before { width: 6px; height: 6px; border-radius: 50%; background: #4078f4; box-shadow: 0 0 0 4px #4078f40d; content: ""; }
.auth-heading h2 { margin: 12px 0 8px; color: #101d3b; font-size: clamp(30px, 3vw, 42px); line-height: 1.3; }
.auth-heading p { color: #64799a; font-size: 15px; line-height: 1.7; }
.auth-tabs { display: flex; gap: 6px; margin: 25px 0 28px; padding: 5px; border: 1px solid #d0dff7; border-radius: 10px; background: #eff5fd; }
.auth-tabs button { flex: 1; min-height: 46px; border: 0; border-radius: 7px; background: transparent; color: #4b6087; font-size: 17px; font-weight: 700; }
.auth-shell .auth-tabs > button[aria-selected="true"] { background: linear-gradient(135deg, #216aff, #1454e6); color: #fff; box-shadow: 0 3px 10px #0756fb20; }
.auth-shell .auth-tabs > button[aria-selected="true"]:hover { background: linear-gradient(135deg, #216aff, #1454e6); color: #fff; }
#authForm { gap: 20px; }
#authForm label, .auth-password-field { color: #17243c; font-size: 15px; font-weight: 600; }
#authForm input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 53px; padding: 13px 15px; border: 1px solid #d4deed; border-radius: 11px; background: #fcfdff; font-size: 16px; font-weight: 400; box-shadow: 0 1px 2px #18335d03; }
#authForm input::placeholder { color: #98a5ba; font-weight: 400; }
#authForm input:focus-visible { outline: 3px solid #1764ff20; outline-offset: 1px; border-color: #3979ff; }
.auth-field-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.auth-field-heading button, .verification-resend button, .auth-back { border: 0; background: transparent; color: #1759e8; font: inherit; cursor: pointer; }
.auth-field-heading button { min-height: 32px; padding: 0; font-size: 14px; }
.auth-password-input, .auth-input-wrap { position: relative; display: block; }
.auth-input-icon { position: absolute; z-index: 1; width: 20px; height: 20px; top: 17px; left: 15px; color: #7c90ae; pointer-events: none; }
.auth-password-input:focus-within .auth-input-icon, .auth-input-wrap:focus-within .auth-input-icon { color: #216aff; }
#authForm .auth-input-wrap input { padding-left: 46px; }
#authForm .auth-password-input input { padding-left: 46px; padding-right: 65px; }
#togglePassword { position: absolute; top: 4px; right: 4px; min-height: 45px; padding: 8px 12px; border: 0; background: transparent; color: #647ba1; font-size: 13px; }
.auth-submit.primary { min-height: 55px; margin-top: 3px; border: 0; border-radius: 11px; background: linear-gradient(115deg, #216aff, #0950eb); color: #fff; font-size: 17px; letter-spacing: .06em; box-shadow: 0 6px 16px #0756fb22; }
.auth-submit.primary:hover:not(:disabled) { background: linear-gradient(115deg, #145de9, #0645d1); box-shadow: 0 8px 22px #0756fb30; }
.auth-shell button:focus-visible { outline: 3px solid #2e6dfc; outline-offset: 3px; }
#authForm input:hover:not(:disabled) { border-color: #a9bddb; }
.auth-secondary-actions { margin-top: 20px; }
.auth-secondary-actions p { margin: 0; color: #7c8faa; font-size: 15px; }
.auth-secondary-actions button { min-height: 36px; font-size: 15px; }
.auth-security { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 26px; padding-top: 23px; border-top: 1px solid #e8edf5; color: #667c9c; font-size: 12px; }
.auth-security svg { width: 19px; height: 19px; flex: none; }
.auth-back { display: block; margin: 0 0 22px -8px; padding: 6px 8px; min-height: 40px; color: #60789c; font-size: 14px; }
.auth-back:hover, .verification-resend button:hover:not(:disabled), .auth-field-heading button:hover { text-decoration: underline; }
.auth-card:not([data-mode="login"]):not([data-mode="register"]) .auth-heading { margin-bottom: 28px; }
.verification-resend { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: -15px; color: #8493aa; font-size: 13px; }
.verification-resend button { min-height: 36px; padding: 4px; }
.verification-resend button:disabled { color: #899ab5; cursor: default; }
#verificationCode { letter-spacing: .24em; font-size: 23px; }
#verificationCode::placeholder { letter-spacing: normal; font-size: 15px; }
.auth-card[data-mode="verify"] #authMessage.is-good { margin: 0; padding: 0; border: 0; background: transparent; color: #647b9d; font-size: 13px; }
@media (max-width: 1000px) and (min-width: 781px) {
  .auth-shell { width: calc(100% - 40px); grid-template-columns: .9fr 1.1fr; }
  .auth-brand { padding: 36px 22px 72px; }
  .auth-brand h1 { font-size: 32px; }
  .brand-signature { left: 22px; letter-spacing: .05em; }
  .auth-panel { padding: 45px 32px; }
}
@media (max-width: 780px) {
  body { padding: 18px 0; }
  .auth-shell { width: min(560px, calc(100% - 28px)); min-height: auto; border-radius: 18px; grid-template-columns: 1fr; }
  .auth-brand { min-height: 0; padding: 24px 20px; }
  .auth-brand h1 { margin-top: 0; font-size: clamp(25px, 5.7vw, 34px); line-height: 1.45; text-align: left; }
  .auth-brand h1 br { display: none; }
  .auth-brand h1 span { white-space: nowrap; }
  .brand-orbit { width: 60%; height: 360px; top: -100px; left: 55%; opacity: .5; }
  .brand-stroke, .brand-signature, .brand-caption, .auth-brand::after { display: none; }
  .auth-panel { padding: 30px 24px; }
  .auth-heading h2 { font-size: 30px; }
  .auth-heading p { font-size: 15px; }
  .auth-tabs { margin-top: 22px; }
  .auth-security { margin-top: 22px; }
  .auth-field-heading button, .verification-resend button, .auth-secondary-actions button, .auth-back { min-height: 44px; }
  .auth-field-heading { margin-bottom: 3px; }
}
@media (max-width: 380px) {
  .auth-panel { padding: 26px 18px; }
  .auth-brand h1 { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-shell *, .verification-dialog * { transition: none !important; animation: none !important; }
}
