/* ============================================================
   FormatLab - Auth Pages (Login/Register/Forgot/Reset)
   匹配 portal 设计系统 v2.1：品牌蓝 #1E6BB8、纯白浅灰、克制阴影
   ============================================================ */

/* ---- 页面基础 ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #000000;
}

/* ---- Header（匹配 portal nav 风格） ---- */
.auth-page .header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.auth-page .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
}

.auth-page .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #000000;
}

.auth-page .logo img {
  height: 32px;
  width: auto;
}

.auth-page .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-page .header-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.auth-page .header-btn.register-btn {
  color: #1E6BB8;
  border: 1.5px solid #1E6BB8;
}
.auth-page .header-btn.register-btn:hover {
  background: #EFF6FF;
}

.auth-page .header-btn.login-btn {
  background: #1E6BB8;
  color: #fff;
}
.auth-page .header-btn.login-btn:hover {
  background: #155A9E;
}

/* ---- Main ---- */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-container {
  display: flex;
  gap: 56px;
  max-width: 1060px;
  width: 100%;
  align-items: center;
}

/* ---- 左侧卡片 ---- */
.auth-card {
  flex: 1;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.06);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-header .brand-mark {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #1E6BB8, #3B82F6);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.auth-header .brand-mark svg {
  width: 24px;
  height: 24px;
  color: #fff;
}

.auth-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #000000;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.subtitle-text {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* ---- 表单 ---- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-input {
  padding: 13px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: #000000;
  transition: all 0.2s;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: #1E6BB8;
  box-shadow: 0 0 0 3px rgba(30,107,184,0.10);
}

.form-input::placeholder { color: #9ca3af; }

.password-group { position: relative; }
.password-input { padding-right: 48px; }

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #9ca3af;
  padding: 6px;
  transition: color 0.2s;
  border-radius: 50%;
  line-height: 1;
}
.password-toggle:hover { color: #1E6BB8; }

/* ---- 表单选项 ---- */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.form-options .checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #4b5563;
  cursor: pointer;
}

.form-options .checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1E6BB8;
  cursor: pointer;
}

.forgot-link {
  font-size: 14px;
  color: #1E6BB8;
  text-decoration: none;
  font-weight: 500;
}
.forgot-link:hover { color: #155A9E; }

/* ---- 按钮 ---- */
.auth-card .btn {
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.auth-card .btn.primary {
  background: #1E6BB8;
  color: #fff;
}
.auth-card .btn.primary:hover {
  background: #155A9E;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30,107,184,0.25);
}

.auth-card .full-width { width: 100%; }

/* ---- 分隔线 ---- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: #9ca3af;
  font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* ---- 微信扫码 ---- */
.wechat-login-area { position: relative; }

.wechat-qrcode-container {
  text-align: center;
  position: relative;
}

.qrcode-img {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  min-width: 180px;
  min-height: 180px;
}

.qrcode-tip {
  font-size: 13px;
  color: #6b7280;
  margin: 10px 0 4px;
}

.qrcode-status {
  font-size: 13px;
  font-weight: 500;
  margin: 4px 0;
  min-height: 20px;
}

.qrcode-countdown {
  font-size: 12px;
  color: #6b7280;
  margin: 4px 0 0;
}

.btn-refresh-qrcode {
  margin-top: 8px;
  padding: 7px 18px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-refresh-qrcode:hover {
  border-color: #1E6BB8;
  color: #1E6BB8;
  background: #EFF6FF;
}

.btn-recheck-qrcode {
  margin-top: 8px;
  padding: 10px 18px;
  border: 1.5px solid #07c160;
  border-radius: 8px;
  background: #f0fdf4;
  color: #059669;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  min-height: 42px;
}
.btn-recheck-qrcode:hover {
  background: #07c160;
  color: #fff;
}
.btn-recheck-qrcode:disabled {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
}

.wechat-btn {
  width: 100%;
  padding: 12px;
  border: 1.5px solid #07c160;
  border-radius: 10px;
  background: #fff;
  color: #07c160;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.wechat-btn:hover {
  background: #f0fdf4;
  border-color: #05a650;
}

.wechat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #07c160;
  color: #fff;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 700;
}

/* ---- 社交登录通用 ---- */
.social-btn {
  flex: 1;
  padding: 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #4b5563;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
}
.social-btn:hover {
  border-color: #1E6BB8;
  color: #1E6BB8;
  background: #EFF6FF;
}
.social-icon { font-size: 18px; font-weight: 700; }

/* ---- 消息提示 ---- */
.message-box {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-top: 14px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message-box.success {
  background: #f0fdf4;
  color: #059669;
  border: 1px solid #bbf7d0;
}
.message-box.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}
.message-box.info {
  background: #EFF6FF;
  color: #1E6BB8;
  border: 1px solid #bfdbfe;
}

/* ---- 动画区域（右侧） ---- */
.auth-animation {
  flex: 1;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8fafc 0%, #EFF6FF 50%, #f8fafc 100%);
  border-radius: 20px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.04);
}

.auth-animation::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, transparent 70%);
  animation: shimmer 10s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50%      { transform: translate(5%, 5%) rotate(180deg); }
}

