/* ==========================================================================
   Centre d'aide BLP+ — feuille de style unique
   Couleurs reprises de l'application (src/index.css) : #006EB6 / #005a94.
   ========================================================================== */

/* ---------- Jetons ------------------------------------------------------- */
:root {
  --primary:      #006EB6;
  --primary-dark: #005A94;
  --primary-soft: #E8F4FD;
  --accent-texte: #006EB6;

  --fond:         #F7F9FC;
  --carte:        #FFFFFF;
  --carte-survol: #FFFFFF;
  --bordure:      #E2E8F0;
  --bordure-forte:#CBD5E1;
  --texte:        #14202E;
  --texte-doux:   #5A6B80;
  --texte-tres-doux:#8494A6;
  --ombre:        0 1px 2px rgba(16, 32, 52, .06), 0 4px 16px rgba(16, 32, 52, .05);
  --ombre-forte:  0 2px 4px rgba(16, 32, 52, .08), 0 12px 32px rgba(16, 32, 52, .12);
  --rayon:        14px;
  --rayon-petit:  9px;
  --largeur:      1180px;
  --entete-haut:  64px;
}

:root[data-theme="dark"] {
  --primary:      #3FA0E4;
  --primary-dark: #2D8AC9;
  --primary-soft: #12293C;
  --accent-texte: #7CC2F0;

  --fond:         #0C121A;
  --carte:        #151E29;
  --carte-survol: #1B2734;
  --bordure:      #253243;
  --bordure-forte:#33455B;
  --texte:        #E9EFF6;
  --texte-doux:   #A3B2C4;
  --texte-tres-doux:#7C8CA1;
  --ombre:        0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  --ombre-forte:  0 2px 4px rgba(0, 0, 0, .5), 0 12px 32px rgba(0, 0, 0, .45);
}

/* ---------- Base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--entete-haut) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.6rem); font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p  { margin: 0 0 1em; }

a { color: var(--accent-texte); text-decoration-color: color-mix(in srgb, var(--accent-texte) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

img { max-width: 100%; height: auto; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.conteneur { width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 0 20px; }

.saut-contenu {
  position: absolute; left: -9999px; top: 0;
  background: var(--primary); color: #fff; padding: 12px 18px; border-radius: 0 0 10px 0; z-index: 200;
}
.saut-contenu:focus { left: 0; }

/* ---------- En-tête ------------------------------------------------------ */
.entete {
  position: sticky; top: 0; z-index: 100;
  height: var(--entete-haut);
  background: color-mix(in srgb, var(--carte) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bordure);
}
.entete .conteneur { height: 100%; display: flex; align-items: center; gap: 12px; }

.marque { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.06rem; color: var(--texte); text-decoration: none; margin-right: auto; }
.marque img { width: 32px; height: 32px; border-radius: 8px; }
.marque span small { display: block; font-size: .68rem; font-weight: 600; color: var(--texte-doux); letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; }

