/* UDCShare v2 — carrousel des fonctionnalités de /fonctionnalites (partials/feature-showcase.ejs, cartes : partials/feature-card.ejs).
   Jetons : tokens.css. Cartes par vue : 1 (téléphone), 2 (≥ 40rem), 3 (≥ 64rem) ; 1 partout pour la vitrine (.v2-carousel--hero).
   Défilement : public/v2/js/carousel.js. L'accueil n'a pas de carrousel (demande du propriétaire, 01/11/2026). */

/* ── Bloc ────────────────────────────────────────────────────────────────── */
.v2-disco__shell {
  position: relative;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--color-brand-soft) 0%, var(--color-surface) 70%);
  box-shadow: var(--shadow-sm);
}
@media (min-width: 48rem) { .v2-disco__shell { padding: var(--space-5); } }

.v2-disco__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
@media (min-width: 40rem) { .v2-disco__head { grid-template-columns: auto 1fr auto; } }

.v2-disco__mark {
  display: none;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid var(--color-brand);
  border-radius: 50%;
  color: var(--color-brand);
  background: var(--color-surface);
}
.v2-disco__mark svg { width: 26px; height: 26px; }
@media (min-width: 40rem) { .v2-disco__mark { display: grid; } }

.v2-disco__heading { margin: 0; font-size: var(--font-size-lg); line-height: var(--font-line-height-tight); }
.v2-disco__lead { margin: var(--space-1) 0 0; font-size: var(--font-size-sm); color: var(--color-text-muted); }
@media (min-width: 48rem) { .v2-disco__heading { font-size: var(--font-size-xl); } .v2-disco__lead { font-size: var(--font-size-base); } }

.v2-disco__all { margin: var(--space-4) 0 0; text-align: center; font-weight: var(--font-weight-medium); }

/* ── Piste ───────────────────────────────────────────────────────────────── */
.v2-carousel { position: relative; --per-view: 1; --gap: var(--space-4); }
@media (min-width: 40rem) { .v2-carousel { --per-view: 2; } }
@media (min-width: 64rem) { .v2-carousel { --per-view: 3; } }

.v2-carousel__viewport { overflow: hidden; border-radius: var(--radius-lg); padding: 2px; margin: -2px; }

.v2-carousel__track {
  display: flex;
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
  will-change: transform;
}
@media (prefers-reduced-motion: no-preference) {
  .v2-carousel__track { transition: transform 500ms ease; }
}

/* ── Carte ───────────────────────────────────────────────────────────────── */
.v2-disco-card {
  position: relative;
  display: flex;
  flex: 0 0 calc((100% - (var(--per-view) - 1) * var(--gap)) / var(--per-view));
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
@media (prefers-reduced-motion: no-preference) {
  .v2-disco-card { transition: box-shadow var(--motion-base), border-color var(--motion-base), transform var(--motion-base); }
  .v2-disco-card:hover { transform: translateY(-2px); }
}
.v2-disco-card:hover, .v2-disco-card:focus-within { border-color: var(--color-brand); box-shadow: var(--shadow-md); }

/* Toute la carte est cliquable (souris, doigt) ; au clavier, le bouton « Découvrir » porte le focus. */
.v2-disco-card__link { position: absolute; inset: 0; z-index: 1; }

.v2-disco-card__visual { position: relative; aspect-ratio: 240 / 150; line-height: 0; background: var(--color-brand-soft); }
.v2-disco-svg { display: block; width: 100%; height: 100%; }

.v2-disco-card__count {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 2;
  padding: 2px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-brand-strong);
  color: var(--color-on-brand);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: 1.6;
}

.v2-disco-card__body { display: flex; flex: 1; flex-direction: column; gap: var(--space-2); padding: var(--space-4); }

