/* B-Empire Academy — charte noir / or / ivoire */
:root {
  --black: #0D0D0D;
  --ink: #1a1a1a;
  --gold: #C9A84C;
  --gold-dark: #8a6d1f;
  --ivory: #FBF8F1;
  --paper: #ffffff;
  --line: #e7e1d3;
  --muted: #6b6559;
  --ok: #1f7a4a;
  --bad: #a3312b;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --r: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--ivory); line-height: 1.6; font-size: 16px; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, .hero-stats strong, .steps span { font-variant-numeric: lining-nums; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; color: var(--black); margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 600; }
h3 { font-size: 1.35rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .75rem; font-weight: 600; color: var(--gold-dark); margin-bottom: .8em; }
.eyebrow a { text-decoration: none; }
.lead { font-size: 1.15rem; max-width: 720px; color: #3d3a33; }

/* Boutons */
.btn { display: inline-block; padding: 14px 26px; border-radius: 999px; font-weight: 600; font-size: .95rem; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; font-family: var(--sans); transition: transform .15s, background .15s, color .15s; text-align: center; }
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--black); }
.btn-gold:hover { background: #d8b95c; }
.btn-dark { background: var(--black); color: #fff; }
.btn-ghost { border-color: currentColor; background: transparent; color: inherit; }
.btn-sm { padding: 9px 18px; font-size: .875rem; }
.btn-block { width: 100%; }
.link-gold { color: var(--gold-dark); font-weight: 600; text-decoration: none; }
.link-gold:hover { text-decoration: underline; }

/* En-tête */
.site-header { background: var(--black); color: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(201,168,76,.25); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 20px; }
.brand img { display: block; width: 190px; height: auto; }
.main-nav { display: flex; align-items: center; gap: 22px; font-size: .92rem; }
.main-nav a { text-decoration: none; color: #e9e4d8; }
.main-nav a:hover { color: var(--gold); }
.main-nav a.btn { color: var(--black); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; }

.flash { padding: 14px 0; font-weight: 500; }
.flash-ok { background: #e6f3ea; color: var(--ok); }
.flash-info { background: #f6efd9; color: #6b5310; }

/* Hero */
.hero { background: radial-gradient(1100px 500px at 80% -10%, rgba(201,168,76,.22), transparent 60%), var(--black); color: #fff; padding: 90px 0 80px; }
.hero h1 { color: #fff; max-width: 860px; }
.hero h1 em { color: var(--gold); font-style: italic; }
.hero .lead { color: #d9d4c7; }
.hero .eyebrow { color: var(--gold); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.hero-stats { list-style: none; padding: 0; margin: 56px 0 0; display: flex; flex-wrap: wrap; gap: 48px; }
.hero-stats strong { display: block; font-family: var(--serif); font-size: 2.6rem; color: var(--gold); line-height: 1; }
.hero-stats span { font-size: .85rem; color: #bdb7a8; text-transform: uppercase; letter-spacing: .12em; }

.page-head { background: var(--black); color: #fff; padding: 64px 0 52px; }
.page-head h1 { color: #fff; }
.page-head .lead { color: #d9d4c7; }
.page-head .eyebrow { color: var(--gold); }
.page-head .muted { color: #bdb7a8; }

/* Sections */
.section { padding: 80px 0; }
.section-dark { background: var(--black); color: #e9e4d8; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-ivory { background: #f3ecdc; }
.section-head { margin-bottom: 40px; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: start; }

/* Cartes */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 18px 40px -22px rgba(0,0,0,.35); transform: translateY(-2px); }
.card p { color: #4a463d; flex: 1; }
.card-top { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; margin-bottom: 18px; }
.card-icon { width: 52px; height: 52px; border-radius: 12px; background: var(--black); color: var(--gold); display: grid; place-items: center; margin-bottom: 16px; }
.card-icon svg { width: 26px; height: 26px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; font-size: .88rem; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; }
.card-soon { opacity: .7; }
.tag { background: #f3ecdc; color: var(--gold-dark); padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.soon { font-size: .85rem; font-weight: 600; color: var(--muted); }

/* Étapes */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.steps span { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--gold); color: var(--gold); font-family: var(--serif); font-size: 1.3rem; font-weight: 700; margin-bottom: 14px; }
.steps p { color: #bdb7a8; font-size: .95rem; }

.callout { background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--r); padding: 28px; }
.checks { list-style: none; padding: 0; margin: 0 0 1.5em; }
.checks li { padding: 8px 0 8px 30px; position: relative; border-bottom: 1px solid #f0ebe0; }
.checks li::before { content: '✓'; position: absolute; left: 0; top: 8px; color: var(--gold-dark); font-weight: 700; }
.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-band > div { max-width: 680px; }

/* Cours */
.progress { height: 6px; background: rgba(201,168,76,.2); border-radius: 99px; overflow: hidden; margin: 22px 0 6px; max-width: 420px; }
.progress div { height: 100%; background: var(--gold); border-radius: 99px; }
.card .progress { margin: 10px 0 6px; }
.syllabus { list-style: none; padding: 0; margin: 0; }
.syllabus li { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.syllabus .num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #f3ecdc; color: var(--gold-dark); font-weight: 700; font-size: .9rem; }
.syllabus li.done .num { background: var(--gold); color: var(--black); }
.syllabus .exam-row .num { background: var(--black); color: var(--gold); }
.syllabus a, .syllabus strong { display: block; font-weight: 600; text-decoration: none; }
.syllabus a:hover { color: var(--gold-dark); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0 0 1.5em; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; font-weight: 600; }

/* Leçon */
.lesson-layout { display: grid; grid-template-columns: 270px 1fr; gap: 48px; padding-top: 48px; padding-bottom: 80px; }
.lesson-side { position: sticky; top: 96px; align-self: start; }
.lesson-side ol { list-style: none; padding: 0; margin: 18px 0 0; }
.lesson-side li a { display: flex; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; font-size: .9rem; color: #4a463d; }
.lesson-side li a span { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #f3ecdc; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--gold-dark); }
.lesson-side li.done a span { background: var(--gold); color: var(--black); }
.lesson-side li.current a { background: var(--paper); color: var(--black); font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
.lesson { max-width: 760px; min-width: 0; }
.prose { font-size: 1.06rem; }
.prose h2 { font-size: 1.7rem; margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.prose blockquote { margin: 1.5em 0; padding: 18px 22px; background: var(--paper); border-left: 3px solid var(--gold); border-radius: 0 var(--r) var(--r) 0; }
.prose .box { background: var(--black); color: #e9e4d8; padding: 22px 24px; border-radius: var(--r); margin: 1.5em 0; }
.prose .box strong { color: var(--gold); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose th { background: #f3ecdc; }
.takeaways { background: #f3ecdc; border-radius: var(--r); padding: 24px 28px; margin: 40px 0; }
.takeaways h2 { font-size: 1.4rem; }
.takeaways ul { margin: 0; padding-left: 1.2em; }

/* Quiz */
.quiz { border-top: 1px solid var(--line); padding-top: 32px; margin-top: 40px; }
.q { border: 1px solid var(--line); background: var(--paper); border-radius: var(--r); padding: 20px 22px; margin: 0 0 18px; }
.q legend { font-weight: 600; padding: 0 6px; margin-left: -6px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; cursor: pointer; margin-top: 6px; border: 1px solid transparent; }
.opt:hover { background: #faf6ec; }
.opt input { margin-top: 5px; accent-color: var(--gold-dark); }
.opt.right { border-color: var(--ok); background: #eaf5ee; }
.opt.wrong { border-color: var(--bad); background: #fbecea; }
.explain { margin: 12px 0 0; font-size: .92rem; color: #6b2a25; background: #fbf1ef; padding: 10px 14px; border-radius: 8px; }
.explain.ok { color: #1d4f33; background: #edf6f0; }
.next { margin-top: 24px; }
.alert { padding: 14px 18px; border-radius: 8px; background: #fbecea; color: var(--bad); margin: 0 0 20px; font-weight: 500; }
.alert-ok { background: #e6f3ea; color: var(--ok); }

/* Auth */
.auth { padding: 64px 20px 90px; display: flex; justify-content: center; }
.auth-card { width: 100%; max-width: 520px; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--r); padding: 36px 34px; }
.auth-card.center { text-align: center; }
.auth-card h1 { font-size: 2.2rem; }
form label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 16px; }
form label small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password] { display: block; width: 100%; margin-top: 6px; padding: 13px 14px; border: 1px solid #d9d2c1; border-radius: 8px; font: inherit; font-size: 1rem; background: #fff; }
input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label.check { display: flex; gap: 10px; font-weight: 400; font-size: .85rem; color: #4a463d; align-items: flex-start; }
label.check input { margin-top: 4px; accent-color: var(--gold-dark); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.auth-alt { text-align: center; margin: 20px 0 0; font-size: .92rem; }

/* Tableau de bord */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.dash-head .btn-ghost { color: #fff; }
.cert-list { display: grid; gap: 12px; margin-bottom: 48px; }
.cert-item { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: var(--r); padding: 18px 22px; text-decoration: none; }
.section h2 + .cards { margin-top: 10px; }

/* Vérification */
.verify-form { display: flex; gap: 10px; margin-bottom: 32px; }
.verify-form input { margin: 0; font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; text-transform: uppercase; }
.verify-result { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 28px; }
.verify-result.ok { border-top: 4px solid var(--ok); }
.verify-result.bad { border-top: 4px solid var(--bad); }
.verify-badge { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; }
.verify-result.ok .verify-badge { color: var(--ok); }
.verify-result.bad .verify-badge { color: var(--bad); }

/* Pied de page */
.site-footer { background: var(--black); color: #bdb7a8; padding: 64px 0 28px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; }
.footer-grid h4 { color: #fff; font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .16em; margin: 0 0 14px; }
.footer-grid a { display: block; text-decoration: none; padding: 4px 0; color: #d9d4c7; }
.footer-grid a:hover { color: var(--gold); }
.footer-grid .muted { color: #8f897b; max-width: 380px; margin-top: 14px; }
.footer-bottom { border-top: 1px solid #2a2a2a; margin-top: 44px; padding-top: 22px; display: flex; flex-direction: column; gap: 6px; font-size: .82rem; }
.footer-bottom .muted { color: #7d776a; }

/* Responsive */
@media (max-width: 960px) {
  .two-col, .lesson-layout { grid-template-columns: 1fr; gap: 32px; }
  .lesson-side { position: static; }
  .steps { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 72px; background: var(--black); flex-direction: column; align-items: stretch; padding: 12px 20px 22px; gap: 0; border-bottom: 1px solid rgba(201,168,76,.25); }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid #222; }
  .main-nav a.btn { margin-top: 12px; border: 0; }
  body.nav-open .main-nav { display: flex; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 60px 0 56px; }
  .hero-stats { gap: 28px; }
  .section { padding: 56px 0; }
  .steps, .footer-grid, .row-2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
  .verify-form { flex-direction: column; }
  .brand img { width: 160px; }
}

/* ---------- Sélecteur de langue ---------- */
.lang-switch { display: inline-flex; gap: 2px; border: 1px solid #333; border-radius: 999px; padding: 3px; }
.lang-switch a { padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; color: #bdb7a8; }
.lang-switch a.active { background: var(--gold); color: var(--black); }
.lang-switch a:hover { color: var(--gold); }
.lang-switch a.active:hover { color: var(--black); }
@media (max-width: 860px) {
  .main-nav .lang-switch { align-self: flex-start; margin: 12px 0 4px; }
  .main-nav .lang-switch a { border-bottom: 0; padding: 6px 14px; }
}

/* ---------- Arabe / RTL ---------- */
[dir="rtl"] { --serif: 'Noto Kufi Arabic', 'Noto Sans Arabic', Tahoma, sans-serif; --sans: 'Noto Sans Arabic', 'Inter', Tahoma, sans-serif; }
[dir="rtl"] body { line-height: 1.85; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { line-height: 1.45; font-weight: 700; }
[dir="rtl"] h1 { font-size: clamp(1.9rem, 4.4vw, 3.1rem); }
[dir="rtl"] .hero h1 em { font-style: normal; }
/* l'espacement des lettres casse la liaison des lettres arabes */
[dir="rtl"] .eyebrow, [dir="rtl"] .hero-stats span, [dir="rtl"] .footer-grid h4 { letter-spacing: 0; text-transform: none; }
[dir="rtl"] .eyebrow { font-size: .85rem; }
[dir="rtl"] .hero-stats strong { font-family: 'Inter', sans-serif; font-weight: 600; }
[dir="rtl"] .checks li { padding: 8px 30px 8px 0; }
[dir="rtl"] .checks li::before { left: auto; right: 0; }
[dir="rtl"] .prose blockquote { border-left: 0; border-right: 3px solid var(--gold); border-radius: var(--r) 0 0 var(--r); }
[dir="rtl"] .prose ul, [dir="rtl"] .prose ol { padding-left: 0; padding-right: 1.3em; }
[dir="rtl"] .takeaways ul { padding-left: 0; padding-right: 1.2em; }
[dir="rtl"] .prose th, [dir="rtl"] .prose td { text-align: right; }
[dir="rtl"] .lesson-side li.current a { box-shadow: inset -3px 0 0 var(--gold); }
[dir="rtl"] .cert-item { border-left: 1px solid var(--line); border-right: 4px solid var(--gold); }
[dir="rtl"] .q legend { margin-left: 0; margin-right: -6px; }
[dir="rtl"] input[dir="ltr"] { text-align: left; }
[dir="rtl"] .verify-form input { letter-spacing: .06em; }

/* ---------- Blocs pédagogiques v2 ---------- */
.prose code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .88em; background: #f1ead8; color: #4a3a0c; padding: 2px 6px; border-radius: 5px; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.prose pre { background: var(--black); color: #e9e4d8; padding: 16px 18px; border-radius: var(--r); overflow-x: auto; direction: ltr; text-align: left; }
.prose pre code { background: none; color: inherit; padding: 0; white-space: pre; }
.prose .case { background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--r); padding: 22px 26px; margin: 2em 0; }
.prose .case h3 { margin-top: 0; font-size: 1.3rem; }
.prose .case h3::before { content: '◆ '; color: var(--gold); }
.prose details.exercise { background: #f3ecdc; border-radius: var(--r); margin: 2em 0; border: 1px solid #e4d7b4; overflow: hidden; }
.prose details.exercise > summary { cursor: pointer; padding: 18px 24px; font-weight: 700; list-style: none; display: flex; gap: 10px; align-items: center; }
.prose details.exercise > summary::-webkit-details-marker { display: none; }
.prose details.exercise > summary::before { content: '✎'; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--black); color: var(--gold); flex: none; }
.prose details.exercise > summary::after { content: '+'; margin-inline-start: auto; font-size: 1.4rem; color: var(--gold-dark); }
.prose details.exercise[open] > summary::after { content: '–'; }
.prose details.exercise > div { padding: 0 24px 20px; }
.prose details.exercise strong:first-child { color: var(--gold-dark); }
.prose .checklist { background: var(--black); color: #e9e4d8; border-radius: var(--r); padding: 24px 28px; margin: 2em 0; }
.prose .checklist h3 { color: var(--gold); margin-top: 0; }
.prose .checklist ul { list-style: none; padding: 0; margin: 0; }
.prose .checklist li { padding: 8px 0 8px 32px; position: relative; border-bottom: 1px solid #2a2a2a; }
.prose .checklist li::before { content: '☐'; position: absolute; left: 0; top: 6px; color: var(--gold); font-size: 1.1rem; }
[dir="rtl"] .prose .checklist li { padding: 8px 32px 8px 0; }
[dir="rtl"] .prose .checklist li::before { left: auto; right: 0; }
@media print { .prose details.exercise > div { display: block; } }

/* Confirmation e-mail */
.mail-icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; background: var(--black); color: var(--gold); display: grid; place-items: center; }
.mail-icon svg { width: 30px; height: 30px; }
.auth-card .auth-alt form, form.auth-alt { margin-top: 10px; }
.linklike { background: none; border: 0; padding: 0; color: var(--gold-dark); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