.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  padding: 8px 13px; border-radius: 999px; font-size: .93rem; font-weight: 600;
  color: var(--texte-doux); text-decoration: none; white-space: nowrap;
}
.nav a:hover { background: var(--primary-soft); color: var(--accent-texte); }
.nav a[aria-current="page"] { background: var(--primary); color: #fff; }

.bouton-theme {
  display: grid; place-items: center;
  width: 38px; height: 38px; margin-left: 6px; flex: none;
  border: 1px solid var(--bordure); border-radius: 10px;
  background: var(--carte); color: var(--texte-doux); cursor: pointer; font-size: 1.05rem;
}
.bouton-theme:hover { border-color: var(--bordure-forte); color: var(--texte); }

@media (max-width: 720px) {
  .marque span small { display: none; }
  .nav a { padding: 8px 10px; font-size: .88rem; }
}
/* Sur les petits écrans, le logo seul tient lieu de marque : sans cela le
   titre passe SOUS la navigation et les deux se chevauchent. */
@media (max-width: 480px) {
  .entete .conteneur { padding: 0 14px; gap: 8px; }
  .marque span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .nav a { padding: 8px 9px; font-size: .84rem; }
  .bouton-theme { width: 34px; height: 34px; margin-left: 2px; }
}

/* ---------- Boutons ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 11px; border: 1px solid transparent;
  font: inherit; font-weight: 650; font-size: .97rem; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-principal { background: var(--primary); color: #fff; }
.btn-principal:hover { background: var(--primary-dark); }
.btn-secondaire { background: var(--carte); color: var(--texte); border-color: var(--bordure-forte); }
.btn-secondaire:hover { border-color: var(--primary); color: var(--accent-texte); }

/* ---------- Bandeau d'accueil -------------------------------------------- */
.hero { padding: clamp(44px, 7vw, 84px) 0 clamp(36px, 5vw, 60px); }
.hero-grille { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.hero .surtitre {
  display: inline-block; padding: 5px 13px; margin-bottom: 18px;
  background: var(--primary-soft); color: var(--accent-texte);
  border-radius: 999px; font-size: .8rem; font-weight: 700; letter-spacing: .03em;
}
.hero p.chapo { font-size: 1.12rem; color: var(--texte-doux); max-width: 54ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.hero-visuel { display: grid; place-items: center; }
.hero-visuel img {
  width: min(300px, 80%);
  filter: drop-shadow(0 24px 44px rgba(0, 110, 182, .28));
}

@media (max-width: 860px) {
  .hero-grille { grid-template-columns: 1fr; }
  .hero-visuel { order: -1; }
  .hero-visuel img { width: min(190px, 55%); }
}

/* ---------- Sections ----------------------------------------------------- */
.section { padding: clamp(38px, 5vw, 62px) 0; }
.section-alt { background: var(--carte); border-block: 1px solid var(--bordure); }
.section-titre { text-align: center; max-width: 62ch; margin: 0 auto clamp(28px, 4vw, 44px); }
.section-titre p { color: var(--texte-doux); margin: 0; }

/* ---------- Grille de cartes --------------------------------------------- */
.grille { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); }

.carte {
  display: flex; flex-direction: column;
  background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon);
  padding: 22px; box-shadow: var(--ombre);
  text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.carte:hover { transform: translateY(-3px); box-shadow: var(--ombre-forte); border-color: color-mix(in srgb, var(--primary) 45%, var(--bordure)); }
.carte .icone { font-size: 1.7rem; line-height: 1; margin-bottom: 12px; }
.carte h3 { margin-bottom: 6px; }
.carte p { color: var(--texte-doux); font-size: .93rem; margin: 0; }
.carte .compte { margin-top: 14px; font-size: .82rem; font-weight: 650; color: var(--texte-tres-doux); }

/* ---------- Barre de recherche ------------------------------------------- */
.barre-recherche { position: relative; max-width: 620px; margin: 0 auto; }
.barre-recherche input {
  width: 100%; padding: 15px 46px 15px 46px;
  font: inherit; font-size: 1rem;
  color: var(--texte); background: var(--carte);
  border: 1px solid var(--bordure-forte); border-radius: 13px; box-shadow: var(--ombre);
}
.barre-recherche input::placeholder { color: var(--texte-tres-doux); }
.barre-recherche input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.barre-recherche .loupe { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--texte-tres-doux); pointer-events: none; }
.barre-recherche .effacer {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; display: none; place-items: center;
  border: 0; border-radius: 50%; background: var(--fond); color: var(--texte-doux); cursor: pointer; font-size: 1rem;
}
.barre-recherche.remplie .effacer { display: grid; }

/* ---------- Page tutoriels ----------------------------------------------- */
.page-entete { padding: clamp(30px, 4vw, 48px) 0 26px; text-align: center; }
.page-entete h1 { margin-bottom: 10px; }
.page-entete .chapo { color: var(--texte-doux); max-width: 60ch; margin: 0 auto 26px; }

.disposition { display: grid; grid-template-columns: 246px minmax(0, 1fr); gap: 34px; padding-bottom: 70px; align-items: start; }

.cote { position: sticky; top: calc(var(--entete-haut) + 20px); max-height: calc(100vh - var(--entete-haut) - 40px); overflow-y: auto; padding-right: 4px; }
.cote-groupe + .cote-groupe { margin-top: 24px; }
.cote-groupe > h2 {
  font-size: .74rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase;
  color: var(--texte-tres-doux); margin-bottom: 9px; padding-left: 12px;
}
.cote-groupe.discret > h2::after { content: " ·"; }
.cote a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; border-radius: 9px;
  font-size: .91rem; font-weight: 550; color: var(--texte-doux); text-decoration: none;
}
.cote a:hover { background: var(--primary-soft); color: var(--accent-texte); }
.cote a.actif { background: var(--primary); color: #fff; font-weight: 650; }
.cote a .puce { font-size: .95rem; }
.cote a .nb { margin-left: auto; font-size: .76rem; opacity: .7; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .disposition { grid-template-columns: 1fr; gap: 20px; }
  .cote {
    position: static; max-height: none; overflow: visible;
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px;
    border-bottom: 1px solid var(--bordure); scrollbar-width: thin;
  }
  .cote-groupe { display: contents; }
  .cote-groupe > h2 { display: none; }
  .cote a { white-space: nowrap; border: 1px solid var(--bordure); }
  .cote a .nb { display: none; }
  .cote-groupe + .cote-groupe { margin-top: 0; }
}

/* Bloc d'une catégorie */
.bloc-cat { scroll-margin-top: calc(var(--entete-haut) + 20px); }
.bloc-cat + .bloc-cat { margin-top: 46px; }
.bloc-cat > header { margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--bordure); }
.bloc-cat > header .fil {
  font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--texte-tres-doux);
}
.bloc-cat > header h2 { display: flex; align-items: center; gap: 10px; margin: 2px 0 4px; }
.bloc-cat > header p { margin: 0; color: var(--texte-doux); font-size: .94rem; }