.v2-disco-card__meta { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.v2-disco-card__tag,
.v2-disco-card__plan {
  padding: 2px var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.v2-disco-card__tag { background: var(--color-brand-soft); color: var(--color-brand-ink); }
.v2-disco-card__plan { background: var(--color-warning-soft); color: var(--color-warning); }

.v2-disco-card__title { margin: 0; font-size: var(--font-size-lg); line-height: var(--font-line-height-tight); }
.v2-disco-card__desc { margin: 0; font-size: var(--font-size-sm); color: var(--color-text-muted); }

.v2-disco-card__cta {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  gap: var(--space-2);
  margin-top: auto;
}
.v2-disco-card__body > .v2-disco-card__desc { margin-bottom: var(--space-3); }

/* ── Flèches ─────────────────────────────────────────────────────────────── */
.v2-carousel__nav { display: flex; gap: var(--space-2); }

.v2-carousel__arrow {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
}
.v2-carousel__arrow:hover { border-color: var(--color-brand); color: var(--color-brand); background: var(--color-surface-2); }
.v2-carousel__arrow:focus-visible,
.v2-carousel__pause:focus-visible,
.v2-carousel__dot:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ── Points, pause, barre de progression ─────────────────────────────────── */
.v2-carousel__foot { display: flex; align-items: center; justify-content: center; gap: var(--space-3); margin-top: var(--space-4); }
.v2-carousel__dots { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; }

.v2-carousel__dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.v2-carousel__dot::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-border-strong);
  opacity: 0.45;
  transition: background var(--motion-fast), transform var(--motion-fast), opacity var(--motion-fast);
}
.v2-carousel__dot[aria-current="true"]::after { background: var(--color-brand); opacity: 1; transform: scale(1.3); }

.v2-carousel__pause {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
}
.v2-carousel__pause:hover { color: var(--color-brand); border-color: var(--color-brand); }
.v2-carousel__pause .v2-carousel__icon-play { display: none; }
.v2-carousel__pause[aria-pressed="true"] .v2-carousel__icon-play { display: block; }
.v2-carousel__pause[aria-pressed="true"] .v2-carousel__icon-pause { display: none; }
.v2-carousel__pause[hidden] { display: none; }

.v2-carousel__progress { height: 3px; margin-top: var(--space-3); overflow: hidden; border-radius: var(--radius-pill); background: var(--color-border); }
.v2-carousel__progress-bar { display: block; height: 100%; background: var(--color-brand); transform: scaleX(0); transform-origin: left center; }
.v2-carousel__progress-bar.is-running { animation: v2-disco-progress var(--disco-interval, 15000ms) linear forwards; }
.v2-carousel__progress-bar.is-paused { animation-play-state: paused; }
@keyframes v2-disco-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .v2-carousel__progress { display: none; } }

/* ── Capture réelle de l'application (feature-media.ejs) ─────────────────── */
.v2-disco-card__visual:has(.v2-disco-card__shot), .v2-feature-hero__visual:has(.v2-disco-card__shot) { overflow: hidden; }
/* Cadre identique aux illustrations (240 / 150) : la capture (3:2) est recadrée, jamais étirée, et ne change pas la hauteur de la carte. */
.v2-disco-card__shot { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; background: var(--color-surface); }
.v2-disco-card__sample {
  padding: 2px var(--space-2); border-radius: 999px;
  font-size: 0.75rem; line-height: 1.4; font-weight: var(--font-weight-medium);
  color: var(--color-text-muted); background: var(--color-surface); border: 1px solid var(--color-border);
}
.v2-feature-hero__sample { margin: var(--space-2) 0 0; font-size: var(--font-size-sm); color: var(--color-text-muted); text-align: center; }

.v2-disco-card.has-shot .v2-disco-card__count { display: none; }

/* ── Effet « abonnement » (31/10/2026) : inclus / disponible en… selon la formule de la personne connectée ─────────── */
.v2-disco-card__plan--included { background: var(--color-success-soft, var(--color-surface)); color: var(--color-success, var(--color-text)); }
.v2-disco-card__plan--upgrade { background: var(--color-warning-soft); color: var(--color-warning); }
.v2-disco-card__perk { margin: 0 0 var(--space-3); font-size: var(--font-size-sm); font-weight: var(--font-weight-medium); color: var(--color-warning); }

/* Carte « Mobile Money » : les logos des opérateurs actifs remplacent le dessin (feature-media.ejs). */
.v2-disco-card__visual--pay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: var(--space-3); line-height: normal; }
.v2-disco-card__visual--pay .v2-payops { align-items: center; }
.v2-disco-card__visual--pay .v2-payops__list { justify-content: center; }

