/* =========================
   SGP Process Flow (Stepper)
   Variant optionnel — trigger: .sgp-scope.sgp-process-flow
   ========================= */

.sgp-scope.sgp-process-flow .sgp-process-flow__head {
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
}

.sgp-scope.sgp-process-flow .sgp-process-flow__head h2 {
  margin: 0 0 6px;
}

.sgp-scope.sgp-process-flow .sgp-process-flow__head p {
  margin: 0;
  opacity: 0.85;
}

/* Liste */
.sgp-scope.sgp-process-flow .sgp-process-flow__list {
  list-style: none;
  padding: 0;
  margin: 18px auto 0;
  max-width: 980px;
  display: grid;
  gap: 12px;
}

/* Item + connecteur (vertical) */
.sgp-scope.sgp-process-flow .sgp-process-flow__item {
  position: relative;
}

/* Ligne verticale douce entre les steps */
.sgp-scope.sgp-process-flow .sgp-process-flow__item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 34px; /* aligné sous la pastille */
  top: 56px; /* sous le header du step */
  bottom: -12px; /* rejoint l'item suivant */
  width: 2px;
  border-radius: 2px;
  opacity: var(--sgp-dl-process-flow-line-opacity, 0.35);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sgp-dl-process-flow-accent, #00a6aa) 55%, transparent),
    color-mix(in srgb, var(--sgp-dl-process-flow-accent, #00a6aa) 10%, transparent)
  );
  pointer-events: none;
}

