/* =========================================================================
   bjschool.tn — feuille de style
   Charte graphique dérivée de SchoolBoost-front/src/styles/theme.css
   (palette indigo/slate de l'application), avec une identité propre au
   site vitrine : accent émeraude (croissance/« Boost ») + ambre (énergie),
   repris des couleurs de graphiques déjà utilisées dans l'app (chart-3,
   chart-4) plutôt qu'inventés — cohérence de marque sans être une simple
   redite de la palette carthage/corail de bjmarket-site.
   Écrite à la main (pas de pipeline Tailwind) : accès au registre npm
   indisponible dans cet environnement de build — voir README.md.
   ========================================================================= */

:root {
  --bg: #F8FAFC;
  --bg-alt: #FFFFFF;
  --fg: #0F172A;
  --muted: #64748B;
  --muted-bg: #F1F5F9;

  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-bg: #EEF2FF;
  --primary-fg: #FFFFFF;

  --accent: #10B981;       /* émeraude — croissance, CTA secondaire */
  --accent-dark: #059669;
  --accent-bg: #ECFDF5;

  --highlight: #F59E0B;    /* ambre — badges, mise en avant */
  --highlight-bg: #FFFBEB;

  --border: rgba(15, 23, 42, 0.10);
  --radius: 0.375rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1.25rem;

  --font-sans: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 45px rgba(79, 70, 229, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; margin: 0 0 .5em; }
p { margin: 0 0 1em; color: var(--fg); }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.15rem; color: var(--fg); }
.brand .mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1rem;
}
.brand .tn { color: var(--muted); font-weight: 600; font-size: .85em; }
nav.main-nav { display: flex; align-items: center; gap: 1.75rem; }
nav.main-nav a { font-weight: 600; font-size: .95rem; color: var(--fg); opacity: .8; }
nav.main-nav a:hover { opacity: 1; color: var(--primary); }
.nav-ctas { display: flex; align-items: center; gap: .75rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.3rem; border-radius: var(--radius); font-weight: 700; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: .85rem 1.75rem; font-size: 1.02rem; }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; }
.btn-block { width: 100%; }

/* ---------- Sections ---------- */
section { padding: 5rem 0; }
section.tight { padding: 3rem 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--primary-bg); color: var(--primary-dark);
  font-weight: 700; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
  padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1rem;
}
.section-head { max-width: 680px; margin: 0 auto 3rem; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.25rem); }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { padding: 4.5rem 0 5rem; overflow: hidden; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); letter-spacing: -0.02em; }
.hero h1 .accent-text { color: var(--primary); }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.hero-ctas { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: 1.75rem; }
.hero-trust { display: flex; gap: 1.5rem; margin-top: 2.25rem; flex-wrap: wrap; }
.hero-trust .item { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--muted); font-weight: 600; }
.hero-visual {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); padding: 1.25rem; position: relative;
}
.hero-visual .browser-dots { display: flex; gap: 6px; margin-bottom: 1rem; }
.hero-visual .browser-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--muted-bg); }
.stat-tile {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1rem; text-align: center; box-shadow: var(--shadow-sm);
}
.stat-tile .n { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat-tile .l { font-size: .78rem; color: var(--muted); font-weight: 600; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ---------- Cards / features ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.75rem; box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; font-size: 1.2rem;
}
.card h3 { font-size: 1.05rem; }
.card p { color: var(--muted); font-size: .93rem; margin-bottom: 0; }
.card.accent .icon { background: var(--accent-bg); color: var(--accent-dark); }

/* ---------- Persona strip ---------- */
.persona { text-align: center; padding: 1.5rem; }
.persona .avatar {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary-bg), var(--accent-bg));
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--primary);
}

