/* ==========================================================================
   PandaCodeur - moteur de QCM autonome
   Correction entierement cote navigateur : aucun appel serveur.
   Le balisage des questions reste celui de la page (contenu indexable) ;
   cette feuille ne fait qu'habiller et signaler l'etat de correction.
   ========================================================================== */

.pc-quiz {
  --pc-accent: #e2571e;
  --pc-ok: #1b7e3c;
  --pc-ok-fond: rgba(27, 126, 60, .07);
  --pc-ko: #c0392b;
  --pc-ko-fond: rgba(192, 57, 43, .06);
  --pc-bord: rgba(0, 0, 0, .12);
  margin: 0 0 10px;
}

/* ----------------------------------------------------------- barre d'etat */
.pc-q-barre {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin: 0 0 18px;
  border: 1px solid var(--pc-bord);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.pc-q-barre-txt {
  font-size: .88rem;
  font-weight: 700;
  margin: 0;
}

.pc-q-jauge {
  flex: 1 1 130px;
  height: 7px;
  min-width: 110px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .09);
  overflow: hidden;
}

.pc-q-jauge i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: var(--pc-accent);
  transition: width .25s ease;
}

/* -------------------------------------------------------------- questions */
.pc-quiz .media-list { list-style: none; padding: 0; margin: 0; }

.pc-quiz li.media {
  padding: 16px 18px;
  margin: 0 0 14px;
  border: 1px solid var(--pc-bord);
  border-left: 4px solid rgba(0, 0, 0, .14);
  border-radius: 9px;
  background: #fff;
  transition: border-color .2s ease;
}

.pc-quiz li.media:focus-within { border-left-color: var(--pc-accent); }

.pc-quiz .media-heading {
  font-size: 1.02rem !important;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 12px;
}

/* numerotation : la page porte deja "1/", "2/"... on n'en ajoute pas */
.pc-quiz .custom-control.custom-radio {
  position: relative;
  display: block;
  padding: 9px 12px 9px 40px;
  margin: 0 0 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}

.pc-quiz .custom-control.custom-radio:hover { background: rgba(0, 0, 0, .035); }

.pc-quiz .custom-control-input {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--pc-accent);
  cursor: pointer;
}

.pc-quiz .custom-control-label {
  display: block;
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
  cursor: pointer;
}

.pc-quiz .custom-control-label::before,
.pc-quiz .custom-control-label::after { content: none !important; }

.pc-quiz li.media img { max-width: 100%; height: auto; border-radius: 8px; margin: 4px 0 12px; }

/* --------------------------------------------------------- apres controle */
.pc-quiz.pc-corrige .custom-control.custom-radio { cursor: default; }
.pc-quiz.pc-corrige .custom-control-input,
.pc-quiz.pc-corrige .custom-control-label { cursor: default; }

.pc-quiz li.media.pc-ok { border-left-color: var(--pc-ok); }
.pc-quiz li.media.pc-ko { border-left-color: var(--pc-ko); }

.pc-quiz .custom-radio.pc-bonne {
  border-color: var(--pc-ok);
  background: var(--pc-ok-fond);
}

.pc-quiz .custom-radio.pc-mauvaise {
  border-color: var(--pc-ko);
  background: var(--pc-ko-fond);
}

.pc-quiz .custom-radio.pc-bonne .custom-control-label,
.pc-quiz .custom-radio.pc-mauvaise .custom-control-label { font-weight: 600; }

.pc-marque {
  display: inline-block;
  min-width: 1.35em;
  font-weight: 800;
  font-style: normal;
}

.pc-bonne .pc-marque { color: var(--pc-ok); }
.pc-mauvaise .pc-marque { color: var(--pc-ko); }

/* explication */
.pc-q-exp {
  margin: 11px 0 0;
  padding: 11px 13px;
  border-radius: 7px;
  background: rgba(0, 0, 0, .04);
  border-left: 3px solid var(--pc-accent);
  font-size: .89rem;
  line-height: 1.6;
}

.pc-q-exp b {
  display: block;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--pc-accent);
  margin-bottom: 3px;
}

/* signalement d'une question laissee vide */
.pc-quiz li.media.pc-vide { border-left-color: #b8860b; }

.pc-q-vide {
  margin: 10px 0 0;
  font-size: .85rem;
  font-weight: 700;
  color: #8a6400;
}

/* ------------------------------------------------------------- boutons */
.pc-quiz .pc-q-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}

.pc-quiz button {
  font-size: .95rem;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 7px;
  border: 0;
  cursor: pointer;
}

.pc-quiz .pc-q-valider { background: var(--pc-accent); color: #fff; }
.pc-quiz .pc-q-valider:hover { filter: brightness(1.07); }

.pc-quiz .pc-q-refaire {
  background: transparent;
  color: inherit;
  border: 1px solid var(--pc-bord);
}

.pc-quiz .pc-q-refaire:hover { border-color: var(--pc-accent); color: var(--pc-accent); }

/* ------------------------------------------------------------- resultat */
.pc-q-score {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 20px 22px;
  margin: 0 0 20px;
  border: 1px solid var(--pc-bord);
  border-radius: 11px;
  background: #fff;
  scroll-margin-top: 80px;
}

.pc-q-anneau {
  flex: 0 0 86px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.32rem;
  font-weight: 800;
  color: #fff;
  background: var(--pc-accent);
}

.pc-q-score.pc-reussi .pc-q-anneau { background: var(--pc-ok); }
.pc-q-score.pc-echoue .pc-q-anneau { background: var(--pc-ko); }

.pc-q-score-txt { flex: 1 1 220px; }

.pc-q-score-txt strong {
  display: block;
  font-size: 1.12rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.pc-q-score-txt span { font-size: .91rem; line-height: 1.6; opacity: .82; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 575.98px) {
  .pc-quiz li.media { padding: 13px 14px; }
  .pc-quiz .media-heading { font-size: .97rem !important; }
  .pc-quiz .custom-control-label { font-size: .91rem; }
  .pc-q-anneau { flex-basis: 70px; width: 70px; height: 70px; font-size: 1.1rem; }
  .pc-q-score { padding: 16px; gap: 14px; }
  .pc-q-barre { padding: 9px 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-quiz *, .pc-q-jauge i { transition: none !important; }
}

/* ------------------------------------------------- renvoi vers le cours */
.pc-reviser {
  margin: 34px 0 10px;
  padding: 22px 24px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 11px;
  background: #fff;
}

.pc-reviser h2 {
  font-size: 1.22rem !important;
  font-weight: 800;
  margin: 0 0 16px;
  padding: 0 0 9px;
  border-bottom: 2px solid rgba(226, 87, 30, .28);
}

.pc-rev-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  grid-auto-rows: 1fr;
  gap: 14px;
}

.pc-rev-lien {
  display: flex;
  flex-direction: column;
  padding: 15px 16px;
  border: 1px solid rgba(0, 0, 0, .11);
  border-radius: 9px;
  text-decoration: none;
  color: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.pc-rev-lien:hover {
  border-color: #e2571e;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .09);
  transform: translateY(-3px);
  color: inherit;
  text-decoration: none;
}

.pc-rev-t { font-weight: 700; font-size: .98rem; margin-bottom: 5px; }
.pc-rev-d { font-size: .84rem; line-height: 1.5; opacity: .76; flex: 1; }

.pc-rev-pied { margin: 16px 0 0; font-size: .89rem; }
.pc-rev-pied a { font-weight: 700; color: #e2571e; }

@media (max-width: 575.98px) {
  .pc-reviser { padding: 17px 16px; }
  .pc-rev-grille { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-rev-lien { transition: none !important; }
}
