/* ==========================================================================
   1. VARIABLES & CONFIGURATION GLOBALE
   ========================================================================== */
:root {
  --navy: #08284d;
  --blue: #0d5ea6;
  --cyan: #1597a5;
  --orange: #ef7d22;
  --green: #2b9b54;
  --red: #c74646;
  --ink: #162238;
  --muted: #66758a;
  --bg: #f2f6fa;
  --line: #d9e3ee;
  --shadow: 0 16px 45px rgba(8, 40, 77, .1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

body.admin-page {
  min-height: 100vh;
  background: #f2f6fa;
}

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: 11px;
  padding: 12px 18px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
}

.secondary {
  background: #edf3f8;
  color: var(--navy);
  border: 1px solid #cfdce8;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   2. ENTÊTE & VUES DU SITE UTILISATEUR (PUBLIC)
   ========================================================================== */
header {
  min-height: 100px;
  padding: 18px max(24px, calc((100vw - 1220px) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand img {
  width: 90px;
  max-height: 64px;
  object-fit: contain;
}

.brand-logo { 
  height: 45px;
  width: auto; 
  object-fit: contain; 
  display: block; 
}

.brand h1 {
  margin: 0;
  color: var(--navy);
}

.brand p, .brand small {
  margin: 4px 0;
  color: var(--muted);
}

small.text-orange {
  color: #ea580c;
  font-weight: bold;
}

.text-orange {
  color: #ea580c;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* Hero Section */
.hero {
  padding: 70px max(24px, calc((100vw - 1220px) / 2));
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 45px;
  align-items: center;
  color: #fff;
  background: linear-gradient(135deg, #08284df5, #0d5ea6e8);
}

.hero h2 {
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  line-height: 1.03;
  margin: 18px 0;
}

.hero p {
  max-width: 760px;
  line-height: 1.7;
  color: #d8e6f3;
}

.hero form, .panel {
  background: #fff;
  color: var(--ink);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 8px;
  font-size: .88rem;
  font-weight: 700;
  margin: 14px 0;
}

input, select, textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #cbd7e4;
  border-radius: 11px;
  background: #fff;
}

/* Catalogue & Grille */
.catalog {
  width: min(1220px, calc(100% - 48px));
  margin: auto;
  padding: 40px 0 80px; /* Changé 55px à 40px, mais combiné avec le margin-top au-dessus, l'effet sera parfait */
}

.section-head, .q-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.section-head h2 {
  margin: 4px 0;
  color: var(--navy);
}

small {
  color: var(--cyan);
  font-weight: 800;
  letter-spacing: .1em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 28px;
}

.card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
}

/* ==========================================================================
   3. COMPOSANT DROPDOWN DU PROFIL
   ========================================================================== */
.admin-profile-dropdown {
  position: relative;
  display: inline-block;
}

.avatar-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-trigger:hover {
  background: var(--bg);
  border-color: var(--blue);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  background: #edf3f8;
  color: var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.username-text {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.9rem;
}

.arrow-icon {
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.2s;
}

.dropdown-menu {
  position: absolute;
  top: 120%;
  right: 0;
  background: #ffffff;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  z-index: 1000;
  padding: 8px 0;
  animation: slideDown 0.15s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-user-info {
  padding: 10px 18px 6px;
  display: flex;
  flex-direction: column;
}

.dropdown-user-info strong {
  font-size: 0.82rem;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-user-info span {
  font-size: 0.78rem;
  color: var(--muted);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--line);
  margin: 8px 0;
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  padding: 11px 18px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: var(--bg);
}

.dropdown-item i:first-child {
  color: var(--blue);
  font-size: 1.1rem;
  width: 24px;
  margin-right: 12px;
  display: flex;
  justify-content: center;
}

.dropdown-item .item-text {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 600;
  flex-grow: 1;
}

.dropdown-item .arrow-sub {
  color: var(--line);
  font-size: 0.8rem;
  margin-left: auto;
  transition: color 0.15s, transform 0.15s;
}

.dropdown-item:hover .arrow-sub {
  color: var(--blue);
  transform: translateX(2px);
}

.dropdown-item.logout-item .item-text,
.dropdown-item.logout-item i:first-child {
  color: var(--red);
}

.dropdown-item.logout-item:hover {
  background: #fdf2f2;
}

/* ==========================================================================
   4. STRUCTURE DE LA SIDEBAR COULISSANTE
   ========================================================================== */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 40, 77, 0.4);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 999;
  padding: 15px 0;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 10px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header strong {
  font-size: 0.85rem;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.close-sidebar-btn {
  background: none;
  border: none;
  padding: 5px;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-sidebar-btn:hover {
  color: var(--red);
}

.sidebar-divider {
  height: 1px;
  background-color: var(--line);
  margin: 10px 0;
}

.sidebar-item {
  width: 100%;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  padding: 14px 20px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.sidebar-item:hover {
  background: var(--bg);
}

.sidebar-item i:first-child {
  color: var(--blue);
  font-size: 1.2rem;
  width: 24px;
  margin-right: 16px;
  display: flex;
  justify-content: center;
}

.sidebar-item .sidebar-text {
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 600;
  flex-grow: 1;
}

.sidebar-item .arrow-nav {
  color: var(--line);
  font-size: 0.85rem;
  margin-left: auto;
  transition: color 0.15s, transform 0.15s;
}

.sidebar-item:hover .arrow-nav {
  color: var(--blue);
  transform: translateX(3px);
}

/* ==========================================================================
   5. LECTEUR VIDÉO SÉCURISÉ
   ========================================================================== */
.video-player {
  overflow: hidden;
  border-radius: 12px;
  background: #0f172a;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.2);
}

#video {
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  background: #0f172a;
  display: block;
  pointer-events: none;
  user-select: none;
}

.video-controls {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  color: #e8f1fb;
  background: #07182d;
}

.video-controls button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: .92rem;
}

.video-controls button:hover {
  background: #0b4f8c;
}

#videoTime {
  min-width: 86px;
  font-variant-numeric: tabular-nums;
  color: #d7e6f6;
  font-weight: 700;
}

.video-lock {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .88rem;
  color: #b9cae0;
}

.training-notice {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #7e93ad;
  border-radius: 7px;
  background: #f5f8fb;
  color: #51657b;
  font-size: .92rem;
}

.training-notice.is-warning {
  border-left-color: var(--orange);
  background: #fff8ee;
  color: #a24700;
}

.training-notice.is-success {
  border-left-color: var(--green);
  background: #f0faf3;
  color: #18713b;
}

/* ==========================================================================
   6. VUE DE LA PAGE DE FORMATION (VIDÉO + INFOS)
   ========================================================================== */
#training {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

#training .back {
  background: none;
  border: none;
  color: #64748b;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s ease;
}

#training .back:hover {
  color: var(--navy);
}

.training-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  align-items: start;
}

@media (max-width: 968px) {
  .training-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.training-grid .section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 15px;
}

.training-grid .section-head h2 {
  font-size: 1.4rem;
  color: var(--navy);
  margin: 4px 0 0 0;
}

.training-grid .section-head small {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #94a3b8;
  font-size: 0.75rem;
}

#status {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #64748b;
  transition: all 0.3s ease;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: #475569;
}

#progressText {
  font-weight: 700;
  color: var(--orange);
}

.bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

#bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f97316, #ea580c);
  border-radius: 4px;
  transition: width 0.3s linear;
}

