/* Nunito Sans, la fuente institucional de MinTrabajo, servida desde el mismo sitio (sin Google Fonts) */
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/NunitoSans-400.woff') format('woff'); }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/NunitoSans-600.woff') format('woff'); }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/NunitoSans-700.woff') format('woff'); }
@font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/NunitoSans-800.woff') format('woff'); }

:root {
  --vino: #6a1d36;
  --vino-osc: #4e1428;
  --vino-claro: #f6ecef;
  --vino-borde: #e4c9d2;
  --gris: #f2f5f7;
  --linea: #e2e8f0;
  --texto: #1e293b;
  --suave: #64748b;
  --ok: #1f7a4d;
  --ok-fondo: #e8f5ee;
  --error: #b42318;
  --error-fondo: #fdecea;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--gris);
  color: var(--texto);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.franja { display: flex; height: 5px; position: sticky; top: 0; z-index: 20; }
.franja i { display: block; }
.franja .am { flex: 2; background: #fcd116; }
.franja .az { flex: 1; background: #003893; }
.franja .ro { flex: 1; background: #ce1126; }

.cabecera {
  background: #fff;
  border-bottom: 1px solid var(--linea);
}
.cabecera-in {
  max-width: 820px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 16px;
}
.cabecera img { height: 58px; width: auto; }
.cabecera .sep { width: 1px; align-self: stretch; background: var(--linea); }
.cabecera .ent { font-family: 'Nunito Sans', sans-serif; font-weight: 700; color: var(--vino); font-size: 1rem; line-height: 1.2; }
.cabecera .sub { font-size: .8rem; color: var(--suave); }

.progreso { position: sticky; top: 5px; z-index: 19; height: 4px; background: var(--vino-claro); }
.progreso span { display: block; height: 100%; width: 0; background: var(--vino); transition: width .3s ease; }

main { max-width: 820px; margin: 0 auto; padding: 28px 20px 64px; }

.portada {
  background: var(--vino);
  color: #fff;
  border-radius: 14px;
  padding: 28px 28px 26px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.portada::after {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.portada .etq {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; background: rgba(255,255,255,.16);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.portada h1 { font-family: 'Nunito Sans', sans-serif; font-size: 1.9rem; font-weight: 800; line-height: 1.15; margin-bottom: 6px; }
.portada .curso { font-weight: 600; opacity: .95; }
.portada .fecha { font-size: .88rem; opacity: .8; margin-bottom: 14px; }
.portada p.intro { font-size: .95rem; opacity: .92; max-width: 60ch; position: relative; z-index: 1; }

.seccion-tit {
  font-family: 'Nunito Sans', sans-serif; font-size: .8rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--vino);
  margin: 30px 4px 10px; display: flex; align-items: center; gap: 10px;
}
.seccion-tit::after { content: ''; flex: 1; height: 1px; background: var(--vino-borde); }

.pregunta {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.pregunta.falta { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-fondo); }
.pregunta .enun { font-weight: 600; font-size: 1.02rem; margin-bottom: 4px; display: flex; gap: 10px; }
.pregunta .num {
  flex: none; min-width: 26px; height: 26px; border-radius: 50%;
  background: var(--vino-claro); color: var(--vino); font-size: .8rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 1px;
}
.pregunta .req { color: var(--vino); margin-left: 2px; }
.pregunta .ayuda { font-size: .82rem; color: var(--suave); margin: 0 0 4px 36px; }
.pregunta .aviso { display: none; font-size: .82rem; color: var(--error); font-weight: 600; margin: 8px 0 0 36px; }
.pregunta.falta .aviso { display: block; }

.opciones { display: grid; gap: 8px; margin: 12px 0 0 36px; }
.opciones.escala { grid-template-columns: repeat(4, 1fr); }

.opcion { position: relative; display: block; cursor: pointer; }
.opcion input { position: absolute; opacity: 0; pointer-events: none; }
.opcion span {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--linea); border-radius: 10px;
  padding: 11px 14px; font-size: .93rem; background: #fff;
  transition: border-color .15s, background .15s;
  height: 100%;
}
.opcion span::before {
  content: ''; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #cbd5e1; background: #fff; transition: all .15s;
}
.opcion:hover span { border-color: var(--vino-borde); background: #fdfafb; }
.opcion input:checked + span { border-color: var(--vino); background: var(--vino-claro); font-weight: 500; }
.opcion input:checked + span::before { border-color: var(--vino); box-shadow: inset 0 0 0 4px #fff; background: var(--vino); }
.opcion input:focus-visible + span { outline: 3px solid rgba(106,29,54,.35); outline-offset: 2px; }

.escala .opcion span { flex-direction: column; justify-content: center; text-align: center; gap: 8px; padding: 12px 8px; font-size: .86rem; }

.campo { margin: 12px 0 0 36px; }
.campo input, .campo textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--texto);
  border: 1.5px solid var(--linea); border-radius: 10px; padding: 11px 14px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.campo textarea { min-height: 130px; resize: vertical; }
.campo input:focus, .campo textarea:focus { outline: none; border-color: var(--vino); box-shadow: 0 0 0 3px rgba(106,29,54,.12); }

.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.acciones { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 1rem;
  background: var(--vino); color: #fff; padding: 14px 38px; border-radius: 999px;
  transition: background .2s, transform .1s;
  text-decoration: none; display: inline-block;
}
.btn:hover { background: var(--vino-osc); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn.sec { background: #fff; color: var(--vino); border: 1.5px solid var(--vino); }
.btn.sec:hover { background: var(--vino-claro); }
.nota { font-size: .82rem; color: var(--suave); text-align: center; }
.error-gen { color: var(--error); font-weight: 600; font-size: .9rem; text-align: center; }

/* Pantalla final */
.final { background: #fff; border: 1px solid var(--linea); border-radius: 14px; padding: 34px 28px; text-align: center; }
.final .icono {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--ok-fondo); color: var(--ok); display: flex; align-items: center; justify-content: center;
}
.final h2 { font-family: 'Nunito Sans', sans-serif; font-size: 1.6rem; color: var(--vino); margin-bottom: 6px; }
.final p { color: var(--suave); max-width: 52ch; margin: 0 auto; }
.puntaje {
  margin: 22px auto 6px; width: 150px; height: 150px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--vino) calc(var(--p) * 1%), var(--vino-claro) 0);
  position: relative;
}
.puntaje::before { content: ''; position: absolute; inset: 12px; background: #fff; border-radius: 50%; }
.puntaje b, .puntaje small { position: relative; }
.puntaje b { font-family: 'Nunito Sans', sans-serif; font-size: 2.3rem; color: var(--vino); line-height: 1; }
.puntaje small { color: var(--suave); font-size: .82rem; margin-top: 4px; }

.revision { text-align: left; margin-top: 26px; display: grid; gap: 10px; }
.rev { border: 1px solid var(--linea); border-left: 4px solid var(--ok); border-radius: 10px; padding: 12px 14px; font-size: .9rem; }
.rev.mal { border-left-color: var(--error); }
.rev .q { font-weight: 600; margin-bottom: 4px; }
.rev .r { color: var(--suave); }
.rev .r b { color: var(--texto); font-weight: 600; }
.rev .estado { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ok); }
.rev.mal .estado { color: var(--error); }

.cargando { text-align: center; color: var(--suave); padding: 60px 0; }

/* Portada con las tres encuestas */
.tarjetas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tarjeta {
  background: #fff; border: 1px solid var(--linea); border-radius: 12px; padding: 22px 20px;
  text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.tarjeta:hover { border-color: var(--vino); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(106,29,54,.10); }
.tarjeta .paso { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--vino); }
.tarjeta h3 { font-family: 'Nunito Sans', sans-serif; font-size: 1.25rem; }
.tarjeta p { font-size: .88rem; color: var(--suave); flex: 1; }
.tarjeta .ir { font-weight: 700; color: var(--vino); font-size: .9rem; }

.pie { text-align: center; font-size: .78rem; color: var(--suave); margin-top: 36px; }

@media (max-width: 680px) {
  .cabecera img { height: 46px; }
  .portada { padding: 22px 20px; }
  .portada h1 { font-size: 1.5rem; }
  .pregunta { padding: 16px; }
  .opciones, .campo { margin-left: 0; }
  .pregunta .ayuda, .pregunta .aviso { margin-left: 0; }
  .opciones.escala { grid-template-columns: 1fr 1fr; }
  .tarjetas { grid-template-columns: 1fr; }
}
