/*
© 2026 Lionel Baldock
Projet : Vérifications Permis
Design et UI originaux – Tous droits réservés
*/

#revisionScreen {
  display: none;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: #d8effd;
  color: #222;
  position: relative;
  overflow-x: hidden;
  isolation: isolate;
}

body::before,
body::after {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  transform: rotate(-30deg);
  transform-origin: center;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background-image: url("images/logo_car.png");
  background-repeat: repeat;
  background-size: 180px 180px;
  opacity: 0.15;
}

body::after {
  z-index: -1;
  background-image:
    linear-gradient(
      45deg,
      #d8effd 25%,
      transparent 25%,
      transparent 75%,
      #d8effd 75%,
      #d8effd
    ),
    linear-gradient(
      45deg,
      #d8effd 25%,
      transparent 25%,
      transparent 75%,
      #d8effd 75%,
      #d8effd
    );
  background-size: 360px 360px;
  background-position: 0 0, 180px 180px;
}


#menuScreen,
#revisionScreen,
#examResultScreen,
#statsScreen,
#errorsScreen {
  position: relative;
  z-index: 1;
}

/* ===== MENU ===== */

#menuScreen {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  box-sizing: border-box;
}

.menuPanel {
  width: 100%;
  max-width: 720px;
  box-sizing: border-box;
}

.mainTitle {
  margin: 0 0 40px;
  text-align: center;
  font-size: 39px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #1f2937;
}

.mainSubtitle {
  margin: -10px 0 30px;
  text-align: center;
  font-size: 15px;
  color: #64748b;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}

.menuCard {
  position: relative;
  display: block;
  width: 100%;
  max-width: 560px;
  padding: 18px 24px 18px 76px;
  border: none;
  border-radius: 999px;
  background: #fdfdfd;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  text-align: center;
  color: #222;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
  box-sizing: border-box;
}

.menuCard:hover {
  transform: translateY(-6px);
}

.menuCardWithStats {
  padding-right: 86px;
}

.menuFiches {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.12),
    inset 0 0 0 2px #2c7be5;
}

.menuFiches:hover {
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.18),
    inset 0 0 0 5px #2c7be5;
}

.menuExam {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.12),
    inset 0 0 0 2px #dc2626;
}

.menuExam:hover {
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.18),
    inset 0 0 0 5px #dc2626;
}

.menuStats {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.12),
    inset 0 0 0 2px #7dbb4c;
}

.menuStats:hover {
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.18),
    inset 0 0 0 5px #7dbb4c;
}

.menuErrors {
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.12),
    inset 0 0 0 2px #f4c542;
}

.menuErrors:hover {
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.18),
    inset 0 0 0 5px #f4c542;
}

.menuIcon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  line-height: 1;
  pointer-events: none;
}

.menuText {
  display: block;
}

.menuTitle,
.menuSubtitle {
  transform: translateZ(0);
  backface-visibility: hidden;
}

.menuTitle {
  display: block;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.menuSubtitle {
  display: block;
  margin-top: 4px;
  text-align: center;
  font-size: 15px;
  color: #666;
  line-height: 1.3;
}

.menuDisabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.menuInlineStats {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  z-index: 2;
}

.menuInlineStats:hover {
  transform: translateY(-50%) scale(1.04);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.14);
  filter: brightness(0.99);
}

.menuInlineStats svg {
  width: 34px;
  height: 34px;
  display: block;
}

/* ===== RÉVISION ===== */

