/* =========================================================
   ESTILOS GENERALES
========================================================= */
body {
  background: linear-gradient(180deg, #eef4f9 0%, #f7fbff 100%) !important;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #1f2d3d;
}

h1,
h2,
h3,
h4,
h5 {
  color: #2f5d8a;
}

.card {
  background-color: #ffffff;
  border-radius: 1rem;
}

.text-primary {
  color: #4f7ea8 !important;
}

.text-secondary {
  color: #6c7f92 !important;
}

/* =========================================================
   BOTONES PRINCIPALES
========================================================= */
.btn-primary,
.btn-formulario {
  background-color: #547da4 !important;
  border-color: #547da4 !important;
  color: #ffffff !important;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.btn-primary:hover,
.btn-formulario:hover {
  background-color: #456b8e !important;
  border-color: #456b8e !important;
  color: #ffffff !important;
}

/* =========================================================
   ENCABEZADO VISUAL SUPERIOR
========================================================= */
.encabezado-formulario {
  background: linear-gradient(135deg, #dce8f3 0%, #edf4fa 100%);
  border: 1px solid #d2deea;
}

.badge-serio {
  background-color: #577b9d;
  color: #ffffff;
  font-size: 0.85rem;
  padding: 0.55rem 0.95rem;
}

.titulo-principal {
  color: #2f587f;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.subtitulo-principal {
  color: #5d7185;
  font-size: 1.02rem;
  line-height: 1.7;
}

/* =========================================================
   TARJETA PRINCIPAL DE FORMULARIOS
========================================================= */
.formulario-card {
  background-color: #ffffff;
  border: 1px solid #dde7f0;
}

.seccion-titulo {
  color: #355d84;
  font-weight: 700;
}

/* =========================================================
   CAMPOS DE FORMULARIO
========================================================= */
.campo-wrapper {
  background-color: #f9fcff;
  border: 1px solid #e2ebf3;
  border-radius: 16px;
  padding: 16px;
}

.form-label {
  color: #365a7c;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.form-control,
.form-select {
  border-radius: 12px !important;
  border: 1px solid #bfd0df !important;
  padding: 12px 14px !important;
  background-color: #ffffff !important;
  color: #24384c;
}

.form-control:focus,
.form-select:focus {
  border-color: #6f97ba !important;
  box-shadow: 0 0 0 0.2rem rgba(79, 126, 168, 0.18) !important;
}

/* =========================================================
   CAJA DE TÉRMINOS
========================================================= */
.terminos-box {
  background-color: #f4f8fc;
  border: 1px solid #dbe6ef;
  border-radius: 14px;
  padding: 16px 18px;
}

.form-check-label {
  color: #4d6277;
}

/* =========================================================
   ALERTAS
========================================================= */
.alert-formulario {
  border-radius: 14px;
  border: 1px solid #efc7c7;
}

/* =========================================================
   RESUMEN DEL TEST
========================================================= */
.resumen-test-box {
  background-color: #f4f8fc;
  border: 1px solid #dbe6ef;
  border-radius: 14px;
  padding: 14px 18px;
  color: #4d6277;
}

/* =========================================================
   CAJA DE CADA PREGUNTA
========================================================= */
.pregunta-box {
  background-color: #f9fcff;
  border: 1px solid #e2ebf3;
  border-radius: 16px;
  padding: 18px;
}

.pregunta-tipo {
  display: inline-block;
  background-color: #e8f1f8;
  color: #416885;
  border: 1px solid #d3e1ec;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
}

.pregunta-texto {
  color: #23384d;
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 500;
}

/* =========================================================
   ESCALA DE RESPUESTA HORIZONTAL
   - Escritorio: horizontal
   - Tablet: horizontal con scroll si hiciera falta
   - Móvil: horizontal con scroll suave
========================================================= */
.escala-respuesta {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 6px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.escala-respuesta::-webkit-scrollbar {
  height: 6px;
}

.escala-respuesta::-webkit-scrollbar-thumb {
  background-color: #c5d6e6;
  border-radius: 999px;
}

.opcion-escala {
  flex: 0 0 auto;
  display: block;
}

.btn-escala {
  min-width: 48px;
  height: 48px;
  border-radius: 12px !important;
  font-weight: 600;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Estado normal de los botones 1 a 10 */
.btn-outline-primary.btn-escala {
  color: #547da4;
  border-color: #bfd0df;
  background-color: #ffffff;
}

/* Hover */
.btn-outline-primary.btn-escala:hover {
  background-color: #eef5fb;
  border-color: #6f97ba;
  color: #456b8e;
}

/* Seleccionado */
.btn-check:checked + .btn-outline-primary.btn-escala {
  background-color: #547da4 !important;
  border-color: #547da4 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 0.18rem rgba(84, 125, 164, 0.15);
}

/* Focus accesible */
.btn-check:focus + .btn-outline-primary.btn-escala {
  box-shadow: 0 0 0 0.2rem rgba(79, 126, 168, 0.2);
}

/* =========================================================
   ESPACIADOS Y AJUSTES GENERALES
========================================================= */
.container {
  max-width: 1200px;
}

/* =========================================================
   RESPONSIVE TABLET
========================================================= */
@media (max-width: 991.98px) {
  .titulo-principal {
    font-size: 1.8rem;
  }

  .subtitulo-principal {
    font-size: 0.98rem;
  }

  .pregunta-box {
    padding: 16px;
  }

  .btn-escala {
    min-width: 46px;
    height: 46px;
  }
}

/* =========================================================
   RESPONSIVE MÓVIL
========================================================= */
@media (max-width: 767.98px) {
  body {
    font-size: 0.97rem;
  }

  .encabezado-formulario {
    padding: 1.25rem !important;
  }

  .titulo-principal {
    font-size: 1.45rem;
    line-height: 1.3;
  }

  .subtitulo-principal {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .formulario-card .card-body {
    padding: 1.25rem !important;
  }

  .campo-wrapper {
    padding: 14px;
    border-radius: 14px;
  }

  .pregunta-box {
    padding: 14px;
    border-radius: 14px;
  }

  .pregunta-texto {
    font-size: 0.97rem;
    line-height: 1.55;
  }

  .resumen-test-box {
    padding: 12px 14px;
  }

  .escala-respuesta {
    gap: 7px;
    padding-bottom: 8px;
  }

  .btn-escala {
    min-width: 42px;
    height: 42px;
    font-size: 0.95rem;
    border-radius: 10px !important;
  }

  .btn-primary,
  .btn-formulario {
    font-size: 1rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
  }
}

/* =========================================================
   RESPONSIVE MÓVIL PEQUEÑO
========================================================= */
@media (max-width: 480px) {
  .titulo-principal {
    font-size: 1.3rem;
  }

  .subtitulo-principal {
    font-size: 0.92rem;
  }

  .btn-escala {
    min-width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .pregunta-tipo {
    font-size: 0.76rem;
    padding: 4px 8px;
  }
}

/* =========================================================
   ALERTA FLOTANTE DE VALIDACIÓN
========================================================= */
.alerta-flotante-validacion {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 360px;
  background-color: #b94b4b;
  color: #ffffff;
  padding: 14px 18px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  font-weight: 600;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.alerta-flotante-validacion.mostrar {
  opacity: 1;
  transform: translateY(0);
}

.alerta-flotante-validacion.ocultar {
  opacity: 0;
  transform: translateY(-10px);
}

/* =========================================================
   RESALTADO DE PREGUNTA PENDIENTE
========================================================= */
.pregunta-pendiente-destacada {
  border: 2px solid #d46a6a !important;
  box-shadow: 0 0 0 0.25rem rgba(212, 106, 106, 0.12);
  transition: all 0.3s ease;
}

/* =========================================================
   ALERTA FLOTANTE RESPONSIVE
========================================================= */
@media (max-width: 767.98px) {
  .alerta-flotante-validacion {
    top: 14px;
    right: 14px;
    left: 14px;
    max-width: none;
    font-size: 0.95rem;
    padding: 12px 14px;
  }
}

/* =========================================================
   RESULTADO PARCIAL
========================================================= */
.resultado-circulo {
  width: 240px;
  height: 240px;
  margin: 0 auto;
  border-radius: 50%;
  background: #f7fbff;
  border: 10px solid #dce8f3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.7);
}

.resultado-circulo-valor {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2f587f;
  line-height: 1;
}

.resultado-circulo-texto {
  margin-top: 10px;
  color: #5c7186;
  font-size: 0.98rem;
  text-align: center;
  max-width: 130px;
}

.resultado-resumen-box {
  background-color: #f9fcff;
  border: 1px solid #e2ebf3;
  border-radius: 18px;
  padding: 24px;
}

.resultado-etiqueta {
  display: inline-block;
  background-color: #e8f1f8;
  color: #416885;
  border: 1px solid #d3e1ec;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

.resultado-categoria {
  color: #2f587f;
  font-weight: 700;
}

.resultado-mensaje {
  color: #4f6377;
  line-height: 1.7;
}

/* Estados visuales */
.estado-bajo {
  border-color: #d8c7c7;
}

.estado-medio {
  border-color: #d9e2c7;
}

.estado-alto {
  border-color: #c8dae9;
}

/* Bloque premium */
.resultado-premium-box {
  background: linear-gradient(135deg, #eef4f9 0%, #f8fbfe 100%);
  border: 1px solid #dde7f0;
  border-radius: 18px;
  padding: 24px;
}

.lista-premium {
  margin: 0;
  padding-left: 1.2rem;
  color: #53687c;
  line-height: 1.8;
}

/* Botón outline secundario */
.btn-outline-secondary {
  color: #5f7488;
  border-color: #c9d7e3;
}

.btn-outline-secondary:hover {
  background-color: #eef4f9;
  border-color: #b9cad8;
  color: #486073;
}

/* Responsive resultado parcial */
@media (max-width: 767.98px) {
  .resultado-circulo {
    width: 200px;
    height: 200px;
  }

  .resultado-circulo-valor {
    font-size: 2.1rem;
  }

  .resultado-resumen-box,
  .resultado-premium-box {
    padding: 18px;
  }
}

/* =========================================================
   VARIABLES DESTACADAS EN RESULTADO PARCIAL
========================================================= */
.variables-panel {
  background-color: #f9fcff;
  border: 1px solid #e2ebf3;
  border-radius: 18px;
  padding: 22px;
  height: 100%;
}

.variables-panel-header {
  margin-bottom: 18px;
}

.variables-panel-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.badge-fortaleza {
  background-color: #e6f0f8;
  color: #426784;
  border: 1px solid #d1e1ee;
}

.badge-desarrollo {
  background-color: #f4edf0;
  color: #7a5f6b;
  border: 1px solid #e3d5dc;
}

.variables-lista {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.variable-item {
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #e2ebf3;
  background-color: #ffffff;
}

.variable-item-fortaleza {
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fc 100%);
}

.variable-item-desarrollo {
  background: linear-gradient(180deg, #fffdfd 0%, #faf6f8 100%);
}

.variable-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.variable-item-nombre {
  color: #29445c;
  font-weight: 600;
  line-height: 1.4;
}

.variable-item-score {
  color: #355d84;
  font-weight: 700;
  white-space: nowrap;
}

.variable-barra {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background-color: #e9f0f6;
  overflow: hidden;
  margin-bottom: 8px;
}

.variable-barra-relleno {
  height: 100%;
  border-radius: 999px;
}

.barra-fortaleza {
  background: linear-gradient(90deg, #7ea4c6 0%, #547da4 100%);
}

.barra-desarrollo {
  background: linear-gradient(90deg, #caa3b0 0%, #ad7f90 100%);
}

.variable-item-meta {
  color: #6a7d8f;
  font-size: 0.92rem;
}

/* Responsive */
@media (max-width: 767.98px) {
  .variables-panel {
    padding: 18px;
  }

  .variable-item {
    padding: 14px;
  }

  .variable-item-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .variable-item-score {
    white-space: normal;
  }
}

/* =========================================================
   PÁGINA DE PAGO / RESULTADO PREMIUM
========================================================= */
.premium-detalle-lista {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.premium-detalle-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border: 1px solid #e2ebf3;
  background-color: #f9fcff;
  border-radius: 16px;
}

.premium-detalle-icono {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #e4eef7;
  color: #456b8e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 32px;
}

.premium-detalle-titulo {
  color: #29445c;
  font-weight: 700;
  margin-bottom: 4px;
}

.premium-detalle-texto {
  color: #596f83;
  line-height: 1.6;
}

.premium-nota {
  background-color: #f4f8fc;
  border: 1px solid #dbe6ef;
  border-radius: 14px;
  padding: 16px 18px;
  color: #5b6f82;
  line-height: 1.7;
  font-size: 0.95rem;
}

.premium-caja-superior {
  text-align: center;
}

.premium-etiqueta {
  display: inline-block;
  background-color: #e8f1f8;
  color: #416885;
  border: 1px solid #d3e1ec;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 600;
}

.premium-precio {
  color: #2f587f;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.1;
}

.premium-resumen-box {
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
  border: 1px solid #dde7f0;
  border-radius: 18px;
  padding: 18px;
}

.premium-resumen-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: #55697c;
  border-bottom: 1px solid #e8eff5;
}

.premium-resumen-item:last-child {
  border-bottom: none;
}

.premium-total {
  color: #2f587f;
  font-weight: 700;
  padding-top: 14px;
}

/* Responsive */
@media (max-width: 767.98px) {
  .premium-precio {
    font-size: 2rem;
  }

  .premium-detalle-item {
    padding: 12px;
  }

  .premium-resumen-box {
    padding: 16px;
  }
}

/* =========================================================
   RESULTADO COMPLETO - TARJETAS INTERPRETATIVAS
========================================================= */
.variable-item.h-100 {
  height: 100%;
}

.variable-item .resultado-mensaje {
  color: #4f6377;
  line-height: 1.75;
  font-size: 0.97rem;
}

.variable-item .small {
  background-color: #f7fbff;
  border: 1px solid #e2ebf3;
  border-radius: 14px;
  padding: 12px 14px;
  line-height: 1.7;
}

.variable-item-descripcion {
  text-align: justify !important;
  text-justify: inter-word;
}

/* =========================================================
   CHART.JS - RESULTADO COMPLETO
========================================================= */
.radar-chart-wrapper {
  position: relative;
  width: 100%;
  min-height: 460px;
}

@media (max-width: 991.98px) {
  .radar-chart-wrapper {
    min-height: 420px;
  }
}

@media (max-width: 767.98px) {
  .radar-chart-wrapper {
    min-height: 360px;
  }
}

@media (max-width: 480px) {
  .radar-chart-wrapper {
    min-height: 320px;
  }
}

/* =========================================================
   DOUGHNUT CHART - RESULTADO GLOBAL
========================================================= */
.doughnut-chart-wrapper {
  position: relative;
  width: 100%;
  max-width: 280px;
  height: 280px;
  margin: 0 auto;
}

.doughnut-centro-texto {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

.doughnut-centro-valor {
  font-size: 2rem;
  font-weight: 700;
  color: #2f587f;
  line-height: 1;
}

.doughnut-centro-label {
  margin-top: 8px;
  color: #667b8e;
  font-size: 0.92rem;
}

.resultado-explicacion-doughnut {
  background-color: #f7fbff;
  border: 1px solid #e2ebf3;
  border-radius: 14px;
  padding: 14px 16px;
  color: #4f6377;
  line-height: 1.7;
}

@media (max-width: 767.98px) {
  .doughnut-chart-wrapper {
    max-width: 240px;
    height: 240px;
  }

  .doughnut-centro-valor {
    font-size: 1.7rem;
  }

  .doughnut-centro-label {
    font-size: 0.88rem;
  }
}

/* =========================================================
   AJUSTES DOUGHNUT - CENTRO Y LEYENDA
========================================================= */
.doughnut-chart-wrapper {
  position: relative;
  width: 100%;
  max-width: 280px;
  height: 280px;
  margin: 0 auto 14px auto;
}

.doughnut-centro-texto {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  transform: translateY(-10px);
}

.doughnut-centro-valor {
  font-size: 2rem;
  font-weight: 700;
  color: #2f587f;
  line-height: 1;
}

.doughnut-centro-label {
  margin-top: 8px;
  color: #667b8e;
  font-size: 0.92rem;
  line-height: 1.2;
}

.doughnut-leyenda {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 0 auto 14px auto;
  text-align: left;
}

.doughnut-leyenda-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doughnut-leyenda-color {
  width: 34px;
  height: 14px;
  border-radius: 4px;
  flex: 0 0 34px;
}

.doughnut-leyenda-color-principal {
  background-color: rgba(84, 125, 164, 1);
}

.doughnut-leyenda-color-restante {
  background-color: rgba(220, 232, 243, 0.95);
  border: 1px solid #d7e3ee;
}

.doughnut-leyenda-texto {
  color: #4f6377;
  font-size: 0.95rem;
  line-height: 1.3;
}

@media (max-width: 767.98px) {
  .doughnut-chart-wrapper {
    max-width: 240px;
    height: 240px;
  }

  .doughnut-centro-texto {
    transform: translateY(-8px);
  }

  .doughnut-centro-valor {
    font-size: 1.7rem;
  }

  .doughnut-centro-label {
    font-size: 0.88rem;
  }

  .doughnut-leyenda-texto {
    font-size: 0.9rem;
  }

  .doughnut-leyenda-color {
    width: 30px;
    height: 12px;
    flex-basis: 30px;
  }
}
