/* ===== Base fournie (adaptée pour le web) ===== */
html, body { margin:0 !important; padding:0 !important; height:100% !important; width:100% !important; }  /*overflow: hidden; }*/ /* Empêche le scroll global */
* { -ms-text-size-adjust:100%; -webkit-text-size-adjust:100%; }
table, td { mso-table-lspace:0 !important; mso-table-rspace:0 !important; }
table { border-collapse:collapse !important; }
img { -ms-interpolation-mode:bicubic; border:0; outline:none; text-decoration:none; display:block; }
a { text-decoration:none; }
/* --- Styles --- */
.container { width:100%; max-width:600px; margin:0 auto; }
.btn { background:#4F46E5; color:#ffffff !important; padding:14px 22px; border-radius:8px; display:inline-block; font-weight:700; }
.btn:hover { opacity:0.95; }
.muted { color:#6b7280; }
.small { font-size:12px; line-height:18px; color:#6b7280; }
.legal { font-size:11px; line-height:17px; color:#6b7280; }


/* ===== App styles ===== */
:root { --brand:#4F46E5; --bg:#f7f7fb; }
body { background: var(--bg); font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; }
.navbar-brand span { font-weight:700; }
.navbar { box-shadow:0 2px 6px rgba(0,0,0,0.06); }

/* Login card centré */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.login-card { background:#fff; border-radius:16px; box-shadow:0 8px 24px rgba(0,0,0,0.08); width:100%; max-width:420px; }

/* Layout app */
.sidebar { background:#fff; border-right:1px solid #e5e7eb; min-height:100%; }
.sidebar .list-group-item { border:0; border-left:4px solid transparent; border-radius:0; padding:12px 16px; font-weight:600; color:#374151; }
.sidebar .list-group-item:hover { background:#f3f4f6; }
.sidebar .list-group-item.active { background:#eef2ff; color:#1f2937; border-left-color:var(--brand); }
.app-shell {
  min-height: calc(100vh - 56px - 56px); /* header + footer */
  height: calc(100vh - 56px - 56px);
  overflow: hidden;
}
.main-content { 
  background:#fff; /*min-height:100%;*/ padding:24px; 
  height: 100%;
  overflow-y: auto; /* Scroll interne si besoin */
  display: block;
  padding: 16px 24px; /* plus compact */

}
.footer { background:#fff; border-top:1px solid #e5e7eb; }

/* Utilitaires */
.badge-soft { background:#eef2ff; color:#3730a3; font-weight:600; }

.toc a{ text-decoration:none }
.section{ margin-bottom: 1.5rem; }
.kbd{ background:#f3f4f6; border:1px solid #e5e7eb; border-radius:.375rem; padding:.25rem .5rem; font-size:.875rem; }
.note{ background:#fefce8; border:1px solid #fde68a; border-radius:.5rem; padding:1rem; }
.table-sm td, .table-sm th{ padding:.5rem; }
.callout{ background:#eef2ff; border:1px solid #c7d2fe; border-radius:.5rem; padding:1rem; }
.card-plain{ background:#fff; border:1px solid #e5e7eb; border-radius:.75rem; padding:1rem; }

.cal-wrap{ background:#fff; border:1px solid #e5e7eb; border-radius:12px; }
.cal-toolbar{ padding:10px 12px; border-bottom:1px solid #e5e7eb; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.cal-toolbar .title{ font-weight:700; margin-right:auto; }
.cal-grid{ width:100%; border-collapse:collapse; table-layout:fixed; }
.cal-grid thead th{ font-size:12px; text-transform:uppercase; color:#6b7280; padding:8px; border-bottom:1px solid #e5e7eb; }
.cal-grid td{ vertical-align:top; padding:8px; border-right:1px solid #f1f5f9; border-bottom:1px solid #f1f5f9; height:120px; position:relative; }
.cal-grid td:nth-child(7){ border-right:none; }
.daynum{ position:absolute; top:6px; right:8px; font-size:12px; color:#64748b; }
.day-out{ background:#fafafa; }
.event{ font-size:12px; line-height:1.25; background:#eef2ff; border-left:3px solid #4F46E5; border-radius:6px; padding:4px 6px; margin-top:6px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.event .time{ font-weight:700; margin-right:4px; }
.legend{ padding:8px 12px; font-size:12px; color:#6b7280; }
@media (max-width: 768px){
  .cal-grid td{ height:96px; padding:6px; }
  .event{ font-size:11px; }
}


.quiz-wrap{ background:#fff; border:1px solid #e5e7eb; border-radius:12px; position:relative; }
.quiz-head{ padding:12px 14px; border-bottom:1px solid #e5e7eb; display:flex; align-items:center; gap:8px; }
.quiz-title{ font-weight:700; margin-right:auto; }
.quiz-body{ padding:16px; position:relative; } /* position for warn bar */
.quiz-foot{ padding:12px 14px; border-top:1px solid #e5e7eb; display:flex; gap:8px; justify-content:space-between; align-items:center; }
.pill{ background:#eef2ff; color:#4F46E5; border-radius:999px; padding:4px 8px; font-size:12px; font-weight:700; }
.locked{ background:#fff7ed; border:1px solid #fdba74; color:#9a3412; border-radius:8px; padding:8px 10px; font-size:13px; display:none; }
.choices .form-check{ margin-bottom:8px; }
.summary{ display:none; }
.progress{ height:6px; border-radius:999px; }
.progress-bar{ background:#4F46E5; }
/* La zone QCM devient le conteneur de positionnement */
#qcmZone { position: relative; }

/* Overlay centré DANS la zone QCM (caché par défaut) */
#antiOverlay{
  position: absolute;
  inset: 0;
  display: none;              /* <-- important: caché par défaut */
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}
#antiOverlay .anti-box{
  max-width: 560px;
  width: min(92%, 560px);
  text-align: center;
  background: rgba(255,255,255,.92);
  border-radius: 12px;
  border: 2px solid #ef4444;
  box-shadow: 0 20px 50px rgba(0,0,0,.15);
  pointer-events: auto;
}
#antiOverlay.mode-warning .anti-box{
  border-color: var(--warn-color, #f59e0b);
  background: var(--warn-bg, #fff7ed);
}

.pill-ok    { background:#e5fbea; color:#065f46; }
.pill-warn  { background:#fef3c7; color:#92400e; }
.pill-danger{ background:#fee2e2; color:#991b1b; }

/* Pré-offense (couleurs pilotées en JS) */
#qcmZone.qcm-warn{
  outline: 3px solid var(--warn-color, #f59e0b);
  background: var(--warn-bg, #fff7ed);
  transition: outline-color .2s linear, background-color .2s linear;
}

/* Blur uniquement sur la zone QCM (chrono en-tête non flouté) */
#qcmZone.qcm-blur > *:not(#antiOverlay){
  filter: blur(3px);
  pointer-events: none;
}
#antiOverlay.mode-block .anti-box{
  border-color: #ef4444;
  background: #fee2e2;
}
/* Cache définitivement le toggle bip */
#qcmBeepToggle { display: none !important; }

.btn.btn-disabled,
#qcmBeepToggle:disabled {
  opacity: .5 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

/* L'éval close n'active PAS le blur (on garde la lecture possible) */
#qcmZone.qcm-closed > *:not(#antiOverlay){
  filter: none !important;
  pointer-events: none; /* empêche toute interaction */
}

/* Highlight PRE-OFFENSE (bordure + fond doux, couleurs pilotées en JS) */
#qcmZone.qcm-warn{
  outline: 3px solid var(--warn-color, #f59e0b);
  background: var(--warn-bg, #fff7ed);
  transition: outline-color .2s linear, background-color .2s linear;
}

/* Blur UNIQUEMENT sur le contenu de la zone (pas le chrono dans .quiz-head) */
#qcmZone.qcm-blur > *:not(#antiOverlay){
  filter: blur(3px);
  pointer-events: none; /* désactive les interactions pendant le blocage */
}

/* Pré-avertissement : encadrement + fond (couleur pilotée en JS via --warn-color / --warn-bg) */
#qcmZone.qcm-warn{
  border: 2px solid var(--warn-color, #f59e0b); /* amber-500 */
  border-radius: 10px;
  background: var(--warn-bg, #fff7ed);          /* amber-50 */
  transition: border-color .15s linear, background-color .15s linear;
}
/* Barre d’avertissement en tête de zone */
.warn-bar{
  position:absolute; top:-12px; left:16px; right:16px;
  background: var(--warn-bg, #fff7ed);
  border:1px solid var(--warn-color, #f59e0b);
  color:#7c2d12; /* amber-900-ish */
  border-radius:8px; padding:8px 10px; font-size:13px;
  box-shadow:0 6px 16px rgba(0,0,0,.06);
  display:none;
}
.warn-bar strong{ font-weight:800; }
.warn-count{ font-weight:800; margin-left:.25rem; }

/* Overlay blocage (uniquement pour les offenses) */
.anti-overlay{ position:absolute; inset:0; display:none; align-items:center; justify-content:center; z-index:10; }
.anti-overlay.mode-block{ background:rgba(255,235,238,.93); } /* rouge clair */
.anti-box{ background:#ffffff; border:1px solid #e5e7eb; border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,.08); padding:18px 20px; max-width:420px; text-align:center; }
.anti-title{ font-weight:800; margin-bottom:6px; }
.anti-sub{ color:#6b7280; }
.anti-count{ font-weight:800; font-size:28px; margin:6px 0 0; color:#b91c1c; } /* rouge */

/* Anti-print dur */
@media print { body * { display:none !important; } }

#roadWrapper {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 30px;
  padding: 20px;
  height: 550px;
}

#roadContainer {
  flex: 0 0 60%;
  height: 100%;
  border-radius: 12px;
}

#objectivesList {
  flex: 0 0 40%;
  max-height: 100%;
  overflow-y: auto;
  font-family: "Segoe UI", Arial, sans-serif;
}

#objectivesList h3 {
  margin-bottom: 20px;
  font-size: 20px;
  color: #333;
}

#objectivesList ul {
  list-style: none;
  padding: 0 0 0 40px; /* espace à gauche pour la pastille */
  margin: 0;
  border-left: 3px solid #ddd;
  position: relative;
}

#objectivesList li {
  position: relative;
  margin: 20px 0;
  padding: 12px 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
}

#objectivesList li::before {
  content: "";
  position: absolute;
  left: -34px; 
  top: 16px;
  width: 14px;
  height: 14px;
  background: var(--dot-color, #3949ab);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #ddd;
}
#objectivesList li::before {
  background: var(--dot-color, #3949ab);
}

#objectivesList li:hover {
  /*transform: scale(1.03);*/
  background: #f5f5ff;
}

#objectivesList li.active {
  background: #f5f5ff;
  /*transform: scale(1.03);*/

}


.timeline-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
}

.timeline {
  position: relative;
  padding: 20px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #e0e0e0;
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 20px 40px;
  box-sizing: border-box;
}

.timeline-item-content {
  background: #fff;
  border-radius: 8px;
  padding: 15px 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.timeline-item-content h5 {
  margin: 0 0 10px;
  color: #333;
  transition: color 0.3s ease;
}

.timeline-item-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.timeline-item-content:hover h5 {
  color: var(--accent-color, #007aff);
}

.timeline-item ul {
  list-style: none;       /* enlève les puces */
  margin: 8px 0 0;
  padding-left: 0;
  color: #555;
}

.timeline-dot {
  position: absolute;
  top: 24px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-color, #007aff);
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
  font-weight: bold;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-dot.active,
.timeline-item-content:hover ~ .timeline-dot {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px rgba(0,0,0,0.15);
}
.timeline-item-content:hover,
.timeline-item-content.hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.timeline-item-content:hover h5,
.timeline-item-content.hover h5 {
  color: var(--accent-color, #007aff);
}

.timeline-dot.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px rgba(0,0,0,0.15);
}

.timeline-item.left {
  left: 0;
  text-align: right;
}

.timeline-item.left .timeline-dot {
  right: -13px;
}

.timeline-item.right {
  left: 50%;
}

.timeline-item.right .timeline-dot {
  left: -13px;
}

/* Animation apparition */
.timeline-item {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.timeline-item.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .timeline::before {
    left: 15px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 50px;
    padding-right: 20px;
    text-align: left !important;
  }
  .timeline-item.left,
  .timeline-item.right {
    left: 0;
  }
  .timeline-item .timeline-dot {
    left: 0;
  }
}


/* Polices manuscrites */
@import url('https://fonts.googleapis.com/css2?family=Cedarville+Cursive&family=Great+Vibes&display=swap');

.signature-box {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 380px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #fafafa;
  overflow: hidden;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.05);
}

.signature-preview {
  font-family: 'Great Vibes', 'Cedarville Cursive', cursive;
  font-size: 36px;
  padding: 16px 20px;
  text-align: center;
  color: #1e293b;
  outline: none;
  min-height: 80px;
  transition: all 0.2s ease-in-out;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.05);
}

.signature-preview:empty::before {
  content: attr(placeholder);
  color: #9ca3af;
  font-style: italic;
}

.signature-preview:focus {
  border-color: #4F46E5;
  background: #ffffff;
}

.signature-timestamp {
  position: absolute;
  bottom: 6px;
  right: 10px;
  font-size: 11px;
  color: #9ca3af;
  pointer-events: none;
  font-family: monospace;
}

.event.signed {
  background: #ECFDF5;
  border-left-color: #10B981;
}

.event.late {
  background: #FEF2F2;
  border-left-color: #EF4444;
}

.event.upcoming {
  background: #EEF2FF;
  border-left-color: #4F46E5;
}

.end-module-menu {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #ffffff;
  border: 2px solid #10B981;
  border-radius: 12px;
  padding: 12px 18px;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  transition: opacity 0.3s ease;
}

.end-module-menu .menu-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.end-module-menu button {
  font-weight: 600;
}

.survey-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

.survey-question {
  margin-bottom: 24px;
  border-bottom: 1px dashed #e5e7eb;
  padding-bottom: 16px;
}

.survey-question h6 {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.survey-category {
  font-size: 13px;
  color: #6b7280;
}

.star-rating {
  display: flex;
  gap: 8px;
  font-size: 24px;
  cursor: pointer;
  color: #d1d5db;
  transition: color 0.2s ease;
}

.star-rating .star:hover,
.star-rating .star.active {
  color: #facc15;
}

.star-rating .star.selected {
  color: #f59e0b;
}

textarea.form-control {
  resize: vertical;
}

#surveyThanks {
  animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}


/* --- Correction espacement excessif haut contenu --- */
.main-content {
  padding-top: 8px !important; /* réduit l'espace haut */
}

/* --- Corrige le haut du bloc road --- */
#roadWrapper {
  padding-top: 0 !important;
  height: auto !important; /* permet d’adapter la hauteur au contenu */
  min-height: 400px;       /* tu peux ajuster selon le rendu souhaité */
}

/* --- Supprime marge sur première section --- */
.section:first-of-type {
  margin-top: 0 !important;
}

/* === Correction bouton hover invisible === */
.btn {
  background-color: var(--brand, #4F46E5);
  color: #fff !important;
  border: none;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn:hover, 
.btn:focus {
  background-color: #4338ca !important; /* un peu plus foncé */
  color: #fff !important; /* garde le texte visible */
  transform: translateY(-1px);
}

.btn:active {
  background-color: #3730a3 !important; /* encore plus foncé pour effet clic */
  transform: translateY(0);
}

.btn:disabled {
  background-color: #a5b4fc !important;
  color: #e0e7ff !important;
  cursor: not-allowed;
  opacity: 0.8;
}

.report-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  max-width: 600px;
  margin: 0 auto;
}

.report-upload p {
  font-size: 14px;
  color: #4b5563;
}

.report-sent .alert {
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px solid #d1fae5;
  color: #065f46;
}

#downloadReportBtn {
  border-color: #10b981 !important;
  color: #065f46 !important;
}

#downloadReportBtn:hover {
  background: #10b981 !important;
  color: #fff !important;
}

.card .download-btn,
.card .download-btn i {
  opacity: 1 !important;
  visibility: visible !important;
  display: inline-flex !important;
  position: relative !important;
  pointer-events: auto !important;
}