/* ───────────────────────────────────────────────────────────
   Evaluación 360 · Grupo FR
   Paleta corporativa tomada del logotipo institucional
   ─────────────────────────────────────────────────────────── */
:root {
  --verde: #00B500;
  --verde-osc: #024F01;
  --verde-medio: #046B04;
  --verde-claro: #E8F6E8;
  --verde-borde: #CBE5CB;
  --rojo: #FF2A30;
  --tinta: #16210F;
  --gris: #5C6A5C;
  --gris-claro: #8A968A;
  --linea: #E1E9E1;
  --fondo: #F1F4F1;
  --blanco: #FFFFFF;
  --sombra: 0 1px 2px rgba(2, 40, 2, .05), 0 8px 24px rgba(2, 40, 2, .06);
  --radio: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* ── Encabezado ─────────────────────────────────────────── */
.encabezado {
  background: linear-gradient(125deg, var(--verde-osc) 0%, var(--verde-medio) 55%, var(--verde) 130%);
  color: #fff;
  padding: 18px 20px 20px;
  position: relative;
  overflow: hidden;
}
.encabezado::after {
  content: "";
  position: absolute; inset: -60% -20% auto auto;
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.10), transparent 62%);
  pointer-events: none;
}
.encabezado-interior {
  max-width: 980px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.logo { height: 54px; width: auto; flex: none; }
.encabezado h1 {
  font-size: 17px; line-height: 1.3; margin: 0; font-weight: 800; letter-spacing: .2px;
  text-transform: uppercase;
}
.encabezado .lema { font-size: 11px; letter-spacing: 2.4px; opacity: .85; font-weight: 700; margin-bottom: 4px; }
.encabezado .codigo { font-size: 11.5px; color: #CFF0CF; margin-top: 5px; }

/* ── Barra de progreso ──────────────────────────────────── */
.progreso {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linea);
}
.progreso-interior { max-width: 980px; margin: 0 auto; padding: 10px 20px 12px; }
.pasos { display: flex; gap: 6px; list-style: none; margin: 0 0 8px; padding: 0; overflow-x: auto; scrollbar-width: none; }
.pasos::-webkit-scrollbar { display: none; }
.pasos li {
  font-size: 11.5px; font-weight: 700; color: var(--gris-claro);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent;
}
.pasos li.activo { color: var(--verde-osc); background: var(--verde-claro); border-color: var(--verde-borde); }
.pasos li.hecho { color: var(--verde-medio); }
.pasos li.hecho::before { content: "✓ "; }
.barra { height: 6px; background: var(--linea); border-radius: 999px; overflow: hidden; }
.barra > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--verde-medio), var(--verde)); transition: width .35s ease; }
.progreso-txt { font-size: 11.5px; color: var(--gris); margin-top: 6px; display: flex; justify-content: space-between; gap: 12px; }

/* ── Contenedor ─────────────────────────────────────────── */
.contenedor { max-width: 980px; margin: 0 auto; padding: 22px 20px 120px; }

.tarjeta {
  background: var(--blanco); border: 1px solid var(--linea);
  border-radius: var(--radio); box-shadow: var(--sombra);
  padding: 22px; margin-bottom: 18px;
}
.tarjeta.plana { box-shadow: none; }

.seccion-titulo { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.seccion-num {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  background: var(--verde-claro); color: var(--verde-osc);
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  border: 1px solid var(--verde-borde);
}
.seccion-titulo h2 { font-size: 18px; margin: 3px 0 0; font-weight: 800; color: var(--verde-osc); letter-spacing: .2px; }
.lema-seccion { font-size: 13px; color: var(--verde-medio); font-style: italic; margin: 2px 0 0; }

.bloque-info {
  background: var(--verde-claro); border: 1px solid var(--verde-borde);
  border-left: 4px solid var(--verde); border-radius: 10px;
  padding: 12px 14px; margin: 14px 0; font-size: 13.5px; color: #24401F;
}
.bloque-info b { color: var(--verde-osc); }
.bloque-info ul { margin: 6px 0 0; padding-left: 18px; }
.bloque-info li { margin: 3px 0; }

.etiqueta-obj { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 800; color: var(--verde-medio); }

/* ── Campos ─────────────────────────────────────────────── */
.campo { margin-bottom: 18px; }
.campo > label, .campo > .rotulo {
  display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; color: var(--tinta);
}
.campo .ayuda { font-size: 12.5px; color: var(--gris); margin-top: 5px; }
.req { color: var(--rojo); font-weight: 700; }

input[type="text"], input[type="number"], select, textarea {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 15px;
  border: 1px solid #D3DED3; border-radius: 10px; background: #fff; color: var(--tinta);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px rgba(0, 181, 0, .16);
}
.campo.error input, .campo.error select, .campo.error textarea,
.pregunta.error { border-color: var(--rojo) !important; }
.pregunta.error { box-shadow: 0 0 0 3px rgba(255, 42, 48, .10); }
.mensaje-error { color: var(--rojo); font-size: 12.5px; margin-top: 5px; font-weight: 600; display: none; }
.campo.error .mensaje-error { display: block; }

.contador { font-size: 11.5px; color: var(--gris-claro); text-align: right; margin-top: 3px; }

/* ── Ficha del colaborador ──────────────────────────────── */
.ficha {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--verde-osc), var(--verde-medio));
  color: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
}
.ficha .nombre { font-size: 17px; font-weight: 800; line-height: 1.2; }
.ficha .detalle { font-size: 12.5px; opacity: .9; }
.ficha .sep { width: 1px; height: 34px; background: rgba(255,255,255,.28); }

