/* ===== 认证页（登录/注册）布局 ===== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #EEF2FF 0%, #F4F6FF 40%, #FAFBFF 70%, #FFFFFF 100%);
}

.auth-inner {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ===== 背景气泡装饰 ===== */
.bg-bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-bubble {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .5;
}

.bubble-1 {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -60px;
  background: radial-gradient(circle, rgba(108,99,255,.25), transparent 70%);
}

.bubble-2 {
  width: 240px;
  height: 240px;
  bottom: -60px;
  left: -50px;
  background: radial-gradient(circle, rgba(255,138,101,.22), transparent 70%);
}

.bubble-3 {
  width: 200px;
  height: 200px;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(94,231,223,.18), transparent 70%);
}

/* ===== 合并后的认证卡片（banner + 表单 一体） ===== */
.auth-card {
  overflow: hidden;
  padding: 0;
  gap: 0;
}

/* 渐变头部（原 banner 合并进卡片顶部） */
.auth-card-banner {
  padding: 28px 24px 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--tab-chat-2) 60%, var(--warm));
  position: relative;
  overflow: hidden;
  text-align: center;
}

.auth-card-banner::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(255,255,255,.25), transparent 70%);
  border-radius: 50%;
}

.banner-decor {
  position: absolute;
  left: -30px;
  bottom: -50px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255,255,255,.15), transparent 70%);
  border-radius: 50%;
}

.banner-content {
  position: relative;
  z-index: 1;
}

.banner-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 3px solid rgba(255,255,255,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.banner-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: .3px;
}

.banner-subtitle {
  font-size: 13px;
  opacity: .9;
  margin: 0;
}

/* 表单主体 */
.auth-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== 表单元素 ===== */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.input-wrap {
  position: relative;
}

.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.input-wrap .input-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-input,
.input-wrap input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--r);
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.6);
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  font-family: inherit;
  box-sizing: border-box;
}

.form-input::placeholder,
.input-wrap input::placeholder {
  color: var(--ink-3);
}

.form-input:focus,
.input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: rgba(255,255,255,.7);
}

/* 记住我 / 表单行 */
.form-row {
  flex-direction: row;
  align-items: center;
}

.checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid rgba(108,99,255,.3);
  background: rgba(255,255,255,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background .2s, border-color .2s;
}

.checkbox-box svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s, transform .15s;
}

.checkbox-input:checked + .checkbox-box {
  background: linear-gradient(135deg, var(--primary), var(--warm));
  border-color: transparent;
}

.checkbox-input:checked + .checkbox-box svg {
  opacity: 1;
  transform: scale(1);
}

.checkbox-label {
  font-size: 14px;
  color: var(--ink-2);
}

/* ===== 按钮修饰 ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 14px 20px;
  font-size: 15px;
}

/* ===== 分隔线与链接 ===== */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(110,140,255,.12);
}

.divider-text {
  font-size: 12px;
  color: var(--ink-3);
}

.auth-links {
  text-align: center;
}

.link-text {
  font-size: 14px;
  color: var(--ink-3);
  margin: 0;
}

.link-accent {
  color: var(--primary);
  font-weight: 600;
}

/* ===== 密码强度 ===== */
.pwd-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  height: 4px;
}

.pwd-strength span {
  flex: 1;
  background: rgba(110,140,255,.1);
  border-radius: 999px;
  transition: background .25s;
}

.pwd-strength[data-level="1"] span:nth-child(-n+1) { background: #F5576C; }
.pwd-strength[data-level="2"] span:nth-child(-n+2) { background: #FFB88C; }
.pwd-strength[data-level="3"] span:nth-child(-n+3) { background: #5EE7DF; }
.pwd-strength[data-level="4"] span:nth-child(-n+4) { background: #6C63FF; }

.pwd-hint {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 6px;
}

/* ===== 验证码 ===== */
.captcha-row {
  display: flex;
  gap: 10px;
}

.captcha-row .input-wrap {
  flex: 1;
}

.captcha-btn {
  padding: 12px 16px;
  border-radius: var(--r);
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(255,255,255,.6);
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  min-width: 110px;
  transition: .2s;
  font-family: inherit;
}

.captcha-btn:disabled {
  color: var(--ink-3);
  cursor: not-allowed;
  opacity: .7;
}

/* ===== 协议勾选 ===== */
.auth-agree {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.auth-agree input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--primary);
}

.auth-agree a {
  color: var(--primary);
  text-decoration: none;
}

/* ===== 备用提交按钮与页脚（兼容旧引用） ===== */
.auth-submit {
  width: 100%;
  padding: 14px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 600;
  border: none;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--warm));
  box-shadow: var(--shadow-primary);
  cursor: pointer;
  transition: transform .18s var(--ease);
}

.auth-submit:active {
  transform: scale(0.98);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-3);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

/* ===== 关闭按钮 ===== */
.auth-close-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: var(--shadow-float);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  z-index: 100;
  transition: transform .18s var(--ease), background .2s, color .2s;
  text-decoration: none;
}

.auth-close-btn:active {
  transform: scale(0.92);
  background: rgba(245,87,108,.12);
  color: var(--warm);
}

.auth-close-btn svg {
  stroke: currentColor;
  fill: none;
}

/* ===== 密码小眼睛 ===== */
.input-wrap-pwd {
  position: relative;
}

.input-wrap-pwd input {
  padding-right: 44px;
}

.pwd-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: color .2s, background .2s;
}

.pwd-toggle:active {
  background: rgba(108,99,255,.1);
}

.pwd-toggle.is-visible {
  color: var(--primary);
}

.pwd-eye-icon {
  display: none;
  stroke: currentColor;
  fill: none;
}

.pwd-toggle .pwd-eye-show {
  display: block;
}

.pwd-toggle .pwd-eye-hide {
  display: none;
}

.pwd-toggle.is-visible .pwd-eye-show {
  display: none;
}

.pwd-toggle.is-visible .pwd-eye-hide {
  display: block;
}

/* ===== toast 容器 ===== */
.toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

/* ===== 响应式 ===== */
@media (max-width: 360px) {
  .auth-wrap { padding: 16px; }
  .auth-card-banner { padding: 22px 18px 18px; }
  .banner-title { font-size: 20px; }
  .auth-card-body { padding: 18px; }
  .form-input, .input-wrap input { font-size: 14px; padding: 11px 14px; }
}
