/* ============================================================
   Aurora · 账号页（登录 / 注册 / 找回密码 / 会员中心）
   仅这些页面按需加载；公共变量与组件来自 base.css。
   ============================================================ */

/* ---------- 认证类页面（登录 / 注册 / 找回 / 重置 / 验证） ---------- */
.auth-wrap {
  max-width: 460px;
  margin: 0 auto;
  padding-bottom: 8px;
}

/* 验证页：结果卡片 + 重发卡片分开展示 */
.auth-wrap .auth-card + .auth-card {
  margin-top: 16px;
}

.glass.auth-card {
  padding: clamp(20px, 3.6vw, 28px);
  border-radius: var(--radius-lg);
  animation: auth-rise var(--dur-md) var(--ease-out) both;
}

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.auth-head {
  text-align: center;
  margin-bottom: 16px;
}

.auth-logo {
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: var(--accent-grad);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.auth-logo img { width: 100%; height: 100%; object-fit: contain; object-position: center; background: var(--glass-strong); display: block; }

.auth-head h1 {
  margin: 0 0 4px;
  font-size: 1.26rem;
  letter-spacing: -0.01em;
}

.auth-head p {
  margin: 0;
  color: var(--muted, #55534e);
  font-size: 0.88rem;
}

/* ---------- 认证表单：输入框 / 浮动标签 / 动效 ---------- */
.auth-card {
  position: relative;
  isolation: isolate;
  /* 认证页主按钮：与全站品牌蓝紫渐变保持同一套语言 */
  --auth-cta-a: var(--accent);
  --auth-cta-b: var(--accent-2);
  --auth-cta-shadow: rgba(var(--accent-rgb), 0.38);
  --auth-cta-ring: var(--accent-soft);
}

/* 卡片顶部柔光，缓慢呼吸；不参与点击 */
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 190px;
  border-radius: inherit;
  background: radial-gradient(62% 100% at 50% 0%, var(--accent-soft), transparent 72%);
  opacity: 0.7;
  pointer-events: none;
  z-index: -1;
  animation: auth-glow 9s var(--ease-in-out) infinite alternate;
}

@keyframes auth-glow {
  from { opacity: 0.45; transform: translateY(-10px); }
  to   { opacity: 0.85; transform: translateY(4px); }
}

/* 输入框基础样式（含验证码输入，登录/注册页此前无任何表单皮肤） */
.auth-card input {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  background: var(--glass-grad);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.98rem;
  line-height: 1.5;
  transition: border-color var(--dur-sm) var(--ease-out),
              box-shadow var(--dur-sm) var(--ease-out),
              background var(--dur-sm) var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}

.auth-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft),
              0 14px 30px -18px rgba(var(--accent-rgb), 0.75);
}

/* 字段容器：图标 + 浮动标签 */
.auth-fields {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

/* 注册页：视口够宽时成对字段两列排布，显著压缩纵向高度；窄屏自动单列 */
@media (min-width: 620px) {
  .auth-fields--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }

  .auth-fields--pair > .auth-field--full {
    grid-column: 1 / -1;
  }
}

.auth-field {
  position: relative;
  animation: auth-field-in 0.46s var(--ease-out) both;
}

.auth-fields > .auth-field:nth-child(2) { animation-delay: 0.05s; }
.auth-fields > .auth-field:nth-child(3) { animation-delay: 0.1s; }
.auth-fields > .auth-field:nth-child(4) { animation-delay: 0.15s; }
.auth-fields > .auth-field:nth-child(5) { animation-delay: 0.2s; }
.auth-fields > .auth-field:nth-child(6) { animation-delay: 0.25s; }

@keyframes auth-field-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.auth-field > input {
  padding-top: 19px;
  padding-bottom: 6px;
}

.auth-field.has-icon > input { padding-left: 46px; }

.auth-field--pw > input { padding-right: 52px; }

.auth-field > label {
  position: absolute;
  left: 16px;
  top: 25px; /* 输入框最小高度 50 的一半：带强度条的字段也能保持对齐 */
  margin: 0;
  transform: translateY(-50%);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg-3);
  pointer-events: none;
  transition: top var(--dur-sm) var(--ease-out),
              transform var(--dur-sm) var(--ease-out),
              font-size var(--dur-sm) var(--ease-out),
              color var(--dur-sm) var(--ease-out);
}

.auth-field.has-icon > label { left: 46px; }

/* 聚焦或有内容时标签上浮 */
.auth-field > input:focus + label,
.auth-field > input:not(:placeholder-shown) + label {
  top: 9px;
  transform: none;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.auth-field-icon {
  position: absolute;
  left: 15px;
  top: 25px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--fg-3);
  transform: translateY(-50%);
  pointer-events: none;
  transition: color var(--dur-sm) var(--ease-out),
              transform var(--dur-sm) var(--ease-spring);
}

.auth-field-icon svg {
  width: 18px;
  height: 18px;
}

.auth-field:focus-within .auth-field-icon {
  color: var(--accent);
  transform: translateY(-50%) scale(1.08);
}

/* 密码可见切换 */
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 25px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--fg-3);
  cursor: pointer;
  transform: translateY(-50%);
  transition: color var(--dur-sm) var(--ease-out),
              background var(--dur-sm) var(--ease-out);
}

