/* MultiValue+ — popup du bouton « + » (tuile MultiValue+ du lanceur, et
   bouton du lanceur des profils créateurs).

   Gabarit : templates/home/_multivalue_popup.html (coquille .zmvp, HORS de
   .zh-page), qui fait foi pour les noms :
     .zmvp[data-zmvp][hidden][aria-hidden]
       .zmvp-backdrop[data-zmvp-close]
       .zmvp-card[role=dialog][tabindex=-1][data-zmvp-card]
         .zmvp-head  > .zmvp-badge (icon_badge) + .zmvp-titles
                       (p.zmvp-kicker, h2#zmvp-title.zmvp-title,
                       p#zmvp-sub.zmvp-sub) + button.zmvp-close
         .zmvp-body[data-zmvp-body] : la section .zmv du composant, rendue
                       dedans (zmvp_inline : ticket, multipost, multishop,
                       profils) ou DÉPLACÉE dedans par le JS le temps de
                       l'ouverture (home, wall-street ; .zmvp-ph garde sa
                       place dans la page).
   Chargé APRÈS landing-multivalue.css (composant, aucune règle .zmvp) par
   home/home.html, wallstreet/home.html, ticket/home.html,
   multipost/home.html, multishop/home.html et public/artist_public_stub.html.
   Variante sombre des profils : landing-multivalue-pp-theme.css, qui n'a
   qu'à redéfinir les jetons --zmvp-* ci-dessous sous
   :root[data-pp-theme="dark"].

   Tout est préfixé .zmvp ; seule exception : le verrou body.zmvp-open (posé
   par le JS, distinct de html.zmv-lock que closeSheet retire). Empilement :
   footer fixe 90 < nav / FAB chat 100 < MultiPost+ 1000 < chat 1200 <
   POPUP 1450 < feuille .zmv-overlay 1500 < toast .zmv-toast 1600 < auth 9999
   < modale légale 10050. Rien d'autre que 1450 (coquille) et 1 (carte
   au-dessus du fond) : le reste vit dans le contexte de la carte.

   Points de rupture : ≥ 901 px grille 2 colonnes du composant ; ≤ 900 px
   carte de 760 px (le composant passe en 1 colonne au même seuil) ; viewport
   bas > 700 px (téléphone à l'horizontale) en-tête compact ; ≤ 700 px plein
   écran façon bottom-sheet, zones sûres iOS ; ≤ 700 px et ≤ 520 px de haut
   sans sous-titre. Tout :hover vit sous @media (hover: hover). Le svg du
   bouton fermer est dimensionné ici (mobile.css impose svg { height: auto }).
   La carte ne garde ni transform ni filter hors animation : la feuille et le
   toast du composant (position fixe, hors coquille) n'en dépendent pas. */

/* ─── Jetons ─────────────────────────────────────────────────────────────── */

