/* --------- POLICE GLOBALE --------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0f172a;
  color: #0f172a;
  min-height: 100vh;
}

/* --------- Containers (HOME UNIQUEMENT) --------- */

body:not(.training-page) .site-header,
body:not(.training-page) main,
body:not(.training-page) .site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

/* --------- HEADER / HERO (HOME) --------- */

.site-header {
  padding-top: 2.5rem;
  padding-bottom: 1.5rem;
}

.header-inner {
  background: radial-gradient(circle at top left, #4f46e5 0%, #1d4ed8 30%, #020617 100%);
  border-radius: 24px;
  padding: 1.8rem 1.6rem 1.9rem;
  color: #e5e7eb;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.8);
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #e5e7eb;
}

.logo-text h1 {
  font-size: clamp(1.4rem, 2.4vw, 1.7rem);
  font-weight: 800;
}

.logo-text p {
  font-size: 0.9rem;
  color: #cbd5f5;
  margin-top: 0.15rem;
}

.header-main {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.6fr);
  gap: 1.5rem;
  align-items: flex-start;
}

.header-copy h2 {
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.header-copy p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #e2e8f0;
  margin-bottom: 1rem;
}

/* Pills de confiance */

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.pill {
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.35);
  background: rgba(15, 23, 42, 0.4);
  color: #e5e7eb;
}

/* Panel rassurant */

.header-panel {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.9);
}

.header-panel .panel-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 0.4rem;
}

.header-panel .panel-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #cbd5f5;
}

/* CTA */

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #111827;
  cursor: pointer;
  box-shadow:
    0 14px 35px rgba(15, 23, 42, 0.9),
    0 0 22px rgba(248, 113, 113, 0.5);
  transform: translateY(0);
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out,
    filter 0.15s ease-out;
}

.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 20px 45px rgba(15, 23, 42, 1),
    0 0 28px rgba(248, 113, 113, 0.7);
  filter: brightness(1.04);
}

.cta-btn:active {
  transform: translateY(0);
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.95),
    0 0 14px rgba(248, 113, 113, 0.6);
}

.cta-btn:focus-visible {
  outline: 2px solid #facc15;
  outline-offset: 2px;
}

/* --------- SECTIONS (HOME) --------- */

.section {
  background: #0b1220;
  border-radius: 20px;
  padding: 1.6rem 1.6rem 1.8rem;
  margin-top: 0.75rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(30, 64, 175, 0.4);
  color: #e5e7eb;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.section-header p {
  font-size: 0.9rem;
  color: #9ca3af;
}

/* --------- CONCEPT / STORYTELLING --------- */

.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
}

.concept-block {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid rgba(55, 65, 81, 0.8);
}

.concept-block h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.concept-block p {
  font-size: 0.9rem;
  color: #cbd5f5;
  line-height: 1.6;
}

/* ==== PETITE CARTE “TEASER” ==== */

.course-card-small {
  margin-top: 1.2rem;
  background: #020617;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.9);
  cursor: pointer;
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out,
    border-color 0.15s ease-out,
    background 0.15s ease-out;
}

.course-card-small:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 1);
  border-color: rgba(248, 113, 113, 0.7);
  background: #020617;
}

.course-card-small:active {
  transform: translateY(0);
}

.course-small-content {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1.2fr);
  gap: 0.9rem;
  align-items: center;
}

.course-small-text h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: #e5e7eb;
}

.course-small-text p {
  font-size: 0.9rem;
  color: #cbd5f5;
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

.cta-small {
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  box-shadow:
    0 10px 26px rgba(15, 23, 42, 0.9),
    0 0 18px rgba(248, 113, 113, 0.45);
}

.course-small-avatar {
  position: relative;
  justify-self: flex-end;
}

.course-small-avatar img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid rgba(248, 113, 113, 0.8);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.9);
}

