/* --------------------------
   ESTILOS GENERALES
--------------------------- */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #fafafa;
  color: #333;
}


/* --------------------------
   CONTENEDOR PRINCIPAL
--------------------------- */
.container {
  max-width: 1200px;
  margin: 40px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 40px 50px;
}

/* --------------------------
   FORMULARIO PRINCIPAL
--------------------------- */
form#diagnosticoForm {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

label {
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

select:focus,
input:focus {
  outline: 2px solid #f05a1a;
  border-color: #f05a1a;
}

/* --------------------------
   BLOQUE DE PREGUNTAS
--------------------------- */
.pregunta {
  background: #fff;
  border-left: 4px solid #f05a1a;
  padding: 15px 20px;
  border-radius: 6px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}
.pregunta.oculto { display: none; }

.pregunta label {
  font-weight: bold;
  color: #ad0c0c;
  margin-bottom: 8px;
  display: block;
}

.pregunta .check-label {
  font-weight: normal !important;
  color: #000 !important;
}

/* ---------- GRID de CHECKBOXES ---------- */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 8px 20px;
  margin-top: 10px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.check-item input[type="checkbox"] {
  transform: scale(1.1);
  cursor: pointer;
}

.check-label {
  cursor: pointer;
  color: #333;
}

/* --------------------------
   BOTONES
--------------------------- */
button[type="submit"],
.btn-principal {
  background-color: #f05a1a;
  color: #fff;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  padding: 12px 25px;
  cursor: pointer;
  transition: background-color 0.3s;
  align-self: center;
}
button[type="submit"]:hover,
.btn-principal:hover {
  background-color: #ad0c0c;
}

/* --------------------------
   MODAL RESULTADO
--------------------------- */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#overlay:not(.oculto) { display: flex; }

#modalResultado {
  background: #fff;
  border: 3px solid #f05a1a;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px 40px 100px;
  position: relative;
  color: #333;
  animation: fadeIn 0.3s ease-in-out;
}

#modalResultado::-webkit-scrollbar {
  width: 10px;
}
#modalResultado::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 5px;
}
#modalResultado::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

#modalResultado h2 {
  color: #ad0c0c;
  font-size: 22px;
  text-align: center;
  border-bottom: 1px solid #f05a1a40;
  padding-bottom: 10px;
}

