/* 登录/注册页样式 — 2026-04-23 重写为新版（Vue v2）一致风格：浅色卡片 + 紫色主色 */

:root {
  --lf-primary: #6b5bff;
  --lf-primary-hover: #5a4be6;
  --lf-primary-dark: #4338ca;
  --lf-primary-soft: #eef2ff;
  --lf-primary-soft-hover: #e6ebff;
  --lf-text: #2b2f38;
  --lf-text-muted: #7a808c;
  --lf-text-strong: #111827;
  --lf-border: #e6e8ef;
  --lf-border-focus: #c7d2fe;
  --lf-bg: #f6f7fb;
  --lf-card: #ffffff;
  --lf-danger: #ef4444;
  --lf-success: #16a34a;
  --lf-shadow-sm: 0 2px 8px rgba(22, 28, 45, 0.04);
  --lf-shadow: 0 8px 24px rgba(22, 28, 45, 0.08);
  --lf-shadow-lg: 0 16px 40px rgba(22, 28, 45, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--lf-text);
  background: var(--lf-bg);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== 新版顶部导航条（对齐 frontend-v2/.lf-topbar） ===== */
.lf-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 66px;
  background: #ffffff;
  border-bottom: 1px solid var(--lf-border);
  box-shadow: 0 8px 24px rgba(22, 28, 45, 0.05);
  position: sticky;
  top: 0;
  z-index: 20;
}

.lf-topbar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
}

.lf-topbar__logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.lf-topbar__logo strong {
  color: #5366d9;
  letter-spacing: 0.2px;
}

.lf-topbar__nav {
  display: flex;
  gap: 34px;
  align-items: center;
  font-size: 16px;
}

.lf-topbar__nav a {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  text-decoration: none;
  color: #4b5563;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.lf-topbar__nav a:hover {
  color: var(--lf-primary-dark);
  background: #f5f7ff;
}

.lf-topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lf-pay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lf-pay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

/* ===== 登录主容器 ===== */
.login-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
  position: relative;
}

/* 背景装饰（浅色柔和，不再是深色渐变） */
.background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.gradient-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(139, 92, 246, 0.12), transparent 65%),
    radial-gradient(700px 400px at 15% 85%, rgba(99, 102, 241, 0.10), transparent 65%);
}

.floating-shapes {
  position: absolute;
  inset: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.6;
  animation: float 18s ease-in-out infinite;
}

.shape-1 {
  width: 280px;
  height: 280px;
  top: -60px;
  left: -60px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.45), transparent 70%);
}

.shape-2 {
  width: 220px;
  height: 220px;
  bottom: 12%;
  right: -40px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.40), transparent 70%);
  animation-delay: -6s;
}

.shape-3 {
  width: 180px;
  height: 180px;
  top: 40%;
  left: -30px;
  background: radial-gradient(circle, rgba(196, 181, 253, 0.35), transparent 70%);
  animation-delay: -12s;
}

.shape-4 {
  width: 140px;
  height: 140px;
  bottom: -30px;
  left: 45%;
  background: radial-gradient(circle, rgba(221, 214, 254, 0.30), transparent 70%);
  animation-delay: -3s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(18px, -22px) scale(1.05); }
  66% { transform: translate(-14px, 16px) scale(0.95); }
}

/* ===== 登录卡片 ===== */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--lf-card);
  border-radius: 18px;
  padding: 44px 40px 32px;
  box-shadow: var(--lf-shadow-lg);
  border: 1px solid var(--lf-border);
}

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

.logo {
  display: inline-flex;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border: 1px solid var(--lf-border);
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.header h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: var(--lf-text-strong);
  letter-spacing: 0.3px;
}

.header p {
  margin: 0;
  color: var(--lf-text-muted);
  font-size: 14px;
}

/* ===== 表单 ===== */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--lf-text);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--lf-border);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-wrapper:focus-within {
  border-color: var(--lf-primary);
  box-shadow: 0 0 0 4px rgba(107, 91, 255, 0.12);
}