.zmvp {
  --zmvp-ink: var(--zh-text, #1a0a3d);
  --zmvp-muted: var(--zh-muted, #6b54a8);
  --zmvp-green-dark: #15803d;
  --zmvp-line: rgba(31, 19, 64, 0.09);
  --zmvp-scrim: rgba(15, 8, 38, 0.55);
  /* Dégradé de la section #multivalue : la popup prolonge la page. */
  --zmvp-surface: linear-gradient(165deg, #f6fbf7 0%, #eff6f1 45%, #f4f1fc 100%);
  --zmvp-shadow: 0 30px 80px -30px rgba(15, 7, 34, 0.65);
  --zmvp-glow: rgba(22, 163, 74, 0.14);
  --zmvp-head-bg: rgba(255, 255, 255, 0.6);
  --zmvp-badge-bg: rgba(22, 163, 74, 0.12);
  --zmvp-badge-ring: rgba(22, 163, 74, 0.28);
  --zmvp-close-bg: #fff;
  --zmvp-close-hover: #f1eff7;
  --zmvp-close-line: rgba(31, 19, 64, 0.18);
  --zmvp-scrollbar: rgba(31, 19, 64, 0.22);
  --zmvp-display: "Space Grotesk", sans-serif;
  --zmvp-body: "DM Sans", sans-serif;
}

@keyframes zmvp-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes zmvp-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes zmvp-rise {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}

/* ─── Coquille, fond, verrou ─────────────────────────────────────────────── */

.zmvp {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1450;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
/* `hidden` gagne TOUJOURS sur le display: flex ci-dessus. */
.zmvp[hidden] {
  display: none !important;
}
/* Verrou de défilement de la page pendant l'ouverture (seul le corps de la
   carte défile). Jamais html.zmv-lock : la feuille le retire en se fermant. */
body.zmvp-open {
  overflow: hidden;
}
.zmvp-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: var(--zmvp-scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: zmvp-fade 0.2s ease;
}

/* ─── Carte ──────────────────────────────────────────────────────────────── */

.zmvp-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  max-width: 1180px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  border-radius: 22px;
  background: var(--zmvp-surface);
  box-shadow: var(--zmvp-shadow);
  color: var(--zmvp-ink);
  font-family: var(--zmvp-body);
  animation: zmvp-pop 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Focus programmatique à l'ouverture (tabindex=-1) : pas d'anneau sur toute
   la carte ; le bouton fermer garde le sien. */
.zmvp-card:focus,
.zmvp-card:focus-visible {
  outline: none;
}
/* Halo vert de la section (son .zmv-orb est masqué dans la popup). En-tête
   et corps sont positionnés : ils passent devant. */
.zmvp-card::before {
  content: "";
  position: absolute;
  top: -160px;
  right: -140px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--zmvp-glow), transparent 70%);
  pointer-events: none;
}

/* ─── En-tête (fixe : seul le corps défile) ──────────────────────────────── */

.zmvp-head {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 18px 32px;
  border-bottom: 1px solid var(--zmvp-line);
  background: var(--zmvp-head-bg);
}
/* Anneau autour de la pastille icon_badge (.zh-chip-ic, taille inline). */
.zmvp-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 50%;
  background: var(--zmvp-badge-bg);
  box-shadow: inset 0 0 0 1px var(--zmvp-badge-ring);
}
.zmvp-badge > .zh-chip-ic {
  box-shadow: 0 8px 18px -8px rgba(22, 163, 74, 0.7);
}
.zmvp-titles {
  flex: 1 1 auto;
  min-width: 0;
}
.zmvp-kicker {
  margin: 0 0 4px;
  font-family: var(--zmvp-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--zmvp-green-dark);
}
.zmvp-title {
  margin: 0;
  font-family: var(--zmvp-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.2;
  color: var(--zmvp-ink);
  overflow-wrap: break-word;
}
.zmvp-sub {
  max-width: 680px;
  margin: 4px 0 0;
  font-family: var(--zmvp-body);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--zmvp-muted);
}
.zmvp-close {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--zmvp-line);
  border-radius: 50%;
  background: var(--zmvp-close-bg);
  color: var(--zmvp-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.15s ease;
}
.zmvp-close svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
}
.zmvp-close:focus-visible {
  outline: 2px solid var(--zmvp-green-dark);
  outline-offset: 2px;
  border-radius: 50%;
}
.zmvp-close:active {
  transform: scale(0.94);
}

/* ─── Corps (défile) ─────────────────────────────────────────────────────── */

.zmvp-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 24px 32px 32px;
  scrollbar-width: thin;
  scrollbar-color: var(--zmvp-scrollbar) transparent;
}
/* Réserve de hauteur laissée dans la page pendant le déplacement (home,
   wall-street) ; hauteur posée en style par le JS. */
.zmvp-ph {
  display: block;
  pointer-events: none;
}

/* ─── Section du composant dans la popup ─────────────────────────────────── */

/* Comme .wsl-cote > .zmv (wall-street) : la coque de la section (padding
   96 px, dégradé, overflow: hidden pour le halo) est portée par la carte. */
