/* ============================================================
   PrépInfo — LMS CPGE
   Design System Premium · Version 2.0
   Style : minimaliste académique, inspiré Stripe / Notion
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --blue-900: #0a2d52;
  --blue-800: #0C447C;
  --blue-600: #185FA5;
  --blue-400: #378ADD;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;

  --purple-800: #3C3489;
  --purple-100: #ede9fe;

  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6B7280;
  --gray-300: #D1D5DB;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;

  --green-600: #16a34a;
  --green-100: #dcfce7;
  --red-600:   #dc2626;
  --red-100:   #fee2e2;
  --amber-600: #d97706;
  --amber-100: #fef3c7;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);

  --transition: .15s ease;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-900);
  background: #f4f6f9;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue-600);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--blue-800); }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: -.3px;
  flex-shrink: 0;
}
.navbar-brand span { color: #c0392b; }

.navbar-links {
  display: flex;
  gap: .25rem;
  flex: 1;
}
.navbar-links a {
  font-size: 13px;
  color: var(--gray-500);
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.navbar-links a:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}
.navbar-links a.active {
  color: var(--blue-800);
  background: var(--blue-50);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.navbar-user {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
}
.btn-logout {
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  color: var(--gray-500);
  background: #fff;
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition);
}
.btn-logout:hover {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-300);
  text-decoration: none;
}

/* ── Flash Messages ─────────────────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1.5rem;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.flash-error   { background: var(--red-100);   border-color: var(--red-600);   color: #7f1d1d; }
.flash-success { background: var(--green-100); border-color: var(--green-600); color: #14532d; }

/* ── Boutons ────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: var(--blue-800);
  color: #fff;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
  letter-spacing: .01em;
}
.btn-primary:hover {
  background: var(--blue-600);
  box-shadow: 0 2px 8px rgba(24,95,165,.25);
  text-decoration: none;
  color: #fff;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: transparent;
  color: var(--blue-800);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--blue-800);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-outline:hover {
  background: var(--blue-50);
  text-decoration: none;
}

.btn-full { width: 100%; }

/* ── Badges / Tags ──────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-right: 4px;
  letter-spacing: .02em;
}
.tag-cnc   { background: #fde8e0; color: #9a3412; }
.tag-cs    { background: var(--blue-100); color: #1e40af; }
.tag-mines { background: var(--purple-100); color: #4c1d95; }
.tag-xens  { background: #d1fae5; color: #065f46; }
.tag-ccinp { background: var(--amber-100); color: #78350f; }
.tag-corr  { background: #d1fae5; color: #065f46; }
.tag-py    { background: var(--blue-100); color: #1e3a8a; }
.tag-algo  { background: var(--purple-100); color: #3730a3; }
.tag-num   { background: #d1fae5; color: #064e3b; }
.tag-sql   { background: var(--amber-100); color: #713f12; }
.tag-struct{ background: #d1fae5; color: #065f46; }

/* ── Progress Bars ──────────────────────────────────────────── */
.prog-bar-outer {
  height: 5px;
  background: var(--gray-200);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}
.prog-bar-outer.prog-sm { height: 4px; margin-top: 0; }
.prog-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-600), var(--blue-400));
  border-radius: 99px;
  transition: width .4s ease;
}

/* ── Layout ─────────────────────────────────────────────────── */
.page-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header { margin-bottom: 2rem; }
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.3px;
  margin-bottom: .3rem;
  color: var(--gray-900);
}
.page-sub { font-size: 13px; color: var(--gray-500); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: .6rem;
}
.breadcrumb a { color: var(--blue-600); font-weight: 500; }
.breadcrumb span { color: var(--gray-300); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  /* Remplace le fond uni par l'image */
  background-image: url('/static/img/hero-bg.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--blue-900); /* fallback si l'image charge pas */

  padding: 4rem 2rem;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45); /* ajuste 0.3–0.6 selon ton image */
  z-index: 1;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 0%, rgba(55,138,221,.2) 0%, transparent 70%);
  pointer-events: none;
  z-index: 2; /* au-dessus de ::before, sous le contenu */
}

