/* Importar fuente Montserrat */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  background: linear-gradient(to left, #52da5e, #66cc00);
}

body {
  font-family: 'Montserrat', Arial, sans-serif;
  background: transparent;
  font-size: 16px;
  color: #2C3E50;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

h1 {
  text-align: center;
  color: #fff;
  font-size: 2rem;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Estilos del formulario */
#msform {
  text-align: center;
  position: relative;
  overflow: hidden; /* Asegura que los fieldsets no se desborden */
  min-height: 400px; /* Añadido para asegurar espacio suficiente */
}

#msform fieldset {
  background: white;
  border: 0 none;
  border-radius: 10px;
  box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.4);
  padding: 20px 30px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  display: none;
}

#msform fieldset:first-of-type {
  display: block;
}

/* Inputs */
#msform input,
#msform select {
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 10px;
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  color: #2C3E50;
}

#msform input:focus,
#msform select:focus {
  border: 1px solid #00aeef;
  box-shadow: none;
  outline: none;
  transition: all 0.5s ease-in;
}

/* Encabezados */
.fs-title {
  font-size: 18px;
  text-transform: uppercase;
  color: #2C3E50;
  margin-bottom: 10px;
  letter-spacing: 2px;
  font-weight: bold;
}

.fs-subtitle {
  font-weight: normal;
  font-size: 13px;
  color: #666;
  margin-bottom: 20px;
}

/* Barra de progreso */
#progressbar {
  margin-bottom: 30px;
  overflow: hidden;
  counter-reset: step;
  display: flex;
  justify-content: space-between;
}

#progressbar li {
  list-style-type: none;
  color: white;
  text-transform: uppercase;
  font-size: 9px;
  flex: 1;
  position: relative;
  letter-spacing: 1px;
  text-align: center;
}

#progressbar li:before {
  content: counter(step);
  counter-increment: step;
  width: 24px;
  height: 24px;
  line-height: 26px;
  display: block;
  font-size: 12px;
  color: #333;
  background: white;
  border-radius: 25px;
  margin: 0 auto 10px auto;
}

#progressbar li:after {
  content: '';
  width: 100%;
  height: 2px;
  background: white;
  position: absolute;
  left: -50%;
  top: 9px;
  z-index: -1;
}

#progressbar li:first-child:after {
  content: none;
}

#progressbar li.active:before,
#progressbar li.active:after {
  background: #00aeef;
  color: white;
}

/* Modal mejorado */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow-y: auto; /* Permite scroll si el contenido es muy alto */
  padding: 20px 0; /* Añade padding vertical para evitar que el modal toque los bordes */
}

.modal-content {
  background-color: white;
  margin: 20px auto;
  padding: 25px;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  max-height: calc(100vh - 40px); /* Máxima altura disponible menos el padding */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  text-align: left;
  position: relative;
  overflow-y: auto; /* Scroll interno si el contenido excede la altura máxima */
  animation: modalSlideIn 0.3s ease-out;
}

/* Animación para el modal */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h2 {
  font-size: 1.6rem;
  color: #2C3E50;
  margin-bottom: 15px;
  padding-right: 40px; /* Espacio para el botón de cerrar */
  line-height: 1.3;
}

.modal-content p {
  font-size: 1rem;
  color: #4b5563;
  margin-bottom: 15px;
  line-height: 1.5;
}

.modal-content ul {
  list-style: disc;
  padding-left: 25px;
  margin-bottom: 20px;
}

.modal-content li {
  margin-bottom: 8px;
  line-height: 1.4;
}

.modal-content .highlight {
  color: #dc2626;
  font-weight: bold;
  display: block;
  margin: 20px 0;
  padding: 15px;
  background-color: #fef2f2;
  border-left: 4px solid #dc2626;
  border-radius: 5px;
}

.modal-content .close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  color: #6b7280;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-content .close:hover {
  color: #00aeef;
  background-color: #f3f4f6;
}

.buttons {
  text-align: right;
  margin-top: 20px;
}

.action-button {
  width: 100px;
  font-weight: bold;
  color: white;
  border: 0 none;
  border-radius: 25px;
  cursor: pointer;
  padding: 10px 5px;
  margin: 10px 5px;
  background: #00aeef;
  transition: all 0.3s ease;
}

.action-button:hover,
.action-button:focus {
  box-shadow: 0 0 0 2px white, 0 0 0 3px #00aeef;
}

.action-button-previous {
  background: #6b7280;
}

.action-button-previous:hover,
.action-button-previous:focus {
  box-shadow: 0 0 0 2px white, 0 0 0 3px #6b7280;
}

.action-button:disabled,
.action-button-previous:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Responsividad mejorada */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .container {
    padding: 5px;
  }

  h1 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }

  #progressbar li {
    font-size: 8px;
  }

  #msform fieldset {
    width: 95%;
    padding: 15px 20px;
  }

  .modal {
    padding: 10px 0;
  }

  .modal-content {
    width: 95%;
    margin: 10px auto;
    padding: 20px;
    max-height: calc(100vh - 20px);
    border-radius: 10px;
  }

  .modal-content h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    padding-right: 35px;
  }

  .modal-content p {
    font-size: 0.9rem;
  }

  .modal-content .close {
    top: 12px;
    right: 15px;
    font-size: 1.8rem;
    width: 28px;
    height: 28px;
  }

  .buttons {
    text-align: center;
    margin-top: 15px;
  }

  .action-button {
    width: 90px;
    font-size: 14px;
    padding: 8px 4px;
    margin: 8px 3px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
    letter-spacing: 1px;
  }

  #progressbar li {
    font-size: 7px;
  }

  #progressbar li:before {
    width: 20px;
    height: 20px;
    line-height: 22px;
    font-size: 10px;
  }

  .modal-content {
    width: 98%;
    padding: 15px;
    margin: 5px auto;
  }

  .modal-content h2 {
    font-size: 1.2rem;
    line-height: 1.2;
  }

  .modal-content p {
    font-size: 0.85rem;
  }

  .modal-content ul {
    padding-left: 20px;
  }

  .modal-content .highlight {
    padding: 12px;
    font-size: 0.9rem;
    margin: 15px 0;
  }

  .action-button {
    width: 80px;
    font-size: 12px;
    padding: 6px 3px;
    margin: 5px 2px;
  }
}

/* Para pantallas muy pequeñas en landscape */
@media (max-height: 500px) {
  .modal {
    padding: 5px 0;
  }
  
  .modal-content {
    margin: 5px auto;
    max-height: calc(100vh - 10px);
  }
}