@media (max-width: 600px) {
  .course-small-content {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .course-small-avatar {
    justify-self: flex-start;
  }
}

/* --------- CARTE DÉTAILLÉE --------- */

.course-card-detail {
  display: none;
  position: relative;
}

.course-card-detail.is-visible {
  display: block;
}

.course-card {
  margin-top: 1.2rem;
  background: radial-gradient(circle at top left, #111827 0%, #020617 55%, #020617 100%);
  border-radius: 18px;
  padding: 1.4rem 1.4rem 1.5rem;
  border: 1px solid rgba(248, 113, 113, 0.4);
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 1),
    0 0 28px rgba(248, 113, 113, 0.25);
  color: #e5e7eb;
}

.course-tag {
  display: inline-flex;
  font-size: 0.75rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(248, 113, 113, 0.6);
  color: #fee2e2;
  margin-bottom: 0.6rem;
}

.course-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.course-intro {
  font-size: 0.92rem;
  line-height: 1.7;
  color: #e5e7eb;
  margin-bottom: 1rem;
}

.course-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.course-column h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #fee2e2;
}

.course-column ul {
  list-style: none;
}

.course-column li {
  font-size: 0.88rem;
  color: #e5e7eb;
  line-height: 1.6;
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.25rem;
}

.course-column li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: #fb923c;
}

.course-footer {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.price-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.price {
  font-size: 1.1rem;
  font-weight: 700;
}

.note {
  font-size: 0.82rem;
  color: #9ca3af;
}

/* Bouton retour (carte détaillée) */

.back-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
}

.back-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(248, 113, 113, 0.8);
  color: #fff1e6;
  transform: translateY(-2px);
}

.back-btn:active {
  transform: translateY(0);
}

/* --------- FOOTER --------- */

.site-footer {
  padding-top: 0.8rem;
  padding-bottom: 2rem;
  text-align: center;
}

.site-footer p {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* --------- RESPONSIVE HOME --------- */

@media (max-width: 800px) {
  .header-main {
    grid-template-columns: 1fr;
  }

  .header-panel {
    margin-top: 0.5rem;
  }
}

@media (max-width: 600px) {
  body:not(.training-page) .site-header,
  body:not(.training-page) main,
  body:not(.training-page) .site-footer {
    padding: 1.3rem 1rem;
  }

  .header-inner {
    padding: 1.5rem 1.3rem 1.6rem;
  }

  .section {
    padding: 1.3rem 1.2rem 1.4rem;
  }

  .course-footer {
    align-items: flex-start;
  }

  .cta-btn {
    width: 100%;
  }
}

/* ========= TOPBAR GLOBALE ========= */

.topbar {
  width: 100%;
  background: #020617;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.8rem 0;
  transition: all 0.25s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.topbar.topbar-xl {
  padding: 2.4rem 0;
  box-shadow: 0 12px 35px rgba(0,0,0,0.45);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between; /* logo à gauche, bouton à droite */
}

/* Bouton menu de la landing : bien collé à droite */
body:not(.training-page) .menu-toggle {
  margin-left: auto;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.topbar-logo-img {
  height: 85px;
  width: 85px;
  border-radius: 50%;
  display: block;
  transition: all 0.25s ease;
}

.topbar.topbar-xl .topbar-logo-img {
  height: 92px;
  width: 92px;
}

.topbar-title {
  font-size: 1.35rem;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  font-weight: 800;
  color: #e5e7eb;
  letter-spacing: 0.01em;
  transition: all 0.25s ease;
}

.topbar.topbar-xl .topbar-title {
  font-size: 2rem;
}

/* ======= Bouton Retour Global (si besoin) ======= */

.back-global-btn {
  display: inline-block;
  margin-bottom: 1.2rem;
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.45);
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
}

.back-global-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(248, 113, 113, 0.8);
  color: #fff1e6;
  transform: translateY(-2px);
}

.back-global-btn:active {
  transform: translateY(0);
}

/* ========= PAGE FORMATION INTERACTIVE ========= */

html, body {
  height: 100%;
}

/* Topbar sur la page de formation */

.training-page .topbar {
  height: 125px;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.8rem 1.5rem !important;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}

.training-page .topbar-logo-img {
  height: 64px !important;
  width: 64px !important;
}

.training-page .topbar-title {
  font-size: 1.6rem !important;
  line-height: 1.1;
  white-space: nowrap;
}

.training-page .topbar.topbar-xl {
  padding: 0.8rem 0 !important;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4) !important;
}

