/* ========================
   FUENTES Y BASE
======================== */
@import url(https://fonts.googleapis.com/css?family=Montserrat:400,500,700);

* {
  margin: 0; 
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100%;
  font-family: 'Montserrat', sans-serif;
  color: #2C3E50;
  background-attachment: fixed; 
  background-position: center;
  background-size: cover;    
  background-repeat: no-repeat;  
  background-image:     
    linear-gradient(rgba(0,0,0,0.55),rgba(0,0,0,0.75)), 
    url(Imagenes/fondo2.jpg);
  
}
.barra-superior {
  display: block;
  width: 100%;
  background-color: #f0f0f0;
  border-bottom: 3px solid #d50032;
  padding: 14px 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.logos-container {
  display: block;
  text-align: center;
}
.logo {
  height: 85px;
  display: inline-block;
  padding: 0 2em;
}

/*  FORMULARIO */
#msform {
  width: 70%;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  margin-top: 60px;
}

#msform fieldset {
  width: 100%;
  min-height: 80vh; 
  background: #fff;
  border-radius: 15px;
  padding: 40px 50px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  top: 0;
  left: 0;
}

#msform fieldset:not(:first-of-type) {
  display: none;
}

/* INPUTS & SELECTS */
#msform input[type="text"],
#msform input[type="email"],
#msform input[type="date"],
#msform input[type="number"],
#msform select,
#msform textarea {

  margin: 6px 0;
  border: 1px solid #ccc;
  transition: 0.3s ease-in-out;
  outline: none;
  align-items: center;
  width: 350px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
}

#msform input:focus,
#msform select:focus,
#msform textarea:focus {
  border-color: #27AE60;
  box-shadow: 0 0 8px rgba(39,174,96,0.4);
}

/*  BOTONES */
#msform .action-button {
  padding: 12px 38px;
  margin: 25px 18px;
  border: none;
  border-radius: 35px;
  font-weight: bold;
  font-size: 18px;
  cursor: pointer;
  background: #ffbb00f0;
  color: white;
  transition: 0.3s;
}

#msform .action-button:hover {
  background: #ffbb00f0;
  transform: scale(1.05);
}

#msform .submit {
  background: #2980B9;
}
#msform .submit:hover {
  background: #21618C;
}

/* TITULOS */
.fs-title {
  font-size: 28px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 35px;
  color: #2C3E50;
}

h2 {
   background: linear-gradient(90deg, #252826, #313432); 
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  margin: 20px 0;
  font-size: 1.3em;
}
h3 {
 background: linear-gradient(90deg, #a4a8a6, #b3b9b9); 
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 15px 0;
  font-size: 1.1em;
}

.incentivo{
  background: linear-gradient(
    90deg,
    rgba(255, 203, 152, 0.7),
    rgba(246, 181, 121, 0.7)
  );
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 15px 0;
  font-size: 1.1em;
}


/*  PROGRESS BAR */
#progressbar {
  margin-bottom: 40px;
  overflow: hidden;
  counter-reset: step;
  display: flex;
  justify-content: space-between;
}
#progressbar li {
  list-style-type: none;
  color: white;
  text-transform: uppercase;
  font-size: 18px;
  width: 100%;
  float: left;
  position: relative;
  font-weight: 500;
}
#progressbar li:before {
  content: counter(step);
  counter-increment: step;
  width: 65px;
  height: 65px;
  line-height: 65px;
  display: block;
  text-align: center;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #ddd;
  color: #333;
  font-weight: bold;
}

/*progressbar connectors*/
#progressbar li:after {
content: '';
  position: absolute;
  top: 30px;
  left: -50%;
  width: 100%;
  height: 6px;
  background: #ddd;
  z-index: -1;
}
#progressbar li:first-child:after {
  /*connector not needed before the first step*/
  content: none; 
}
/*marking active/completed steps green*/
/*The number of the step and the connector before it = green*/
#progressbar li.active:before,  #progressbar li.active:after{
  background: #ffbb00f0;
  color: white;
}

.intro-fieldset {
  border: 2px solid #ccc;
  border-radius: 12px;
  padding: 30px 40px;
  background-color: #fafafa;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  max-width: 900px;
  margin: 40px auto;
}

.intro-text {
  text-align: justify;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 17px;
  font-weight: 500;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px 35px;
  margin-bottom: 25px;
  text-align: left;
}

.campo {
  display: flex;
  flex-direction: column;
}

.campo label {
  font-weight: 500;
  margin-bottom: 6px;
  color: #333;
}