.aside-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.participant-box {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 15px;
}

.participant-box small {
  font-weight: 700;
  color: #94a3b8;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

#who {
  font-size: 1.25rem;
  color: var(--navy);
  margin: 5px 0;
}

#dept {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0;
}

.rules {
  background: #fff7ed;
  border-left: 4px solid #f97316;
  padding: 15px;
  border-radius: 0 8px 8px 0;
}

.rules b {
  color: #c2410c;
  font-size: 0.95rem;
  display: block;
  margin-bottom: 8px;
}

.rules ul {
  margin: 0;
  padding-left: 20px;
  font-size: 0.85rem;
  color: #7c2d12;
  line-height: 1.5;
}

.rules li {
  margin-bottom: 5px;
}

.demo {
  margin-top: 15px;
  padding: 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  text-align: center;
}

.demo b { 
  font-size: 0.85rem; 
  color: #64748b; 
  display: block; 
}

.demo button { 
  margin-top: 8px; 
  padding: 6px 12px; 
  font-size: 0.8rem; 
}

/* ==========================================================================
   7. DESIGN ACCUEIL (CATALOGUE STYLE MOODLE)
   ========================================================================== */
.welcome-banner {
  text-align: center;
  margin-top: 50px;      /* AJOUT : Crée un espace de 50px sous la bordure du header */
  margin-bottom: 40px;   /* Garde l'espace avec les cartes en dessous */
  padding-bottom: 15px;
  border-bottom: 2px solid #f1f5f9;
}

