/* ==========================================================================
   登录页样式
   说明：index.html 专用，依赖 base.css
   ========================================================================== */

/* ----- 登录页 body（覆盖 base 的最小 body 样式） ----- */
body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f7fb;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.10), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(37, 99, 235, 0.08), transparent 45%);
  overflow: hidden;
  position: relative;
}

/* ==========================================================================
   背景装饰光斑
   ========================================================================== */
.bg-shapes {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    rgba(59, 130, 246, 0.20),
    transparent 70%);
  filter: blur(12px);
  animation: float 10s ease-in-out infinite;
}

.shape-1 {
  width: 360px;
  height: 360px;
  top: -100px;
  left: -100px;
}

.shape-2 {
  width: 280px;
  height: 280px;
  bottom: -80px;
  right: -60px;
  animation-delay: 3s;
  background: radial-gradient(circle at 30% 30%,
    rgba(37, 99, 235, 0.18),
    transparent 70%);
}

.shape-3 {
  width: 200px;
  height: 200px;
  top: 45%;
  right: 8%;
  animation-delay: 5s;
  background: radial-gradient(circle at 30% 30%,
    rgba(96, 165, 250, 0.18),
    transparent 70%);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-20px); }
}

/* ==========================================================================
   登录容器 / 卡片
   ========================================================================== */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e8ecf4;
  padding: 44px 36px 32px;
  border-radius: 16px;
  box-shadow:
    0 8px 40px rgba(30, 41, 59, 0.08),
    0 2px 8px rgba(30, 41, 59, 0.04);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

/* 卡片顶部高光线条 */
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb 0%, #3b82f6 50%, #2563eb 100%);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ----- 头部 ----- */
.card-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.30);
  margin-bottom: 4px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a1f3a;
  letter-spacing: 0.5px;
}

.login-subtitle {
  font-size: 14px;
  color: #8b92b0;
}

/* ==========================================================================
   表单项
   ========================================================================== */
.form-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-item label {
  font-size: 13px;
  font-weight: 600;
  color: #555a72;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  color: #aab0c8;
  pointer-events: none;
  transition: color 0.2s;
}

.input-wrap input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 40px;
  font-size: 14px;
  color: #1a1f3a;
  background: #f4f6fb;
  border: 1.5px solid #e3e7f2;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-wrap input::placeholder {
  color: #aab0c8;
}

.input-wrap input:focus {
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.input-wrap input:focus + .input-icon,
.input-wrap input:focus ~ .input-icon {
  color: #2563eb;
}

/* 密码可见切换 */
.toggle-pwd {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #aab0c8;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.toggle-pwd:hover {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

/* 校验失败 */
.form-item input.invalid {
  border-color: #e74c3c;
  background: #fff5f5;
}

.form-item input.invalid + .input-icon {
  color: #e74c3c;
}

.error-text {
  font-size: 12px;
  color: #e74c3c;
  min-height: 14px;
}

/* ==========================================================================
   记住我
   ========================================================================== */
.form-options {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 13px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #666b85;
  user-select: none;
}

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

.checkmark {
  width: 16px;
  height: 16px;
  border: 1.5px solid #d0d5e6;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.checkmark::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s;
}

.checkbox input:checked + .checkmark {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  border-color: transparent;
}

.checkbox input:checked + .checkmark::after {
  transform: rotate(45deg) scale(1);
}

/* ==========================================================================
   登录按钮
   ========================================================================== */
.login-btn {
  height: 48px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
  margin-top: 4px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.30);
}

.login-btn:hover {
  opacity: 0.93;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.38);
}

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

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

/* 加载旋转 */
.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ==========================================================================
   全局提示
   ========================================================================== */
.login-message {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  min-height: 18px;
}

.login-message.success {
  color: #27ae60;
}

.login-message.fail {
  color: #e74c3c;
}

/* ==========================================================================
   演示提示
   ========================================================================== */
.demo-tip {
  text-align: center;
  font-size: 12px;
  color: #8b92b0;
  padding: 8px;
  background: #f4f6fb;
  border-radius: 8px;
  border: 1px dashed #e3e7f2;
}

.demo-tip b {
  color: #7c3aed;
  font-weight: 600;
}

/* ==========================================================================
   响应式（登录页）
   ========================================================================== */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px 24px;
  }

  .login-title {
    font-size: 22px;
  }
}