.input-wrapper input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--lf-text);
  font-family: inherit;
}

.input-wrapper input::placeholder {
  color: #9aa2b1;
}

.input-wrapper .icon {
  padding: 0 12px;
  color: var(--lf-text-muted);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.toggle-password {
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--lf-text-muted);
  padding: 0 12px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.toggle-password:hover {
  color: var(--lf-primary);
}

.toggle-password svg {
  width: 20px;
  height: 20px;
}

/* 短信发送按钮 */
.invite-btn,
.sms-row .invite-btn {
  margin-right: 6px;
  padding: 0 14px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--lf-border-focus);
  background: var(--lf-primary-soft);
  color: var(--lf-primary-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.invite-btn:hover:not(:disabled) {
  background: var(--lf-primary-soft-hover);
}

.invite-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 错误提示 */
.error-message {
  font-size: 12px;
  color: var(--lf-danger);
  min-height: 16px;
  display: block;
}

/* 辅助链接：忘记密码 / 切换登录方式 */
.remember-me {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -4px;
}

.forgot-link {
  background: none;
  border: none;
  padding: 4px 0;
  color: var(--lf-primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.forgot-link:hover {
  color: var(--lf-primary-hover);
  text-decoration: underline;
}

/* ===== 主按钮（登录/注册） ===== */
.login-btn {
  position: relative;
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.45);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-btn .btn-text {
  position: relative;
  z-index: 1;
}

.login-btn .btn-loader {
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: -9px;
  margin-top: -9px;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  opacity: 0;
}

.login-btn.loading .btn-text {
  opacity: 0;
}

.login-btn.loading .btn-loader {
  opacity: 1;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 底部"还没账号？立即注册" / "返回登录" */
.login-extra-link,
.back-to-login {
  text-align: center;
  font-size: 14px;
  color: var(--lf-text-muted);
  margin-top: 4px;
}

.login-extra-link a,
.back-to-login a,
.register-link {
  color: var(--lf-primary);
  text-decoration: none;
  font-weight: 600;
  margin-left: 4px;
}

.login-extra-link a:hover,
.back-to-login a:hover {
  color: var(--lf-primary-hover);
  text-decoration: underline;
}

/* ===== 成功/失败提示 ===== */
.alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--lf-danger);
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--lf-success);
}

/* ===== 页脚 ===== */
.footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--lf-text-muted);
}

.footer a {
  color: var(--lf-primary);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ===== 右下 APP 下载悬浮卡片 ===== */
.auth-app-download {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #fff;
  border: 1px solid var(--lf-border);
  border-radius: 14px;
  padding: 14px 14px 10px;
  box-shadow: var(--lf-shadow);
  text-align: center;
  z-index: 10;
}

.auth-app-download__qr {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  display: block;
}

.auth-app-download__text {
  margin-top: 8px;
  font-size: 12px;
  color: var(--lf-text-muted);
}

/* ===== 自定义弹窗（.custom-modal-*，JS 动态创建） ===== */
.custom-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.custom-modal.show {
  display: flex;
}

.custom-modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 400px;
  width: calc(100% - 40px);
  padding: 28px 24px 20px;
  box-shadow: var(--lf-shadow-lg);
}

.custom-modal-message {
  font-size: 15px;
  color: var(--lf-text);
  line-height: 1.6;
  margin: 0 0 18px;
  word-break: break-word;
}

.custom-modal-btn {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.custom-modal-btn:hover {
  opacity: 0.92;
}

/* ===== 响应式 ===== */
@media (max-width: 720px) {
  .lf-topbar {
    padding: 0 14px;
    height: 58px;
  }

  .lf-topbar__nav {
    display: none;
  }

  .lf-topbar__logo strong {
    font-size: 16px;
  }

  .login-container {
    padding: 24px 16px 40px;
  }

  .login-card {
    padding: 32px 24px 24px;
  }

  .header h1 {
    font-size: 20px;
  }

  .auth-app-download {
    display: none;
  }
}