.welcome-banner h2 {
  color: #1e293b;
  font-size: 1.8rem;
  margin: 0;
}

.welcome-banner p {
  color: #64748b;
  margin: 5px 0 0 0;
}

.grid-courses {
  display: grid;
  max-width: 1000px; 
  margin: 0 auto;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
  padding: 10px 0;
}

.course-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
  border: 1px solid #e2e8f0;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.card-badge {
  position: absolute;
  top: 0;
  left: 20px;
  background: #f97316;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 6px 12px;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-image {
  height: 120px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.15);
  font-size: 3.5rem;
  position: relative;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-body small {
  color: #f97316;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.card-body h3 {
  margin: 10px 0;
  font-size: 1.2rem;
  color: #1e293b;
  line-height: 1.4;
}

.card-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.8rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   8. COMPOSANT POP-UP (MODALE D'IDENTITÉ)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: opacity 0.3s ease;
}

.modal-content {
  background: #ffffff;
  padding: 25px 30px;
  border-radius: 14px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  position: relative;
  animation: scaleUp 0.2s ease-out;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 5px;
  font-size: 1.3rem;
  color: #1e293b;
  text-align: center;
}

.modal-content p {
  font-size: 0.85rem;
  color: #64748b;
  text-align: center;
  margin-bottom: 20px;
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #94a3b8;
  cursor: pointer;
}

.close-btn:hover { 
  color: #1e293b; 
}

/* Espace entre la case de saisie et le bouton dans la modale */
.modal-content button[type="submit"] {
  margin-top: 20px; /* Crée un écart propre de 20px */
  width: 100%;      /* Optionnel : force le bouton à prendre toute la largeur pour être bien aligné */
}

/* ==========================================================================
   9. BOUTON CONNEXION ADMINISTRATEUR ÉLÉGANT
   ========================================================================== */
.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background-color: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
  border-radius: 99px; /* Forme pilule très moderne */
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none; /* Supprime le soulignement moche */
  transition: all 0.25s ease;
  box-shadow: 0 2px 5px rgba(13, 94, 166, 0.05);
}

/* Effet au survol : le bouton se remplit proprement */
.btn-admin:hover {
  background-color: var(--blue);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 94, 166, 0.2);
}

/* Effet au clic */
.btn-admin:active {
  transform: translateY(0);
}

/* Style de l'icône à l'intérieur */
.btn-admin i {
  font-size: 1rem;
}

/* ==========================================================================
   10. PARCOURS APPRENANT : QCM, RÉSULTAT ET ADAPTATION MOBILE
   ========================================================================== */
#appMain {
  min-height: calc(100vh - 100px);
}

#home {
  min-height: calc(100vh - 100px);
  padding: 0 24px 72px;
}

.course-card:focus-visible,
button:focus-visible,
.btn-admin:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(13, 94, 166, .35);
  outline-offset: 3px;
}

.course-unavailable {
  opacity: .8;
}

.course-unavailable .card-footer {
  color: #a35a1a;
}



#quiz {
  min-height: calc(100vh - 100px);
  padding: 22px 0 64px;
}

#quiz > .back {
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0;
  background: transparent;
  color: #64748b;
}

.quiz-catalog {
  padding-top: 24px;
}

.quiz-question {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(8, 40, 77, .05);
}

.quiz-question legend {
  width: 100%;
  padding: 0 0 14px;
  color: var(--navy);
  font-weight: 800;
  line-height: 1.45;
}

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid #dfe8f0;
  border-radius: 10px;
  background: #fbfdff;
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
}

.answer-option:hover {
  border-color: #9fc3e3;
  background: #f1f7fc;
}