.animation-container {
  position: relative;
  width: 100%;
  height: 300px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 20px;
  padding-bottom: 40px;
}

/* ---- 角色（保留 JS 兼容，视觉软化） ---- */
.character {
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  flex-shrink: 0;
}
.character:hover {
  transform: translateY(-10px) scale(1.06);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.orange-character {
  width: 110px; height: 110px;
  background: linear-gradient(145deg, #93c5fd 0%, #3b82f6 50%, #2563eb 100%);
  border-radius: 50%;
  z-index: 3;
  animation: float-orange 2.5s ease-in-out infinite;
}
@keyframes float-orange {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-18px) rotate(-3deg); }
}
.orange-character::before {
  content: '';
  position: absolute;
  top: -10px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 16px;
  background: #86efac;
  border-radius: 50% 50% 0 0;
}

.purple-character {
  width: 100px; height: 130px;
  background: linear-gradient(145deg, #a5b4fc 0%, #818cf8 50%, #6366f1 100%);
  z-index: 2;
  border-radius: 50px 50px 32px 32px;
  animation: float-purple 3s ease-in-out infinite;
  animation-delay: 0.3s;
}
@keyframes float-purple {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-22px) rotate(2deg); }
}
.purple-character::before {
  content: '';
  position: absolute;
  top: -12px; left: 50%; transform: translateX(-50%);
  width: 30px; height: 16px;
  background: #86efac;
  border-radius: 50%;
}

.black-character {
  width: 90px; height: 120px;
  background: linear-gradient(145deg, #6b7280 0%, #4b5563 50%, #374151 100%);
  z-index: 3;
  border-radius: 45px 45px 36px 36px;
  animation: float-black 2.8s ease-in-out infinite;
  animation-delay: 0.6s;
}
@keyframes float-black {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-16px) rotate(-2deg); }
}
.black-character::before,
.black-character::after {
  content: '';
  position: absolute;
  top: -14px;
  width: 22px; height: 26px;
  background: linear-gradient(145deg, #6b7280 0%, #4b5563 100%);
  border-radius: 50% 50% 0 0;
}
.black-character::before { left: 10px; transform: rotate(-12deg); }
.black-character::after  { right: 10px; transform: rotate(12deg); }

.yellow-character {
  width: 90px; height: 100px;
  background: linear-gradient(145deg, #fde047 0%, #facc15 50%, #eab308 100%);
  z-index: 2;
  border-radius: 50% 50% 42% 42%;
  animation: float-yellow 2.6s ease-in-out infinite;
  animation-delay: 0.9s;
}
@keyframes float-yellow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-18px) rotate(3deg); }
}
.yellow-character::before {
  content: '';
  position: absolute;
  top: -4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 20px;
  background: #86efac;
  border-radius: 0 0 4px 4px;
}