/* Layout des 3 colonnes */

.training-page main.lesson-wrapper {
  max-width: none;
  padding: 1.5rem;
  margin: 0 auto;
}

.lesson-wrapper {
  height: calc(100vh - 120px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Colonne GAUCHE : consignes */

.lesson-panel {
  background: #020617;
  border-radius: 18px;
  padding: 24px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  width: 100%;
  max-width: none;
}

.lesson-panel h1 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.lesson-sub {
  font-size: 0.9rem;
  color: #9ca3af;
  margin-bottom: 0.8rem;
}

.lesson-panel h2 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.lesson-steps {
  list-style: decimal;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.lesson-hint {
  font-size: 0.85rem;
  color: #cbd5f5;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  border: 1px dashed rgba(148, 163, 184, 0.6);
}

/* Colonne CENTRALE : éditeur */

.editor-panel {
  background: #020617;
  border-radius: 18px;
  border: 1px solid rgba(30, 64, 175, 0.7);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 1);
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

/* Ligne complète des tabs + boutons */
.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* Groupe des tabs à gauche */
.editor-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Groupe Run + Corriger à droite */
.editor-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Onglets */
.tabs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tab {
  background: #1f2937;
  color: #e5e7eb;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #374151;
  cursor: pointer;
  font-size: 14px;
  transition: 0.15s;
  transform: translateX(-8px);
  opacity: 0.6;
}

.tab.active {
  background: #111827;
  border-color: #f59e0b;
  color: #f59e0b;
  opacity: 1;
}

/* Actions en haut de l'éditeur (Run + Corriger) */
.editor-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Boutons Run & Corriger (base) */
.run-btn,
.check-btn {
  padding: 8px 18px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  background: #f97316;
  color: white;
  box-shadow: 0 0 12px rgba(249,115,22,0.4);
  transition: 0.15s;
}

.run-btn:hover,
.check-btn:hover {
  background: #ea580c;
  transform: translateY(-2px);
}

.run-btn:active,
.check-btn:active {
  transform: translateY(0);
}

/* Spécifique "Corriger mon code" générique */
.check-btn {
  background: #1e293b;
  color: #e5e7eb;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.9);
}

.check-btn:hover {
  background: #f97316;
  color: #111827;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 1);
}

/* Run bouton style */
.run-btn {
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #111827;
  box-shadow:
    0 10px 25px rgba(15, 23, 42, 0.95),
    0 0 16px rgba(248, 113, 113, 0.6);
}

.run-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 32px rgba(15, 23, 42, 1),
    0 0 20px rgba(248, 113, 113, 0.8);
}

/* Bouton "Corriger mon code" – version training-page */
.training-page .editor-actions {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.training-page .check-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: none;
  background: #f97316;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.35);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.training-page .check-btn:hover {
  background: #ea580c;
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(234, 88, 12, 0.4);
}

.training-page .check-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.35);
}

/* === textarea éditeur === */

.code-editor {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  padding: 0.8rem;
  background: #020617;
  color: #e5e7eb;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  border-radius: 0 0 18px 18px;
  resize: none;
  overflow: auto;
  box-sizing: border-box;
  display: none;
}

.code-editor.active {
  display: block;
}

/* Colonne DROITE : prévisualisation */

.preview-panel {
  background: #020617;
  border-radius: 18px;
  border: 1px solid rgba(55, 65, 81, 0.9);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 1);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.preview-header {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(55, 65, 81, 0.9);
  font-size: 0.85rem;
  color: #e5e7eb;
}

#preview-frame {
  flex: 1;
  width: 100%;
  border: none;
  border-radius: 0 0 18px 18px;
  background: white;
}

/* ====== BARRE DES NIVEAUX FULL WIDTH ====== */

