/* ============================================================
   HERO SLIDER — 3 slides GSAP (accueil)
   Charte : bleu #1d3f94 / rouge #d61f2c, dégradés + glow subtils
   ============================================================ */

.hero-slider {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 640px; height: calc(100vh - 74px); max-height: 900px;
  background: var(--blue-darker);
}
@supports (height: 100svh) {
  .hero-slider { height: calc(100svh - 74px); }
}

/* ----- Slides ----- */
.hs-slide {
  position: absolute; inset: 0; display: flex; align-items: center;
  visibility: hidden; opacity: 0;
}
.hs-slide.is-active { visibility: visible; opacity: 1; }
.hs-inner {
  position: relative; z-index: 2; width: 100%;
  display: grid; grid-template-columns: 1.02fr .98fr; gap: 36px; align-items: center;
  padding-top: 12px; padding-bottom: 74px;
  perspective: 1100px; /* scène 3D : les visuels pivotent, les badges flottent en Z */
}
.hs-visual { max-width: 560px; margin: 0 auto; width: 100%; will-change: transform; transform-style: preserve-3d; }
.hs-text { will-change: transform; }
.cvp-stage, .mst-stage { transform-style: preserve-3d; }

/* ----- Fonds ----- */
.hs-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hs-bg-dark  { background: radial-gradient(120% 120% at 18% 0%, #16306e 0%, #0e1f4b 48%, #0a1637 100%); }
.hs-bg-deep  { background: radial-gradient(120% 130% at 82% 0%, #172f6b 0%, #0d1d47 52%, #091430 100%); }
/* Slide 2 : ambiance dégradé bleu de la marque, plus lumineuse que les slides 1/3 */
.hs-bg-brand {
  background: linear-gradient(150deg, #2a52b8 0%, #1d3f94 42%, #12275e 100%);
}
.hs-glow-sky { width: 520px; height: 520px; background: rgba(126,160,232,.4); top: -180px; right: -120px; }

.hs-grid {
  position: absolute; inset: -1px;
  background-image:
    linear-gradient(rgba(126,160,232,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126,160,232,.07) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(75% 75% at 50% 40%, #000 45%, transparent 100%);
          mask-image: radial-gradient(75% 75% at 50% 40%, #000 45%, transparent 100%);
}
.hs-grid-light {
  background-image:
    linear-gradient(rgba(29,63,148,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29,63,148,.06) 1px, transparent 1px);
}
.hs-glow { position: absolute; border-radius: 50%; filter: blur(90px); will-change: transform; }
.hs-glow-blue { width: 480px; height: 480px; background: rgba(63,106,216,.32); top: -160px; left: -120px; }
.hs-glow-red  { width: 380px; height: 380px; background: rgba(214,31,44,.16); bottom: -140px; right: -80px; }
.hs-glow-teal { width: 380px; height: 380px; background: rgba(23,152,79,.14); bottom: -120px; right: -60px; }

.hs-particle {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #9db8ef; opacity: .35; box-shadow: 0 0 8px 1px rgba(157,184,239,.55);
  will-change: transform, opacity;
}

/* ----- Texte ----- */
.hs-kicker {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: .8rem; letter-spacing: 1.6px; text-transform: uppercase;
  color: #c9d6f2; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  padding: 7px 15px; border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.hs-title {
  font-size: clamp(2.1rem, 4.4vw, 3.5rem); line-height: 1.08; letter-spacing: -1px;
  color: #fff; margin: 20px 0 0;
}
.hs-line { display: inline-block; will-change: transform; }
.grad-text-light {
  background: linear-gradient(90deg, #9db8ef 0%, #ff8a92 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hs-lead { margin: 18px 0 0; font-size: 1.1rem; color: #b9c8ea; max-width: 52ch; }
.hs-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hs-slide .hero2-stats { margin-top: 34px; }
/* Stats lisibles sur fonds bleus */
.hs-slide .hstat strong { color: #fff; }
.hs-slide .hstat strong i { color: #ff8a92; }
.hs-slide .hstat span { color: #b9c8ea; }

/* Slide 2 : illustration lisible sur fond bleu (couleurs seulement — animations intactes) */
.hs-slide-brand .net-links { stroke: #9db8ef; opacity: .6; }
.hs-slide-brand .art-network > circle:first-of-type { opacity: .9; }

/* ============================================================
   SLIDE 1 — Carte du Maroc
   ============================================================ */
.map-ma { width: 100%; height: auto; max-height: calc(100vh - 220px); display: block; }
.ma-outline { will-change: auto; }
.ma-link { will-change: stroke-dashoffset; }
.ma-city-dot { will-change: transform; transform-box: fill-box; transform-origin: center; }
.ma-city-halo { transform-box: fill-box; transform-origin: center; }
.ma-city-label {
  font: 600 11px/1 var(--font); fill: #c9d6f2; opacity: 0;
  paint-order: stroke; stroke: rgba(10,22,55,.85); stroke-width: 3px; stroke-linejoin: round;
}
.ma-hub-label {
  font: 700 12px/1 var(--font); fill: #ffd9dc;
  paint-order: stroke; stroke: rgba(10,22,55,.85); stroke-width: 3px; stroke-linejoin: round;
}
.ma-hub-ring { transform-box: fill-box; transform-origin: center; }
.ma-signal { will-change: transform; }

/* ============================================================
   SLIDE 3 — Scène de matching IA
   ============================================================ */
.mst-stage { position: relative; width: 100%; aspect-ratio: 520 / 470; max-height: calc(100vh - 230px); }
.mst-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.mst-line, .mst-link { stroke: url(#mstLine); stroke-width: 2; stroke-linecap: round; opacity: .85; }

.glass-card {
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 14px 40px rgba(4,10,30,.35);
  color: #eaf0ff;
}

.mst-company {
  position: absolute; top: 4%; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  width: min(88%, 400px); will-change: transform, opacity;
}
.mst-co-ico {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: rgba(126,160,232,.22); color: #c9d6f2; flex-shrink: 0;
}
.mst-company strong { display: block; font-size: .95rem; }
.mst-company small { color: #aabbe4; font-size: .76rem; line-height: 1.3; display: block; }
.mst-pub { margin-left: auto; color: #6ee7a0; font-size: .72rem; font-weight: 700; white-space: nowrap; }

.mst-ai { position: absolute; top: 38%; left: 50%; width: 108px; height: 108px; margin: -54px; will-change: transform, opacity; }
.mst-ai-core {
  position: absolute; inset: 18px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #1d3f94, #0e1f4b);
  border: 1px solid rgba(157,184,239,.5);
  color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: .5px;
  box-shadow: 0 0 34px rgba(63,106,216,.5), inset 0 0 18px rgba(157,184,239,.25);
}
.mst-ai-core small { font-size: .58rem; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: #9db8ef; }
.mst-ai-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px dashed rgba(157,184,239,.55); border-top-color: #ff8a92;
  will-change: transform;
}
.mst-ai-scan {
  position: absolute; inset: -16px; border-radius: 50%;
  border: 1.5px solid rgba(110,231,160,.55);
  opacity: 0; will-change: transform, opacity;
}

.mst-cand {
  position: absolute; display: flex; align-items: center; gap: 10px;
  padding: 10px 13px; width: min(46%, 215px); will-change: transform, opacity;
}
#mstC1 { left: 2%;  bottom: 26%; }
#mstC2 { left: 28%; bottom: 8%; }
#mstC3 { right: 2%; bottom: 24%; }
.mst-cand strong { display: block; font-size: .84rem; }
.mst-cand small { color: #aabbe4; font-size: .7rem; display: block; line-height: 1.25; }
.mst-meta { position: absolute; right: 10px; top: -9px; background: rgba(14,31,75,.92); border: 1px solid rgba(157,184,239,.35); color: #c9d6f2; font-size: .6rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.mst-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; position: relative; }
.mst-avatar::after { content: ""; position: absolute; inset: 22% 30% 45%; border-radius: 50%; background: rgba(255,255,255,.85); }
.mst-avatar::before { content: ""; position: absolute; left: 22%; right: 22%; bottom: 12%; height: 30%; border-radius: 50% 50% 0 0; background: rgba(255,255,255,.85); }
.av-blue { background: #3f6ad8; } .av-red { background: #d6606a; } .av-navy { background: #56638a; }
.mst-check {
  position: absolute; left: -9px; top: -9px; width: 22px; height: 22px;
  display: grid; place-items: center; border-radius: 50%;
  background: #17984f; color: #fff; font-size: .72rem; font-weight: 800;
  box-shadow: 0 0 14px rgba(23,152,79,.65);
  opacity: 0; transform: scale(0); will-change: transform, opacity;
}

.mst-chip {
  position: absolute; padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #eaf0ff; font-size: .7rem; font-weight: 700; white-space: nowrap;
  box-shadow: 0 8px 22px rgba(4,10,30,.3); will-change: transform, opacity;
}
.chip-1 { top: 22%; left: 0; color: #b9f4d2; }
.chip-2 { top: 30%; right: 0; color: #b9f4d2; }
.chip-3 { top: 55%; left: 4%; }
.chip-4 { top: 50%; right: 6%; }
.chip-5 { bottom: 4%;  left: 12%; }
.chip-6 { bottom: 2%;  right: 10%; }

/* ============================================================
   SLIDE 4 — Créez votre CV en quelques secondes
   ============================================================ */
.hs-bg-cv { background: radial-gradient(115% 125% at 22% 0%, #1a3a8f 0%, #12275e 50%, #0b1738 100%); }

.cvp-points { list-style: none; margin: 18px 0 0; padding: 0; }
.cvp-points li { color: #cfe3d8; font-weight: 600; font-size: .98rem; padding: 3px 0; }

.cvp-stage { position: relative; width: 100%; max-width: 470px; margin: 0 auto; aspect-ratio: 47 / 44; }
.cvp-sheet {
  position: absolute; left: 8%; top: 2%; width: 58%; aspect-ratio: 210 / 260;
  background: #fff; border-radius: 12px; padding: 7% 6%;
  box-shadow: 0 24px 70px rgba(3, 8, 25, .55), 0 2px 0 rgba(255,255,255,.35) inset;
  will-change: transform, opacity;
}
.cvp-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 2.5px solid #1d3f94; margin-bottom: 14px; }
.cvp-avatar {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(140deg, #1d3f94, #0e1f4b); flex-shrink: 0;
  border: 2.5px solid #d61f2c;
}
.cvp-head-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.cvp-bar { display: block; height: 9px; border-radius: 5px; background: #dbe3f4; will-change: transform; }
.cvp-bar-name { width: 82%; background: #1d3f94; height: 11px; }
.cvp-bar-role { width: 55%; background: #f0b9bd; }
.cvp-body { display: flex; flex-direction: column; gap: 9px; }
.cvp-sec { display: block; width: 38%; height: 8px; border-radius: 4px; background: #d61f2c; opacity: .85; margin-top: 6px; }
.cvp-bar.w90 { width: 90%; } .cvp-bar.w85 { width: 85%; } .cvp-bar.w80 { width: 80%; }
.cvp-bar.w75 { width: 75%; } .cvp-bar.w65 { width: 65%; }
.cvp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cvp-chip {
  background: #eef2fb; color: #1d3f94; border-radius: 7px; padding: 3px 9px;
  font-size: .62rem; font-weight: 700;
}

.cvp-tpls {
  position: absolute; right: 4%; top: 10%; display: flex; flex-direction: column; gap: 10px;
}
.cvp-tpl {
  display: block; width: 52px; height: 66px; border-radius: 8px;
  background: linear-gradient(180deg, var(--c) 0%, var(--c) 30%, #fff 30%, #f0f3fa 100%);
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: 0 10px 26px rgba(3,8,25,.4); will-change: transform, opacity;
}
.cvp-tpl:nth-child(2) { transform: translateX(-8px); }
.cvp-tpl:nth-child(4) { transform: translateX(-6px); }

.cvp-float {
  position: absolute; padding: 8px 14px; border-radius: 999px;
  /* Fond opaque : ces badges passent DEVANT la feuille blanche du CV */
  background: #14265c; border: 1px solid rgba(157,184,239,.5);
  color: #eaf0ff; font-size: .78rem; font-weight: 700; white-space: nowrap;
  box-shadow: 0 10px 26px rgba(3,8,25,.45); will-change: transform, opacity;
}
.cvp-time { left: 0; bottom: 22%; }
.cvp-free { left: 4%; top: 4%; color: #6ee7a0; }
.cvp-dl {
  right: 2%; bottom: 6%;
  background: linear-gradient(90deg, #d61f2c, #a91620); border-color: transparent;
  font-size: .85rem; padding: 11px 18px; box-shadow: 0 14px 34px rgba(214,31,44,.4);
}

@media (max-width: 960px) {
  .cvp-stage { max-width: 360px; }
  .cvp-tpl { width: 40px; height: 52px; }
}

/* ============================================================
   Contrôles (points, flèches) + vague
   ============================================================ */
.hs-ui {
  position: absolute; left: 0; right: 0; bottom: 26px; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 max(22px, calc((100% - 1180px) / 2 + 22px));
  pointer-events: none;
}
.hs-dots { display: flex; gap: 10px; pointer-events: auto; }
.hs-dot {
  position: relative; width: 44px; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,.25); border: 0; cursor: pointer; overflow: hidden;
  transition: background .25s;
}
.hs-dot-fill {
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, #7ea0e8, #ff8a92);
  transform: scaleX(0); transform-origin: left center; will-change: transform;
}
.hs-dot:not(.is-active):hover { background: rgba(255,255,255,.45); }
.hs-arrows { display: flex; gap: 10px; pointer-events: auto; }
.hs-arrow {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22);
  color: #fff; cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .2s, transform .2s;
}
.hs-arrow:hover { background: rgba(255,255,255,.18); transform: translateY(-2px); }
.hs-arrow:active { transform: translateY(0) scale(.96); }
.hs-wave { position: absolute; left: 0; right: 0; bottom: -1px; line-height: 0; z-index: 5; pointer-events: none; }
.hs-wave svg { width: 100%; height: 56px; display: block; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .hero-slider { height: auto; max-height: none; min-height: 0; }
  /* La slide active dimensionne le conteneur (les autres restent superposées) */
  .hs-slide { position: absolute; inset: 0; }
  .hs-slide.is-active { position: relative; inset: auto; }
  .hs-inner {
    grid-template-columns: 1fr; gap: 22px; text-align: center;
    padding-top: 46px; padding-bottom: 108px;
  }
  .hs-text { order: 1; }
  .hs-visual { order: 2; max-width: 420px; }
  .hs-actions, .hs-slide .hero2-stats { justify-content: center; }
  .hs-kicker { margin-top: 6px; }
  .ma-city-label { display: none; }
  .ma-city.is-major .ma-city-label { display: block; font-size: 12px; }
  .mst-chip { display: none; }
  .chip-1, .chip-2 { display: block; }
}
@media (max-width: 680px) {
  .hs-title { font-size: clamp(1.8rem, 7.4vw, 2.4rem); }
  .hs-lead { font-size: 1rem; }
  .hs-visual { max-width: 340px; }
  .hs-ui { bottom: 18px; }
  .hs-arrows { display: none; }
  .mst-company { width: 96%; }
  .mst-cand { width: 48%; }
  .hs-slide .hero2-stats { gap: 20px; }
}

/* ============================================================
   Accessibilité / repli sans JS ou GSAP
   ============================================================ */
.hero-slider:not(.hs-ready) .hs-slide.is-active .hs-text,
.hero-slider:not(.hs-ready) .hs-slide.is-active .hs-visual { opacity: 1; transform: none; }
.hero-slider:not(.hs-ready) .hs-ui { display: none; }
.hero-slider:not(.hs-ready) .ma-city-label { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .mst-ai-ring, .hs-glow, .hs-particle { animation: none !important; }
  .hs-dot-fill { transition: none; }
}