/* Eyes */
.eye {
  position: absolute;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  top: 32px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  animation: blink 4s infinite;
}
@keyframes blink {
  0%, 45%, 55%, 100% { transform: scaleY(1); }
  50%                { transform: scaleY(0.1); }
}
.eye::after {
  content: '';
  position: absolute;
  width: 10px; height: 10px;
  background: #1a1a2e;
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.orange-character .eye { top: 34px; }
.orange-character .left-eye { left: 20px; }
.orange-character .right-eye { right: 20px; }

.purple-character .eye { top: 40px; }
.purple-character .left-eye { left: 20px; }
.purple-character .right-eye { right: 20px; }

.black-character .eye { top: 38px; }
.black-character .left-eye { left: 16px; }
.black-character .right-eye { right: 16px; }

.yellow-character .eye { top: 30px; }
.yellow-character .left-eye { left: 18px; }
.yellow-character .right-eye { right: 18px; }

/* Mouth */
.mouth {
  position: absolute;
  width: 24px; height: 12px;
  border-radius: 0 0 12px 12px;
  background: #1a1a2e;
  top: 60px; left: 50%;
  transform: translateX(-50%);
  transition: all 0.3s ease;
}
.orange-character .mouth { top: 64px; }
.purple-character .mouth { top: 70px; }
.black-character .mouth { top: 66px; }
.yellow-character .mouth { top: 58px; }

/* Cheeks */
.character::after {
  content: '';
  position: absolute;
  width: 16px; height: 10px;
  background: rgba(255, 100, 100, 0.3);
  border-radius: 50%;
  top: 48px;
}
.orange-character::after {
  left: 14px;
  box-shadow: 66px 0 0 rgba(255, 100, 100, 0.3);
}
.purple-character::after {
  left: 14px;
  box-shadow: 64px 0 0 rgba(255, 100, 100, 0.3);
  top: 54px;
}
.black-character::after {
  left: 12px;
  box-shadow: 60px 0 0 rgba(255, 100, 100, 0.3);
  top: 52px;
}
.yellow-character::after {
  left: 12px;
  box-shadow: 56px 0 0 rgba(255, 100, 100, 0.3);
  top: 44px;
}

/* JS-driven focus states (login.js 依赖这些类名和选择器) */
.username-focus .orange-character {
  transform: translateX(-45px) translateY(-55px) scale(1.2) rotate(-10deg);
}
.username-focus .purple-character {
  transform: translateY(-70px) rotate(-15deg) scale(1.15);
}
.password-focus .black-character {
  transform: translateX(45px) translateY(-25px) rotate(28deg) scale(0.88);
}
.password-focus .black-character .eye {
  height: 3px;
  border-radius: 0;
  animation: none;
}
.password-focus .black-character .eye::after {
  display: none;
}
.password-focus .yellow-character {
  transform: translateX(35px) translateY(-45px) rotate(-22deg) scale(1.12);
}
.password-focus .yellow-character .eye {
  height: 3px;
  border-radius: 0;
  animation: none;
}
.password-focus .yellow-character .eye::after {
  display: none;
}

.typing-happy .mouth {
  width: 32px;
  height: 16px;
  border-radius: 0 0 16px 16px;
}
.typing-happy .character {
  animation: bounce 0.5s ease;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-20px); }
}

.character.clicked {
  animation: wiggle 0.6s ease;
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg) scale(1.08); }
  25%      { transform: rotate(-12deg) scale(1.12); }
  75%      { transform: rotate(12deg) scale(1.12); }
}

/* ---- Footer ---- */
.auth-footer {
  padding: 20px 24px;
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: #fff;
}
.auth-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.auth-footer a {
  color: #6b7280;
  text-decoration: none;
  font-size: 13px;
}
.auth-footer a:hover { color: #1E6BB8; }

/* ---- 邮箱验证码 ---- */
.email-row { position: relative; }
.email-input { padding-right: 110px !important; }

.send-code-btn {
  position: absolute;
  right: 4px; top: 4px; bottom: 4px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #1E6BB8;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  z-index: 2;
  height: calc(100% - 8px);
}
.send-code-btn:hover { background: #155A9E; }
.send-code-btn:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
}
.send-code-btn.counting {
  background: #e2e8f0;
  color: #64748b;
}

/* ---- 密码强度 ---- */
.password-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.strength-bar {
  flex: 1;
  height: 5px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  width: 0;
  transition: width 0.3s, background 0.3s;
}
.strength-fill.weak   { background: #ef4444; }
.strength-fill.medium { background: #f59e0b; }
.strength-fill.strong { background: #10b981; }
.strength-text {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

/* ---- 链接 ---- */
.link {
  color: #1E6BB8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.link:hover { color: #155A9E; }

/* ---- 加载动画 ---- */
.loading-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 隐藏 ---- */
.hidden { display: none !important; }

/* ---- 提示文字 ---- */
.input-hint, .input-status {
  font-size: 13px;
  margin: 0;
}
.input-hint { color: #9ca3af; }
.input-status.success { color: #10b981; }
.input-status.error   { color: #ef4444; }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .auth-container {
    flex-direction: column;
    gap: 24px;
  }
  .auth-animation {
    min-height: 240px;
    width: 100%;
    order: -1;
    padding: 24px;
    border-radius: 14px;
  }
  .animation-container {
    height: 180px;
    gap: 14px;
    padding-bottom: 24px;
  }
  .orange-character { width: 70px; height: 70px; }
  .purple-character { width: 60px; height: 80px; }
  .black-character  { width: 55px; height: 75px; }
  .yellow-character { width: 55px; height: 65px; }

  .orange-character .eye,
  .purple-character .eye,
  .black-character .eye,
  .yellow-character .eye {
    width: 14px; height: 14px;
  }
  .orange-character .eye::after,
  .purple-character .eye::after,
  .black-character .eye::after,
  .yellow-character .eye::after {
    width: 8px; height: 8px;
  }
  .mouth { width: 18px; height: 9px; }

  .auth-card { padding: 28px 22px; max-width: 100%; }
  .auth-header h2 { font-size: 20px; }
}

@media (max-width: 480px) {
  .auth-main { padding: 16px; }
  .auth-card { padding: 24px 18px; }
  .auth-page .header-inner { padding: 0 16px; }
  .auth-footer-inner { flex-direction: column; gap: 6px; }
}
