/**
 * Estilos modernos y sofisticados para el wizard de captura de datos
 * Enfoque en usabilidad, estética y experiencia de usuario
 */

:root {
  /* Paleta de colores principal */
  --primary: #4361ee;
  --primary-light: #5e7bff;
  --primary-dark: #3a56d4;
  --secondary: #f72585;
  --success: #10b981;
  --warning: #fbbf24;
  --danger: #ef4444;
  --info: #3b82f6;
  --light: #f9fafb;
  --dark: #1f2937;
  --muted: #6b7280;
  
  /* Grises neutros */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Espaciado y diseño */
  --border-radius-sm: 0.25rem;
  --border-radius: 0.5rem;
  --border-radius-lg: 1rem;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Transiciones */
  --transition-fast: 0.15s ease;
  --transition: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Fuentes */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Estilos base y reinicio */
body {
  font-family: var(--font-sans);
  background-color: #f5f7fa;
  color: var(--gray-800);
  line-height: 1.6;
}

/* Contenedor principal */
.container {
  max-width: 1140px;
  padding: 0 15px;
  margin: 3rem auto;
}

/* Tarjeta principal del wizard */
.card {
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: var(--transition);
  background-color: #ffffff;
}

.card:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.card-header {
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 1.5rem 2rem;
  position: relative;
  overflow: hidden;
}

.card-header h3 {
  font-weight: 700;
  margin: 0;
  font-size: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Efecto decorativo en el encabezado */
.card-header::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 60%);
  transform: rotate(30deg);
}

.card-body {
  padding: 2.5rem 2rem;
}

/* Indicador de pasos mejorado */
.step-indicator {
  margin-bottom: 2.5rem;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  position: relative;
}

/* Línea conectora entre los pasos */
.step-indicator::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 10%;
  right: 10%;
  height: 2px;
  background-color: var(--gray-200);
  z-index: 1;
}

.step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 120px;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: white;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border: 2px solid var(--gray-200);
  transition: all var(--transition);
  position: relative;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.step-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-500);
  margin: 0;
  transition: color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Paso activo */
.step.active .step-number {
  transform: scale(1.1);
  background-color: var(--primary);
  color: white;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
}

.step.active .step-title {
  color: var(--primary);
  font-weight: 600;
}

/* Paso completado */
.step.completed .step-number {
  background-color: var(--success);
  color: white;
  border-color: var(--success);
  position: relative;
}

.step.completed .step-number::after {
  font-family: 'Font Awesome 6 Free';
  content: '\f00c';
  font-weight: 900;
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}

.step.completed .step-number span {
  opacity: 0;
}

.step.completed .step-title {
  color: var(--success);
}

/* Animaciones para las transiciones de los formularios */
.wizard-form {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.wizard-form.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Estilos para los encabezados de sección */
.wizard-form h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  position: relative;
}

.wizard-form h4::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--primary);
  border-radius: 2px;
}

/* Estilos mejorados para campos de formulario */
.form-label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.form-control {
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  padding: 0.7rem 1rem;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  color: var(--gray-800);
  font-size: 0.95rem;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.form-control::placeholder {
  color: var(--gray-400);
}

/* Estilos mejorados para checkboxes */
.form-check {
  margin-bottom: 0.75rem;
  padding-left: 1.75rem;
}

.form-check-input {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.2rem;
  margin-left: -1.75rem;
  border: 1px solid var(--gray-400);
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-label {
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.2rem 0;
  user-select: none;
}

/* Botones con efecto hover y foco mejorados */
.btn {
  font-weight: 500;
  padding: 0.6rem 1.5rem;
  border-radius: var(--border-radius);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn i {
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn-secondary {
  background-color: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
  background-color: var(--gray-200);
  color: var(--gray-800);
}

/* Efecto de onda en los botones */
.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
  }
}

/* Mensajes de alerta mejorados */
.alert {
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
  animation: slide-down var(--transition);
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-left: 4px solid var(--success);
}

.alert-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-left: 4px solid var(--danger);
}

.alert::before {
  margin-right: 0.75rem;
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 1rem;
}

.alert-success::before {
  content: '\f00c';
}

.alert-danger::before {
  content: '\f071';
}

@keyframes slide-down {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Paso final de confirmación con animación */
#form-6 {
  text-align: center;
  padding: 2rem 1rem;
}

#form-6 .success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--success), #34d399);
  color: white;
  border-radius: 50%;
  font-size: 3rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
  animation: success-pulse 2s infinite;
}

@keyframes success-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

#form-6 .lead {
  color: var(--gray-700);
  font-size: 1.15rem;
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Estilos específicos para grupos de campos */
.edades-container .mb-3 {
  background-color: var(--gray-50);
  padding: 1rem;
  border-radius: var(--border-radius);
  border-left: 3px solid var(--primary);
  margin-bottom: 1rem;
  transition: all var(--transition-fast);
}

.edades-container .mb-3:hover {
  background-color: white;
  box-shadow: var(--shadow);
}

/* Mejoras de accesibilidad */
.form-control:focus, .btn:focus, .form-check-input:focus {
  outline: none;
}

/* Estilos para campos de número */
input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Adaptaciones responsivas */
@media (max-width: 991.98px) {
  .card-body {
    padding: 2rem 1.5rem;
  }
  
  .step-title {
    font-size: 0.8rem;
  }
}

@media (max-width: 767.98px) {
  .step-indicator {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 0.5rem;
  }
  
  .step-indicator::before {
    left: 18px;
    right: 18px;
  }
  
  .step {
    flex: 0 0 auto;
    margin-right: 1.5rem;
  }
  
  .step:last-child {
    margin-right: 0;
  }
  
  .card-header h3 {
    font-size: 1.25rem;
  }
  
  .wizard-form h4 {
    font-size: 1.15rem;
  }
}

@media (max-width: 575.98px) {
  .container {
    margin: 1rem auto;
  }
  
  .card-body {
    padding: 1.5rem 1rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .form-label {
    font-size: 0.85rem;
  }
  
  .form-control {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }
}

/* Ajustes para alta densidad de píxeles */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #5e7bff;
    --primary-light: #7c93ff;
    --primary-dark: #4361ee;
  }

  body {
    background-color: #111827;
    color: #e5e7eb;
  }

  .card {
    background-color: #1f2937;
    color: #f9fafb;
  }

  .card-header {
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    color: #f9fafb;
  }

  .form-control {
    background-color: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
  }

  .form-control:focus {
    border-color: var(--primary);
  }

  .form-control::placeholder {
    color: #9ca3af;
  }

  .form-label,
  .form-check-label { /* <-- añadido aquí */
    color: #d1d5db;
  }

  .step-number {
    background-color: #374151;
    border-color: #4b5563;
    color: #d1d5db;
  }

  .btn-secondary {
    background-color: #374151;
    color: #f9fafb;
    border-color: #4b5563;
  }

  .btn-secondary:hover {
    background-color: #4b5563;
    color: #ffffff;
  }

  .edades-container .mb-3 {
    background-color: #2d3748;
    color: #f3f4f6;
  }

  .step-title {
    color: #9ca3af;
  }

  .step.active .step-title {
    color: var(--primary-light);
  }

  .wizard-form h4 {
    color: #f3f4f6;
    border-bottom-color: #4b5563;
  }

  .card-body,
  .card-footer,
  .form-text,
  .text-muted,
  .text-secondary {
    color: #d1d5db !important;
  }
}
