/* =========================================================
   星环设计 - 登录 / 注册页样式
   ========================================================= */

/* 全屏居中容器（带渐变星空背景） */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #6a5cff 0%, #4a3dbd 45%, #1b1740 100%);
}
[data-theme="dark"] .auth-wrap {
  background: linear-gradient(135deg, #191632 0%, #221d47 50%, #0e0c1d 100%);
}

/* 登录 / 注册页：纯白壁纸（去掉渐变星空，想恢复就删掉页面上的 auth-wrap--white 类） */
.auth-wrap--white,
[data-theme="dark"] .auth-wrap--white {
  background: #ffffff;
}
/* 纯白背景下给卡片加一层细边，避免和背景糊在一起 */
.auth-wrap--white .auth-card {
  border: 1px solid var(--border);
}
[data-theme="dark"] .auth-wrap--white .auth-card {
  border-color: rgba(0, 0, 0, 0.08);
}

/* 认证卡片 */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  animation: cardUp 0.35s ease;
}
@keyframes cardUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-card h1 {
  font-size: 24px;
  text-align: center;
  color: var(--primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* 登录/注册页大标题旁的 logo 图 */
.auth-logo { width: 32px; height: 32px; }
.auth-card .sub {
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 26px;
}

/* 表单行 */
.form-item { margin-bottom: 16px; }
.form-item label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}

/* 验证码行：输入框 + canvas 图片 */
.captcha-row { display: flex; gap: 10px; }
.captcha-row .input { flex: 1; }
#captchaCanvas {
  width: 110px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
}
.captcha-tip { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* 「发送验证码」按钮：跟输入框挤在 .captcha-row 里，宽度固定、不换行 */
.code-btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 104px;
  justify-content: center;
}
.code-btn:disabled { opacity: .6; cursor: not-allowed; }

.auth-card .btn.block { margin-top: 6px; padding: 12px; font-size: 15px; }

.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-2);
}

/* =========================================================
   移动端适配
   ========================================================= */
@media (max-width: 640px) {
  .auth-wrap { padding: 16px 12px; align-items: flex-start; }
  .auth-card { padding: 26px 20px; margin-top: 8vh; }
  .auth-card h1 { font-size: 21px; }
}

/* ---------- 忘记密码 ---------- */
.forgot-tip {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
  margin: 4px 0 12px;
}
#forgotForm { margin-top: 6px; }

/* ---------- 第三方登录（GitHub 等，按钮由 login.js 按后端配置决定显示） ---------- */
.oauth-box { margin-top: 14px; }
/* 🔴 类里若写了 display 会盖掉 [hidden]，所以这里显式兜底一条 */
.oauth-box[hidden] { display: none; }
.oauth-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-2);
}
.oauth-sep::before,
.oauth-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
/* 图标按钮并排居中（只有图标、没有文字，加第三家也不用改样式） */
.oauth-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s;
}
.oauth-btn:hover { border-color: var(--primary); background: var(--bg-hover); }
.oauth-btn:active { transform: translateY(1px); }
.oauth-btn i { font-size: 17px; line-height: 1; }