.levels-bar {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 1.5rem 0 2.5rem;
  background: transparent;
}

.levels-nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Ligne des boutons 1–10 : jamais de retour à la ligne, jamais de scroll */
.levels-inner {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}

/* Boutons 1–10 : rétrécissent automatiquement */
.level-btn {
  flex: 1 1 48px;
  max-width: 55px;
  min-width: 26px;
  height: 40px;
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.15s ease;
  box-shadow: 0 0 6px rgba(255, 119, 0, 0.2);
  padding: 0;
}

.level-btn:hover {
  background: #f97316;
  transform: translateY(-2px);
  box-shadow: 0 0 14px rgba(255, 136, 0, 0.6);
}

.level-btn.active {
  background: #f97316;
  color: #000;
}

/* Boutons “Jour précédent / suivant” — version compacte & responsive */

.levels-nav-btn {
  flex: 0 1 160px;
  min-width: 120px;
  height: 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #020617;
  color: #e5e7eb;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: 0 0 10px rgba(15, 23, 42, 0.8);
}

.levels-nav-btn:hover {
  background: #111827;
  border-color: rgba(249, 115, 22, 0.7);
  transform: translateY(-1px);
}

/* COURSES BUTTON (bouton "Cours" si tu l'utilises) */

.cours-btn {
  width: 200px;
  height: 55px;
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: 0 0 8px rgba(255, 119, 0, 0.2);
  margin-top: 50px;
  margin-left: 30px;
}

.cours-btn:hover {
  background: #f97316;
  transform: translateY(-2px);
  box-shadow: 0 0 14px rgba(255, 136, 0, 0.6);
}

/* CONTENU COURS */

.lesson-content {
  display: none;
  white-space: pre-line;
  line-height: 1.7;
  font-size: 18px;
  color: #e5e7eb;
}

.lesson-content.is-active {
  display: block;
}

.lesson-content h1,
.lesson-content h2,
.lesson-content h3 {
  margin-top: 22px;
  margin-bottom: 10px;
  line-height: 1.3;
  font-weight: 600;
  color: #ffffff;
}

.lesson-content h1 { font-size: 26px; }
.lesson-content h2 { font-size: 22px; }
.lesson-content h3 { font-size: 19px; }

.lesson-content p {
  margin-bottom: 10px;
}

/* Empêche l'interprétation HTML du texte du cours */
.lesson-content code,
.lesson-content pre,
.lesson-content,
.lesson-content * {
  unicode-bidi: plaintext;
}

/* ===== MODE COURS UNIQUEMENT (Jours 3, 4, 5) ===== */

.lesson-wrapper.only-lessons {
  display: flex !important;
  justify-content: center;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1rem;
  height: auto;
}

.lesson-wrapper.only-lessons .lesson-panel {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 2rem;
  border: 1px solid rgba(248,113,113,0.7);
  box-shadow: 0 20px 50px rgba(15,23,42,0.9);
  border-radius: 18px;
  font-size: xx-large;
  padding-right: 24px !important;
}

/* RESPONSIVE FORMATION */

@media (max-width: 1024px) {
  .lesson-wrapper {
    grid-template-columns: 1fr;
    height: auto;
  }

  .editor-panel,
  .preview-panel,
  .lesson-panel {
    min-height: 260px;
  }
}

@media (max-width: 640px) {
  .levels-nav {
    flex-direction: column;
    align-items: center;
  }

  .levels-nav-btn {
    width: 100%;
    max-width: 220px;
  }
}

/* Désactiver le resize sur tous les textareas */

textarea {
  resize: none;
}

/* ========================
   Ajustements formation
   - cacher logo / titre
======================== */

.training-page .topbar-logo,
.training-page .topbar-title,
.training-page .training-title-block {
  display: none !important;
}

/* On garde un peu d'espace en haut pour la barre de niveaux */
.training-page .levels-bar {
  padding-top: 0.8rem;
}

/* ====== BARRE FIXE EN BAS ====== */