/* ---------- Alt background band ---------- */
.band { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.band-primary { background: linear-gradient(135deg, var(--primary) 0%, #4338CA 55%, #3730A3 100%); color: #fff; }
.band-primary h2, .band-primary p { color: #fff; }
.band-primary .btn-ghost { border-color: rgba(255,255,255,.35); color: #fff; }
.band-primary .btn-ghost:hover { border-color: #fff; }

/* ---------- Pricing ---------- */
.plan {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2rem; display: flex; flex-direction: column; gap: 1rem; position: relative;
}
.plan.featured { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.plan .badge {
  position: absolute; top: -13px; left: 2rem; background: var(--primary); color: #fff;
  font-size: .72rem; font-weight: 800; padding: .3rem .7rem; border-radius: 999px; letter-spacing: .03em;
}
.plan .price { font-size: 2.1rem; font-weight: 800; }
.plan .price .per { font-size: .95rem; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .65rem; }
.plan ul li { display: flex; gap: .6rem; font-size: .92rem; align-items: flex-start; }
.plan ul li::before { content: "✓"; color: var(--accent-dark); font-weight: 800; }

/* ---------- Timeline / steps ---------- */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: .5rem; }
.step .num {
  counter-increment: step; width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; margin-bottom: .85rem;
}
.step .num::before { content: counter(step); }

/* ---------- FAQ ---------- */
details.faq { border-bottom: 1px solid var(--border); padding: 1.1rem 0; }
details.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--primary); font-size: 1.3rem; font-weight: 400; }
details.faq[open] summary::after { content: "–"; }
details.faq p { margin-top: .75rem; color: var(--muted); }

/* ---------- Footer ---------- */
footer.site-footer { background: #0F172A; color: #CBD5E1; padding: 3.5rem 0 2rem; }
footer.site-footer h4 { color: #fff; font-size: .9rem; margin-bottom: 1rem; }
footer.site-footer a { color: #CBD5E1; font-size: .88rem; }
footer.site-footer a:hover { color: #fff; }
footer.site-footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
footer.site-footer .col { display: flex; flex-direction: column; gap: .6rem; }
footer.site-footer .bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2.5rem; padding-top: 1.5rem; font-size: .8rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; color: #64748B; }
@media (max-width: 780px) { footer.site-footer .cols { grid-template-columns: 1fr 1fr; } }

/* ---------- Badges / tags ---------- */
.tag { display: inline-block; background: var(--muted-bg); color: var(--muted); font-size: .78rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; }
.tag-accent { background: var(--accent-bg); color: var(--accent-dark); }
.tag-highlight { background: var(--highlight-bg); color: #92400E; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Responsive nav ---------- */
@media (max-width: 860px) {
  nav.main-nav { display: none; }
}

/* =========================================================================
   Documentation portal (manuel/) — sidebar + recherche
   ========================================================================= */
.doc-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.doc-sidebar {
  border-right: 1px solid var(--border); background: var(--bg-alt);
  padding: 1.5rem 1.25rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.doc-sidebar .brand { margin-bottom: 1.25rem; }
.doc-search { width: 100%; padding: .55rem .8rem; border-radius: var(--radius); border: 1px solid var(--border); font-family: var(--font-sans); font-size: .88rem; margin-bottom: 1.25rem; }
.doc-search:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.doc-nav-group { margin-bottom: 1.1rem; }
.doc-nav-group .g-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; margin-bottom: .5rem; }
.doc-nav-group a { display: block; padding: .4rem .55rem; border-radius: 6px; font-size: .87rem; color: var(--fg); }
.doc-nav-group a:hover { background: var(--muted-bg); }
.doc-nav-group a.active { background: var(--primary-bg); color: var(--primary-dark); font-weight: 700; }
.doc-switcher { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.5rem; }
.doc-switcher a { padding: .5rem .6rem; border-radius: var(--radius); border: 1px solid var(--border); font-size: .82rem; font-weight: 700; }
.doc-switcher a.current { border-color: var(--primary); background: var(--primary-bg); color: var(--primary-dark); }

.doc-main { padding: 2.5rem 3.5rem 6rem; max-width: 880px; }
.doc-main h1 { font-size: 2rem; }
.doc-main h2 { font-size: 1.4rem; margin-top: 2.5rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.doc-main h2:first-of-type { border-top: none; margin-top: 1.5rem; }
.doc-main h3 { font-size: 1.1rem; margin-top: 1.75rem; color: var(--primary-dark); }
.doc-main h4 { font-size: .98rem; margin-top: 1.25rem; }
.doc-main table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .88rem; }
.doc-main th, .doc-main td { border: 1px solid var(--border); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.doc-main th { background: var(--muted-bg); font-weight: 700; }
.doc-main code { background: var(--muted-bg); padding: .15em .4em; border-radius: 4px; font-size: .88em; }
.doc-main pre { background: #0F172A; color: #E2E8F0; padding: 1rem 1.25rem; border-radius: var(--radius-lg); overflow-x: auto; font-size: .85rem; }
.doc-main pre code { background: transparent; padding: 0; color: inherit; }
.doc-main blockquote { border-left: 3px solid var(--primary); margin: 1.25rem 0; padding: .25rem 1rem; color: var(--muted); background: var(--primary-bg); border-radius: 0 8px 8px 0; }
.doc-main ul, .doc-main ol { padding-left: 1.4rem; }
.doc-main li { margin-bottom: .35rem; }
.doc-callout { border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--accent-bg); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; padding: 1rem 1.25rem; margin: 1.5rem 0; }
.doc-callout.warn { border-left-color: var(--highlight); background: var(--highlight-bg); }
.doc-callout strong { display: block; margin-bottom: .25rem; }
.role-badges { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0 1.25rem; }
.role-badge { font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; background: var(--muted-bg); color: var(--fg); }
.doc-topbar { display: none; }
.no-print { }
.search-hidden { display: none !important; }
mark.search-hit { background: var(--highlight-bg); color: inherit; padding: 0 .1em; border-radius: 2px; }

@media (max-width: 980px) {
  .doc-shell { grid-template-columns: 1fr; }
  .doc-sidebar { position: relative; height: auto; }
  .doc-main { padding: 2rem 1.5rem 4rem; }
}

@media print {
  .doc-sidebar, .doc-topbar, .no-print, .doc-search { display: none !important; }
  .doc-shell { display: block; }
  .doc-main { max-width: 100%; padding: 0; }
  body { background: #fff; }
  a { color: var(--primary-dark); text-decoration: underline; }
}
