/* 登录 / 注册页 */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
}

.auth-topbar {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 600;
  color: var(--label);
}
.auth-brand:hover { text-decoration: none; }
.auth-brand svg { width: 22px; height: 22px; color: var(--label); }

.auth-topbar-action {
  font-size: 15px;
  color: var(--label);
  padding: 6px 4px;
}
.auth-topbar-action:hover { text-decoration: underline; }

/* 圆角矩形按钮（下一步） */
.btn-rect { border-radius: var(--r-md); }

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

.auth-card {
  width: 100%;
  max-width: 400px;
  animation: authIn var(--dur-slow) var(--ease);
}
/* 注册表单较高，从顶部开始避免溢出 */
.auth-card.register-card { align-self: flex-start; }
@keyframes authIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.auth-title {
  font-size: 28px;
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}
.auth-sub {
  text-align: center;
  font-size: 14px;
  color: var(--secondary-label);
  margin-bottom: 28px;
}

/* 两步登录 */
.auth-email-wrap { position: relative; }

.auth-step {
  overflow: hidden;
  transition: max-height var(--dur-slow) var(--ease), opacity var(--dur-normal) var(--ease);
}
.auth-step.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
.auth-step.expanded {
  max-height: 400px;
  opacity: 1;
}

.auth-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--r-md);
}
.auth-identity .id-email {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-identity .id-change {
  background: none;
  border: none;
  color: var(--label);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  font-family: inherit;
}
.auth-identity .id-change:hover { text-decoration: underline; }

.auth-links {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--tertiary-label);
  font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--separator);
}

/* 注册表单 */
.register-card { max-width: 480px; }
.register-card .field-group { margin-bottom: 16px; }

.register-birth { display: flex; gap: 10px; }
.register-birth select { flex: 1; min-width: 0; }

.register-phone { display: flex; gap: 10px; }
.register-phone select { width: 170px; flex-shrink: 0; }

.code-row { display: flex; gap: 10px; }
.code-row .field { flex: 1; min-width: 0; }
.code-row .btn { flex-shrink: 0; }

.register-note {
  font-size: 13px;
  color: var(--secondary-label);
  margin: 4px 0 0;
}

.form-error {
  background: rgba(255, 59, 48, 0.1);
  color: var(--error);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 14px;
  display: none;
}
.form-error.show { display: block; }

.auth-legal {
  margin-top: 28px;
  font-size: 12px;
  color: var(--tertiary-label);
  text-align: center;
  line-height: 1.6;
}

/* ---------- 授权页隐私选择 ---------- */
.privacy-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  background: var(--background);
}
.privacy-option:hover { border-color: var(--tertiary-label); }
.privacy-option.selected {
  border-color: var(--primary);
  background: rgba(0, 122, 255, 0.04);
}
.privacy-option input {
  margin: 2px 0 0;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.privacy-option .po-body { flex: 1; min-width: 0; }
.privacy-option .po-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--label);
  display: flex;
  align-items: center;
  gap: 7px;
}
.privacy-option .po-default {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(0, 122, 255, 0.1);
  padding: 1px 7px;
  border-radius: var(--r-pill);
}
.privacy-option .po-desc {
  font-size: 12.5px;
  color: var(--secondary-label);
  line-height: 1.5;
  margin: 3px 0 0;
}

/* ---------- 注册三阶段（填写 → 条款 → 大陆手机核验） ---------- */
.terms-box {
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  background: var(--background);
  margin-bottom: 18px;
  overflow: hidden;
}
.terms-scroll {
  max-height: 264px;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--secondary-label);
}
.terms-region {
  font-size: 13px;
  font-weight: 600;
  color: var(--label);
  margin: 0 0 8px;
}
.terms-section + .terms-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--separator);
}
.terms-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--label);
  margin: 0 0 5px;
}
.terms-section p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--secondary-label);
}
.reg-back-btn { margin-top: 10px; }.reg-sms-note {
  margin: 12px 0 0;
  font-size: 13.5px;
  color: var(--secondary-label);
  line-height: 1.6;
  text-align: center;
}
.sms-title {
  text-align: center;
  margin-bottom: 10px;
}
.sms-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--label);
  text-align: center;
}
.sms-body { margin-top: 26px; }

/* ---------- OAuth 授权触发的登录：专用样式（无导航栏） ---------- */
html.oauth-login .site-nav { display: none !important; }
html.oauth-login .auth-title {
  font-size: 25px;
  line-height: 1.4;
  margin-bottom: 10px;
}
html.oauth-login .auth-sub { margin-bottom: 26px; }
