/* =========================================
   FLASHCARD QUIZ — CSS LIMPIO (v1)
   ========================================= */

/* ---------- WRAP GENERAL ---------- */
.fq-quiz-wrap{
  min-width: 720px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  background: #fff;
  border: 3px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
}

@media (max-width: 767px){
  .fq-quiz-wrap{
    min-width: auto;
    max-width: 100%;
  }
}

/* ---------- BOTONES ---------- */
.black-btn{
  background:#000;
  color:#fff;
  border:1px solid #000;
  border-radius:10px;
  padding:12px 16px;
  cursor:pointer;
  transition:background .15s ease, opacity .15s ease;
}
.black-btn:hover{ background:#333; opacity:.92; }
.black-btn:focus-visible{ outline:2px solid #a0c4ff; outline-offset:2px; }
.black-btn:active{
  background:#000!important;
  color:#fff!important;
  border-color:#000!important;
  box-shadow:none!important;
}

.fq-actions .fq-btn-wide{ width:100%; }

/* ---------- FORM / FIELDS ---------- */
.fq-selector.fq-vertical{ max-width: 100%; display:block; }
.fq-field{ margin-bottom:14px; }

.fq-count-wrap input[type="number"]{
  width:100%;
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:12px 12px;
  font-size:14px;
}

/* =========================================================
   FIX DEFINITIVO — SELECTOR TEMAS
   Estructura esperada:
   label.fq-topic-row > input + .fq-topic-title + .fq-topic-right + .fq-mini-progress
   ========================================================= */

/* =========================================================
   SELECTOR TEMAS — layout: checkbox + título + quedan (1 línea)
   y debajo la barra
   ========================================================= */

/* quitar bullets */
.fq-selector .fq-topics,
.fq-selector .fq-topic-item{
  list-style:none !important;
  padding:0 !important;
  margin:0 !important;
}
.fq-selector .fq-topic-item{ margin:0 0 10px 0 !important; }

/* 🚨 algunos temas meten <p>/<br> dentro del label:
   -> NO deben ocupar espacio */
.fq-selector label.fq-topic-row p{
  display: contents !important;   /* no añade caja, pero mantiene el contenido */
  margin: 0 !important;
  padding: 0 !important;
}
.fq-selector label.fq-topic-row br{
  display: none !important;       /* evita saltos raros */
}

/* card */
.fq-selector label.fq-topic-row{
  display:flex !important;
  align-items:center !important;
  flex-wrap:wrap !important;         /* para que la barra baje */
  gap:6px 10px !important;           /* ↓ menos alto (antes 10px 12px) */

  width:100% !important;
  padding:10px 12px !important;      /* ↓ menos alto (antes 14px 14px) */
  background:#fff !important;
  border:1px solid #efefef !important;
  border-radius:14px !important;
}

/* checkbox */
.fq-selector label.fq-topic-row > input[type="checkbox"]{
  flex:0 0 auto !important;
  margin:0 !important;
  appearance:auto !important;
  -webkit-appearance:checkbox !important;
}
.fq-selector label.fq-topic-row > input[type="checkbox"]::before,
.fq-selector label.fq-topic-row > input[type="checkbox"]::after{
  content:none !important;
}

/* título al lado del checkbox */
.fq-selector label.fq-topic-row > .fq-topic-title{
  flex:1 1 auto !important;
  min-width:0 !important;
  font-weight:900 !important;
  font-size:14px !important;         /* ↓ un pelín (antes 15px) */
  line-height:1.15 !important;       /* ↓ */
  margin:0 !important;

  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

/* ocultar total pill/badge si aún existe */
.fq-total-pill,
.fq-topic-badge{
  display:flex !important;
	 padding:4px 8px !important;
  border:1px solid #e5e7eb !important;
  border-radius:999px !important;
  background:#f9fafb !important;

  color:#6b7280 !important;
  font-weight:800 !important;
  font-size:12px !important;
  line-height:1 !important;


.fq-topic-badge::before{
  content:"Total: ";
  font-weight:700;
  opacity:.85;
}
}

/* "Quedan" en la MISMA línea y a la derecha */
.fq-selector .fq-topic-remaining{
  margin-left:auto !important;      /* lo empuja al extremo derecho */
  flex:0 0 auto !important;

  font-weight:900 !important;
  font-size:12px !important;
  padding:4px 8px !important;       /* ↓ menos alto (antes 6px 10px) */
  border-radius:999px !important;
  background:#f7f7f7 !important;
  border:1px solid #ededed !important;
  color:#111 !important;
  white-space:nowrap !important;
}

/* botón reset (si aparece), también a la derecha */
.fq-selector .fq-reset-topic{
  flex:0 0 auto !important;
  border-radius:999px !important;
  padding:4px 8px !important;       /* ↓ menos alto */
  border:1px solid #e5e7eb !important;
  background:#fff !important;
  cursor:pointer !important;
  font-weight:900 !important;
  font-size:12px !important;
  white-space:nowrap !important;
}

/* barra abajo ocupando todo el ancho */
.fq-selector .fq-mini-progress{
  flex:0 0 100% !important;
  width:100% !important;
  order:10 !important;             /* fuerza que quede debajo */
  height:5px !important;
  border-radius:999px !important;
  background:#ededed !important;
  overflow:hidden !important;
  margin:6px 0 0 0 !important;      /* ↓ menos alto (antes 10px) */
}

.fq-selector .fq-mini-progress-fill{
  height:100% !important;
  width:0%;
  border-radius:999px !important;
  transition: width .25s ease !important;
}

/* colores */
.fq-selector .fq-mini-progress.is-red .fq-mini-progress-fill{ background:#e74c3c !important; }
.fq-selector .fq-mini-progress.is-orange .fq-mini-progress-fill{ background:#f39c12 !important; }
.fq-selector .fq-mini-progress.is-green .fq-mini-progress-fill{ background:#2ecc71 !important; }

/* en móvil deja que el título parta línea si hace falta */
@media (max-width:520px){
  .fq-selector label.fq-topic-row > .fq-topic-title{
    white-space:normal !important;
  }
}



/* =========================================
   QUIZ: PROGRESO POR PASOS (ARRIBA)
   ========================================= */
/* Ocultar el total (pill con el número total) */


.fq-progress{
  display:flex;
  align-items:center;
  gap:12px;
  margin:6px 0 14px;
}
.fq-progress-steps{
  display:grid;
  grid-template-columns: repeat(10, 1fr);
  gap:8px;
  flex:1 1 auto;
}
.fq-step{
  display:block;
  height:6px;
  border-radius:999px;
  background:#e8edf3;
}
.fq-step.is-active{ background:#3b82f6; }
.fq-step.is-done{ background:#1d4ed8; }

.fq-progress-count{
  flex:0 0 auto;
  min-width:48px;
  text-align:right;
  font-weight:800;
  color:#374151;
}

@media (max-width:480px){
  .fq-progress{ gap:8px; }
  .fq-progress-steps{ gap:6px; }
  .fq-step{ height:5px; }
}

/* Ajuste pequeño de separación interna */
.fq-question h4{ margin-top: 6px; }

/* =========================================
   RESPUESTAS (LOOK GOOGLE FORMS)
   ========================================= */
.fq-answer-list{ list-style:none; margin:0; padding:0; }
.fq-answer-list li{ margin:10px 0; }

.fq-answer-btn.base{
  display:flex;
  align-items:flex-start;
  gap:12px;
  width:100%;
  text-align:left;

  background:#f7f8fa;
  color:#1f2937;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:14px 16px;
  line-height:1.4;

  box-shadow:0 1px 0 rgba(16,24,40,.02);
  transition:background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .02s ease;

  white-space: normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.fq-answer-btn.base:hover:not(:disabled){
  background:#eef1f5;
  border-color:#dbe1e8;
  box-shadow:0 1px 0 rgba(16,24,40,.04);
}
.fq-answer-btn.base:focus-visible{
  outline:2px solid #a0c4ff;
  outline-offset:2px;
}
.fq-answer-btn.base:active{ transform:scale(.997); }

.fq-choice-prefix{
  flex:0 0 auto;
  min-width:28px;
  height:28px;
  border-radius:8px;
  background:#eef1f5;
  color:#6b7280;
  border:1px solid #e5e7eb;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:13px;
  margin-top:1px;
}
.fq-choice-text{
  flex:1 1 auto;
  font-size:15px;
  padding:3px 0;
}

.fq-answer-btn.correct{ background:#e6f4ea; border-color:#b7e1c0; color:#0f5132; }
.fq-answer-btn.wrong  { background:#fdecea; border-color:#f5c2c7; color:#842029; }
.fq-answer-btn:disabled{ opacity:1; cursor:default; box-shadow:none; transform:none; }

/* Feedback */
.fq-feedback{ margin:8px 2px 0; font-weight:900; }
.fq-correct{ color:#0f5132; }
.fq-wrong{ color:#842029; }

/* =========================================
   NOTA & MNEMOTECNIA
   ========================================= */
.fq-note{
  background:#fafafa;
  border:1px solid #efefef;
  border-radius:10px;
  padding:10px 12px;
  line-height:1.4;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.fq-note-image{
  border:1px solid #efefef;
  border-radius:10px;
  background:#fff;
  padding:8px;
  display:none;
  width:max-content;
}
.fq-note-img{
  width:255px;
  height:130px;
  object-fit:contain;
  display:block;
  cursor:zoom-in;
}

/* =========================================
   INSIGNIAS (ETIQUETAS)
   ========================================= */
.fq-badge{
  display:inline-block;
  font-size:12px;
  font-weight:900;
  line-height:1;
  padding:6px 10px;
  border-radius:999px;
  margin-bottom:8px;
  border:1px solid transparent;
}

.fq-badge.is-cecop  { background:#e7f0ff; color:#123b7a; border-color:#c7dafc; }
.fq-badge.is-comu   { background:#f2e8ff; color:#4b2277; border-color:#e0d0ff; }
.fq-badge.is-ayunta { background:#e6fff7; color:#0d4b3a; border-color:#c6f3e4; }

.fq-badge.is-gc{ background:#1f2d3d; color:#fff; border-color:transparent; }
.fq-badge.is-policia{ background:#0b5ed7; color:#fff; border-color:transparent; }

/* Admin badge */
.fq-badge-admin{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid transparent;
  font-size:11px;
  line-height:1;
  font-weight:900;
}
.fq-badge-admin.is-cecop  { background:#e7f0ff; color:#123b7a; border-color:#c7dafc; }
.fq-badge-admin.is-comu   { background:#f2e8ff; color:#4b2277; border-color:#e0d0ff; }
.fq-badge-admin.is-ayunta { background:#e6fff7; color:#0d4b3a; border-color:#c6f3e4; }
.fq-badge-admin.is-gc{ background:#1f2d3d; color:#fff; }
.fq-badge-admin.is-policia{ background:#0b5ed7; color:#fff; }

/* =========================================
   NAV / ADMIN TOOLS
   ========================================= */
.fq-admin-tools{ margin-top:10px; }
.fq-edit-link{
  display:inline-block;
  font-size:13px;
  padding:6px 10px;
  border:1px dashed #ccc;
  border-radius:10px;
  text-decoration:none;
  color:#333;
  background:#fafafa;
}
.fq-edit-link:hover{ background:#f3f3f3; }

/* =========================================
   TABLA RESUMEN
   ========================================= */
.fq-summary-table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
}
.fq-summary-table th,
.fq-summary-table td{
  border:1px solid #efefef;
  padding:8px;
  vertical-align:top;
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* =========================================
   LIGHTBOX
   ========================================= */
.fq-lightbox{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.8);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
}
.fq-lightbox-img{
  max-width:60vw;
  max-height:60vh;
  display:block;
}
.fq-lightbox-close{
  position:absolute;
  top:16px;
  right:16px;
  background:#fff;
  border:0;
  border-radius:999px;
  width:36px;
  height:36px;
  line-height:36px;
  text-align:center;
  font-size:22px;
  cursor:pointer;
}

/* Responsive general */
@media (max-width:480px){
  .fq-question h4{ font-size:16px; line-height:1.35; }
  .fq-answer-btn.base{ padding:12px 14px; }
  .fq-choice-prefix{ min-width:26px; height:26px; font-size:12px; }
  .fq-nav button{ width:100%; margin-top:8px; }
  .fq-summary-table th, .fq-summary-table td{ font-size:14px; }
}
