/* ============================================================
   移动端 登录 / 注册 / 找回密码 统一风格（app 风格）
   依赖 m/static/css/style.css 的 :root 设计变量
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body.auth-body {
  font-family: var(--font-family, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif);
  background: var(--bg-page, #F4F7FC);
  color: var(--text-primary, #17191C);
  min-height: 100vh;
  width: 100%;
  max-width: none !important;
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.auth-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 22px calc(env(safe-area-inset-bottom, 0px) + 24px);
  max-width: 460px;
  margin: auto;
}

/* 顶部品牌区 */
.auth-header { text-align: center; margin-bottom: 22px; }
.auth-logo {
  width: 72px; height: 72px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--border-color, #E4ECF7);
  box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,.05));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.auth-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-title { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.auth-subtitle { margin-top: 6px; font-size: 13px; color: var(--text-tertiary, #878B94); }

/* 卡片 */
.auth-card {
  background: #fff;
  border-radius: var(--radius-xl, 16px);
  box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,.06));
  padding: 22px 18px;
}

/* 表单字段 */
.auth-field {
  display: flex; align-items: center;
  height: 50px;
  padding: 0 14px;
  margin-bottom: 14px;
  background: var(--bg-page, #F4F7FC);
  border: 1.5px solid transparent;
  border-radius: var(--radius-lg, 12px);
  transition: border-color .2s, background .2s;
}
.auth-field:focus-within {
  border-color: var(--primary, #1677FF);
  background: var(--primary-light, #E6F4FF);
}
.auth-field .ic {
  width: 22px; text-align: center;
  color: var(--text-tertiary, #878B94);
  font-size: 16px; transition: color .2s;
}
.auth-field:focus-within .ic { color: var(--primary, #1677FF); }
.auth-field input {
  flex: 1; min-width: 0;
  height: 100%;
  border: none; outline: none; background: transparent;
  padding: 0 10px;
  font-size: 15px; color: var(--text-primary, #17191C);
}
.auth-field input::placeholder { color: var(--text-quaternary, #C4C7CC); }

/* 验证码字段右侧：图形码 / 获取按钮 */
.auth-field.code { padding-right: 10px; }
.auth-captcha-img {
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #E4ECF7);
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .1s, border-color .2s;
}
.auth-captcha-img:active { transform: scale(.97); }
.auth-field .get-code {
  flex-shrink: 0;
  border: none; background: transparent;
  color: var(--primary, #1677FF);
  font-size: 13px; font-weight: 600;
  padding: 0 0 0 12px; margin-left: 4px;
  border-left: 1px solid var(--border-color, #E4ECF7);
  height: 30px; cursor: pointer; white-space: nowrap;
}
.auth-field .get-code:disabled { color: var(--text-quaternary, #C4C7CC); cursor: not-allowed; }

/* 主按钮 */
.auth-btn {
  width: 100%; height: 50px;
  border: none; border-radius: var(--radius-lg, 12px);
  background: var(--primary, #1677FF); color: #fff;
  font-size: 16px; font-weight: 600; letter-spacing: 2px;
  margin-top: 6px; cursor: pointer;
  transition: background .15s, transform .1s;
}
.auth-btn:active { background: var(--primary-active, #0958D9); transform: scale(.99); }

/* 行：记住密码 / 忘记密码 */
.auth-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2px 2px 14px; font-size: 13px; color: var(--text-secondary, #4A4C51);
}
.auth-link-sm { color: var(--primary, #1677FF); text-decoration: none; }

/* 自定义勾选 */
.auth-check {
  display: inline-flex; align-items: flex-start; cursor: pointer;
  gap: 7px; font-size: 13px; color: var(--text-secondary, #4A4C51); line-height: 1.5;
}
.auth-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.auth-check .box {
  flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px;
  border-radius: 5px; border: 1.5px solid var(--border-color, #E4ECF7);
  background: #fff; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.auth-check input:checked + .box { background: var(--primary, #1677FF); border-color: var(--primary, #1677FF); }
.auth-check input:checked + .box::after {
  content: ''; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg); margin-top: -2px;
}
.auth-check a { color: var(--primary, #1677FF); text-decoration: none; }
.auth-agree { display: flex; margin: 4px 2px 16px; }

/* 链接区 */
.auth-links { text-align: center; margin-top: 16px; font-size: 14px; }
.auth-links a { color: var(--primary, #1677FF); text-decoration: none; margin: 0 8px; }

/* 分割线 + 微信 */
.auth-divider {
  display: flex; align-items: center; margin: 22px 0 16px;
  color: var(--text-tertiary, #878B94); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-color, #E4ECF7);
}
.auth-divider span { padding: 0 12px; }
.auth-wechat-wrap { text-align: center; }
.auth-wechat {
  width: 48px; height: 48px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border-color, #E4ECF7);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.04));
  transition: transform .15s;
}
.auth-wechat:active { transform: scale(.95); }
.auth-wechat img { width: 26px; height: 26px; display: block; }

/* 版权 */
.auth-footer {
  margin-top: auto; padding-top: 22px; text-align: center;
  font-size: 11px; color: var(--text-quaternary, #C4C7CC); line-height: 1.7;
}
.auth-footer a { color: var(--text-quaternary, #C4C7CC); text-decoration: none; }

/* 协议弹窗 */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 9998;
}
.popup {
  display: none; position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 88%; max-width: 420px; height: 70vh;
  background: #fff; border-radius: var(--radius-xl, 16px);
  z-index: 9999; overflow: hidden;
}
.popup iframe { width: 100%; height: calc(70vh - 57px); border: 0; display: block; }
.auth-popup-bar { padding: 10px 16px; border-top: 1px solid var(--border-color, #E4ECF7); }
.auth-popup-bar .auth-btn { margin: 0; letter-spacing: 0; }

/* 轻提示 toast */
#toast-container {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  padding-top: calc(env(safe-area-inset-top, 0px) + 18px);
}
.toast {
  display: flex; align-items: center;
  max-width: 86%;
  margin-bottom: 10px;
  padding: 11px 18px;
  background: rgba(23, 25, 28, .92);
  color: #fff;
  font-size: 14px; line-height: 1.4;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  transform: translateY(-16px);
  opacity: 0;
  transition: transform .26s cubic-bezier(.21, 1.02, .73, 1), opacity .26s;
  backdrop-filter: blur(4px);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-ic {
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-right: 9px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: rgba(255, 255, 255, .22);
}
.toast-success { background: rgba(22, 119, 255, .95); }
.toast-success .toast-ic { background: rgba(255, 255, 255, .28); }
.toast-error { background: rgba(232, 65, 65, .95); }
.toast-error .toast-ic { background: rgba(255, 255, 255, .28); }
