/* 登录 / 注册页 */

:root {
  --auth-bg: linear-gradient(180deg, #fafafa 0%, #f0f0f2 100%);
  --auth-card: #fff;
  --auth-border: rgba(0, 0, 0, 0.08);
  --auth-text: #0f172a;
  --auth-muted: #64748b;
  --auth-accent: #6366f1;
  --font: "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.auth-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--auth-bg);
  color: var(--auth-text);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.auth-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  font-size: 16px;
}

.auth-brand-icon {
  flex-shrink: 0;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 16px;
  padding: 32px 28px 36px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-lead {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--auth-muted);
  line-height: 1.5;
}

.auth-field {
  margin-bottom: 18px;
}

.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-text);
  margin-bottom: 6px;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--auth-muted);
  line-height: 1.45;
  margin-bottom: 22px;
}

.auth-check input {
  margin-top: 3px;
}

.auth-submit {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: transform 0.12s, box-shadow 0.2s;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--auth-muted);
}

.auth-footer a {
  color: var(--auth-accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-msg {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.auth-msg.is-error {
  display: block;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.auth-msg.is-ok {
  display: block;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.auth-api-hint {
  margin: -12px 0 16px;
  font-size: 12px;
  color: var(--auth-muted);
}

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

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 10px;
}

.auth-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--auth-muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-tab.is-active {
  background: #fff;
  color: var(--auth-text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.auth-panel {
  display: none;
}

.auth-panel.is-active {
  display: block;
}

.auth-inline {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.auth-inline input {
  flex: 1;
  min-width: 0;
}

.auth-btn-secondary {
  flex-shrink: 0;
  padding: 10px 14px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--auth-text);
  background: #f8fafc;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.auth-btn-secondary:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: rgba(99, 102, 241, 0.35);
}

.auth-btn-secondary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-field input[type="tel"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-captcha-box label {
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-muted);
}

.auth-header-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--auth-accent);
  text-decoration: none;
}

.auth-header-link:hover {
  text-decoration: underline;
}

/* —— 滑块验证 —— */
.auth-slider-root {
  margin-bottom: 18px;
}

.auth-slider-track {
  position: relative;
  height: 44px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid var(--auth-border);
  overflow: hidden;
  user-select: none;
}

.auth-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.2));
  border-radius: 10px 0 0 10px;
  pointer-events: none;
  transition: width 0.05s linear;
}

.auth-slider-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--auth-muted);
  pointer-events: none;
  transition: opacity 0.2s;
}

.auth-slider-thumb {
  position: absolute;
  left: 0;
  top: 2px;
  width: 40px;
  height: 38px;
  border: none;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  color: var(--auth-accent);
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.auth-slider-thumb.is-active {
  cursor: grabbing;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.auth-slider-thumb.is-done {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  cursor: default;
}

.auth-slider-track.is-verified {
  border-color: rgba(99, 102, 241, 0.35);
  background: #eef2ff;
}

.auth-slider-status {
  margin: 8px 0 0;
  font-size: 12px;
  min-height: 18px;
  color: var(--auth-muted);
}

.auth-slider-status.is-ok {
  color: #047857;
}

.auth-slider-status.is-error {
  color: #b91c1c;
}

/* —— 注册页布局 —— */
.auth-body-register {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 45%, #f0fdfa 100%);
}

.auth-main-register {
  align-items: flex-start;
  padding-top: 24px;
  padding-bottom: 56px;
}

.auth-register-wrap {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(360px, 520px);
  gap: 32px;
  width: min(920px, 100%);
  align-items: start;
}

.auth-register-aside {
  padding: 28px 8px 28px 0;
}

.auth-register-badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #4338ca;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 999px;
}

.auth-register-aside h2 {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-register-aside-lead {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--auth-muted);
}

.auth-register-features {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--auth-text);
}

.auth-register-features li {
  position: relative;
  padding: 8px 0 8px 22px;
  line-height: 1.45;
}

.auth-register-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
}

.auth-register-card {
  width: 100%;
  padding: 28px 28px 32px;
}

.auth-register-form .auth-section {
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--auth-border);
}

.auth-register-form .auth-section:last-of-type {
  border-bottom: none;
  margin-bottom: 8px;
}

.auth-section-head {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.auth-section-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-section-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.auth-section-head p {
  margin: 0;
  font-size: 12px;
  color: var(--auth-muted);
  line-height: 1.45;
}

.auth-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.auth-field-full {
  grid-column: 1 / -1;
}

.auth-field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--auth-muted);
}

.auth-field input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}

.auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* —— 法律勾选 —— */
.auth-legal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.auth-legal-toolbar-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--auth-muted);
  flex: 1;
  min-width: 160px;
}

.auth-legal-check-all {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #4338ca;
  background: rgba(99, 102, 241, 0.08);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.auth-legal-check-all:hover {
  background: rgba(99, 102, 241, 0.14);
  border-color: #6366f1;
}

.auth-legal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.auth-legal-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--auth-text);
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--auth-border);
  background: #fafafa;
  transition: border-color 0.15s, background 0.15s;
}

.auth-legal-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: #f8fafc;
}

.auth-legal-item input {
  margin-top: 3px;
  flex-shrink: 0;
}

.auth-legal-item a {
  color: var(--auth-accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-legal-item a:hover {
  text-decoration: underline;
}

.auth-legal-note {
  margin: 0;
  font-size: 12px;
  color: var(--auth-muted);
}

.auth-legal-note a {
  color: var(--auth-accent);
  font-weight: 600;
  text-decoration: none;
}

/* —— 法律弹窗 —— */
body.legal-modal-open {
  overflow: hidden;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.legal-modal[hidden] {
  display: none;
}

.legal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.legal-modal-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: min(85vh, 720px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.legal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--auth-border);
  flex-shrink: 0;
}

.legal-modal-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.legal-modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--auth-muted);
}

.legal-modal-close:hover {
  background: #e2e8f0;
  color: var(--auth-text);
}

.legal-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--auth-text);
}

.legal-modal-body h1 {
  font-size: 20px;
  margin: 0 0 16px;
}

.legal-modal-body h2 {
  font-size: 16px;
  margin: 20px 0 10px;
}

.legal-modal-body h3 {
  font-size: 14px;
  margin: 16px 0 8px;
}

.legal-modal-body p {
  margin: 0 0 10px;
  color: #334155;
}

.legal-modal-body li {
  margin: 0 0 6px 18px;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.legal-table th,
.legal-table td {
  border: 1px solid var(--auth-border);
  padding: 8px 10px;
  text-align: left;
}

.legal-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--auth-border);
  flex-shrink: 0;
}

.legal-modal-agree {
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  cursor: pointer;
}

.legal-loading,
.legal-error {
  color: var(--auth-muted);
}

@media (max-width: 768px) {
  .auth-register-wrap {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-register-aside {
    padding: 0 0 16px;
    text-align: center;
  }

  .auth-register-features {
    text-align: left;
  }

  .auth-field-grid {
    grid-template-columns: 1fr;
  }
}

.auth-forgot-row {
  margin: -8px 0 16px;
  text-align: right;
}

.auth-forgot-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-accent);
  text-decoration: none;
}

.auth-forgot-link:hover {
  text-decoration: underline;
}

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

.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;
}