/* ── Vitrine : une diapositive à la fois, façon bannière (page /fonctionnalites) ─────────────────────────── */
.v2-carousel--hero { --per-view: 1; --gap: 0px; }
.v2-carousel--hero .v2-carousel__viewport {
  margin: 0; padding: 0;
  border: 1px solid var(--color-border);
  background: linear-gradient(135deg, var(--color-brand-soft) 0%, var(--color-surface) 72%);
}
.v2-carousel--hero .v2-carousel__track { gap: 0; }
.v2-carousel--hero .v2-disco-card { flex: 0 0 100%; border: 0; border-radius: 0; background: transparent; box-shadow: none; transform: none; }
.v2-carousel--hero .v2-disco-card:hover, .v2-carousel--hero .v2-disco-card:focus-within { border-color: transparent; box-shadow: none; transform: none; }
.v2-carousel--hero .v2-disco-card__link { display: none; }   /* le bouton « Découvrir » suffit ; le balayage tactile ne déclenche pas de clic */

.v2-carousel--hero .v2-disco-card__visual {
  margin: var(--space-4) var(--space-4) 0;
  aspect-ratio: 488 / 300;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.v2-carousel--hero .v2-disco-card__body { padding: var(--space-5) var(--space-4) var(--space-6); gap: var(--space-3); }
.v2-carousel--hero .v2-disco-card__tag {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 0; border-radius: 0; background: none;
  color: var(--color-brand-ink); font-size: var(--font-size-sm); font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.v2-carousel--hero .v2-disco-card__tag::before { content: ""; width: 1.5rem; height: 2px; background: currentColor; }
.v2-carousel--hero .v2-disco-card__title { font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.25rem); line-height: 1.15; }
.v2-carousel--hero .v2-disco-card__desc { max-width: 42ch; font-size: var(--font-size-base); }
.v2-carousel--hero .v2-disco-card__cta { align-self: flex-start; }

@media (min-width: 48rem) {
  .v2-carousel--hero .v2-disco-card { flex-direction: row-reverse; align-items: center; min-height: 22rem; }
  .v2-carousel--hero .v2-disco-card__visual { flex: 0 0 46%; margin: var(--space-6) var(--space-6) var(--space-6) 0; }
  .v2-carousel--hero .v2-disco-card__body { flex: 1; justify-content: center; padding: var(--space-6); }
}

/* Barres de progression (une par diapositive) : la barre active se remplit pendant le défilement automatique. */
.v2-carousel--hero .v2-carousel__foot { justify-content: space-between; gap: var(--space-4); }
.v2-carousel--hero .v2-carousel__dots { flex: 1; flex-wrap: nowrap; justify-content: flex-start; gap: 6px; min-width: 0; }
.v2-carousel--hero .v2-carousel__dot { flex: 1 1 0; width: auto; max-width: 4rem; min-width: 12px; height: 28px; border-radius: 0; }
.v2-carousel--hero .v2-carousel__dot::after { width: 100%; height: 4px; border-radius: 2px; transform: none; }
.v2-carousel--hero .v2-carousel__dot[aria-current="true"]::after { background: var(--color-brand); opacity: 1; transform: none; }
.v2-carousel--hero.is-running .v2-carousel__dot[aria-current="true"]::after {
  background: linear-gradient(var(--color-brand), var(--color-brand)) left center / 0% 100% no-repeat, var(--color-border-strong);
  animation: v2-disco-segment var(--disco-interval, 15000ms) linear forwards;
}
@keyframes v2-disco-segment { to { background-size: 100% 100%; } }
.v2-carousel--hero .v2-carousel__progress { display: none; }   /* remplacée par les barres */
.v2-carousel--hero .v2-carousel__nav { align-items: center; }

/* ── Index de toutes les fonctionnalités (titres seulement ; repli sans JavaScript) ─────────────────────── */
.v2-disco-index { margin-top: var(--space-6); }
.v2-disco-index__title { margin: 0 0 var(--space-3); font-size: var(--font-size-base); font-weight: var(--font-weight-medium); color: var(--color-text-muted); }
.v2-disco-index__list { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.v2-disco-index__list a {
  display: inline-flex; align-items: center; min-height: var(--size-tap);
  padding: 0 var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: var(--color-surface); color: var(--color-text); text-decoration: none;
}
.v2-disco-index__list a:hover { border-color: var(--color-brand); color: var(--color-brand); }
.v2-disco-index__list a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
