/* ============================================================
   UniPay — Objet arrière-plan global : IMAGES UNIQUEMENT
   ------------------------------------------------------------
   Règle verrouillée : même moteur en mode ordinateur, mobile portrait
   et mobile paysage.

   Responsabilités :
   - chat.css gère le quadrillage pur ;
   - ce fichier gère #unipayPageBackgroundHost, la scène image,
     les transitions, l'opacité et la vignette ;
   - aucune media query ne doit changer le fond selon téléphone/ordinateur.
   ============================================================ */
:root {  --unipay-bg-base: #020812;
  --unipay-bg-image-opacity: 1;
  --unipay-bg-fade-duration: 3000ms;
  --unipay-bg-inline-image: none;
  --unipay-bg-brightness: 1;
}

/* Le body ne charge jamais d'image concurrente. La sequence d'images
   appartient au seul hote global ci-dessous. */
body {
  background-image: none !important;
}

html.unipay-page-bg-ready,
body.unipay-page-bg-ready {
  min-height: 100%;
}

html.unipay-page-bg-ready {
  background: var(--unipay-bg-base) !important;
}

body.unipay-page-bg-ready {
  background: transparent !important;
}

/* Correction 2026-06-16 : aucun positionnement global des enfants du body.
   Les pages gardent leur propre moteur de layout ; le fond reste derrière. */

#unipayPageBackgroundHost {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
  background-color: var(--unipay-bg-base);
  background-image: var(--unipay-bg-inline-image);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

#unipayPageBackgroundHost[aria-hidden="true"] {
  speak: never;
}

#unipayPageBackgroundHost[data-unipay-bg-paused="true"] .unipay-page-bg-image {
  animation-play-state: paused !important;
}

.unipay-page-bg-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.unipay-page-bg-grid,
.unipay-page-bg-vignette {
  display: none !important;
}

.unipay-page-bg-stage {
  display: block;
  z-index: 1;
}

.unipay-page-bg-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  max-width: none;
  max-height: none;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  transition: opacity var(--unipay-bg-fade-duration) ease-in-out, transform var(--unipay-bg-fade-duration) ease-in-out, filter 240ms ease;
  will-change: opacity, transform, filter;
  user-select: none;
  -webkit-user-drag: none;
  object-fit: cover;
  object-position: center center;
  filter: brightness(var(--unipay-bg-brightness));
}

.unipay-page-bg-image:not(.is-visible) {
  opacity: 0 !important;
}

.unipay-page-bg-image.is-visible {
  opacity: var(--unipay-bg-image-opacity);
}

#unipayPageBackgroundHost[data-unipay-bg-transition="zoom"] .unipay-page-bg-image {
  transform: translate3d(0, 0, 0) scale(1.08);
}

#unipayPageBackgroundHost[data-unipay-bg-transition="zoom"] .unipay-page-bg-image.is-visible {
  transform: translate3d(0, 0, 0) scale(1);
}

#unipayPageBackgroundHost[data-unipay-bg-transition="slide"] .unipay-page-bg-image {
  transform: translate3d(1%, 0, 0) scale(1.04);
}

#unipayPageBackgroundHost[data-unipay-bg-transition="slide"] .unipay-page-bg-image.is-visible {
  transform: translate3d(0, 0, 0) scale(1);
}

#unipayPageBackgroundHost[data-unipay-bg-transition="pulse"] .unipay-page-bg-image.is-visible {
  animation: unipay-bg-soft-pulse 10s ease-in-out infinite alternate;
}

#unipayPageBackgroundHost[data-unipay-bg-transition="none"] .unipay-page-bg-image {
  transition: none !important;
}

@keyframes unipay-bg-soft-pulse {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(0, 0, 0) scale(1.035); }
}

@media (prefers-reduced-motion: reduce) {
  .unipay-page-bg-image {
    transition: none;
  }
}

/* La scène et chaque image occupent le viewport complet. object-fit: cover
   recadre les côtés des images panoramiques sur les écrans portrait et remplit
   les écrans larges sans bandes vides. La même règle vaut pour tous les formats. */
