/* ==========================================================================
 * 认证页共享组件样式（login / register / forgot-password 三页复用）
 * --------------------------------------------------------------------------
 * 按 auth 现行 Lan 设计语言（唯一蓝色 accent #0066FF + 墨色中性阶（DESIGN_lan.md））：
 *   - 白卡 24px 圆角 + 卡片阴影，置于浅灰画布之上；
 *   - 表单字段 / 输入框 / 密码行 / 复选框 / 提交按钮 / 验证码行共用以下类名。
 * 尺寸以 rem 表达（1rem = 10 设计px，375 基准，见 global.css 说明）。
 * ========================================================================== */

.auth-page {
  background-color: var(--page-bg-color);
  position: relative;
  box-sizing: border-box;
  /* 顶部留白：返回按钮移除后收窄（原 10.5rem 为左上角返回按钮预留），
     垂直居中由 flex 完成，页面骨架（页眉页脚贴底）见 header-footer.css */
  padding: 3.6rem 2.4rem 3.6rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* ===== 白色卡片容器 ===== */
.auth-card {
  position: relative;
  z-index: 1;
  width: 34.2rem;
  padding: 2.4rem;
  box-sizing: border-box;
  background: var(--color-card-bg);
  border-radius: 2.4rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
}

/* 登录卡片：主卡片顶部额外留白 */
.auth-card--login {
  margin-top: 3.2rem;
}

/* ===== 标题区 ===== */
.auth-title {
  color: var(--color-text-primary);
  font-size: 3.2rem;
  line-height: 3.6rem;
  font-weight: 600;
  text-align: center;
  margin: 0;
}

.auth-subtitle {
  color: var(--color-text-secondary);
  font-size: 1.6rem;
  line-height: 2.4rem;
  font-weight: 400;
  text-align: center;
  /* 与标题的组内间距取 {spacing.sm} 8px（须小于卡片子块间 24px，维持层级关系） */
  margin: 0.8rem 0 0;
}

/* ===== 表单 ===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.auth-label {
  color: var(--color-label);
  font-size: 1.4rem;
  line-height: 2rem;
  font-weight: 400;
}

/* 输入框（含验证码输入框）：1px 描边 + 12px 圆角 */
.auth-input {
  height: 4.9rem;
  padding: 1.4rem 1.2rem 1.2rem;
  box-sizing: border-box;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border-input);
  border-radius: 1.2rem;
  color: var(--color-text-primary);
  font-size: 1.6rem;
  line-height: 2.1rem;
  font-family: inherit;
  width: 100%;
  outline: none;
}

.auth-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 1;
}

/* 聚焦时 placeholder 变浅灰（纯 CSS 实现） */
.auth-input:focus::placeholder {
  color: var(--color-placeholder);
}

/* 错误态：红色边框 */
.auth-input--error {
  border-color: var(--color-form-error);
}

.auth-error-text {
  color: var(--color-form-error);
  font-size: 1.2rem;
  line-height: 1.6rem;
}

/* 字符超限提示（仅在已达上限后继续输入时出现） */
.auth-limit-text {
  color: var(--color-warning-deep); /* 白底警示文字取可读的警示深色 */
  font-size: 1.2rem;
  line-height: 1.6rem;
}

/* ===== 密码行：统一边框容器，内含输入框与眼睛图标 ===== */
.auth-password-row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-border-input);
  border-radius: 1.2rem;
  background: var(--color-card-bg);
}

.auth-password-row:focus-within {
  border-color: var(--color-text-secondary);
}

.auth-password-row--error {
  border-color: var(--color-form-error);
}

/* 密码输入框：去掉自身描边，融入外层容器 */
.auth-input--password {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 1.2rem 0 0 1.2rem;
  padding-right: 1.2rem;
  background: transparent;
  height: auto;
}

.auth-eye {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.2rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 0 1.2rem 1.2rem 0;
}

/* 忘记密码链接行（登录页）：右对齐小字链接 */
.auth-forgot-row {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
}