/* ── Leyenda de la escala ───────────────────────────────── */
.leyenda { border: 1px solid var(--linea); border-radius: 12px; overflow: hidden; margin: 14px 0 4px; }
.leyenda summary {
  cursor: pointer; padding: 11px 14px; font-size: 13px; font-weight: 700;
  background: #F7FAF7; color: var(--verde-osc); list-style: none;
}
.leyenda summary::-webkit-details-marker { display: none; }
.leyenda summary::before { content: "▸ "; }
.leyenda[open] summary::before { content: "▾ "; }
.leyenda table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.leyenda td { padding: 8px 12px; border-top: 1px solid var(--linea); vertical-align: middle; }
.leyenda td:first-child { width: 42%; font-weight: 700; text-align: center; white-space: nowrap; }

/* ── Preguntas con escala ───────────────────────────────── */
.pregunta {
  border: 1px solid var(--linea); border-radius: 12px; padding: 14px; margin-bottom: 12px;
  background: #fff; transition: border-color .15s;
}
.pregunta.respondida { border-color: var(--verde-borde); background: #FCFEFC; }
.pregunta-texto { font-size: 14.5px; font-weight: 600; margin-bottom: 12px; line-height: 1.45; }
.pregunta-texto .n { color: var(--verde-medio); font-weight: 800; margin-right: 4px; }

.opciones { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.opciones input { position: absolute; opacity: 0; pointer-events: none; }
.opcion {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-align: center; padding: 10px 6px; border: 1.5px solid var(--linea); border-radius: 10px;
  cursor: pointer; font-size: 12px; font-weight: 700; color: var(--gris);
  background: #fff; transition: all .14s ease; min-height: 62px; user-select: none;
}
.opcion .punto { width: 13px; height: 13px; border-radius: 50%; border: 2px solid currentColor; opacity: .5; }
.opcion:hover { border-color: var(--verde); color: var(--verde-osc); }
input:checked + .opcion {
  color: #fff; border-color: transparent; transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(2, 40, 2, .16);
}
input:checked + .opcion .punto { opacity: 1; background: currentColor; }
input:focus-visible + .opcion { box-shadow: 0 0 0 3px rgba(0, 181, 0, .3); }

/* ── Matriz (compañeros / áreas) ────────────────────────── */
.matriz { border: 1px solid var(--linea); border-radius: 12px; overflow: hidden; }
.matriz-cab, .matriz-fila { display: grid; grid-template-columns: minmax(170px, 1.7fr) repeat(5, minmax(70px, 1fr)); }
/* El encabezado va en el flujo normal: si se deja fijo (sticky) se despega y
   tapa la segunda fila cuando la matriz está cerca del borde superior. */
.matriz-cab { background: #F7FAF7; border-bottom: 1px solid var(--linea); }
/* En listas largas se repite cada 8 filas para no perder de vista las columnas */
.matriz-cab.repetida { border-top: 1px solid var(--linea); }
.matriz-cab div { padding: 9px 6px; font-size: 11px; font-weight: 800; text-align: center; color: var(--gris); line-height: 1.25; }
.matriz-cab div:first-child { text-align: left; padding-left: 14px; color: var(--verde-osc); }
.matriz-fila { border-top: 1px solid var(--linea); align-items: stretch; }
.matriz-fila:first-child { border-top: none; }
.matriz-fila.respondida { background: #FCFEFC; }
.matriz-nombre {
  padding: 10px 14px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.matriz-nombre .avatar {
  flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--verde-claro);
  color: var(--verde-osc); display: grid; place-items: center; font-size: 11px; font-weight: 800;
  border: 1px solid var(--verde-borde);
}
.celda { display: grid; place-items: center; padding: 6px 4px; border-left: 1px solid #F0F3F0; }
.celda input { position: absolute; opacity: 0; pointer-events: none; }
.celda label {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid #CBD6CB; cursor: pointer;
  display: grid; place-items: center; transition: all .13s ease;
}
.celda label:hover { border-color: var(--verde); transform: scale(1.08); }
.celda input:checked + label { border-color: transparent; box-shadow: 0 2px 7px rgba(2,40,2,.2); }
.celda input:checked + label::after { content: "✓"; color: #fff; font-size: 14px; font-weight: 800; line-height: 1; }
.celda input:focus-visible + label { box-shadow: 0 0 0 3px rgba(0,181,0,.3); }
.celda .movil { display: none; }

/* ── Botones ────────────────────────────────────────────── */
.acciones {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--linea); padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.acciones-interior { max-width: 980px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.boton {
  font: inherit; font-size: 15px; font-weight: 700; border-radius: 10px; padding: 12px 22px;
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.boton.primario { background: linear-gradient(120deg, var(--verde-medio), var(--verde)); color: #fff; box-shadow: 0 3px 12px rgba(0,140,0,.28); }
.boton.primario:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.boton.secundario { background: #fff; color: var(--verde-osc); border-color: var(--verde-borde); }
.boton.secundario:hover:not(:disabled) { background: var(--verde-claro); }
.boton:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.espaciador { flex: 1; }
.contador-paso { font-size: 12.5px; color: var(--gris); font-weight: 600; }

/* ── Avisos ─────────────────────────────────────────────── */
.aviso {
  border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin: 14px 0; font-weight: 600;
  border: 1px solid; display: none;
}
.aviso.ver { display: block; }
.aviso.error { background: #FFF1F1; border-color: #FFC9CB; color: #A31119; }
.aviso.exito { background: var(--verde-claro); border-color: var(--verde-borde); color: var(--verde-osc); }
.aviso ul { margin: 6px 0 0; padding-left: 18px; font-weight: 500; }

.oculto { display: none !important; }

/* ── Pantalla final ─────────────────────────────────────── */
.final { text-align: center; padding: 40px 20px; }
.final .icono {
  width: 78px; height: 78px; border-radius: 50%; margin: 0 auto 18px;
  background: linear-gradient(120deg, var(--verde-medio), var(--verde));
  display: grid; place-items: center; color: #fff; font-size: 38px;
  box-shadow: 0 8px 24px rgba(0,140,0,.3);
}
.final h2 { color: var(--verde-osc); font-size: 24px; margin: 0 0 8px; }
.final p { color: var(--gris); max-width: 520px; margin: 0 auto 10px; }
.folio { display: inline-block; font-family: ui-monospace, Consolas, monospace; font-size: 15px; font-weight: 700;
  background: var(--verde-claro); border: 1px dashed var(--verde-borde); color: var(--verde-osc);
  padding: 8px 16px; border-radius: 10px; margin: 12px 0; }

/* ── Resumen previo al envío ────────────────────────────── */
.resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.resumen .caja { border: 1px solid var(--linea); border-radius: 12px; padding: 14px; text-align: center; }
.resumen .caja .t { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--gris); font-weight: 800; }
.resumen .caja .v { font-size: 24px; font-weight: 800; color: var(--verde-osc); margin-top: 4px; }
.resumen .caja .s { font-size: 11px; color: var(--gris-claro); }

/* ── Archivos ───────────────────────────────────────────── */
.zona-archivo {
  border: 2px dashed var(--verde-borde); border-radius: 12px; padding: 20px; text-align: center;
  background: #FAFDFA; cursor: pointer; transition: all .15s;
}
.zona-archivo:hover { border-color: var(--verde); background: var(--verde-claro); }
.zona-archivo input { display: none; }
.lista-archivos { list-style: none; padding: 0; margin: 10px 0 0; }
.lista-archivos li {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  border: 1px solid var(--linea); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; background: #fff;
}
.lista-archivos .quitar { margin-left: auto; background: none; border: none; color: var(--rojo); cursor: pointer; font-size: 18px; line-height: 1; }

.pie {
  text-align: center; font-size: 11.5px; color: var(--gris-claro);
  padding: 24px 20px 10px; line-height: 1.7;
}

/* ── Móvil ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  body { font-size: 15px; }
  .contenedor { padding: 16px 12px 130px; }
  .tarjeta { padding: 16px 14px; border-radius: 12px; }
  .encabezado { padding: 14px 14px 16px; }
  .encabezado h1 { font-size: 14.5px; }
  .logo { height: 42px; }

  .opciones { grid-template-columns: 1fr 1fr; }
  .opciones > *:last-child { grid-column: span 2; }
  .opcion { flex-direction: row; justify-content: flex-start; gap: 9px; min-height: 46px; padding: 9px 12px; text-align: left; font-size: 13px; }

  .matriz { border: none; }
  .matriz-cab { display: none; }
  .matriz-fila {
    display: block; border: 1px solid var(--linea); border-radius: 12px;
    margin-bottom: 10px; background: #fff; padding: 10px 12px 12px;
  }
  .matriz-fila.respondida { border-color: var(--verde-borde); }
  .matriz-nombre { padding: 0 0 9px; font-size: 14px; }
  .celda {
    display: flex; align-items: center; gap: 10px; border-left: none;
    border-top: 1px solid #F2F5F2; padding: 7px 2px; justify-content: flex-start;
  }
  .celda label { width: 24px; height: 24px; flex: none; }
  .celda .movil { display: inline; font-size: 13px; font-weight: 600; color: var(--gris); }
  .celda:has(input:checked) .movil { color: var(--tinta); font-weight: 700; }

  .acciones-interior { flex-wrap: wrap; }
  .boton { flex: 1; padding: 12px 14px; font-size: 14.5px; }
  .contador-paso { width: 100%; text-align: center; order: -1; margin-bottom: 2px; }
  .espaciador { display: none; }
}

@media print {
  .progreso, .acciones, .encabezado::after { display: none !important; }
  body { background: #fff; }
  .tarjeta { box-shadow: none; break-inside: avoid; }
}