/* Campo que ocupa todo el ancho */
.campo-full {
  grid-column: 1 / -1;
}

/* ==== Botones sección ==== */
.botones-seccion {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 25px;
}
.modal-ventana { 
  display: none; 
  position: fixed; 
  justify-content: center; 
  align-items: center; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  background-color: rgba(0,0,0,0.5); 
  z-index: 9999; 
} 
.modal-contenido { 
  background: white; 
  padding: 45px; 
  border-radius: 10px; 
  text-align: center; 
  width: 420px; 
  font-size: 20px;
} 
.modal-botones button { 
  margin-top: 15px; 
  background-color: #2C3E50; 
  color: white; 
  border: none; 
  padding: 12px 18px; 
  font-size: 18px;
  border-radius: 8px; 
  cursor: pointer; 
}

.requerido {
  color: red;
  margin-left: 3px;
}
.mensaje-error {
  color: red;
  font-size: 0.8em;
  margin-top: 3px;
  display: block;
}

.mensaje-error.visible {
  display: block;
}

.pregunta {
  display: flex;
  align-items: center;
  gap: 6px;          
  flex-wrap: wrap;   
}

.pregunta .mensaje-error {
  order: 99;           
  flex-basis: 100%;    
  width: 100%;
  display: none;      
  margin-top: 2px;     
  margin-left: 0;      
  text-align: left;    
  color: red;
  font-size: 0.8rem;  
}

.pregunta .mensaje-error.visible {
  display: block;
}
.preguntas {
  display: flex;
  align-items: center;
  gap: 6px;          
  flex-wrap: wrap;   
}

.preguntas .mensaje-error {
  order: 99;           
  flex-basis: 100%;    
  width: 100%;
  display: none;      
  margin-top: 2px;     
  margin-left: 0;      
  text-align: left;    
  color: red;
  font-size: 0.8rem;  
}

.preguntas .mensaje-error.visible {
  display: block;
}
.direccion-container {
  margin-top: 10px;
  font-family: Arial, sans-serif;
  background: #f9f9f9;
  padding: 15px 25px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  max-width: 850px;
}

.direccion-container p {
  margin-bottom: 25px;
  font-weight: 700;
  color: #2C3E50;
  font-size: 16px;
}

/* Cada fila de campos */
.direccion-container .field {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

/* Etiquetas */
.direccion-container label {
  font-size: 16px;
  font-weight: 500;
  color: #2c3e50;
  margin-right: 20px;
}
/* Inputs y selects más pequeños y uniformes */
.direccion-container select,
.direccion-container input[type="text"] {
  padding: 4px 6px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: center;
  height: 36px;
}

.direccion-container select#viaPrincipal,
.direccion-container select#orientacionPrincipal,
.direccion-container select#letraPrincipal,
.direccion-container select#letraSecundaria {
  width: 95px;
}

.direccion-container input#numPrincipal,
.direccion-container input#numSecundaria,
.direccion-container input#numeroFinal {
  width: 70px;
}

.direccion-container input#direccionGenerada {
  width: 280px;
}

/* Checkboxes pequeños y alineados */
/* Checkboxes pequeños y alineados correctamente */
.direccion-container input[type="checkbox"] {
  transform: scale(0.9);
  margin: 0 4px 0 8px; /* separación más natural entre checkbox y texto */
  vertical-align: middle;
}

/* Texto al lado del checkbox (Bis, E, S) */
.direccion-container .field input[type="checkbox"] + label {
  margin: 0 10px 0 2px;
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  color: #2C3E50;
  vertical-align: middle;
}

/* Botones */
.direccion-container button {
  padding: 5px 12px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background-color: #2c3e50;
  color: white;
  transition: background 0.3s ease;
}

.direccion-container button:hover {
  background-color: #4d647b;
}

/* === Estilo para las preguntas de tipo Sí/No === */
#contenedor-preguntas {
  width: 80%;
  margin: 30px auto;
  background: #f9f9f9;
  padding: 25px 40px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.pregunta {
  display: flex;
  justify-content: space-between; /* Espacia el texto y las opciones */
  align-items: center;
  margin-bottom: 8px;
}

.pregunta label {
  font-weight: 500;
  font-size: 16px;
  color: black;
  flex: 3;
  text-align: left;
}

.preguntas {
  display: flex;
  justify-content: space-between; /* Espacia el texto y las opciones */
  align-items: center;
  margin-bottom: 8px;
}
.preguntas label {
  font-weight: 500;
  font-size: 16px;
  color: black;
  flex: 3;
  text-align: left;
}