.container {
  width: 100%;
  max-width: 980px;
  margin: 24px auto;
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

h1 {
  margin: 0 0 20px 0;
  text-align: center;
  font-size: 24px;
  line-height: 1.3;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: #eef3f7;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 24px;
}

.fiche-number {
  font-weight: bold;
  font-size: 20px;
}

.jump-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.jump-box input {
  width: 80px;
  padding: 8px;
  font-size: 15px;
  border: 1px solid #cfd6dd;
  border-radius: 8px;
  box-sizing: border-box;
}

.section {
  margin-bottom: 24px;
}

.label {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.question {
  font-size: 26px;
  font-weight: bold;
  line-height: 1.4;
  margin-bottom: 12px;
}

.answer {
  display: none;
  font-size: 20px;
  line-height: 1.6;
  background: #eaf4ff;
  border-left: none;
  padding: 14px 16px;
  border-radius: 8px;
}

.images {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.images img {
  display: block;
  width: 100%;
  max-height: 460px;
  height: auto;
  object-fit: contain;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
}

.safety-block {
  background: #eefbe7;
  border-left: none;
  padding: 16px;
  border-radius: 8px;
}

.safety-icon {
  width: 70px;
  display: block;
  margin-bottom: 10px;
}

.buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 16px;
  cursor: pointer;
  color: white;
  background: #2c7be5;
}

button.secondary {
  background: #6c757d;
}

button:hover {
  opacity: 0.92;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#backToMenuButton {
  margin-bottom: 20px;
}

/* ===== RESULTAT EXAMEN ===== */

#examResultScreen {
  display: none;
  min-height: 100vh;
  justify-content: center;
  align-items: center;
  padding: 24px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.examResultCard {
  position: relative;
  z-index: 2;
  isolation: isolate;
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 24px;
  padding: 110px 28px 36px 28px;
  text-align: center;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.examResultBadge {
  width: 160px;
  height: 160px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: -100px auto 20px auto;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
}

.examResultBadge img {
  width: 90px;
  height: auto;
}

.examResultTitle {
  margin: 0;
  font-size: 42px;
  line-height: 1.2;
  font-weight: 700;
}

.examResultText {
  margin: 12px 0 24px 0;
  font-size: 18px;
  color: #666;
}

/* ===== QCM ===== */

.answerChoiceBtn {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 14px 16px;
  border: 4px solid transparent;
  border-radius: 14px;
  background: #f7f9fc;
  color: #1f2937;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
  box-sizing: border-box;
}

.answerChoiceBtn:hover {
  border-color: rgba(0, 0, 0, 0.18);
}

.answerChoiceBtn:disabled {
  cursor: default;
  opacity: 1;
}

.answerChoiceBtn.is-correct {
  border-color: #7bc67e;
}

.answerChoiceBtn.is-wrong {
  border-color: #e38b8b;
}

.revealInlineButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  background: #2f80ed;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(47, 128, 237, 0.22);
  transition: 0.2s ease;
}

.revealInlineButton:hover {
  transform: translateY(-1px);
  filter: brightness(0.98);
}

#a1Wrapper {
  display: flex;
  align-items: flex-start;
  min-height: 52px;
}

#a1 {
  width: 100%;
}

.topbarLeft {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topNextTriangle {
  width: 0;
  height: 0;
  padding: 0;
  border: none;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid #2f80ed;
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.topNextTriangle:hover {
  transform: translateX(2px);
  filter: brightness(0.95);
}

.topNextTriangle:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.topPrevTriangle {
  width: 0;
  height: 0;
  padding: 0;
  border: none;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-right: 18px solid #2f80ed;
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.topPrevTriangle:hover {
  transform: translateX(-2px);
  filter: brightness(0.95);
}

.topPrevTriangle:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

/* ===== Q1 INTERACTIVE ===== */

.q1InteractiveContainer {
  display: none;
  margin-bottom: 18px;
}

.q1InteractiveWrap {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.q1InteractiveImage {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.q1PlayMarker {
  --marker-scale: 1;
  --label-gap: clamp(4px, 0.9vw, 8px);
  --marker-label-font-size: clamp(14px, 3vw, 24px);
  --marker-label-pad-y: clamp(3px, 0.55vw, 4px);
  --marker-label-pad-x: clamp(7px, 1.1vw, 9px);
  --marker-label-dark-pad-y: clamp(4px, 0.75vw, 6px);
  --marker-label-dark-pad-x: clamp(8px, 1.25vw, 10px);
  --marker-circle-size: clamp(52px, 10.5vw, 84px);
  --marker-circle-border: clamp(3px, 0.5vw, 4px);
  --marker-arrow-width: clamp(30px, 6vw, 48px);
  --marker-arrow-height: clamp(34px, 6.5vw, 52px);
  --marker-arrow-head-width: clamp(9px, 1.75vw, 14px);
  --marker-arrow-head-height: clamp(14px, 2.75vw, 22px);
  --marker-arrow-shaft-width: clamp(5px, 1vw, 8px);
  --marker-arrow-shaft-height: clamp(14px, 2.75vw, 22px);
  --marker-arrow-shaft-offset: clamp(12px, 2.5vw, 20px);

  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%) scale(var(--marker-scale));
  transform-origin: center center;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  user-select: none;
  z-index: 5;
}

.q1PlayMarker:disabled {
  cursor: default;
}

.q1PlayMarker .markerLabel {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: var(--marker-label-font-size);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  padding: var(--marker-label-pad-y) var(--marker-label-pad-x);
  border-radius: 8px;
}

.q1PlayMarker.has-dark-label .markerLabel {
  background: #000000;
  color: #ffffff;
  border-radius: 999px;
  padding: var(--marker-label-dark-pad-y) var(--marker-label-dark-pad-x);
}

/* ===== CERCLE ===== */

.q1PlayMarker.circle {
  width: var(--marker-circle-size);
  height: var(--marker-circle-size);
  border: var(--marker-circle-border) solid #ffffff;
  border-radius: 50%;
  box-sizing: border-box;
}

/* ===== BASE FLECHE ===== */

.q1PlayMarker.arrow,
.q1PlayMarker.arrow-down,
.q1PlayMarker.arrow-left,
.q1PlayMarker.arrow-right {
  width: var(--marker-arrow-width);
  height: var(--marker-arrow-height);
}

/* flèche UP */
.q1PlayMarker.arrow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  border-left: var(--marker-arrow-head-width) solid transparent;
  border-right: var(--marker-arrow-head-width) solid transparent;
  border-bottom: var(--marker-arrow-head-height) solid #ffffff;
}

.q1PlayMarker.arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  top: var(--marker-arrow-shaft-offset);
  transform: translateX(-50%);
  width: var(--marker-arrow-shaft-width);
  height: var(--marker-arrow-shaft-height);
  background: #ffffff;
  border-radius: 999px;
}

/* flèche LEFT */
.q1PlayMarker.arrow-left::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  border-top: var(--marker-arrow-head-width) solid transparent;
  border-bottom: var(--marker-arrow-head-width) solid transparent;
  border-right: var(--marker-arrow-head-height) solid #ffffff;
}

.q1PlayMarker.arrow-left::after {
  content: "";
  position: absolute;
  left: var(--marker-arrow-shaft-offset);
  top: 50%;
  transform: translateY(-50%);
  width: var(--marker-arrow-shaft-height);
  height: var(--marker-arrow-shaft-width);
  background: #ffffff;
  border-radius: 999px;
}

/* flèche RIGHT */
.q1PlayMarker.arrow-right::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border-top: var(--marker-arrow-head-width) solid transparent;
  border-bottom: var(--marker-arrow-head-width) solid transparent;
  border-left: var(--marker-arrow-head-height) solid #ffffff;
}

