:root {
  --bg: #fafaf9;
  --bg-soft: #f4f4f3;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-strong: rgba(255, 255, 255, 0.85);
  --border: rgba(10, 10, 10, 0.08);
  --border-strong: rgba(10, 10, 10, 0.16);
  --text: #0a0a0a;
  --text-soft: #525252;
  --text-mute: #8a8a8a;
  --black: #0a0a0a;
  --accent: #f59e0b;        /* amber discret pour highlights */
  --accent-soft: #fde68a;
  --accent-2: #16a34a;      /* vert très discret (touche algérienne) */
}

* { -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

body[dir="rtl"] {
  font-family: 'Noto Kufi Arabic', 'Inter', system-ui, sans-serif;
}

/* Halo très doux en fond — statique pour économiser le GPU */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.aurora::before,
.aurora::after {
  content: "";
  position: absolute;
  width: 50vmax;
  height: 50vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  will-change: auto;
}
.aurora::before {
  background: radial-gradient(circle, var(--accent) 0%, transparent 65%);
  top: -20vmax; left: -10vmax;
}
.aurora::after {
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 65%);
  bottom: -25vmax; right: -10vmax;
}

/* Mode low-end : pas d'aurora, pas de blur lourd */
html.low-end .aurora { display: none; }
html.low-end .glass,
html.low-end .glass-strong,
html.low-end .formation-card,
html.low-end .lang-toggle,
html.low-end .pill,
html.low-end .btn-ghost {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(255, 255, 255, 0.92) !important;
}

/* Grille subtile en background */
.grain::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(10,10,10,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10,10,10,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
}

/* Glass card — blur réduit pour la perf */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.glass-strong {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

/* Reveal animation — plus rapide et plus discrète */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .45s cubic-bezier(.22,.61,.36,1), transform .45s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}
.reveal[data-delay="100"] { transition-delay: .06s; }
.reveal[data-delay="200"] { transition-delay: .12s; }
.reveal[data-delay="300"] { transition-delay: .18s; }
.reveal[data-delay="400"] { transition-delay: .24s; }
.reveal[data-delay="500"] { transition-delay: .3s; }

/* Mode low-end : pas d'animation reveal */
html.low-end .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Highlight (remplace l'ancien gradient-text) — soulignement jaune épais */
.highlight {
  position: relative;
  display: inline-block;
  isolation: isolate;
  padding: 0 .1em;
}
.highlight::before {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 0.08em;
  height: 0.32em;
  background: var(--accent);
  opacity: 0.55;
  border-radius: 2px;
  z-index: -1;
  pointer-events: none;
}

/* Boutons noirs minimalistes */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .9rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  background: var(--black);
  color: #fff;
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
  border: 1px solid var(--black);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: #1f1f1f;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,0.4);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .9rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  color: var(--text);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  transition: all .2s ease;
}
.btn-ghost:hover {
  background: var(--surface-strong);
  border-color: var(--black);
  transform: translateY(-2px);
}

/* Card formation */
.formation-card {
  position: relative;
  border-radius: 1.5rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
  overflow: hidden;
}
.formation-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), rgba(10,10,10,0.06), transparent 40%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.formation-card:hover {
  transform: translateY(-6px);
  border-color: var(--black);
  background: var(--surface-strong);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.15);
}
.formation-card:hover::before {
  opacity: 1;
}

/* Day chip — noir */
.day-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.05rem;
  background: var(--black);
  color: #fff;
  flex-shrink: 0;
}

/* Timeline line */
.timeline {
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 1.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--black), transparent);
  opacity: .2;
}
body[dir="rtl"] .timeline::before {
  left: auto;
  right: 1.5rem;
}

/* Lang toggle */
.lang-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 4px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.lang-toggle button {
  padding: .35rem .9rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-soft);
  transition: all .25s ease;
}
.lang-toggle button.active {
  background: var(--black);
  color: #fff;
}

/* Pill tag */
.pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.pill .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* Section divider */
.divider-glow {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-strong), transparent);
}

/* Bullet check */
.bullet {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  color: var(--text);
}
.bullet::before {
  content: "";
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--black);
  margin-top: 2px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'><polyline points='5 12 10 17 19 7'/></svg>");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
}

/* FAQ */
.faq-item summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2.5rem;
}
body[dir="rtl"] .faq-item summary {
  padding-right: 0;
  padding-left: 2.5rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--black);
  transition: transform .3s ease;
}
body[dir="rtl"] .faq-item summary::after {
  right: auto;
  left: 0;
}
.faq-item[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--black); }

/* Marquee logos */
.marquee {
  display: flex;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.marquee-track {
  display: flex;
  gap: 3rem;
  animation: scroll-x 30s linear infinite;
  white-space: nowrap;
  color: var(--text-mute);
}
@keyframes scroll-x {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Header sticky behaviour */
header[data-header].is-scrolled .glass {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--border-strong);
}

/* Icon round (remplace les emojis dans cards "pour qui / objectifs") */
.icon-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: var(--black);
  color: #fff;
  font-size: 1.15rem;
}
.icon-round.is-accent {
  background: var(--accent);
  color: var(--black);
}
.icon-round.is-accent-2 {
  background: var(--accent-2);
  color: #fff;
}
.icon-round.is-light {
  background: #fff;
  color: var(--black);
  border: 1px solid var(--border-strong);
}

/* Big icon for formation cards */
.formation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background: var(--black);
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

/* Hover : seul le card de pack complet a un fond accent */
.card-accent {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(22, 163, 74, 0.08)) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}
.card-accent .formation-icon {
  background: var(--accent);
  color: var(--black);
}

/* RTL adjustments */
body[dir="rtl"] .ltr-only { display: none; }
body[dir="ltr"] .rtl-only { display: none; }

/* Hide one language at a time */
[data-lang-fr], [data-lang-ar] {
  display: none;
}
body[data-lang="fr"] [data-lang-fr] { display: revert; }
body[data-lang="ar"] [data-lang-ar] { display: revert; }
body[data-lang="fr"] span[data-lang-fr],
body[data-lang="ar"] span[data-lang-ar] {
  display: inline;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .aurora::before, .aurora::after { animation: none; }
  .marquee-track { animation: none; }
}
