/* =========================================================
   登录 / 注册页
   ========================================================= */

.auth-page {
  background: #ffffff;
  min-height: 100svh;
}

/* ---------- 顶栏 ---------- */
.auth-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px var(--pad);
}

.auth-back {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--bone-dim);
  transition: color 0.3s ease;
}
.auth-back:hover { color: var(--ember); }

/* ---------- 本地文件模式提示 ---------- */
.auth-offline {
  margin: 0 0 20px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.7;
  color: #8a4a1c;
  background: rgba(233, 160, 92, 0.14);
  border-left: 2px solid #e9a05c;
}
.auth-offline b {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
}
.auth-offline span { display: block; color: var(--bone-dim); }
.auth-offline a { color: #bf6b2c; text-decoration: underline; text-underline-offset: 3px; word-break: break-all; }

/* ---------- 布局 ---------- */
.auth-wrap {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 22px;
  padding: clamp(96px, 14vh, 150px) var(--pad) clamp(40px, 8vh, 70px);
}

.auth-card {
  width: min(460px, 100%);
  margin-block: auto;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: clamp(26px, 4vw, 42px);
  box-shadow: 0 40px 90px -60px rgba(30, 51, 72, 0.55);
}

.auth-eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--bone-dim);
}

.auth-title {
  margin: 0 0 22px;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* ---------- 标签页 ---------- */
.auth-tabs {
  position: relative;
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}

.auth-tab {
  padding: 0 0 12px;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--bone-dim);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.3s ease;
}
.auth-tab:hover { color: var(--bone); }
.auth-tab.is-active { color: var(--bone); }

.auth-tab__ink {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 0;
  background: var(--leaf);
  transition: width 0.45s var(--ease), transform 0.45s var(--ease);
}

/* ---------- 表单 ---------- */
.field { margin-bottom: 13px; }

.field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--bone-dim);
}
.field__label span {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  opacity: 0.65;
}

.field__wrap { position: relative; }

/* 给「显示」留出位置，避免密码点和按钮叠在一起 */
.field__wrap .field__input { padding-right: 60px; }

/* 干掉 Edge / IE 自带的密码显示小眼睛，它和我们的按钮会重叠 */
.field__input::-ms-reveal,
.field__input::-ms-clear,
.field__input::-webkit-credentials-auto-fill-button {
  display: none !important;
  width: 0;
  height: 0;
}

.field__input {
  width: 100%;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--bone);
  border-radius: 0;
  outline: none;
  transition: border-color 0.3s ease;
}
.field__input::placeholder { color: rgba(30, 51, 72, 0.26); }
.field__input:focus { border-bottom-color: var(--leaf); }

.field.has-error .field__input { border-bottom-color: #d9762f; }

.field__eye {
  position: absolute;
  right: 0;
  bottom: 11px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
  cursor: pointer;
  transition: color 0.25s ease;
}
.field__eye:hover { color: var(--ember); }

.field__error {
  min-height: 15px;
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: #bf6b2c;
}

.field--check { margin-top: 4px; }
.field--check .field__error { margin-top: 2px; }

/* ---------- 验证码 ---------- */
.code-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
.code-row .field__input { flex: 1; }

.code-btn {
  flex: none;
  padding: 6px 0 7px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ember);
  border-bottom: 1px solid rgba(90, 162, 208, 0.5);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}
.code-btn:hover { color: var(--leaf); border-bottom-color: var(--leaf); }
.code-btn:disabled { color: var(--bone-dim); border-bottom-color: var(--line); cursor: default; }

/* ---------- 演示验证码 ---------- */
.code-hint {
  margin: 8px 0 0;
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #2f7fa6;
  background: rgba(156, 200, 232, 0.16);
  border-left: 2px solid #9cc8e8;
}
.code-hint b { font-size: 13px; letter-spacing: 0.12em; color: #1f5d7d; }

/* ---------- 勾选 / 行 ---------- */
.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--bone-dim);
  cursor: pointer;
  line-height: 1.6;
}
.check input {
  appearance: none;
  width: 13px;
  height: 13px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.check input:checked {
  background: var(--leaf);
  border-color: var(--leaf);
}
.check input:checked::after {
  content: "";
  position: absolute;
  left: 3.5px; top: 1px;
  width: 4px; height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(42deg);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 22px;
}

.auth-link {
  font-size: 12px;
  color: var(--bone-dim);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(90, 162, 208, 0.45);
  text-underline-offset: 4px;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}
.auth-link:hover { color: var(--ember); text-decoration-color: var(--ember); }

/* ---------- 提示 ---------- */
.auth-hint {
  margin: 4px 0 20px;
  padding: 12px 14px;
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--bone-dim);
  background: rgba(156, 200, 232, 0.14);
  border-left: 2px solid rgba(156, 200, 232, 0.9);
}
.auth-hint b {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #2f7fa6;
  margin-bottom: 3px;
}