/* Vignette de tutoriel */
.grille-tutos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); }

.tuto {
  display: flex; flex-direction: column;
  background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon);
  overflow: hidden; box-shadow: var(--ombre);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tuto.disponible:hover { transform: translateY(-3px); box-shadow: var(--ombre-forte); border-color: color-mix(in srgb, var(--primary) 45%, var(--bordure)); }

.tuto .apercu {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  display: grid; place-items: center;
  background: linear-gradient(140deg, color-mix(in srgb, var(--primary) 88%, #000) 0%, var(--primary) 55%, color-mix(in srgb, var(--primary) 70%, #fff) 100%);
  border: 0; padding: 0; cursor: pointer; color: #fff;
}
.tuto .apercu img { width: 100%; height: 100%; object-fit: cover; }
.tuto .apercu .lecture {
  position: absolute; inset: 0; margin: auto;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255, 255, 255, .93); color: var(--primary);
  display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  transition: transform .15s ease;
}
.tuto .apercu:hover .lecture { transform: scale(1.08); }
.tuto .apercu .duree {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0, 0, 0, .72); color: #fff; font-size: .74rem; font-weight: 650;
  padding: 2px 7px; border-radius: 5px;
}

/* Fiche sans vidéo */
.tuto.a-venir .apercu {
  background: repeating-linear-gradient(135deg, var(--fond) 0 12px, color-mix(in srgb, var(--primary) 7%, var(--fond)) 12px 24px);
  color: var(--texte-tres-doux); cursor: default;
}
.tuto.a-venir .apercu .etiquette {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--carte); border: 1px dashed var(--bordure-forte); border-radius: 999px;
  padding: 6px 14px; font-size: .8rem; font-weight: 650; color: var(--texte-doux);
}

.tuto .corps { padding: 15px 17px 17px; display: flex; flex-direction: column; flex: 1; }
.tuto h3 { font-size: .99rem; margin-bottom: 5px; }
.tuto p { font-size: .88rem; color: var(--texte-doux); margin: 0; }

/* Lecteur intégré */
.tuto .lecteur { aspect-ratio: 16 / 9; width: 100%; border: 0; display: block; }

/* Aucun résultat */
.vide { text-align: center; padding: 70px 20px; color: var(--texte-doux); }
.vide .grand { font-size: 2.6rem; display: block; margin-bottom: 10px; }
.vide strong { color: var(--texte); }

.compteur-resultats { margin: 0 0 20px; font-size: .9rem; color: var(--texte-doux); }
mark { background: color-mix(in srgb, var(--primary) 24%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- FAQ ---------------------------------------------------------- */
.faq-theme { scroll-margin-top: calc(var(--entete-haut) + 20px); }
.faq-theme + .faq-theme { margin-top: 34px; }
.faq-theme > h2 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }

.qr { background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon-petit); box-shadow: var(--ombre); overflow: hidden; }
.qr + .qr { margin-top: 10px; }
.qr summary {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px; cursor: pointer; font-weight: 650; list-style: none;
}
.qr summary::-webkit-details-marker { display: none; }
.qr summary::after {
  content: "＋"; margin-left: auto; flex: none;
  color: var(--texte-tres-doux); font-weight: 400; font-size: 1.15rem; line-height: 1.4;
  transition: transform .18s ease;
}
.qr[open] summary::after { content: "－"; }
.qr summary:hover { background: var(--primary-soft); }
.qr[open] summary { border-bottom: 1px solid var(--bordure); }
.qr .reponse { padding: 16px 18px 4px; color: var(--texte-doux); }
.qr .reponse ul { margin: 0 0 1em; padding-left: 1.2em; }
.qr .reponse li { margin-bottom: .35em; }
.qr .reponse strong { color: var(--texte); }

/* ---------- Encadré ------------------------------------------------------ */
.encadre {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-radius: var(--rayon); padding: 18px 20px; margin: 26px 0;
}
.encadre .icone { font-size: 1.3rem; line-height: 1.3; flex: none; }
.encadre p { margin: 0; font-size: .94rem; }
.encadre p + p { margin-top: .5em; }

/* ---------- Liste de points forts ---------------------------------------- */
.points { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); list-style: none; padding: 0; margin: 0; }
.points li h3 { display: flex; align-items: center; gap: 9px; }
.points li p { color: var(--texte-doux); font-size: .93rem; margin: 0; }

/* ---------- Pied de page ------------------------------------------------- */
.pied { background: var(--carte); border-top: 1px solid var(--bordure); padding: 34px 0; margin-top: auto; }
.pied .conteneur { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; justify-content: space-between; }
.pied p { margin: 0; font-size: .87rem; color: var(--texte-doux); }
.pied nav { display: flex; flex-wrap: wrap; gap: 18px; font-size: .87rem; }

body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }

@media print {
  .entete, .cote, .barre-recherche, .bouton-theme, .pied nav { display: none !important; }
  .qr .reponse { display: block !important; }
}
