/* =====================================================================
   encuestas.css — Estilos específicos de la administración de encuestas
   y de la página pública de respuesta. Reutiliza base/app/crud.
   ===================================================================== */

/* Modal más ancho para el editor y los resultados */
.modal-card.modal-lg { max-width: 720px; width: 100%; }

.tabla-crud th.ctr, .tabla-crud td.ctr { text-align: center; }

.sec-title {
  font-size: 15px; font-weight: 700; color: var(--brand-dark);
  margin: 20px 0 10px; padding-top: 14px; border-top: 1px solid var(--line);
}

/* ── Preguntas (editor) ─────────────────────────────────────────────── */
.preguntas-wrap { margin-top: 6px; }

.preguntas-list { list-style: none; margin: 0 0 12px; padding: 0; }
.preguntas-list .vacio-p { color: var(--muted); font-size: 14px; padding: 8px 0; }

.pregunta-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  margin-bottom: 8px; background: var(--brand-light);
}
.pi-main { min-width: 0; }
.pi-txt  { font-size: 14px; font-weight: 600; }
.pi-esc  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pi-acc  { white-space: nowrap; flex-shrink: 0; }

.pregunta-form {
  display: grid; grid-template-columns: 1fr 260px; gap: 12px; align-items: end;
  padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm);
}
.pregunta-form .pf-actions {
  grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px;
}
.pregunta-form select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 14px; background: var(--bg);
}

/* ── Resultados ─────────────────────────────────────────────────────── */
.res-kpis { display: flex; gap: 12px; margin-bottom: 8px; }
.kpi {
  flex: 1; text-align: center; padding: 12px; background: var(--brand-light);
  border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.kpi-n { display: block; font-size: 24px; font-weight: 800; color: var(--brand-dark); }
.kpi-l { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.res-pregunta { margin-top: 14px; }
.rp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.rp-txt  { font-weight: 600; font-size: 14px; }
.rp-prom { font-size: 12px; color: var(--muted); white-space: nowrap; }

.dist { display: flex; flex-direction: column; gap: 4px; }
.dist-row { display: flex; align-items: center; gap: 8px; }
.dist-v { width: 20px; text-align: right; font-size: 12px; color: var(--muted); }
.dist-bar { flex: 1; height: 14px; background: var(--line); border-radius: 7px; overflow: hidden; }
.dist-fill { display: block; height: 100%; background: var(--brand); border-radius: 7px; }
.dist-c { width: 28px; font-size: 12px; color: var(--muted); }

.coment-list { margin: 8px 0 0; padding-left: 18px; }
.coment-list li { font-size: 14px; margin-bottom: 6px; color: #374151; }

/* ── Página pública de respuesta ────────────────────────────────────── */
.enc-public {
  max-width: 640px; margin: 40px auto; padding: 0 16px;
}
.enc-card {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; box-shadow: 0 6px 24px rgba(0,0,0,.06);
}
.enc-logo { text-align: center; margin-bottom: 16px; }
.enc-logo img { width: 140px; }
.enc-titulo { font-size: 22px; font-weight: 800; color: var(--brand-dark); text-align: center; margin: 0 0 6px; }
.enc-sub { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: 14px; }

.enc-preg { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.enc-preg:last-of-type { border-bottom: 0; }
.enc-preg-txt { font-weight: 600; margin-bottom: 12px; }

/* Rejilla de opciones: TODAS del mismo tamaño (columnas iguales). --cols la fija el JS:
   escalas de hasta 5 → una fila; de 6 a 10 → dos filas parejas (5 por fila). Así el
   valor 10 no queda solo estirado en su propia fila. */
.enc-opts { display: grid; grid-template-columns: repeat(var(--cols, 5), 1fr); gap: 8px; }
.enc-opt {
  cursor: pointer; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 0; text-align: center; font-size: 14px; background: var(--bg);
  min-width: 0; transition: all .12s ease;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px;
}
.enc-opt:hover { border-color: var(--brand); background: var(--brand-light); }
.enc-opt input { display: none; }
.enc-opt.sel { border-color: var(--brand); background: var(--brand); color: #fff; }
.enc-opt .eo-n { font-weight: 700; }
.enc-opt .eo-l { font-size: 10px; line-height: 1.1; opacity: .8; }

.enc-coment { margin-top: 8px; }
.enc-coment textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; resize: vertical;
}
.enc-foot { margin-top: 24px; text-align: center; }
.enc-estado { text-align: center; padding: 40px 20px; }
.enc-estado h2 { color: var(--brand-dark); }

@media (max-width: 560px) {
  .pregunta-form { grid-template-columns: 1fr; }
  .res-kpis { flex-direction: column; }
}
