/* ============================================================================
   DEMO BANNER
   Barre de conversion fixe en haut - espace démo uniquement (metropole-lyon),
   jamais en iframe (voir script inline de index.html + __syncDemoBanner).
   Glassmorphism signature du DS ; tokens sémantiques → le dark mode est
   automatique, seuls les tokens locaux --banner-* sont redéfinis en dark.
   --banner-h (00-colors.css) est posé par le script inline dès le premier
   paint - les composants flottants l'intègrent dans leur top ; la barre
   reste en display:none pendant le délai d'entrée (géré en JS) puis glisse
   par-dessus la carte (zéro layout shift, rien de focusable en invisible).
   ============================================================================ */

/* ── Conteneur ───────────────────────────────────────────────────────────── */

#demo-banner {
  /* Tokens locaux de composant (seuls redéfinis en dark) */
  --banner-shadow:
    0 1px 8px rgba(0, 0, 0, 0.06),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.95);
  /* Texte de la pill : primary assombri pour tenir WCAG AA (≥4.5:1) sur le
     fond clair --primary-alpha-12 - le vert brut #14AE5C plafonne à ~2.4:1 */
  --banner-cta-fg: color-mix(in srgb, var(--color-primary) 60%, var(--gray-900));

  display: none; /* montré par le script inline synchrone (délai 1.2s) */
  position: fixed;
  inset: 0 0 auto 0;
  height: 40px;
  z-index: 1700;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 44px;
  background: color-mix(in srgb, var(--surface-base) 75%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--banner-shadow);
  font-size: 13px;
  line-height: 1;
  /* Le délai d'entrée est en JS (display:none → flex) ; l'animation démarre
     au passage en display:flex */
  animation: demo-banner-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[data-theme='dark'] #demo-banner {
  --banner-shadow:
    0 1px 8px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.065);
  /* Sur la pill sombre, le vert primaire tient l'AA (~5:1) sans ajustement */
  --banner-cta-fg: var(--primary);
}

@keyframes demo-banner-in {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

@keyframes demo-banner-out {
  from { transform: translateY(0);     opacity: 1; }
  to   { transform: translateY(-100%); opacity: 0; }
}

/* ── Texte contextuel ────────────────────────────────────────────────────── */

.demo-banner__label {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Seule emphase du texte - la pill est la réponse visuelle à la question */
.demo-banner__label strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── CTA pill (lien principal) ───────────────────────────────────────────── */

.demo-banner__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--primary-alpha-12);
  border: 1px solid var(--primary-alpha-35);
  border-radius: 999px;
  color: var(--banner-cta-fg);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  /* Pulsation d'attention unique, ~2 s après la fin de l'entrée (0.5s après
     le reveal JS) - le délai court depuis le passage en display:flex */
  animation: demo-banner-pulse 0.9s ease-out 2.5s 1;
}

@keyframes demo-banner-pulse {
  from { box-shadow: 0 0 0 0 var(--primary-alpha-35); }
  to   { box-shadow: 0 0 0 7px transparent; }
}

.demo-banner__cta:hover {
  background: var(--primary-alpha-22);
  border-color: var(--primary-alpha-45);
  transform: translateY(-1px);
}

.demo-banner__cta > i {
  font-size: 10px;
  opacity: 0.9;
  transition: transform 0.2s, opacity 0.2s;
}

.demo-banner__cta:hover > i {
  transform: translateX(2px);
  opacity: 1;
}

/* Hint à l'intérieur de la pill - lève les objections au point de décision.
   Couleur pleine (pas d'opacity sur le vert : contraste WCAG insuffisant) */
.demo-banner__hint {
  font-weight: 400;
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* ── Bouton fermer ───────────────────────────────────────────────────────── */

.demo-banner__close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.demo-banner__close:hover {
  color: var(--text-primary);
  background: var(--gray-100);
}

/* ── Accessibilité ───────────────────────────────────────────────────────── */

.demo-banner__cta:focus-visible,
.demo-banner__close:focus-visible {
  outline: 2px solid var(--banner-cta-fg);
  outline-offset: 2px;
}

/* Aucune animation en motion réduit (le reveal JS est alors immédiat) */
@media (prefers-reduced-motion: reduce) {
  #demo-banner,
  .demo-banner__cta {
    animation: none !important;
  }
}

/* ── Responsive : repli progressif (le contenu complet exige ~940px) ─────── */

/* ≤940px : masquer le hint - label + pill tiennent jusqu'à ~700px */
@media (max-width: 940px) {
  .demo-banner__hint {
    display: none;
  }
}

/* ≤700px : la pill CTA seule, centrée */
@media (max-width: 700px) {
  #demo-banner {
    padding: 0 40px;
    gap: 0;
  }

  .demo-banner__label {
    display: none;
  }
}