/* Contenedor de las opciones */
.opciones {
  display: flex;
  gap: 10px;
  min-width: 350px; 
  justify-content:flex-end;
}

/* Ocultar el radio original */
.opciones input[type="radio"] {
  display: none;
}

/* Estilo para los botones "Sí" y "No" */
.opciones label {
  background-color: transparent;
  border: 2px solid #ccc;
  padding: 6px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  color: #333;
  text-align: center;
  min-width: 60px; 
}

/* Cuando está seleccionado */
.opciones input[type="radio"]:checked + label {
  background-color: #4d647b;
  color: white;
  border-color: #4d647b;
}

/* Efecto al pasar el mouse */
.opciones label:hover {
  background-color: #4d647b;
  color: white;
}
.preguntas-multiples {
  display:grid;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 15px;
}
.preguntas-multiples label {
  font-size: 16px;
  font-weight: 500;
  color: black;
  width: 60%; 
  min-width: 250px;
  text-align: center;
  margin-bottom: 25px;
}
.preguntas-multiples .principal-label {
  text-align: left;    
  margin-bottom: 22px; 
  width: 100%;         
  font-weight: 500;    
  color: black;
}

/* === Campo de sistemas de certificación === */
.campo-certificacion label {
  font-size: 16px;
  font-weight: 500;
  color: black;
  width: 60%; 
  min-width: 250px;
  text-align: left;
}

.campo-certificacion select {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  color: #333;
  transition: border-color 0.3s ease;
}

.campo-certificacion select:focus {
  outline: none;
  border-color: #2c3e50;
}

#tipoContainer {
  margin-top: 10px;
}
#tipoContainer select {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  color: #333;
}
.tratamiento {
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}

.tratamiento h4 {
  margin-bottom: 10px;
  color: #333;
  font-weight: 600;
}

.tratamiento a {
  color: #0078d7;
  text-decoration: none;
}

.tratamiento a:hover {
  text-decoration: underline;
}

.tratamiento .check-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tratamiento input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid red;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.tratamiento input[type="checkbox"]:checked {
  background-color: red;
  border-color: red;
}

.tratamiento input[type="checkbox"]:checked::after {
  content: "✔";
  color: white;
  position: absolute;
  font-size: 14px;
  left: 3px;
  top: 0px;
}

.captcha-container {
    margin-top: 25px;
    padding: 15px;
    border: 1px solid #d3d3d3;
    border-radius: 10px;
    background-color: #f9f9f9;
    text-align: center;
    width: 70%;
    margin-left: auto;
    margin-right: auto;
}

.captcha-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 8px;
}

.captcha-instruccion {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 12px;
}