.zmvp-body > .zmv {
  padding: 0;
  background: none;
  overflow: visible;
  scroll-margin-top: 0;
}
/* Home : la section déplacée garde .zh-reveal ; elle est visible d'emblée,
   même si l'IntersectionObserver de la page ne l'a pas encore révélée. */
.zmvp-body > .zmv.zh-reveal {
  opacity: 1;
  transform: none;
  transition: none;
}
/* Simulateur + connexion seulement (P3) : ni halo, ni en-tête (doublon de
   celui de la popup), ni carte « pote », ni atouts. */
.zmvp-body > .zmv > .zmv-orb,
.zmvp-body > .zmv .zmv-head,
.zmvp-body > .zmv .zmv-friend,
.zmvp-body > .zmv .zmv-perks {
  display: none;
}
/* Ancre #multivalue-scale qui défile DANS le corps : pas de nav à réserver
   (le composant pose 78 px). */
.zmvp-body > .zmv .zmv-card--scale {
  scroll-margin-top: 16px;
}

/* ─── Survol (pointeurs qui survolent seulement) ─────────────────────────── */

@media (hover: hover) {
  .zmvp-close:hover {
    border-color: var(--zmvp-close-line);
    background: var(--zmvp-close-hover);
    color: var(--zmvp-ink);
  }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

/* Tablette : carte resserrée, le composant est en 1 colonne au même seuil. */
@media (max-width: 900px) {
  .zmvp-card {
    max-width: 760px;
  }
  .zmvp-head {
    padding: 18px 16px 16px 24px;
  }
  .zmvp-body {
    padding: 20px 24px 28px;
  }
}

/* Viewport bas au-delà de 700 px (téléphone à l'horizontale, petite
   fenêtre) : le corps garde l'essentiel de la hauteur. */
@media (min-width: 701px) and (max-height: 520px) {
  .zmvp {
    padding: 12px;
  }
  .zmvp-card {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
  .zmvp-head {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .zmvp-kicker,
  .zmvp-sub {
    display: none;
  }
  .zmvp-title {
    font-size: 18px;
    letter-spacing: -0.4px;
  }
  .zmvp-body {
    padding-top: 16px;
    padding-bottom: 20px;
  }
}

/* Mobile : plein écran façon bottom-sheet, zones sûres (encoche, barre
   d'accueil), titre compact, sous-titre sur 2 lignes au plus. */
@media (max-width: 700px) {
  .zmvp {
    align-items: stretch;
    padding: 0;
  }
  .zmvp-card {
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
    animation: zmvp-rise 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .zmvp-card::before {
    top: -120px;
    right: -150px;
    width: 340px;
    height: 340px;
  }
  .zmvp-head {
    gap: 12px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) calc(10px + env(safe-area-inset-right, 0px)) 12px
      calc(16px + env(safe-area-inset-left, 0px));
  }
  .zmvp-badge {
    padding: 4px;
  }
  .zmvp-kicker {
    display: none;
  }
  .zmvp-title {
    font-size: 18px;
    letter-spacing: -0.4px;
    line-height: 1.25;
  }
  .zmvp-sub {
    display: -webkit-box;
    margin-top: 2px;
    overflow: hidden;
    font-size: 12.5px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  .zmvp-body {
    padding: 16px calc(16px + env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px))
      calc(16px + env(safe-area-inset-left, 0px));
  }
}

/* Mobile à l'horizontale : le sous-titre cède sa place au simulateur. */
@media (max-width: 700px) and (max-height: 520px) {
  .zmvp-sub {
    display: none;
  }
}

/* Contraste élevé (Windows) : l'ombre disparaît, la carte garde un bord. */
@media (forced-colors: active) {
  .zmvp-card {
    border: 1px solid CanvasText;
  }
}

/* Mouvement réduit : ni animation d'entrée ni transition du bouton. */
@media (prefers-reduced-motion: reduce) {
  .zmvp-backdrop,
  .zmvp-card {
    animation: none;
  }
  .zmvp-close {
    transition: none;
  }
  .zmvp-close:active {
    transform: none;
  }
}