.auth-forgot {
  color: var(--color-text-secondary);
  font-size: 1.2rem;
  line-height: 1.6rem;
  cursor: pointer;
}

/* ===== 操作区（登录页：协议勾选 + 提交按钮） ===== */
.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* ===== 协议勾选行 ===== */
.auth-agree {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.8rem;
}

.auth-checkbox {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.4rem;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border-input);
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}

.auth-checkbox--checked {
  background: var(--color-brand);
  border-color: var(--color-brand);
}

/* 选中态对勾（CSS ::after 绘制，反白色；随 --checked 类自动出现/消失——
   勾选框 DOM 内无子元素，对勾由伪元素生成，此前无任何元素引用对勾样式导致只见色块不见 √） */
.auth-checkbox--checked::after {
  content: '';
  width: 0.5rem;
  height: 0.8rem;
  border-right: 1.5px solid var(--color-text-inverse);
  border-bottom: 1.5px solid var(--color-text-inverse);
  transform: rotate(45deg) translate(-1px, -1px);
}

.auth-agree-text {
  color: var(--color-text-secondary);
  font-size: 1.2rem;
  line-height: 1.6rem;
  font-weight: 400;
}

/* 《服务协议》/《隐私政策》可点击链接：与同行文本样式一致 */
.auth-agree-link {
  color: var(--color-text-secondary);
  font-size: 1.2rem;
  line-height: 1.6rem;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
}

/* ===== 提交按钮 ===== */
.auth-submit {
  height: 4.8rem;
  padding: 1.2rem 0;
  box-sizing: border-box;
  background: var(--color-brand-bg);
  border: none;
  border-radius: 2.4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  width: 100%;
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.auth-submit-text {
  color: var(--color-text-inverse);
  font-size: 1.6rem;
  line-height: 2.4rem;
  font-weight: 500;
}

/* ===== 验证码行：输入框 + 获取验证码按钮 ===== */
.auth-code-row {
  display: flex;
  flex-direction: row;
  gap: 0.8rem;
}

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

.auth-code-btn {
  width: 9.6rem;
  height: 4.9rem;
  box-sizing: border-box;
  border: 1px solid var(--color-border-input);
  border-radius: 1.2rem;
  background: var(--color-card-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  padding: 0;
}

.auth-code-btn--disabled {
  opacity: 0.6;
  cursor: default;
}

.auth-code-btn-text {
  color: var(--color-text-primary);
  font-size: 1.4rem;
  line-height: 2rem;
  font-weight: 400;
}

/* ===== 底部链接区（卡片外） ===== */
.auth-footer {
  display: flex;
  justify-content: center;
  margin-top: 2.4rem;
}

.auth-footer-text {
  color: var(--color-text-secondary);
  font-size: 1.6rem;
  line-height: 2.4rem;
  font-weight: 400;
}

.auth-footer-link {
  color: var(--color-brand);
  font-size: 1.6rem;
  line-height: 2.4rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

/* 整行可点击的次级文字链接（找回密码页「返回登录」，次级灰色样式） */
a.auth-footer-text {
  text-decoration: none;
  cursor: pointer;
}

/* ===== 登录页指纹一键登录卡片 ===== */

/* 紧凑卡片：指纹卡片内部紧凑间距 */
.auth-card--compact {
  gap: 1.2rem;
}

/* 指纹图标按钮（圆形 + ink 主题图标） */
.login-fingerprint-btn {
  width: 4.8rem;
  height: 4.8rem;
  margin: 1.2rem auto 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 0;
}

.login-fingerprint-icon {
  width: 4.8rem;
  height: 4.8rem;
  display: block;
}

/* 指纹卡片协议勾选行居中 */
.auth-agree--center {
  justify-content: center;
}

/* 登录方式切换引导（放大突出） */
.login-switch {
  display: flex;
  justify-content: center;
}

.login-switch--extra {
  margin-top: 1.2rem;
}

.login-switch-text {
  color: var(--color-brand);
  font-size: 1.8rem;
  line-height: 2.6rem;
  font-weight: 600;
  cursor: pointer;
}