.pw-toggle:hover,
.pw-toggle:focus-visible {
  color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.pw-toggle svg {
  width: 19px;
  height: 19px;
}

.pw-toggle .eye-off { display: none; }
.pw-toggle.is-on .eye-on { display: none; }
.pw-toggle.is-on .eye-off { display: block; }

/* 密码强度 */
.pw-meter {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
}

.pw-meter i {
  flex: 1 1 0;
  height: 4px;
  border-radius: 999px;
  background: var(--hairline);
  transition: background var(--dur-md) var(--ease-out);
}

.pw-meter[data-level="1"] i:nth-child(1) { background: #ff453a; }
.pw-meter[data-level="2"] i:nth-child(-n+2) { background: #ff9f0a; }
.pw-meter[data-level="3"] i:nth-child(-n+3) { background: #30d158; }
.pw-meter[data-level="4"] i:nth-child(-n+4) { background: var(--accent-2); }

.pw-meter-text {
  flex: 0 0 auto;
  margin-left: 5px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--fg-3);
}

/* 验证码等独立字段的标题 */
.auth-label {
  margin: 12px 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-2);
}

.auth-card .captcha-widget {
  margin-top: 0;
}

/* 提交按钮：翡翠绿主色 + 加载态 */
.auth-card .btn {
  min-height: 46px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--auth-cta-a), var(--auth-cta-b));
  box-shadow: 0 12px 26px -14px var(--auth-cta-shadow),
              inset 0 1px 0 rgba(255, 255, 255, 0.26);
  transition: transform 0.18s var(--ease-out),
              box-shadow 0.22s var(--ease-out),
              filter 0.22s var(--ease-out);
}

@media (hover: hover) {
  .auth-card .btn:hover {
    transform: translateY(-1px);
    filter: saturate(1.06);
    box-shadow: 0 16px 30px -14px var(--auth-cta-shadow),
                inset 0 1px 0 rgba(255, 255, 255, 0.32);
  }
}

.auth-card .btn:active {
  transform: translateY(0) scale(0.985);
}

.auth-card .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--auth-cta-ring),
              0 12px 26px -14px var(--auth-cta-shadow);
}

/* 按钮行：主按钮占满，第三方登录压缩为图标按钮 */
.auth-card .btn-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 16px;
}

.auth-card .btn-row .btn {
  flex: 1 1 auto;
}

.btn-qq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 15px;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  background: var(--glass-lo, rgba(255, 255, 255, 0.26));
  color: var(--fg);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--dur-sm) var(--ease-out),
              color var(--dur-sm) var(--ease-out),
              background var(--dur-sm) var(--ease-out);
}

.btn-qq svg {
  width: 17px;
  height: 17px;
}

.btn-qq:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* 字段说明与底部注记：合并为一行，压缩表单高度 */
.auth-hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--fg-3);
}

.auth-note {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--fg-3);
}

.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.75s linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

.auth-card .field-tip {
  margin: -6px 0 14px;
}

/* 字段网格内的提示文字：由网格 gap 控制间距，避免双重留白 */
.auth-card .auth-fields > .field-tip {
  margin: -6px 0 0;
}

.auth-alt {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  margin-top: 12px;
  font-size: 0.86rem;
}

.auth-alt a {
  color: var(--accent);
  text-decoration: none;
}

.auth-alt a:hover {
  text-decoration: underline;
}

.auth-status {
  text-align: center;
  padding: 8px 0 4px;
}

.auth-status .auth-mark {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 34px;
  line-height: 1;
}

.auth-status .auth-mark.is-ok {
  color: #12893f;
  background: rgba(18, 137, 63, 0.12);
}

.auth-status .auth-mark.is-err {
  color: #c0392b;
  background: rgba(192, 57, 43, 0.12);
}

/* 注册页邀请码提示：有效（品牌色）/ 无效（琥珀色） */
.auth-hint--invite {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft, rgba(var(--accent-rgb), 0.14));
  color: var(--accent);
}

.auth-hint--invite.is-warn {
  background: rgba(255, 149, 0, 0.14);
  color: #a86400;
}

@media (prefers-color-scheme: dark) {
  .auth-hint--invite.is-warn { color: #ffb340; }
}

/* ---------- 移动端：认证页字号与布局 ---------- */
@media (max-width: 640px) {
  /* 16px 防 iOS 聚焦自动缩放（0.98rem ≈ 15.7px） */
  .auth-card input {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .glass.auth-card {
    padding: 18px 16px;
    border-radius: var(--radius-md);
  }

  .auth-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 20px;
  }

  .auth-head h1 {
    font-size: 1.12rem;
  }

  .auth-head p {
    font-size: 0.84rem;
    line-height: 1.55;
  }

  .auth-field > input {
    min-height: 52px;
  }

  .auth-field > label {
    top: 26px;
  }

  .auth-field-icon,
  .pw-toggle {
    top: 26px;
  }

  .auth-card .btn-row {
    gap: 8px;
    margin-top: 14px;
  }

  .auth-card .btn-row .btn,
  .btn-qq {
    min-height: 48px;
  }

  .auth-alt {
    gap: 2px 12px;
    margin-top: 14px;
  }

  .auth-alt a,
  .auth-alt-note {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
  }
}