.bottom-brand-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 62px;
  background: #020617;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 9999;
  box-shadow: 0 -4px 14px rgba(0,0,0,0.35);
}

.bottom-brand-logo {
  height: 45px;
  width: 45px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(248, 113, 113, 0.7);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.9);
}

.bottom-brand-title {
  font-size: 1.98rem;
  font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
  font-weight: 900;
  color: #e5e7eb;
  letter-spacing: 0.02em;
}

/* Empêche le contenu d’être caché derrière la barre */
body.training-page {
  padding-bottom: 70px;
}

/* Bouton ☰ (commun) */
.menu-toggle {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  font-size: 1.4rem;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.2s ease;
}

.menu-toggle:hover {
  background: #111827;
}

/* ===== Bouton menu – landing uniquement ===== */

body:not(.training-page) .topbar-inner {
  position: relative;
  justify-content: center;
}

body:not(.training-page) .menu-toggle {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}

/* Menu latéral */

.side-menu {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100vh;
  background: #0f172a;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  z-index: 200;
}

.side-menu.open {
  right: 0;
}

/* Fond sombre derrière le menu */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 150;
}

.menu-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  color: #fff;
}

.close-menu {
  background: none;
  border: none;
  color: #e5e7eb;
  font-size: 1.3rem;
  cursor: pointer;
}

.menu-item {
  padding: 12px 14px;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.1);
  color: #e5e7eb;
  border-radius: 12px;
  margin-bottom: 14px;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.menu-item:hover {
  background: #334155;
}

.logout {
  background: #7f1d1d;
  border-color: rgba(255,255,255,0.2);
}

.logout:hover {
  background: #b91c1c;
}

/******************************************
   FEEDBACK — VERSION JOUR 1 (UNIFIÉE)
******************************************/

/* Le conteneur feedback est sous les tabs */

#feedback-box {
  position: absolute;
  top: 62px;
  left: 20px;
  right: 20px;
  max-width: 600px;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
  font-size: 0.9rem;
  line-height: 1.55;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.9);
  z-index: 30;
  display: none;
}

/* États OK / ERREUR */
#feedback-box.ok {
  display: block;
  border-color: rgba(34, 197, 94, 0.75);
  box-shadow: 0 12px 32px rgba(22, 163, 74, 0.35);
}

#feedback-box.error {
  display: block;
  border-color: rgba(248, 113, 113, 0.8);
  box-shadow: 0 12px 32px rgba(248, 113, 113, 0.35);
}

/* Texte */
#feedback-box p {
  margin-bottom: 0.3rem;
}

/* Croix */
.feedback-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 50%;
  transition: 0.15s ease;
}

.feedback-close:hover {
  color: #ffffff;
  background: rgba(248, 113, 113, 0.25);
}

/* Important : enlever le feedback dans la prévisualisation */
.preview-panel #feedback-box {
  display: none !important;
}

/* Optionnel: petit wrapper texte si tu l'utilises */
.feedback-box {
  position: absolute;
  top: 60px;
  left: 20px;
  right: 20px;
  max-width: 600px;
  z-index: 20;
}

.feedback-body {
  margin-top: 5px;
}
/* Page login */
.login-wrapper {
  min-height: calc(100vh - 150px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-card {
  max-width: 400px;
  width: 100%;
  background: #020617;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,0.5);
  padding: 1.8rem;
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
  color: #e5e7eb;
}

.login-input {
  width: 100%;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.6);
  background: #020617;
  color: #e5e7eb;
  margin: 1rem 0;
}

.login-error {
  margin-top: 8px;
  color: #fca5a5;
  font-size: 0.85rem;
}
/* ====== TABS CONNEXION / INSCRIPTION ====== */

.login-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0.8rem 0 1.4rem;
}

.login-tab {
  flex: 1;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #020617;
  color: #e5e7eb;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.15s ease;
}

.login-tab.active {
  background: #f97316;
  border-color: rgba(249, 115, 22, 0.9);
  color: #111827;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.45);
}

/* une seule section visible à la fois */
.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
}