.hero-content {
  position: relative;
  z-index: 3;
}


.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: 4px 14px;
  margin-bottom: 1.2rem;
  letter-spacing: .04em;
}
.hero h1 {
  font-size: 2.1rem;
  font-weight: 700;
  max-width: 560px;
  margin: 0 auto 1rem;
  letter-spacing: -.5px;
  line-height: 1.2;
}
.hero h1 em { color: #6ee7b7; font-style: normal; }
.hero p {
  font-size: 15px;
  color: rgba(255,255,255,.7);
  max-width: 460px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
}
.stat { padding: 1.25rem; text-align: center; }
.stat-n {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: -.5px;
}
.stat-l { font-size: 11px; color: var(--gray-500); margin-top: 3px; font-weight: 500; }

.filieres-section { max-width: 820px; margin: 3rem auto; padding: 0 1.5rem; }
.filieres-section h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1.2rem; }
.filieres-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.filiere-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  background: #fff;
  display: block;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-xs);
}
.filiere-card:hover {
  border-color: var(--blue-400);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.fil-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--blue-50);
  color: var(--blue-800);
  letter-spacing: .04em;
}
.filiere-card p { font-size: 12px; color: var(--gray-500); line-height: 1.5; }

/* ── Auth ───────────────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 2.2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}
.auth-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue-800);
  margin-bottom: 1.5rem;
  letter-spacing: -.3px;
}
.auth-logo span { color: #c0392b; }
.auth-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--gray-900);
}
.auth-link {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 1.2rem;
  text-align: center;
}
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: .4rem;
  color: var(--gray-700);
  letter-spacing: .02em;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--gray-900);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(24,95,165,.1);
}
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
  font-size: 13px;
  color: var(--gray-600);
}
.optional { font-size: 11px; color: var(--gray-400); font-weight: 400; }

/* ── Dashboard ──────────────────────────────────────────────── */
.year-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: #fff;
  box-shadow: var(--shadow-xs);
}
.year-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1.3rem;
}
.year-card-header.year-1 { background: var(--blue-800); }
.year-card-header.year-2 { background: var(--purple-800); }
.year-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}
.year-card-filieres { display: flex; gap: 6px; }
.fil-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  letter-spacing: .03em;
}
.year-card-body { padding: 1.2rem; }

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  gap: 14px;
}
.course-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: block;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  color: inherit;
  box-shadow: var(--shadow-xs);
}
.course-card:hover {
  border-color: var(--blue-400);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
}
.course-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .9rem;
}
.course-theme-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--blue-50);
}
.theme-algo .course-theme-icon { background: #f5f3ff; }
.theme-num  .course-theme-icon { background: #f0fdf4; }
.theme-sql  .course-theme-icon { background: #fffbeb; }
.course-prog-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-600);
}
.course-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: .3rem;
  color: var(--gray-900);
  letter-spacing: -.1px;
}
.course-card p  { font-size: 12px; color: var(--gray-500); margin-bottom: .7rem; line-height: 1.5; }
.course-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: .8rem; }
.course-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--gray-400);
  margin-top: .6rem;
  font-weight: 500;
}

/* ── Chapitres — tableau ────────────────────────────────────── */
.chapters-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-xs);
  table-layout: fixed;
}
.chapters-table colgroup col:nth-child(1) { width: 64px; }
.chapters-table colgroup col:nth-child(3) { width: 180px; }
.chapters-table colgroup col:nth-child(4) { width: 44px; }

