/* 绪光AI登录页面 - 明亮蓝紫主题 */
:root {
  /* 明亮蓝紫主色调 */
  --primary: #7C9CF5;
  --primary-light: #A3B9F7;
  --primary-dark: #5A7FDB;
  --primary-muted: #C5D6F9;
  
  /* 淡薰衣草紫 */
  --secondary: #B8A5E8;
  --secondary-light: #D4C8F2;
  --accent: #7C9CF5;
  --accent-soft: #E8E4F7;
  
  /* 明亮浅色调 */
  --bg-dark: #F5F3FA;
  --bg-deep: #EAE7F2;
  --bg-card: #FFFFFF;
  --bg-card-light: #F8F6FC;
  --bg-card-hover: #F0EDFA;
  --bg-input: #F8F6FC;
  
  /* 文字颜色 */
  --text-primary: #2D2A4A;
  --text-secondary: #5A5678;
  --text-muted: #8B87A0;
  --text-placeholder: #A9A5BC;
  --border: #E8E4F2;
  
  /* 状态颜色 */
  --success: #7C9CF5;
  --warning: #E5B567;
  --danger: #E57CA5;
  
  /* 渐变 */
  --gradient-primary: linear-gradient(135deg, #7C9CF5 0%, #B8A5E8 100%);
  --gradient-soft: linear-gradient(135deg, #A3B9F7 0%, #D4C8F2 100%);
  --gradient-card: linear-gradient(145deg, #FFFFFF 0%, #F8F6FC 100%);
  --gradient-glow: linear-gradient(135deg, rgba(124, 156, 245, 0.15) 0%, rgba(184, 165, 232, 0.15) 100%);
  
  /* 阴影 */
  --shadow-glow: 0 0 40px rgba(124, 156, 245, 0.2);
  --shadow-glow-strong: 0 0 60px rgba(124, 156, 245, 0.35);
  --shadow-card: 0 20px 60px rgba(45, 42, 74, 0.08);
  --shadow-input: 0 4px 16px rgba(124, 156, 245, 0.08);
  
  /* 圆角 */
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  
  /* 过渡 */
  --transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans SC', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  padding: 24px 16px;
}

/* Animated Background */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at 30% 20%, rgba(124, 156, 245, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(184, 165, 232, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(163, 185, 247, 0.06) 0%, transparent 60%);
}

.bg-shapes {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

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

.shape-1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #A3B9F7 0%, #7C9CF5 100%);
  top: -20%;
  left: -10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #D4C8F2 0%, #B8A5E8 100%);
  bottom: -15%;
  right: -5%;
  animation-delay: -8s;
}

.shape-3 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, #C5D6F9 0%, #A3B9F7 100%);
  top: 30%;
  left: 20%;
  animation-delay: -16s;
}

.shape-4 {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #E8E4F7 0%, #D4C8F2 100%);
  top: 15%;
  right: 25%;
  animation-delay: -12s;
  opacity: 0.3;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.02); }
}

/* Login Container */
.login-container {
  width: min(92vw, 900px);
  max-width: 100%;
  display: flex;
  align-items: stretch;
  gap: 40px;
  margin: auto;
}

/* Brand Section */
.login-brand {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 280px;
}

.brand-content {
  text-align: center;
  padding: 40px;
}

.logo-icon {
  width: 90px;
  height: 90px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: var(--shadow-glow);
  animation: pulse 3s ease-in-out infinite;
}

.logo-icon svg {
  width: 50px;
  height: 50px;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 40px rgba(124, 156, 245, 0.3); }
  50% { box-shadow: 0 0 60px rgba(124, 156, 245, 0.5); }
}

