/* ===================================================================
   登录页专用样式
   适用于登录页（原 login.html / login-password.html 两步设计）

   第三方资源与授权声明
   --------------------
   界面图标使用 Font Awesome Free 6.x（https://fontawesome.com）
     · 图标（Icons）：CC BY 4.0 —— 需署名
     · 字体（Fonts）：SIL OFL 1.1
     · 代码（CSS/JS）：MIT License
   署名位置：前台页脚「图标来自 Font Awesome Free（CC BY 4.0）」
   =================================================================== */

/* 登录页整体变量 */
:root {
  --login-bg: #0f1e28;
  --login-bg-2: #1a3a4a;
  --login-surface: #ffffff;
  --login-primary: #1a3a4a;
  --login-primary-light: #2b5568;
  --login-accent: #e67e22;
  --login-accent-soft: #fdf0e5;
  --login-text: #1a2933;
  --login-text-soft: #6b7f8c;
  --login-text-mute: #9aacb8;
  --login-border: #e8edf1;
  --login-border-soft: #f0f4f7;
  --login-danger: #e04a6e;
}

/* 页面容器：居中 + 深色背景 + 装饰 */
.login-page {
  min-height: 100vh;
  background: linear-gradient(150deg, var(--login-bg), var(--login-bg-2));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* 背景装饰圆 */
.login-page::before {
  content: '';
  position: absolute;
  top: -180px;
  left: -180px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230,126,34,0.15), transparent 65%);
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -200px;
  right: -160px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43,85,104,0.35), transparent 65%);
  pointer-events: none;
}

/* 登录卡片 */
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--login-surface);
  border-radius: 20px;
  padding: 40px 36px 36px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 1;
}

/* 顶部 Logo */
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--login-primary);
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  text-decoration: none;
}

.login-logo .logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--login-primary), var(--login-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.05rem;
}

/* 标题 */
.login-title {
  text-align: center;
  margin-bottom: 26px;
}

.login-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--login-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.login-title p {
  font-size: 0.88rem;
  color: var(--login-text-soft);
  line-height: 1.5;
}

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

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

.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--login-text);
  letter-spacing: 0.01em;
}

/* 输入框带图标的容器 */
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .input-icon {
  position: absolute;
  left: 16px;
  color: var(--login-text-mute);
  font-size: 0.95rem;
  pointer-events: none;
  transition: color 0.18s;
}

.input-wrap input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 46px;
  border-radius: 12px;
  border: 1.5px solid var(--login-border);
  background: #fafbfc;
  font-size: 0.95rem;
  color: var(--login-text);
  outline: none;
  transition: all 0.18s;
  font-family: inherit;
}

.input-wrap input::placeholder { color: var(--login-text-mute); }

.input-wrap input:focus {
  border-color: var(--login-primary-light);
  background: white;
  box-shadow: 0 0 0 4px rgba(43, 85, 104, 0.08);
}

.input-wrap input:focus + .input-icon,
.input-wrap:focus-within .input-icon {
  color: var(--login-primary);
}

/* 密码框右侧的显示/隐藏按钮 */
.input-wrap .toggle-pw {
  position: absolute;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--login-text-mute);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  font-size: 0.9rem;
}

.input-wrap .toggle-pw:hover { color: var(--login-primary); background: var(--login-border-soft); }

/* 主按钮 */
.login-btn {
  height: 50px;
  border-radius: 12px;
  border: none;
  background: var(--login-primary);
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.login-btn:hover { background: var(--login-primary-light); transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(26, 58, 74, 0.5); }
.login-btn:active { transform: translateY(0); }

.login-btn i { font-size: 0.9rem; }

/* 次级链接（返回 / 忘记密码） */
.login-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 0.82rem;
}

.login-links a {
  color: var(--login-text-soft);
  text-decoration: none;
  transition: color 0.18s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.login-links a:hover { color: var(--login-accent); }

/* 第二步显示的用户名条 */
.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--login-border-soft);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.user-chip .chip-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f3d9bd, #e0b58a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #4a3520;
  flex-shrink: 0;
}

.user-chip .chip-info { flex: 1; min-width: 0; }

.user-chip .chip-label {
  font-size: 0.72rem;
  color: var(--login-text-mute);
  margin-bottom: 2px;
}

.user-chip .chip-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--login-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip .chip-switch {
  font-size: 0.78rem;
  color: var(--login-primary);
  text-decoration: none;
  background: white;
  border: 1px solid var(--login-border);
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.18s;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.user-chip .chip-switch:hover { background: var(--login-primary); color: white; border-color: var(--login-primary); }

/* 错误提示 */
.form-error {
  background: #fef2f5;
  border: 1px solid #fad5de;
  color: var(--login-danger);
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.form-error i { font-size: 0.85rem; }

/* 顶部步骤指示（可选） */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--login-border);
  transition: all 0.25s;
}

.step-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--login-accent);
}

.step-dot.done { background: var(--login-primary); }

/* 页脚小字 */
.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.78rem;
  color: var(--login-text-mute);
}

.login-footer a { color: var(--login-text-soft); text-decoration: none; }
.login-footer a:hover { color: var(--login-accent); }

/* 加载状态（可选） */
.login-btn.loading {
  pointer-events: none;
  opacity: 0.85;
}

.login-btn.loading i {
  animation: spin 0.8s linear infinite;
}

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

/* ===================================================================
   响应式
   =================================================================== */
@media (max-width: 480px) {
  .login-card { padding: 32px 24px 28px; }
  .login-title h1 { font-size: 1.2rem; }
}

/* ===================================================================
   提示条（例如「你已安全退出」，配合 PHP 版登录页使用）
   =================================================================== */
.form-info {
  background: #eef7f1;
  border: 1px solid #cde9d8;
  color: #1e7f49;
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.form-info i { font-size: 0.85rem; }