/* Card step — accent-soft pour fond, accent pour bordure */
.sgp-scope.sgp-process-flow .sgp-process-flow__step {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 18px calc(18px + 6px);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sgp-dl-process-flow-accent-soft, #e6f7f6) 90%, transparent),
    color-mix(in srgb, var(--sgp-dl-process-flow-accent-soft, #e6f7f6) 70%, transparent)
  );
  border: 1px solid color-mix(in srgb, var(--sgp-dl-process-flow-accent, #00a6aa) 10%, transparent);
  border-radius: var(--sgp-dl-process-flow-radius, 18px);
  border-left: 0 !important;
}

/* Process Flow — liseré premium à gauche (auto) */
.sgp-scope.sgp-process-flow .sgp-process-flow__step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sgp-dl-process-flow-accent, #00a6aa) 70%, transparent),
    color-mix(in srgb, var(--sgp-dl-process-flow-accent, #00a6aa) 40%, transparent)
  );
  opacity: var(--sgp-dl-process-flow-line-opacity, 0.35);
  border-radius: 999px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--sgp-dl-process-flow-accent, #00a6aa) 22%, transparent),
    0 10px 22px color-mix(in srgb, var(--sgp-dl-process-flow-accent, #00a6aa) 22%, transparent);
  pointer-events: none;
}

/* Ligne interne */
.sgp-scope.sgp-process-flow .sgp-process-flow__row {
  display: flex;
  gap: 12px;
  align-items: center; /* pastille centrée verticalement avec le texte */
}

/* Pastille */
.sgp-scope.sgp-process-flow .sgp-process-flow__pill {
  min-width: 68px;
  text-align: center;
  transform: translateY(1px); /* micro align vertical */
  border-color: var(--sgp-dl-process-flow-dot, #ffbf00);
  color: var(--sgp-dl-process-flow-dot, #ffbf00);
  background-color: color-mix(in srgb, var(--sgp-dl-process-flow-accent-soft, #e6f7f6) 60%, transparent);
}

/* Texte */
.sgp-scope.sgp-process-flow .sgp-process-flow__content h3 {
  margin: 0 0 6px;
}

.sgp-scope.sgp-process-flow .sgp-process-flow__content p {
  margin: 0;
  opacity: 0.9;
}

/* Note */
.sgp-scope.sgp-process-flow .sgp-process-flow__note {
  text-align: center;
  max-width: 900px;
  margin: 18px auto 0;
}

/* ---------------------------------------------------------
   Process Flow — compatibility with "process" (contact) markup
   + left accent strip + responsive stacking
--------------------------------------------------------- */

/* If legacy row exists, align pill and text nicely on desktop */
.sgp-scope.sgp-process-flow .sgp-process__row {
  align-items: center;
}

/* Optional: tighten pill a bit visually inside process-flow */
.sgp-scope.sgp-process-flow .sgp-process__pill {
  white-space: nowrap;
}

/* Alignement "pastille + texte" si la step contient une pill type Étape 1 */
.sgp-scope.sgp-process-flow .sgp-process-flow__step .sgp-process__row,
.sgp-scope.sgp-process-flow .sgp-process-flow__step .sgp-process-flow__row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.sgp-scope.sgp-process-flow .sgp-process-flow__step .sgp-process__pill,
.sgp-scope.sgp-process-flow .sgp-process-flow__step .sgp-process-flow__pill {
  margin-top: 0 !important;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 640px) {
  .sgp-scope.sgp-process-flow .sgp-process-flow__row {
    gap: 10px;
  }

  .sgp-scope.sgp-process-flow .sgp-process-flow__item:not(:last-child)::after {
    left: 30px;
  }

  .sgp-scope.sgp-process-flow .sgp-process-flow__pill {
    min-width: 62px;
  }

  /* Mobile: stack to avoid title being squeezed (override inline styles) */
  .sgp-scope.sgp-process-flow .sgp-process__row {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .sgp-scope.sgp-process-flow .sgp-process__pill {
    margin-top: 0 !important;
  }

  .sgp-scope.sgp-process-flow .sgp-process-flow__body {
    width: 100%;
  }
}

/* Sécurité mobile : éviter les titres énormes qui débordent */
@media (max-width: 520px) {
  .sgp-scope.sgp-process-flow .sgp-process-flow__title {
    font-size: 20px;
    line-height: 1.15;
  }
}

/* =========================
   Process Flow — layouts optionnels
   ========================= */

/* Layout optionnel : GRID 4 (Refonte) */
.sgp-scope.sgp-process-flow .sgp-process-flow__list--grid4 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

.sgp-scope.sgp-process-flow .sgp-process-flow__list--grid4 .sgp-process-flow__step {
  padding: 16px;
}

@media (max-width: 980px) {
  .sgp-scope.sgp-process-flow .sgp-process-flow__list--grid4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .sgp-scope.sgp-process-flow .sgp-process-flow__list--grid4 {
    grid-template-columns: 1fr;
  }
}

/* Layout optionnel : GRID 3 + 2 centré (Méthodologie) */
.sgp-scope.sgp-process-flow .sgp-process-flow__list--grid32 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

/* 3 en haut */
.sgp-scope.sgp-process-flow .sgp-process-flow__list--grid32 > li:nth-child(1),
.sgp-scope.sgp-process-flow .sgp-process-flow__list--grid32 > li:nth-child(2),
.sgp-scope.sgp-process-flow .sgp-process-flow__list--grid32 > li:nth-child(3) {
  grid-column: span 2;
}

/* 2 centrés en dessous */
.sgp-scope.sgp-process-flow .sgp-process-flow__list--grid32 > li:nth-child(4) {
  grid-column: 2 / span 2;
}

.sgp-scope.sgp-process-flow .sgp-process-flow__list--grid32 > li:nth-child(5) {
  grid-column: 4 / span 2;
}

@media (max-width: 980px) {
  .sgp-scope.sgp-process-flow .sgp-process-flow__list--grid32 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sgp-scope.sgp-process-flow .sgp-process-flow__list--grid32 > li {
    grid-column: auto / span 1 !important;
  }
}

@media (max-width: 620px) {
  .sgp-scope.sgp-process-flow .sgp-process-flow__list--grid32 {
    grid-template-columns: 1fr;
  }
}
/* =========================================
   SGP Process Flow — Numbered Cards (addon)
   Scope: uniquement si .sgp-scope.sgp-process-flow
========================================= */

.sgp-scope.sgp-process-flow .sgp-pf-cards {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

/* Process Flow — Cards "pf" (Refonte / Méthodo) : variables injectées */
.sgp-scope.sgp-process-flow .sgp-pf-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--sgp-dl-process-flow-radius, 18px);

  background: color-mix(in srgb, var(--sgp-dl-process-flow-accent-soft, #e6f7f6) 90%, transparent);

  border: 1px solid color-mix(in srgb, var(--sgp-dl-process-flow-accent, #00a6aa) 18%, transparent);

  /* Vertical accent border (uses line opacity var) — fallback for browsers without color-mix */
  border-left: 4px solid var(--sgp-dl-process-flow-accent, #00a6aa);

  /* Laisser respirer le contenu */
  padding: 16px 18px 16px 22px;
}

/* Vertical accent border — version with line-opacity when color-mix supported */
@supports (background-color: color-mix(in srgb, red 50%, blue)) {
  .sgp-scope.sgp-process-flow .sgp-pf-card {
    border-left: 4px solid color-mix(
      in srgb,
      var(--sgp-dl-process-flow-accent, #00a6aa) calc(var(--sgp-dl-process-flow-line-opacity, 0.35) * 100),
      transparent
    );
  }
}

/* Row layout : pastille + contenu, alignement vertical parfait */
.sgp-scope.sgp-process-flow .sgp-pf-row {
  display: flex;
  gap: 12px;
  align-items: center; /* <- vertical centering */
}

/* Pastille numéro — dot pour fond, contraste pour texte */
.sgp-scope.sgp-process-flow .sgp-pf-num {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: rgba(7, 28, 58, .92);
  background: var(--sgp-dl-process-flow-dot, #ffbf00);
  border: 1px solid color-mix(in srgb, var(--sgp-dl-process-flow-dot, #ffbf00) 80%, transparent);
}

/* Text */
.sgp-scope.sgp-process-flow .sgp-pf-title {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.2;
}

.sgp-scope.sgp-process-flow .sgp-pf-text {
  margin: 0;
  opacity: .92;
}

/* -----------------------------------------
   Layouts
----------------------------------------- */

/* 4 colonnes desktop, puis 2, puis 1 */
.sgp-scope.sgp-process-flow .sgp-pf-cards--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 980px) {
  .sgp-scope.sgp-process-flow .sgp-pf-cards--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .sgp-scope.sgp-process-flow .sgp-pf-cards--4 {
    grid-template-columns: 1fr;
  }
}

/* 5 cards: 3 en haut, 2 centrées dessous (desktop), sans impacter mobile */
.sgp-scope.sgp-process-flow .sgp-pf-cards--5 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}
.sgp-scope.sgp-process-flow .sgp-pf-cards--5 > .sgp-pf-card:nth-child(1),
.sgp-scope.sgp-process-flow .sgp-pf-cards--5 > .sgp-pf-card:nth-child(2),
.sgp-scope.sgp-process-flow .sgp-pf-cards--5 > .sgp-pf-card:nth-child(3) {
  grid-column: span 4;
}
/* 4 et 5 centrées */
.sgp-scope.sgp-process-flow .sgp-pf-cards--5 > .sgp-pf-card:nth-child(4) {
  grid-column: 3 / span 4; /* centre-gauche */
}
.sgp-scope.sgp-process-flow .sgp-pf-cards--5 > .sgp-pf-card:nth-child(5) {
  grid-column: 7 / span 4; /* centre-droite */
}
@media (max-width: 980px) {
  .sgp-scope.sgp-process-flow .sgp-pf-cards--5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sgp-scope.sgp-process-flow .sgp-pf-cards--5 > .sgp-pf-card {
    grid-column: auto !important;
  }
}
@media (max-width: 640px) {
  .sgp-scope.sgp-process-flow .sgp-pf-cards--5 {
    grid-template-columns: 1fr;
  }
}
/* Ensure vertical accent border wins (scoped) */
.sgp-scope.sgp-process-flow .sgp-pf-card{
  border-left: 4px solid var(--sgp-dl-process-flow-accent, #00a6aa) !important;
}

@supports (background-color: color-mix(in srgb, red 50%, blue)) {
  .sgp-scope.sgp-process-flow .sgp-pf-card{
    border-left: 4px solid color-mix(
      in srgb,
      var(--sgp-dl-process-flow-accent, #00a6aa) calc(var(--sgp-dl-process-flow-line-opacity, 0.35) * 100%),
      transparent
    ) !important;
  }
}