/* ---------- 按钮 ---------- */
.auth-submit {
  width: 100%;
  justify-content: space-between;
  margin-top: 4px;
}
.auth-submit[disabled] { opacity: 0.6; pointer-events: none; }

.auth-switch {
  margin: 18px 0 0;
  font-size: 12px;
  color: var(--bone-dim);
  text-align: center;
}
.auth-switch .auth-link { margin-left: 4px; }

/* ---------- 审核中 ---------- */
.auth-pending {
  text-align: center;
  padding: 10px 0 4px;
}
/* 成功图标：圆圈先画出来，对勾随后勾上 */
.auth-pending__mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  animation: markPop 0.5s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.auth-pending__mark svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.mark__ring {
  fill: none;
  stroke: var(--leaf);
  stroke-width: 1.6;
  stroke-dasharray: 145;
  stroke-dashoffset: 145;
  transform-origin: 28px 28px;
  animation: drawRing 0.75s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.mark__check {
  fill: none;
  stroke: #2f6b86;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 38;
  stroke-dashoffset: 38;
  animation: drawCheck 0.42s 0.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes drawRing {
  to { stroke-dashoffset: 0; }
}
@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}
@keyframes markPop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-pending__mark { animation: none; }
  .mark__ring, .mark__check { animation: none; stroke-dashoffset: 0; }
}
.auth-pending__title {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 600;
}
.auth-pending__text {
  margin: 0 0 22px;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--bone-dim);
}
.auth-pending__text b { color: var(--bone); font-weight: 600; }
.auth-pending__btn { width: 100%; justify-content: center; }

/* ---------- 底部状态 ---------- */
.auth-status {
  margin: 16px 0 0;
  min-height: 16px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--bone-dim);
  text-align: center;
}
.auth-status.is-ok { color: #2f6b86; }
.auth-status.is-warn { color: #bf6b2c; }

.auth-foot {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--bone-dim);
  opacity: 0.8;
}

/* ---------- 移动端 ---------- */
@media (max-width: 560px) {
  .auth-wrap { padding-top: 92px; justify-content: flex-start; }
  .auth-card { padding: 22px 18px; }
  .auth-title { margin-bottom: 18px; }
  .auth-tabs { margin-bottom: 22px; }
  .auth-foot { display: none; }
}

/* ---------- 成功徽章：胶囊平滑收成蓝圆 + 白圈白勾 ---------- */
.auth-submit {
  position: relative;
  transition:
    width 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    min-width 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    height 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    padding 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    border-radius 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    background-color 0.4s ease,
    box-shadow 0.55s ease,
    transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.auth-submit.is-orb {
  display: flex;          /* inline-flex 下 margin:auto 不生效，必须块级 */
  align-items: center;
  justify-content: center;
  width: 58px;
  min-width: 58px;
  height: 58px;
  padding: 0;
  margin: 8px auto 0;
  border-color: transparent;
  border-radius: 50%;
  background: #4a8fc7;
  box-shadow:
    0 14px 28px -16px rgba(47, 107, 134, 0.9),
    0 0 0 7px rgba(74, 143, 199, 0.10);
  pointer-events: none;
}

/* 文字淡出，不参与布局，让圆能收到 58px */
.auth-submit.is-orb span,
.auth-submit.is-orb i {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.orb-svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  opacity: 0;
  overflow: visible;
  transition: opacity 0.25s ease 0.22s;
}
.auth-submit.is-orb .orb-svg { opacity: 1; }

.orb-ring {
  fill: none;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.8;
  stroke-dasharray: 107;
  stroke-dashoffset: 107;
}
.orb-check {
  fill: none;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
}
.auth-submit.is-orb .orb-ring {
  animation: orbDraw 0.45s 0.42s ease forwards;
}
.auth-submit.is-orb .orb-check {
  animation: orbDraw 0.3s 0.72s ease forwards;
}

@keyframes orbDraw {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-submit { transition: none; }
  .auth-submit.is-orb .orb-ring,
  .auth-submit.is-orb .orb-check { animation: none; stroke-dashoffset: 0; }
  .orb-svg { transition: none; }
}

/* ---------- 登录方式切换 ---------- */
.auth-modes {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  padding: 3px;
  background: rgba(30, 51, 72, 0.05);
  border-radius: 999px;
}
.auth-mode {
  flex: 1;
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  color: var(--bone-dim);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.auth-mode:hover { color: var(--bone); }
.auth-mode.is-on {
  color: var(--bone);
  background: #ffffff;
  box-shadow: 0 6px 16px -12px rgba(30, 51, 72, 0.8);
}

/* 登录页标题：日期为主，星期为辅 */
.auth-title__date { letter-spacing: -0.02em; }
.auth-title__week {
  margin-left: 10px;
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--bone-dim);
  vertical-align: 0.35em;
}