/* ===== ESTILOS GENERALES ===== */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== VARIABLES DEL TEMPLATE ===== */
:root {
  --neutral--100: #030712;
  --neutral--70: #374151;
  --neutral--90: #111827;
  --neutral--60: #4b5563;
  --neutral--50: #6b7280;
  --neutral--40: #b6bcc6;
  --neutral--20: #e5e7eb;
  --neutral--0: white;
  --neutral--80: #1f2937;
  --neutral--30: #d1d5db;
  --neutral--10: #f9fafb;
}

/* Nota: Eliminada la etiqueta 'body' para evitar conflictos con el sitio principal */

/* ===== OVERLAY DEL MODAL (REPARADO) ===== */
.modal-overlay {
  position: fixed !important; /* Forzar posición fija */
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important; /* Ancho completo de la ventana */
  height: 100vh !important; /* Alto completo de la ventana */
  background-color: rgba(3, 7, 18, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2147483647 !important; /* Valor máximo de Z-Index */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow-y: auto; /* Permitir scroll si el modal es muy alto */
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===== CONTENEDOR DEL MODAL ===== */
.modal-container {
  background-color: var(--neutral--0);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh; /* Máximo 90% de la altura de la ventana */
  overflow-y: auto; /* Scroll interno si el contenido es largo */
  box-shadow: 0 20px 60px rgba(3, 7, 18, 0.3);
  transform: translateY(20px);
  transition: transform 0.3s ease;
  position: relative; /* Asegura contexto para elementos absolutos internos */
  margin: auto; /* Centrado extra de seguridad */
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

/* ===== HEADER DEL MODAL ===== */
.modal-header {
  padding: 32px 40px 24px;
  border-bottom: 1px solid var(--neutral--20);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 32px;
  right: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--neutral--50);
  transition: color 0.2s;
  z-index: 10;
}

.modal-close:hover {
  color: var(--neutral--100);
}

.modal-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--neutral--100);
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.modal-subtitle {
  font-size: 16px;
  font-weight: 400;
  color: var(--neutral--50);
  margin: 0;
  line-height: 150%;
}

/* ===== INDICADOR DE PROGRESO ===== */
.progress-wrapper {
  padding: 0 40px 24px;
}

.progress-steps {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.progress-step {
  flex: 1;
  height: 4px;
  background-color: var(--neutral--20);
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.progress-step.active {
  background-color: var(--neutral--100);
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.progress-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral--40);
  transition: color 0.3s ease;
}

.progress-label.active {
  color: var(--neutral--100);
}

/* ===== CONTENIDO DEL MODAL ===== */
.modal-content {
  padding: 32px 40px;
}

.step-container {
  display: none;
}

.step-container.active {
  display: block;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== FORMULARIO (usando estilos del template) ===== */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral--100);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.form-label.required::after {
  content: " *";
  color: #ef4444;
}

/* Input usando el estilo text-field del template */
.text-field {
  border-style: none none solid;
  border-width: 1px;
  border-color: black black var(--neutral--30);
  letter-spacing: 0.02em;
  height: auto;
  margin-bottom: 0;
  padding: 0 16px 16px;
  font-size: 16px;
  line-height: 150%;
  width: 100%;
  background-color: transparent;
  color: var(--neutral--100);
  font-family: 'Inter Tight', sans-serif;
  transition: border-bottom-color 0.2s ease;
}

.text-field:focus {
  outline: none;
  border-bottom-color: var(--neutral--100);
}

.text-field::placeholder {
  color: var(--neutral--50);
}

/* Select personalizado con estilo del template */
.select-wrapper {
  position: relative;
}

.text-field.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 40px;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--neutral--50);
  pointer-events: none;
}

/* Error message */
.error-message {
  display: none;
  font-size: 14px;
  color: #ef4444;
  margin-top: 8px;
}

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

.text-field.error {
  border-bottom-color: #ef4444;
}

/* ===== RESUMEN ===== */
.summary-grid {
  display: grid;
  gap: 20px;
}

.summary-card {
  background-color: var(--neutral--10);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--neutral--20);
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--neutral--20);
}

.summary-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--neutral--100);
  margin: 0;
  letter-spacing: 0.02em;
}

.summary-edit-btn {
  background: none;
  border: none;
  color: var(--neutral--100);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.summary-edit-btn:hover {
  background-color: var(--neutral--20);
}

.summary-content {
  display: grid;
  gap: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.summary-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral--50);
  flex-shrink: 0;
}

.summary-value {
  font-size: 14px;
  font-weight: 400;
  color: var(--neutral--100);
  text-align: right;
  word-break: break-word;
}

/* ===== TÉRMINOS Y CONDICIONES ===== */
.terms-wrapper {
  margin-top: 24px;
  padding: 20px;
  background-color: var(--neutral--10);
  border-radius: 8px;
  border: 1px solid var(--neutral--20);
}

.terms-text {
  font-size: 14px;
  color: var(--neutral--50);
  margin: 0;
  line-height: 150%;
}

.terms-link {
  color: var(--neutral--100);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s;
}

.terms-link:hover {
  color: var(--neutral--70);
}

/* ===== FOOTER DEL MODAL ===== */
.modal-footer {
  padding: 24px 40px 32px;
  border-top: 1px solid var(--neutral--20);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ===== BOTONES ===== */
.btn {
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-family: 'Inter Tight', sans-serif;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
}

.btn-primary {
  background-color: var(--neutral--100);
  color: var(--neutral--0);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--neutral--90);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(3, 7, 18, 0.2);
}

.btn-primary:disabled {
  background-color: var(--neutral--40);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-secondary {
  background-color: var(--neutral--0);
  color: var(--neutral--100);
  border: 1px solid var(--neutral--30);
}

.btn-secondary:hover {
  background-color: var(--neutral--10);
  border-color: var(--neutral--40);
}

.btn-secondary.hidden {
  display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .modal-container {
    width: 95%;
    max-height: 95vh;
  }

  .modal-header {
    padding: 24px 24px 20px;
  }

  .modal-close {
    top: 24px;
    right: 24px;
  }

  .modal-title {
    font-size: 24px;
  }

  .modal-subtitle {
    font-size: 14px;
  }

  .progress-wrapper {
    padding: 0 24px 20px;
  }

  .progress-labels {
    display: none; /* Ocultar labels en móvil para ahorrar espacio */
  }

  .modal-content {
    padding: 24px 24px;
  }

  .modal-footer {
    padding: 20px 24px 24px;
    flex-direction: column-reverse;
  }

  .btn {
    width: 100%;
  }

  .summary-row {
    flex-direction: column;
    gap: 4px;
  }

  .summary-value {
    text-align: left;
  }
}