.chapters-table thead tr { display: table-row; }
.chapters-table th {
  display: table-cell;
  background: var(--gray-50);
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.chapter-row { display: table-row; cursor: pointer; }
.chapters-table td {
  display: table-cell;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.chapters-table tr:last-child td { border-bottom: none; }
.chapter-row:hover td { background: var(--blue-50); }

/* ── Chapter layout ─────────────────────────────────────────── */
.chapter-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 56px);
}

.sidebar {
  border-right: 1px solid var(--gray-200);
  background: #fff;
  overflow-y: auto;
}
.sidebar-head {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.sidebar-head h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 2px;
  letter-spacing: .02em;
}
.sidebar-head p { font-size: 11px; color: var(--gray-400); }
.breadcrumb-sm { font-size: 11px; margin-bottom: .5rem; }
.breadcrumb-sm a { color: var(--blue-600); font-weight: 500; }

.nav-section { padding: .5rem 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: .5rem 1rem;
  cursor: pointer;
  font-size: 12px;
  color: var(--gray-500);
  border-left: 2px solid transparent;
  transition: all var(--transition);
  line-height: 1.4;
}
.nav-item:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}
.nav-item.active {
  color: var(--blue-800);
  background: var(--blue-50);
  border-left-color: var(--blue-800);
  font-weight: 600;
}
.ni-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-300);
  flex-shrink: 0;
}
.nav-item.done .ni-dot   { background: #22c55e; }
.nav-item.active .ni-dot { background: var(--blue-600); }
.ni-label { flex: 1; }
.ni-check { font-size: 10px; color: #22c55e; font-weight: 700; }

.chapter-main { display: flex; flex-direction: column; overflow: hidden; }

.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  background: #fff;
  padding: 0 .5rem;
}
.tab {
  padding: .8rem 1rem;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  letter-spacing: .02em;
}
.tab:hover  { color: var(--gray-700); }
.tab.active {
  color: var(--blue-800);
  border-bottom-color: var(--blue-800);
}

.panel        { display: none; padding: 1.5rem 1.75rem; }
.panel.active { display: block; }

/* ── Contenu Cours ──────────────────────────────────────────── */
.course-content {
  line-height: 1.85;
  font-size: 14px;
  color: var(--gray-900);
}
.course-content h1 { font-size: 1.4rem; font-weight: 700; margin: 1.75rem 0 .7rem; letter-spacing: -.3px; }
.course-content h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.6rem 0 .6rem;
  padding-bottom: .4rem;
  border-bottom: 1.5px solid var(--gray-200);
  letter-spacing: -.2px;
}
.course-content h3 { font-size: .95rem; font-weight: 700; margin: 1.3rem 0 .4rem; color: var(--gray-700); }
.course-content h4 { font-size: .9rem;  font-weight: 600; margin: 1.1rem 0 .3rem; color: var(--gray-600); }
.course-content p  { margin-bottom: .8rem; line-height: 1.85; }
.course-content ul,
.course-content ol { padding-left: 1.5rem; margin: .5rem 0 .8rem; }
.course-content li { margin-bottom: .3rem; line-height: 1.75; }

.course-content p code,
.course-content li code {
  font-family: "Fira Code", "Cascadia Code", monospace;
  font-size: 12.5px;
  background: var(--gray-100);
  color: #c0392b;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

.course-content blockquote {
  border-left: 3px solid var(--blue-600);
  margin: 1.1rem 0;
  padding: .6rem 1rem;
  background: var(--blue-50);
  color: var(--gray-700);
  font-style: italic;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.course-content img, .ex-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 1rem auto;
  display: block;
  border: 1px solid var(--gray-200);
}

/* ── Tableaux cours ─────────────────────────────────────────── */
.course-content table {
  display: table;
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 13px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--gray-200);
}
.course-content thead tr { background: var(--blue-800); }
.course-content table th {
  background: var(--blue-800);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  border: none;
  letter-spacing: .03em;
}
.course-content table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  border-right: 1px solid var(--gray-100);
  vertical-align: middle;
  text-align: left;
  line-height: 1.6;
}
.course-content table td:last-child    { border-right: none; }
.course-content table tr:last-child td { border-bottom: none; }
.course-content table tr:nth-child(even) td { background: var(--gray-50); }
.course-content table tr:hover td { background: var(--blue-50); transition: background var(--transition); }