.q1PlayMarker.arrow-right::after {
  content: "";
  position: absolute;
  right: var(--marker-arrow-shaft-offset);
  top: 50%;
  transform: translateY(-50%);
  width: var(--marker-arrow-shaft-height);
  height: var(--marker-arrow-shaft-width);
  background: #ffffff;
  border-radius: 999px;
}

/* flèche DOWN */
.q1PlayMarker.arrow-down::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: var(--marker-arrow-shaft-width);
  height: var(--marker-arrow-shaft-height);
  background: #ffffff;
  border-radius: 999px;
}

.q1PlayMarker.arrow-down::after {
  content: "";
  position: absolute;
  left: 50%;
  top: var(--marker-arrow-shaft-offset);
  transform: translateX(-50%);
  border-left: var(--marker-arrow-head-width) solid transparent;
  border-right: var(--marker-arrow-head-width) solid transparent;
  border-top: var(--marker-arrow-head-height) solid #ffffff;
}

.q1PlayMarker.arrow-left,
.q1PlayMarker.arrow-right {
  transform: translate(-50%, -50%) scale(var(--marker-scale));
}

/* ===== LABEL POSITIONS ===== */

.q1PlayMarker.circle.label-top .markerLabel,
.q1PlayMarker.arrow.label-top .markerLabel,
.q1PlayMarker.arrow-down.label-top .markerLabel,
.q1PlayMarker.arrow-left.label-top .markerLabel,
.q1PlayMarker.arrow-right.label-top .markerLabel {
  bottom: calc(100% + var(--label-gap));
}

.q1PlayMarker.circle.label-bottom .markerLabel,
.q1PlayMarker.arrow.label-bottom .markerLabel,
.q1PlayMarker.arrow-down.label-bottom .markerLabel,
.q1PlayMarker.arrow-left.label-bottom .markerLabel,
.q1PlayMarker.arrow-right.label-bottom .markerLabel {
  top: calc(100% + var(--label-gap));
}

.q1PlayMarker.circle.label-left .markerLabel,
.q1PlayMarker.arrow.label-left .markerLabel,
.q1PlayMarker.arrow-down.label-left .markerLabel,
.q1PlayMarker.arrow-left.label-left .markerLabel,
.q1PlayMarker.arrow-right.label-left .markerLabel {
  right: calc(100% + var(--label-gap));
  left: auto;
  top: 50%;
  transform: translateY(-50%);
}