.logo-text {
  font-size: 42px;
  font-weight: 700;
  font-family: 'ZCOOL XiaoWei', serif;
  background: linear-gradient(135deg, #2D2A4A 0%, #7C9CF5 50%, #B8A5E8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.logo-subtitle {
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 24px;
}

.brand-divider {
  width: 60px;
  height: 2px;
  background: var(--gradient-soft);
  margin: 0 auto 24px;
  border-radius: 1px;
}

.brand-desc {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

/* Login Card */
.login-card {
  flex: 1;
  background: var(--gradient-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 320px;
  max-width: 420px;
}

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

.card-header h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.card-header p {
  color: var(--text-muted);
  font-size: 15px;
}

/* Form */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

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

.input-icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
  transition: var(--transition);
}

.form-input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: var(--shadow-input);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--primary-light);
}

.form-input::placeholder {
  color: var(--text-placeholder);
}

.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

.eye-icon {
  width: 20px;
  height: 20px;
}

/* Remember & Forgot */
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.remember-me input {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  background: var(--bg-input);
}

.remember-me input:checked + .checkbox-custom {
  background: var(--gradient-primary);
  border-color: var(--primary);
}

.checkbox-custom::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
  display: none;
}

.remember-me input:checked + .checkbox-custom::after {
  display: block;
}

.remember-me span {
  font-size: 14px;
  color: var(--text-secondary);
}

.forgot-password {
  font-size: 14px;
  color: var(--primary-light);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

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

/* Buttons */
.btn {
  width: 100%;
  padding: 18px;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 8px 30px rgba(129, 140, 248, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(129, 140, 248, 0.5);
}

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

/* Login Tip */
.login-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 24px;
  padding: 14px 16px;
  background: rgba(165, 180, 252, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(165, 180, 252, 0.15);
}

.login-tip svg {
  width: 18px;
  height: 18px;
  color: var(--primary-light);
  flex-shrink: 0;
  margin-top: 2px;
}

.login-tip span {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Toast */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--bg-card);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 3000;
  transition: transform 0.3s ease;
  max-width: calc(100vw - 32px);
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  font-size: 20px;
}

/* Backend Warning */
.backend-warning {
  background: rgba(229, 181, 103, 0.1);
  border: 1px solid var(--warning);
  color: #B8860B;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 13px;
  display: none;
}

/* Error Message */
.error-message {
  background: rgba(229, 124, 165, 0.1);
  border: 1px solid var(--danger);
  color: #C44569;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 14px;
  display: none;
}

.error-message.show {
  display: block;
}

/* Loading */
.loading {
  display: none;
}

.loading.active {
  display: flex;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
    gap: 24px;
  }
  
  .login-brand {
    padding: 20px 0;
  }
  
  .brand-content {
    padding: 20px;
  }
  
  .logo-icon {
    width: 70px;
    height: 70px;
  }
  
  .logo-icon svg {
    width: 40px;
    height: 40px;
  }
  
  .logo-text {
    font-size: 32px;
  }
  
  .logo-subtitle {
    font-size: 16px;
  }
  
  .login-card {
    padding: 32px 24px;
  }
  
  .card-header h2 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 16px 12px;
    align-items: flex-start;
  }
  
  .login-container {
    width: 100%;
  }
  
  .login-brand {
    min-width: auto;
  }
  
  .logo-icon {
    width: 60px;
    height: 60px;
  }
  
  .logo-text {
    font-size: 28px;
  }
  
  .logo-subtitle {
    font-size: 14px;
  }
  
  .brand-desc {
    font-size: 13px;
  }
  
  .login-card {
    padding: 28px 20px;
    min-width: auto;
  }
  
  .card-header h2 {
    font-size: 22px;
  }
  
  .card-header p {
    font-size: 14px;
  }
  
  .form-input {
    padding: 14px 14px 14px 44px;
    font-size: 15px;
  }
  
  .form-group {
    margin-bottom: 18px;
  }
  
  .btn {
    padding: 16px;
    font-size: 16px;
  }
  
  .form-footer {
    margin-bottom: 20px;
  }
  
  .login-tip {
    margin-top: 20px;
    padding: 12px 14px;
  }
  
  .login-tip span {
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .login-card {
    padding: 24px 16px;
  }
  
  .logo-text {
    font-size: 24px;
  }
  
  .form-label {
    font-size: 13px;
  }
}