/* ── Code blocks ────────────────────────────────────────────── */
.code-container {
  width: 100%;
  margin: 1rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid #30304a;
  background: #0d1117;
  box-shadow: var(--shadow-sm);
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}
.code-lang {
  font-family: "Fira Code", monospace;
  font-size: 11px;
  font-weight: 700;
  color: #79c0ff;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.copy-icon {
  font-size: 13px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity var(--transition);
  user-select: none;
  padding: 2px 4px;
  border-radius: 4px;
}
.copy-icon:hover {
  opacity: 1;
  background: rgba(255,255,255,.1);
}
.code-container pre {
  margin: 0;
  padding: .9rem 1.1rem;
  overflow-x: auto;
  background: #0d1117;
}
.code-container pre code {
  font-family: "Fira Code", "Cascadia Code", "Courier New", monospace !important;
  font-size: 12.5px;
  line-height: 1.65;
  background: transparent !important;
  padding: 0 !important;
  color: #e6edf3;
  white-space: pre;
}

.code-error {
  color: var(--red-600);
  font-size: 12px;
  padding: .6rem 1rem;
  background: var(--red-100);
  border-radius: var(--radius-sm);
  margin: .5rem 0;
}
.pandoc-error {
  background: var(--red-100);
  border-left: 3px solid var(--red-600);
  padding: 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  color: #7f1d1d;
}

/* ── Formules MathJax ───────────────────────────────────────── */
.course-content .math { overflow-x: auto; }
.course-content .math.display {
  text-align: center;
  padding: .7rem 0;
  overflow-x: auto;
}
mjx-container[display="true"] {
  display: block;
  text-align: center;
  overflow-x: auto;
  padding: .6rem 0;
}