/* --------------------------
   BLOQUE DE SERVICIOS / MOTIVOS
--------------------------- */
.servicio {
  display: flex;
  align-items: center;
  margin-top: 18px;
  font-weight: bold;
  color: #ad0c0c;
}
.servicio .circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 10px;
}
.circle.rojo { background-color: #d62828; }
.circle.verde { background-color: #4caf50; }
.circle.amarillo { background-color: #ffb703; }

.motivos {
  margin: 6px 0 20px 24px;
}
.motivo {
  background: #f9f9f9;
  border-left: 3px solid #f05a1a;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  line-height: 1.5;
  font-size: 14px;
  color: #444;
}

/* --------------------------
   LEYENDA DEL RESULTADO
--------------------------- */
.leyenda {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  font-size: 14px;
  color: #444;
}
.leyenda .circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

/* --------------------------
   TARJETA DE DATOS DE EMPRESA
--------------------------- */
#diagnosticoForm section:first-of-type {
  background: #fff;
  border: 1px solid #ddd;
  border-left: 4px solid #f05a1a;
  border-radius: 10px;
  padding: 25px 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

#diagnosticoForm section:first-of-type h2 {
  grid-column: span 2;
  color: #ad0c0c;
  border-bottom: 2px solid #f05a1a30;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

/* Inputs y selects dentro del bloque */
#diagnosticoForm section:first-of-type label {
  color: #ad0c0c;
  font-weight: bold;
}
#diagnosticoForm section:first-of-type label input,
#diagnosticoForm section:first-of-type label select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

/* --------------------------
   BLOQUE DE CONDICIONES RGPD
--------------------------- */
.aceptacion {
  margin-top: 25px;
  background-color: #fafafa;
  border: 1px solid #eee;
  padding: 12px 15px;
  border-radius: 8px;
}

.check-condiciones {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.95em;
  line-height: 1.5;
  color: #333;
}
.check-condiciones input[type="checkbox"] {
  margin-top: 4px;
  transform: scale(1.2);
  accent-color: #f05a1a;
}
.check-condiciones a {
  color: #f05a1a;
  text-decoration: none;
}
.check-condiciones a:hover {
  text-decoration: underline;
}

/* --------------------------
   COLUMNA DERECHA / DISCLAIMER
--------------------------- */
.contenedor-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  width: 100%;
  margin-top: 20px;
}
.columna-formulario { flex: 1; min-width: 600px; }
.columna-info {
  width: 400px;
  background-color: #fafafa;
  border-left: 3px solid #f05a1a;
  padding: 24px 28px;
  border-radius: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 90px;
  height: fit-content;
}
.columna-info h2 { color: #ad0c0c; margin-bottom: 10px; }
.columna-info p { text-align: justify; line-height: 1.6; margin-bottom: 10px; }
.disclaimer {
  background-color: #fff5f5;
  border: 1px solid #f5c2c7;
  border-left: 5px solid #d62828;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.8em;
  color: #5a1a1a;
  text-align: justify;
  margin-top: 15px;
}

/* =====================================================
   🧩 FIX FINAL: DATOS EMPRESA UNA COLUMNA EN MÓVIL
===================================================== */
@media (max-width: 768px) {
  #diagnosticoForm section:first-of-type {
    display: block !important;
  }
  #diagnosticoForm section:first-of-type label {
    display: block !important;
    width: 100% !important;
    margin-bottom: 15px !important;
  }
  #diagnosticoForm section:first-of-type input,
  #diagnosticoForm section:first-of-type select {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  #diagnosticoForm section:first-of-type {
    padding: 20px !important;
  }
  #diagnosticoForm section:first-of-type * {
    float: none !important;
    grid-column: auto !important;
  }
  .columna-formulario {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 100% !important;
  }
  .contenedor-flex {
    flex-direction: column !important;
  }
  .columna-info {
    width: 100% !important;
    position: static !important;
    border-left: none !important;
    border-top: 3px solid #f05a1a !important;
    margin-top: 25px !important;
    padding: 20px !important;
  }
}
/* --------------------------
   ICONO DE AYUDA EN PREGUNTAS
--------------------------- */
.pregunta-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.icono-ayuda {
  font-size: 24px;
  color: #f05a1a;
 
  border-radius: 50%;
  width: 18px;
  height: 18px;
  text-align: center;
  line-height: 18px;
  font-weight: bold;
  margin-left: 6px;
  cursor: pointer;
  display: inline-flex;
 
  justify-content: center;

  transition: color 0.2s ease;
  
}

.icono-ayuda:hover {
  color: #ad0c0c;
}

/* Tooltip oculto por defecto */
.tooltip-ayuda {
  display: none;
  position: absolute;
  top: 120%;
  right: 0;
  background-color: #333;
  color: #fff;
  padding: 10px 10px;
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.4;
  width: 250px;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Flecha del tooltip */
.tooltip-ayuda::after {
  content: "";
  position: absolute;
  top: -6px;
  right: 10px;
  border-width: 6px;
  border-style: solid;
  border-color: transparent transparent #333 transparent;
}

/* Mostrar al pasar el ratón */
.icono-ayuda:hover .tooltip-ayuda {
  display: block;
}

/* Adaptación móvil */
@media (max-width: 600px) {
  .tooltip-ayuda {
    right: auto;
    left: 0;
    width: 90%;
  }
}
/* 🔒 Forzamos que los elementos con clase .oculto no se vean nunca */
.oculto {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}