.captcha-box {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.captcha-img {
    border: 1px solid #6d87cf;
    border-radius: 6px;
    height: 60px;
}

.reload-btn {
    background-color: #6d87cf;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.reload-btn:hover {
    background-color: #4c69b2;
}

.captcha-input {
    width: 60%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
}


@media (max-width: 900px) {

 body {
    padding: 0;
    margin: 0;
    background-attachment: scroll;
    display: block; 
  }

  /* === BARRA SUPERIOR === */
  .barra-superior {
    width: 100%;
    display: flex;
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5; 
    padding: 10px 0;
    position: relative; 
    z-index: 10;
  }
  
  .logo {
    height: 45px;
    padding: 0 0.5em;
  }

  #msform {
    width: 95%;
    max-width: 600px;
    margin: 20px auto 40px auto;
  }

  #msform fieldset {
    padding: 20px 15px;
    min-height: auto;
    margin: 0 auto;
    text-align: left;
  }

  .fs-title {
    font-size: 22px;
    text-align: center;
  }

  h2 {
    font-size: 1.1em;
    padding: 8px;
    text-align: center;
  }

  h3 {
    font-size: 1em;
    padding: 6px;
    text-align: center;
  }

  /* === INPUTS Y SELECTS === */
  #msform input[type="text"],
  #msform input[type="email"],
  #msform input[type="date"],
  #msform select,
  #msform textarea {
    font-size: 14px;
    padding: 10px;
    width: 100%;
  }

  /* === BOTONES === */
  #msform .action-button {
    width: 100%;
    margin: 10px 0;
    font-size: 15px;
  }

  /* === PROGRESS BAR === */
  #progressbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0 5px;
  }

  #progressbar li {
    flex: 1;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
  }

  #progressbar li:before {
    width: 35px;
    height: 35px;
    line-height: 35px;
    font-size: 14px;
  }

  #progressbar li:after {
    top: 18px;
    height: 4px;
  }
  #progressbar li.active:before,
  #progressbar li.active:after {
    background: #ffbb00f0;
    color: white;
  }

  /* === MODAL === */
  .modal-contenido {
    width: 90%;
    max-width: 350px;
    padding: 20px;
    margin: 0 auto;
  }

  /* === DIRECCIÓN === */
  .direccion-container {
    padding: 10px 15px;
    max-width: 100%;
  }

  .direccion-container p {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .direccion-container .field {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1px;
    margin-bottom: 8px;
  }

  /* Campos más anchos pero sin romper diseño */
  .direccion-container select,
  .direccion-container input[type="text"] {
    font-size: 13px;
    padding: 4px 6px;
    width: auto;
    min-width: 55px;
    max-width: 70px;
    }

    /* Campo de dirección generada un poco más largo */
   .direccion-container input#direccionGenerada {
        width: 100% !important; /* ocupa todo el ancho disponible */
        max-width: 350px;       /* evita que sea demasiado largo */
        font-size: 15px;
        padding: 8px;
    }

    .direccion-container .field:last-of-type {
        flex-direction: column;
        align-items: stretch;
    }

    .direccion-container button {
        display: block;
        width: 60%;
        margin: 6px auto 0 auto; /* centra el botón horizontalmente */
        font-size: 15px;
        padding: 8px;
        border-radius: 10px;
        text-align: center;
    }
    /* === PREGUNTAS SÍ/NO === */
    .pregunta {
      display: flex;
      flex-direction: row; 
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 10px;
    }

    .pregunta label.principal-label {
        font-size: 15px;
        flex: 1 1 60%;
            text-align: left;
    }

    .opciones {
        display: flex;
        flex-direction: row;
        gap: 10px;
        flex: 1 1 35%;
        justify-content: flex-end;
    }

    .opciones label {
        font-size: 16px; 
        padding: 6px 14px;
        border-radius: 8px;
    }

    .preguntas input.campos {
        
        font-size: 14px !important;
        padding: 8px !important;
        width: 50% !important;
        max-width: 300px;
        display: inline-block;
        vertical-align: middle;
    }
    /* === PREGUNTAS MÚLTIPLES === */
    .preguntas-multiples {
        display: flex;
        flex-direction: column; 
        gap: 10px;
        align-items: flex-start;
    }

    .preguntas-multiples label {
        font-size: 15px;
        line-height: 1.2; /* reduce la altura entre líneas */
        text-align: center;
        margin-bottom: 10px; /* agrega un controlado espacio entre cada una */
        width: 100%;
        display: block; /
    }

    .preguntas-multiples .opciones {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    /* === CAPTCHA === */
    .captcha-container {
        width: 100%;
        padding: 10px;
    }

    .captcha-box {
        flex-direction: column;
        gap: 8px;
    }

    .captcha-input {
        width: 100%;
    }
}

@media (max-width: 360px) {

  /* ===== TEXTO ===== */
  body {
    font-size: 14px;
    
  }

  .fs-title {
    font-size: 18px;
  }

  h2 {
    font-size: 1em;
  }

  h3 {
    font-size: 0.95em;
  }

  /* ===== LOGOS ===== */
  .logo {
    height: 25px;
    padding: 0 0.3em;
  }

  .logos-container {
    gap: 12px;
  }

  /* ===== FORMULARIO ===== */
  #msform {
    width: 100%;
    margin: 10px auto 20px auto;
  }

  #msform fieldset {
    padding: 15px 10px;
  }

  /* ===== PREGUNTAS ===== */
  .pregunta {
    flex-direction: column;
    align-items: flex-start;
  }

  .pregunta label.principal-label {
    width: 100%;
    font-size: 14px;
  }

  .opciones {
    width: 100%;
    justify-content: space-between;
  }

  .opciones label {
    width: 48%;
    text-align: center;
    font-size: 14px;
  }

  /* ===== DIRECCIÓN ===== */
  .direccion-container select,
  .direccion-container input[type="text"] {
    max-width: 60px;
    font-size: 12px;
  }

  .direccion-container input#direccionGenerada {
    font-size: 14px;
  }

  /* ===== BOTONES ===== */
  #msform .action-button,
  .direccion-container button {
    width: 100%;
    font-size: 14px;
  }
}