/* ── Blocs CPGE ─────────────────────────────────────────────── */
.definition-box, .theorem-box, .property-box,
.remark-box, .example-box, .method-box, .warning-box, .proof-box {
  margin: 1.1rem 0;
  padding: .9rem 1.1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.definition-box { border-left: 3px solid var(--blue-600);   background: var(--blue-50);   }
.theorem-box    { border-left: 3px solid #7c3aed;            background: #faf5ff;          }
.property-box   { border-left: 3px solid #059669;            background: #f0fdf4;          }
.remark-box     { border-left: 3px solid #0891b2;            background: #ecfeff;          }
.example-box    { border-left: 3px solid #65a30d;            background: #f7fee7;          }
.method-box     { border-left: 3px solid var(--amber-600);   background: #fffbeb;          }
.warning-box    { border-left: 3px solid var(--red-600);     background: var(--red-100);   }
.proof-box      { border-left: 3px solid #0d9488;            background: #f0fdfa;          }

.box-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .45rem;
  opacity: .7;
}
.proof-box .box-title {
  color: var(--red-600);
}
.box-content { font-size: 13.5px; line-height: 1.75; }

.fbox-block {
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  margin: .9rem 0;
  background: #fff;
}
.page-break {
  border: none;
  border-top: 1px dashed var(--gray-200);
  margin: 1.75rem 0;
}

/* ── Exercices ──────────────────────────────────────────────── */
.ex-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition);
}
.ex-card:hover { box-shadow: var(--shadow-sm); }
.ex-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 1rem;
  cursor: pointer;
  background: #fff;
  transition: background var(--transition);
}
.ex-head:hover { background: var(--gray-50); }
.ex-left  { display: flex; align-items: center; gap: 10px; }
.ex-num   {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.diff-easy { background: #dcfce7; color: #15803d; }
.diff-med  { background: var(--amber-100); color: #b45309; }
.diff-hard { background: #fee2e2; color: #b91c1c; }
.ex-title { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.ex-arrow { font-size: 16px; color: var(--gray-300); transition: transform .2s; }
.ex-body  { padding: 1rem; background: var(--gray-50); border-top: 1px solid var(--gray-100); display: none; }
.ex-body.open { display: block; }

/* ── Annales ────────────────────────────────────────────────── */
.filters-bar { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.3rem; }
.filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--gray-500); min-width: 58px; letter-spacing: .04em; }
.fb {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--transition);
}
.fb:hover { border-color: var(--blue-600); color: var(--blue-800); }
.fb.on    { background: var(--blue-50); border-color: var(--blue-600); color: var(--blue-800); }

.results-count { font-size: 12px; color: var(--gray-400); margin-bottom: .8rem; font-weight: 500; }
.annales-list  { display: flex; flex-direction: column; gap: 8px; }
.ann-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: .85rem 1rem;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-xs);
}
.ann-row:hover {
  border-color: var(--blue-400);
  box-shadow: var(--shadow-sm);
}
.ann-year-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ann-cnc  { background: #fde8e0; color: #9a3412; }
.ann-cs   { background: var(--blue-100); color: #1e40af; }
.ann-mines{ background: var(--purple-100); color: #4c1d95; }
.ann-xens { background: #d1fae5; color: #065f46; }
.ann-ccinp{ background: var(--amber-100); color: #78350f; }
.ayb-num  { font-size: 15px; font-weight: 700; line-height: 1; }
.ayb-lab  { font-size: 9px; opacity: .7; font-weight: 600; letter-spacing: .04em; }
.ann-info { flex: 1; }
.ann-info h4  { font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--gray-900); }
.ann-tags     { display: flex; gap: 4px; flex-wrap: wrap; }
.ann-right    { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ann-dur      { font-size: 11px; color: var(--gray-400); font-weight: 500; }
.done-check   { font-size: 12px; color: var(--green-600); font-weight: 700; }

/* ── États / utilitaires ────────────────────────────────────── */
.loading-msg {
  color: var(--gray-400);
  font-size: 13px;
  padding: 3rem;
  text-align: center;
}
.error-msg { color: var(--red-600); font-size: 13px; padding: 1rem; }
.empty-state { color: var(--gray-400); font-size: 13px; font-weight: 500; }

.exercise-box * {
  text-align: left;
}


.exercise-box pre,
.exercise-box code {
  white-space: pre !important;
  text-align: left !important;
}

.course-desc-list {
  list-style: none;
  padding: 0;
  margin-bottom: .7rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.course-desc-list li {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
  padding-left: 12px;
  position: relative;
}
.course-desc-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue-400);
}

/* ── Sélecteur d'année ──────────────────────────────────────── */
.year-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
}
.year-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  color: var(--gray-500);
  background: #fff;
  transition: all var(--transition);
}
.year-btn:hover {
  border-color: var(--blue-400);
  color: var(--blue-800);
  text-decoration: none;
}
.year-btn.active {
  background: var(--blue-800);
  border-color: var(--blue-800);
  color: #fff;
}

/* ── Puces description cours ────────────────────────────────── */
.course-desc-list {
  list-style: none;
  padding: 0;
  margin-bottom: .7rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.course-desc-list li {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
  padding-left: 12px;
  position: relative;
}
.course-desc-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue-400);
}
/* ─────────────────────────────
   FIGURES LMS (PRO)
───────────────────────────── */

.lms-figure {
  display: block;
  text-align: center;
  margin: 2rem auto;
}

.lms-figure img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.lms-figure figcaption {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.95rem;
  color: #555;
  font-style: italic;
  line-height: 1.4;
}

.prof-card-img {
  width: 100%;
  height: 260px; /* taille de la zone image */
  overflow: hidden;
  border-radius: 20px 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}

.prof-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* adapte l’image sans déformation */
}