.answer-option input {
  width: auto;
  margin-top: 2px;
  accent-color: var(--blue);
}

.quiz-multi-hint {
  font-size: .82rem;
  color: #0b5ca3;
  background: #eaf3fa;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 5px 10px;
  margin: 0 0 8px;
}

.quiz-submit {
  width: 100%;
  margin: 12px 0 0;
  padding: 14px 18px;
}

.training-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

#quizButton {
  background: var(--green);
}

#quizButton:hover {
  filter: brightness(.95);
}

.is-complete {
  background: #e7f7ed !important;
  color: #17723a !important;
}

.video-error {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 4px solid var(--red);
  border-radius: 8px;
  background: #fff1f1;
  color: #942f2f;
  line-height: 1.45;
}

#result {
  min-height: calc(100vh - 100px);
  display: none;
  place-items: center;
  padding: 56px 24px;
}

#result.active {
  display: grid;
}

.result {
  width: min(600px, 100%);
  padding: 42px;
  text-align: center;
  border: 1px solid #c9e9d5;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.result.is-failure {
  border-color: #f2c3c3;
}

#resultIcon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #e7f7ed;
  color: var(--green);
  font-size: 2.35rem;
  font-weight: 900;
}

.result.is-failure #resultIcon {
  background: #fff1f1;
  color: var(--red);
}

.result h2 {
  margin: 8px 0 10px;
  color: var(--navy);
}

.result > p {
  margin: 0 auto;
  max-width: 460px;
  color: var(--muted);
  line-height: 1.55;
}

.score {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin: 24px 0;
  color: var(--navy);
}

.score span {
  font-size: 3.4rem;
  font-weight: 900;
}

.score small {
  color: var(--muted);
}

.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 720px) {
  header {
    min-height: auto;
    padding: 14px 18px;
    gap: 14px;
  }

  .brand {
    gap: 10px;
    min-width: 0;
  }

  .brand img {
    width: 58px;
    max-height: 52px;
  }

  .brand h1 {
    font-size: 1.2rem;
  }

  .brand p,
  .brand small {
    font-size: .72rem;
  }

  .btn-admin {
    padding: 9px 11px;
    font-size: 0;
  }

  .btn-admin i {
    margin: 0;
    font-size: 1rem;
  }

  #home {
    padding: 0 16px 52px;
  }

  .welcome-banner {
    margin-top: 32px;
    margin-bottom: 26px;
  }

  .welcome-banner h2 {
    font-size: 1.45rem;
  }

  #training {
    padding: 16px;
  }

  .panel {
    padding: 18px;
  }

  .training-grid .section-head,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  #quiz > .back,
  .catalog {
    width: min(100% - 32px, 1220px);
  }

  .quiz-question {
    padding: 16px;
  }

  .result {
    padding: 30px 20px;
  }
}


/* Navigation et formulaires — version parcours sans compte obligatoire */
.back-to-public {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  color: #0d5ea6;
  font-weight: 700;
  text-decoration: none;
  font-size: .95rem;
}
.back-to-public:hover { text-decoration: underline; }
.admin-form-help {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid #b8d8ef;
  border-radius: 10px;
  background: #eef8ff;
  color: #163b5d;
  line-height: 1.55;
}
.admin-form-help i { margin-right: 8px; color: #0d5ea6; }
.optional-label { color: #66758a; font-weight: 500; }

/* Verrouillage du parcours tant que la vidéo obligatoire n'est pas terminée. */
.back.is-locked,
.back:disabled {
  cursor: not-allowed;
  opacity: .5;
  pointer-events: none;
}

@media (max-width: 650px) {
  .video-controls {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .video-lock {
    width: 100%;
    margin-left: 0;
  }
}

/* Version v6 : catalogue dynamique et notification par courriel */
.field-help {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.35;
}

.catalog-empty,
.quiz-empty {
  width: 100%;
  margin: 30px 0;
  padding: 20px;
  border: 1px dashed #cbd7e4;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.course-card[aria-disabled="true"] {
  cursor: not-allowed;
}

.course-card[aria-disabled="true"]:hover {
  transform: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

#mailNotice {
  text-align: left;
  margin: 16px auto 0;
  max-width: 640px;
}
