/* quiz_final.css — la vista del alumno de un quiz (quiz_alumno.js) y la aprobación final de
   quizzes (quiz_final.js). Lo de .qa-* es el port de css() del visor de Sergio
   (visor/probar_alumno.js) sin el marco de teléfono: la pantalla del alumno conserva su paleta
   propia (la de la app); lo de .qf-* usa los tokens del Studio. */

/* ---------- vista del alumno ---------- */
.qa-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qa-pantalla {
  --ink: #1c1c1e; --muted: #6b6b70; --faint: #a8a8ad; --line: #e4e4e8; --accent: #3a6df0; --accent-bg: #eaf0fe;
  --green: #16a34a; --green-bg: #e9f8ee; --red: #e5484d; --red-bg: #fdecec; --slate: #475569; --slate-bg: #dbe3ec;
  --amber: #d97706; --amber-bg: #fef3e0; --lightblue: #bfdbfe;
  position: relative; width: 340px; max-width: 100%; min-height: 560px; display: flex; flex-direction: column;
  background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .05); text-align: left; line-height: normal;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.qa-ico { width: 1em; height: 1em; display: block; }
.qa-prog { height: 8px; margin: 16px 18px 0; background: #ececf0; border-radius: 6px; overflow: hidden; flex: none; }
.qa-prog > div { height: 100%; background: var(--green); border-radius: 6px; }
.qa-instr { font-weight: 700; font-size: 17px; padding: 16px 18px 10px; }
.qa-body { flex: 1; padding: 0 18px 16px; }
.qa-error { color: var(--red); font-size: 13px; font-weight: 600; margin-top: 40px; }
.qa-stem { text-align: center; margin: 6px 0 16px; }
.qa-stem img { width: 190px; height: 190px; object-fit: cover; border-radius: 14px; }
.qa-word { font-size: 30px; font-weight: 700; }
.qa-sentence { font-size: 18px; line-height: 1.5; text-align: left; }
.qa-gap { display: inline-block; min-width: 56px; border-bottom: 2px solid var(--ink); }
.qa-chip { font-size: 16px; font-weight: 500; min-height: 42px; min-width: 42px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; background: #f0f0f3; border: 1px solid var(--line); color: var(--ink); border-radius: 10px; cursor: pointer; user-select: none; }
.qa-chip.pending { background: var(--slate-bg); color: var(--slate); border-color: var(--slate); font-weight: 600; }
.qa-chip.correct { background: var(--green-bg); color: var(--green); border-color: var(--green); font-weight: 600; }
.qa-chip.wrong { background: var(--red-bg); color: var(--red); border-color: var(--red); font-weight: 600; }
.qa-chip.ghost { background: transparent; border: 1.5px dashed #cfcfd6; color: var(--faint); }
.qa-chip.locked { opacity: .4; }
.qa-chip.filled { background: var(--accent-bg); color: #1e4fd8; border-color: transparent; }
.qa-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.qa-grid .qa-chip { border-radius: 8px; min-width: 0; }
.qa-dotted { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; border-bottom: 2px dashed #cfcfd6; padding-bottom: 8px; margin: 6px 0 14px; }
.qa-dotted .qa-chip { width: 38px; height: 38px; min-width: 0; padding: 0; border-radius: 8px; }
.qa-fijo { display: inline-flex; align-items: center; justify-content: center; min-width: 14px; min-height: 42px; font-size: 18px; font-weight: 600; color: var(--ink); }
.qa-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.qa-opts { display: flex; flex-direction: column; gap: 9px; }
.qa-opt { text-align: left; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-size: 15px; cursor: pointer; }
.qa-opt.pending { background: var(--slate-bg); border-color: var(--slate); color: var(--slate); font-weight: 600; }
.qa-opt.correct { background: var(--green-bg); border-color: var(--green); color: var(--green); font-weight: 600; }
.qa-opt.wrong { background: var(--red-bg); border-color: var(--red); color: var(--red); font-weight: 600; }
.qa-opt.locked { opacity: .4; }
.qa-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qa-img { border: 3px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; background: #f6f6f8; aspect-ratio: 1 / 1; }
.qa-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qa-img.pending { border-color: var(--slate); box-shadow: 0 0 0 3px var(--slate-bg); }
.qa-img.correct { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.qa-img.wrong { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.qa-audio { width: 64px; height: 64px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 26px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.qa-audio.locked { background: #e6e6ea; color: #b0b0b6; cursor: default; }
.qa-circ { width: 74px; height: 74px; border-radius: 50%; border: 3px solid transparent; background: var(--lightblue); color: var(--ink); font-size: 26px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.qa-circ.pending { border-color: var(--slate); background: var(--slate-bg); }
.qa-circ.correct { background: var(--green); color: #fff; }
.qa-circ.wrong { background: var(--red); color: #fff; }
.qa-under { font-size: 14px; font-weight: 600; margin-top: 6px; text-align: center; min-height: 18px; }
.qa-lang { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 6px; text-align: center; }
.qa-micwrap { position: relative; width: 128px; height: 128px; margin: 0 auto; }
.qa-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.qa-ring circle { fill: none; stroke-width: 6; }
.qa-ring .trk { stroke: var(--line); }
.qa-ring .bar { stroke: transparent; stroke-linecap: round; }
.qa-mic { position: absolute; inset: 12px; border-radius: 50%; border: 3px solid var(--line); background: #fff; color: var(--ink); font-size: 40px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qa-micwrap.rec .qa-mic { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); animation: qaPulse 1.2s ease-in-out infinite; }
.qa-micwrap.rec .bar { stroke: var(--accent); }
.qa-micwrap.warn .qa-mic { border-color: var(--amber); background: var(--amber-bg); color: var(--amber); animation: qaBlink .45s steps(2, end) infinite; }
.qa-micwrap.warn .bar { stroke: var(--amber); }
.qa-micwrap.busy .qa-mic { background: #e6e6ea; color: #b0b0b6; cursor: default; }
.qa-micwrap.correct .qa-mic { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.qa-micwrap.wrong .qa-mic { border-color: var(--red); background: var(--red-bg); color: var(--red); }
@keyframes qaPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(58, 109, 240, .35); } 50% { box-shadow: 0 0 0 12px rgba(58, 109, 240, 0); } }
@keyframes qaBlink { 0% { opacity: 1; } 100% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .qa-micwrap .qa-mic { animation: none !important; } }
.qa-bottom { padding: 12px 16px 16px; background: #fff; flex: none; }
.qa-btn { width: 100%; padding: 14px; border: none; border-radius: 14px; font-size: 16px; font-weight: 700; color: #fff; background: var(--green); cursor: pointer; }
.qa-btn:disabled { background: #e2e2e6; color: #a0a0a6; cursor: default; }
.qa-btn.red { background: var(--red); }
.qa-btn.amber { background: var(--amber); }
.qa-btn.ghost { background: transparent; color: var(--amber); border: 2px solid var(--amber); margin-top: 8px; font-size: 14px; padding: 10px; }
.qa-banner { padding: 14px 16px 16px; border-radius: 18px 18px 0 0; flex: none; }
.qa-banner.ok { background: var(--green-bg); color: var(--green); }
.qa-banner.bad { background: var(--red-bg); color: var(--red); }
.qa-banner.warn { background: var(--amber-bg); color: var(--amber); }
.qa-banner .t1 { font-weight: 800; font-size: 18px; display: flex; gap: 8px; align-items: center; }
.qa-banner.warn .t1 { display: block; }
.qa-banner .t2 { margin: 12px 0 2px; font-size: 15px; color: var(--ink); }
.qa-banner .qa-btn { margin-top: 12px; }
.qa-amber { position: absolute; left: 12px; right: 12px; bottom: 84px; z-index: 2; background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber); border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 14px; }
/* el micrófono simulado: fuera de la pantalla del alumno */
.qa-sim { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; max-width: 340px; }
.qa-sim-t { width: 100%; text-align: center; font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .6px; }
.qa-sim-in { width: 110px; border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px; font-size: 12px; background: #fff; }
.qa-sim-in:focus { outline: none; border-color: var(--illufy-dark); box-shadow: 0 0 0 3px var(--illufy-soft); }

/* ---------- aprobación final de quizzes ---------- */
.qf-cab-s { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.qf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; align-items: start; }
.qf-item { border: 1px solid var(--border); border-radius: 14px; padding: 12px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.qf-item.sel { border-color: var(--illufy-dark); background: var(--illufy-soft); }
.qf-cab { display: flex; align-items: center; gap: 8px; min-width: 0; }
.qf-cab .tag, .qf-marca .tag, .qv-cab .tag { margin-left: 0; }
.qf-palabra { font-size: 15px; }
.qf-sense { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.qf-vista, .qv-vista { display: flex; justify-content: center; }
.qf-acciones { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qf-rechazo { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.qf-fila { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qf-rechazo textarea, .qf-caja textarea, .qf-in, .qf-select {
  border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px; background: #fff; font-size: 13px;
}
.qf-rechazo textarea, .qf-caja textarea { width: 100%; resize: vertical; }
.qf-rechazo textarea:focus, .qf-caja textarea:focus, .qf-in:focus, .qf-select:focus { outline: none; border-color: var(--illufy-dark); box-shadow: 0 0 0 3px var(--illufy-soft); }
.qf-select { max-width: 100%; cursor: pointer; }
.qf-pie {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  margin: 14px -20px -16px; padding: 12px 20px; background: var(--panel);
  border-top: 1px solid var(--border); border-radius: 0 0 16px 16px;
}
.qf-marcas { border: 1px solid var(--border); background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; }
.qf-marca { display: flex; align-items: center; gap: 8px; padding: 4px 0; flex-wrap: wrap; }
.qf-marca .qf-in { flex: 1; min-width: 180px; }
.qf-prueba { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.qf-lado { flex: 1; min-width: 280px; max-width: 520px; display: flex; flex-direction: column; gap: 10px; }
.qf-caja { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--panel); display: flex; flex-direction: column; gap: 6px; }
.qf-caja.marca { border-color: var(--amber); background: var(--amber-soft); }
.qf-palabra-g { font-size: 18px; font-weight: 700; }
.qf-idioma { display: inline-flex; gap: 4px; }
.qf-tabla { box-shadow: none; border-radius: 12px; margin-bottom: 14px; }
.qv-cab { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