.q1PlayMarker.circle.label-right .markerLabel,
.q1PlayMarker.arrow.label-right .markerLabel,
.q1PlayMarker.arrow-down.label-right .markerLabel,
.q1PlayMarker.arrow-left.label-right .markerLabel,
.q1PlayMarker.arrow-right.label-right .markerLabel {
  left: calc(100% + var(--label-gap));
  top: 50%;
  transform: translateY(-50%);
}

/* ===== ETATS CORRECT / FAUX ===== */

.q1PlayMarker.is-correct.circle {
  border-color: #22c55e;
}

.q1PlayMarker.is-wrong.circle {
  border-color: #ef4444;
}

/* flèche UP */
.q1PlayMarker.is-correct.arrow::before {
  border-bottom-color: #22c55e;
}

.q1PlayMarker.is-correct.arrow::after {
  background: #22c55e;
}

.q1PlayMarker.is-wrong.arrow::before {
  border-bottom-color: #ef4444;
}

.q1PlayMarker.is-wrong.arrow::after {
  background: #ef4444;
}

/* flèche DOWN */
.q1PlayMarker.is-correct.arrow-down::before {
  background: #22c55e;
}

.q1PlayMarker.is-correct.arrow-down::after {
  border-top-color: #22c55e;
}

.q1PlayMarker.is-wrong.arrow-down::before {
  background: #ef4444;
}

.q1PlayMarker.is-wrong.arrow-down::after {
  border-top-color: #ef4444;
}

/* flèche LEFT */
.q1PlayMarker.is-correct.arrow-left::before {
  border-right-color: #22c55e;
}

.q1PlayMarker.is-correct.arrow-left::after {
  background: #22c55e;
}

.q1PlayMarker.is-wrong.arrow-left::before {
  border-right-color: #ef4444;
}

.q1PlayMarker.is-wrong.arrow-left::after {
  background: #ef4444;
}

/* flèche RIGHT */
.q1PlayMarker.is-correct.arrow-right::before {
  border-left-color: #22c55e;
}

.q1PlayMarker.is-correct.arrow-right::after {
  background: #22c55e;
}

.q1PlayMarker.is-wrong.arrow-right::before {
  border-left-color: #ef4444;
}

.q1PlayMarker.is-wrong.arrow-right::after {
  background: #ef4444;
}

.q1PlayMarker.is-correct .markerLabel,
.q1PlayMarker.is-wrong .markerLabel {
  color: #ffffff;
  border-radius: 999px;
  padding: var(--marker-label-dark-pad-y) var(--marker-label-dark-pad-x);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.q1PlayMarker.is-correct .markerLabel {
  background: #22c55e;
}

.q1PlayMarker.is-wrong .markerLabel {
  background: #ef4444;
}

/* ===== FEEDBACK ===== */

.q1FeedbackBox {
  max-width: 800px;
  margin: 14px auto 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
  text-align: center;
}

.q1FeedbackBox.good {
  background: #eafaf0;
  color: #166534;
  border: 2px solid #22c55e;
}

.q1FeedbackBox.bad {
  background: #fef2f2;
  color: #991b1b;
  border: 2px solid #ef4444;
}

/* ===== QUESTION / REPONSE EDITOR ===== */

.editorQA {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 18px;
}

.editorQABlock {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
}

.editorQATitle {
  font-weight: 700;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 6px;
}

.editorQAText {
  font-size: 15px;
  color: #1f2937;
  line-height: 1.4;
}

/* ===== STATS GLOBAL ===== */

#statsScreen {
  display: none;
}

#statsScreen .buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

#statsScreen .buttons button {
  width: auto !important;
  min-width: 0;
  padding: 12px 18px;
}

#statsScreen .section .answer p {
  margin: 0 0 10px 0;
}

#statsScreen .section .answer p:last-child {
  margin-bottom: 0;
}

#clearAllStatsButton {
  background: #dc2626;
}

#clearAllStatsButton:hover {
  opacity: 0.95;
}

#clearFichesStatsButton,
#clearExamStatsButton,
#resetExamRotationButton {
  background: #6c757d;
}

/* ===== STATS FICHES ===== */

.statsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.statsGridSecondary {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.statsCard {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.statsLabel {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.statsValue {
  font-size: 26px;
  font-weight: 700;
  color: #1f2937;
}

.statsSubValue {
  margin-top: 8px;
  font-size: 14px;
  color: #64748b;
}

.statsQuestionLine {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.5;
}

/* ===== STATS EXAMEN ===== */

.examStatsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.examStatsCard {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
  min-width: 0;
}

.examStatsCardLabel {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.examStatsCardValue {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.1;
  margin-bottom: 6px;
}

.examStatsCardSubvalue {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.examStatsEmpty {
  display: block;
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.examStatsEmpty p {
  margin: 0;
  color: #64748b;
  line-height: 1.6;
}

.examStatsPanel {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 22px;
}

.examStatsPanelTitle {
  font-size: 14px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 14px;
}

.examStatsChartWrap {
  position: relative;
}

.examStatsProgressCanvas {
  display: block;
  width: 100%;
  height: 300px;
}

.examStatsTooltip {
  display: none;
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: #111827;
  color: #ffffff;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  max-width: 220px;
}

.examStatsTooltipTitle {
  font-weight: 700;
  margin-bottom: 4px;
}

.examStatsBreakdownItem {
  margin-bottom: 16px;
}

.examStatsBreakdownItem:last-child {
  margin-bottom: 0;
}

.examStatsBreakdownHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 7px;
}

.examStatsBreakdownLabel {
  font-weight: 700;
  color: #1f2937;
}

.examStatsBreakdownValue {
  font-size: 13px;
  color: #64748b;
}

.examStatsBreakdownBar {
  width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.examStatsBreakdownBarFill {
  height: 100%;
  background: #2f80ed;
  border-radius: 999px;
}

/* ===== BOUTON STATS → ERREURS ===== */

.examStatsActions {
  margin-bottom: 22px;
}

.examStatsErrorBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  background: #2f80ed;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(47, 128, 237, 0.22);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.examStatsErrorBtn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.examStatsErrorBtn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

/* ===== INFOS ROTATION EXAMEN ===== */

.examRotationInfo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.examRotationInfoItem {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.examRotationInfoLabel {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.examRotationInfoValue {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
  #menuScreen {
    min-height: 100vh;
    padding: 18px 14px 28px;
    align-items: flex-start;
  }

  .menuPanel {
    max-width: 100%;
  }

  .mainTitle {
    font-size: 32px;
    margin: 110px 0 30px;
    line-height: 1.2;
  }

  .menu {
    gap: 16px;
  }

  .menuCard {
    max-width: 100%;
    padding: 18px 18px 18px 58px;
  }

  .menuCardWithStats {
    padding-right: 74px;
  }

  .menuIcon {
    left: 16px;
    font-size: 24px;
  }

  .menuInlineStats {
    right: 10px;
    width: 50px;
    height: 50px;
  }

  .menuInlineStats svg {
    width: 30px;
    height: 30px;
  }

  .menuTitle {
    font-size: 19px;
  }

  .menuSubtitle {
    font-size: 14px;
  }

  .container {
    width: calc(100% - 24px);
    padding: 18px;
    border-radius: 12px;
  }

  h1 {
    font-size: 20px;
  }

  .fiche-number {
    font-size: 18px;
  }

  .question {
    font-size: 20px;
  }

  .answer {
    font-size: 17px;
  }

  .topbar {
    align-items: stretch;
  }

  .jump-box {
    width: 100%;
  }

  .buttons {
    flex-direction: column;
  }

  .buttons button {
    width: 100%;
  }

  .images img,
  .q1InteractiveImage {
    max-height: 320px;
  }

  .safety-icon {
    width: 56px;
  }

  .examStatsBreakdownHead {
    flex-direction: column;
    align-items: flex-start;
  }
}

#errorsScreen .buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

#errorsScreen .buttons button {
  width: auto !important;
  min-width: 0;
  padding: 12px 18px;
}

#errorsScreen .section > div {
  flex-direction: column !important;
  align-items: flex-start !important;
}

/* on limite aux boutons DANS les fiches erreurs */
#errorsScreen .answer button {
  width: 100%;
}

.siteSignature {
  position: fixed;
  right: 14px;
  bottom: 10px;
  z-index: 10;
  font-size: 11px;
  line-height: 1;
  color: rgba(0, 0, 0, 0.38);
  background: rgba(255, 255, 255, 0.55);
  padding: 4px 8px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* plus discret sur mobile */
@media (max-width: 768px) {
  .siteSignature {
    right: 10px;
    bottom: 8px;
    font-size: 10px;
    padding: 3px 7px;
    color: rgba(0, 0, 0, 0.32);
  }
}

/* masquer pendant l'examen et sur l'écran de résultat */
body.exam-mode-active .siteSignature,
body.exam-result-active .siteSignature {
  display: none;
}