/* ================================================================
   用户系统 - User System
   包含：登录、注册、邮箱验证、密码重置、用户设置
   ================================================================ */

/* ============= 模态框覆盖层 ============= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
  animation: fadeIn 0.3s ease-out;
}

/* ============= 验证模态框 ============= */
.verification-modal {
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease-out;
  position: relative;
}

[data-theme="dark"] .verification-modal {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.verification-modal .modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem 2rem;
  border-radius: 12px 12px 0 0;
  position: relative;
}

.verification-modal .modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.verification-modal .modal-close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-base);
}

.verification-modal .modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.verification-modal .modal-body {
  padding: 2rem;
}

/* ============= 忘记密码模态框 ============= */
#forgotPasswordModal .modal-header {
  background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
}

.forgot-password-steps {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  position: relative;
}

.forgot-step {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e2e8f0;
  margin: 0 8px;
  transition: all 0.3s ease;
  position: relative;
}

.forgot-step.active {
  background: #3182ce;
  transform: scale(1.2);
}

.forgot-step.completed {
  background: #48bb78;
}

.forgot-step::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  width: 16px;
  height: 2px;
  background: #e2e8f0;
  transform: translateY(-50%);
}

.forgot-step:last-child::after {
  display: none;
}

.forgot-step.completed::after {
  background: #48bb78;
}

/* ============= 验证步骤 ============= */
.verification-step {
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.verification-step.active {
  opacity: 1;
  transform: translateY(0);
}

.verification-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  animation: pulse 2s infinite;
}

.verification-text {
  font-size: 1rem;
  color: #4a5568;
  line-height: 1.6;
  margin: 0 0 2rem;
}

[data-theme="dark"] .verification-text {
  color: var(--text-secondary);
}

.verification-text strong {
  color: #2d3748;
  font-weight: 600;
}

[data-theme="dark"] .verification-text strong {
  color: var(--text-primary);
}

/* ============= 验证码输入 ============= */
.verification-code-input {
  margin: 2rem 0;
}

.verification-code-input input {
  width: 100%;
  padding: 1rem;
  font-size: 1.5rem;
  font-family: 'Courier New', monospace;
  text-align: center;
  letter-spacing: 0.5rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #f7fafc;
  transition: all 0.2s ease;
}

[data-theme="dark"] .verification-code-input input {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.verification-code-input input:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

[data-theme="dark"] .verification-code-input input:focus {
  background: var(--bg-primary);
}

.verification-code-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 1rem 0;
}

.verification-code-group input {
  flex: 1;
  padding: 0.75rem;
  font-size: 1.25rem;
  font-family: 'Courier New', monospace;
  text-align: center;
  letter-spacing: 0.25rem;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.verification-code-group input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

/* ============= 验证计时器 ============= */
.verification-timer {
  margin: 1rem 0;
  padding: 0.5rem;
  background: #f7fafc;
  border-radius: 6px;
  font-size: 0.875rem;
  color: #718096;
  text-align: center;
}

.verification-timer.warning {
  background: #fef5e7;
  color: #c05621;
}

.verification-timer.danger {
  background: #fed7d7;
  color: #c53030;
}

/* ============= 验证操作按钮 ============= */
.verification-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.verification-actions .btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-size: 0.875rem;
}

.verification-actions .btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.btn-secondary {
  background: #f7fafc;
  color: #4a5568;
  border: 1px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
  background: #edf2f7;
  border-color: #cbd5e0;
}

.btn-danger {
  background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

/* ============= 密码重置成功页面 ============= */
.password-reset-success {
  text-align: center;
  padding: 2rem 0;
}

.password-reset-success .success-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 2rem;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
  animation: successBounce 0.8s ease-out;
}

@keyframes successBounce {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.1); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

.password-reset-success h4 {
  color: #2d3748;
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 600;
}

[data-theme="dark"] .password-reset-success h4 {
  color: var(--text-primary);
}

.password-reset-success p {
  color: #4a5568;
  line-height: 1.6;
  margin: 0 0 2rem;
  font-size: 1.1rem;
}

[data-theme="dark"] .password-reset-success p {
  color: var(--text-secondary);
}

/* ============= 表单样式 ============= */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #2d3748;
  font-size: 0.875rem;
}

[data-theme="dark"] .form-group label {
  color: var(--text-primary);
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-group input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

.form-group input:disabled {
  background: #f7fafc;
  color: #a0aec0;
  cursor: not-allowed;
}

[data-theme="dark"] .form-group input:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* ============= 邮箱掩码显示 ============= */
.masked-email {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: #667eea;
  background: #f0f4ff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

[data-theme="dark"] .masked-email {
  background: var(--bg-secondary);
  color: #81c4ff;
}

/* ============= 验证状态指示器 ============= */
.verification-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin: 1rem 0;
}

.verification-status.success {
  background: #f0fff4;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

.verification-status.warning {
  background: #fffbeb;
  color: #744210;
  border: 1px solid #f6d55c;
}

.verification-status.error {
  background: #fff5f5;
  color: #742a2a;
  border: 1px solid #feb2b2;
}

/* ============= 危险操作样式 ============= */
.danger-modal .modal-header {
  background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.danger-warning {
  background: #fed7d7;
  border: 1px solid #feb2b2;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.warning-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  background: #e53e3e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.danger-warning h4 {
  color: #c53030;
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}

.danger-warning p {
  color: #742a2a;
  margin: 0 0 1rem;
  line-height: 1.5;
}

/* ============= 响应式设计 ============= */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 0.5rem;
  }
  
  .verification-modal {
    width: 100%;
    max-height: 95vh;
  }

  .verification-modal .modal-header {
    padding: 1rem 1.5rem;
  }

  .verification-modal .modal-body {
    padding: 1.5rem;
  }

  .verification-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .verification-code-input input {
    font-size: 1.25rem;
    letter-spacing: 0.25rem;
  }

  .verification-code-group {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .verification-modal .modal-header h3 {
    font-size: 1.1rem;
  }

  .verification-text {
    font-size: 0.9rem;
  }

  .form-group label {
    font-size: 0.8rem;
  }

  .verification-actions .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.8rem;
  }

  .forgot-step {
    width: 10px;
    height: 10px;
    margin: 0 6px;
  }

  .masked-email {
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
  }
}