.background {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  width: 100%;
  min-height: 100%;
}

.background:not(.background--scrollable):not(.background--brand-deco) {
  overflow: hidden;
}

.background--scrollable {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
}

.background--public {
  isolation: isolate;
  overflow: clip;
  background: #fff;
}

.background__municipal-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.background__municipal-base {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    #fff 0%,
    #fff 14%,
    #fffaf7 24%,
    #fff 36%,
    #fdfefe 49%,
    #fff 64%,
    #fbfdfe 79%,
    #fff 100%
  );
}

.background__municipal-base::before,
.background__municipal-base::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.background__municipal-base::before {
  top: 12%;
  left: -22%;
  width: min(72vw, 64rem);
  aspect-ratio: 1.15;
  background: linear-gradient(
    145deg,
    rgb(251 98 107 / 0.09),
    rgb(255 197 201 / 0.2)
  );
  transform: rotate(-16deg);
}

.background__municipal-base::after {
  right: -24%;
  bottom: 5%;
  width: min(76vw, 70rem);
  aspect-ratio: 1.2;
  background: linear-gradient(
    145deg,
    rgb(72 184 194 / 0.08),
    rgb(167 246 255 / 0.18)
  );
  transform: rotate(12deg);
}

.background__municipal-glow {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(2px);
}

.background__municipal-glow--peach {
  top: 31%;
  right: -15%;
  width: min(48vw, 42rem);
  aspect-ratio: 1;
  background: radial-gradient(
    circle,
    rgb(249 189 103 / 0.16) 0%,
    rgb(251 210 157 / 0.07) 52%,
    transparent 72%
  );
}

.background__municipal-glow--cyan {
  bottom: 19%;
  left: -18%;
  width: min(58vw, 52rem);
  aspect-ratio: 1;
  background: radial-gradient(
    circle,
    rgb(62 187 200 / 0.13) 0%,
    rgb(167 246 255 / 0.08) 50%,
    transparent 72%
  );
}

.background__municipal-asset {
  position: absolute;
  display: block;
  max-width: none;
  height: auto;
  object-fit: contain;
  user-select: none;
}

.background__municipal-asset--top-dots {
  top: 1.5rem;
  left: -16.875rem;
  width: 21.875rem;
  opacity: 0.4;
}

.background__municipal-asset--top-wave {
  top: 0;
  left: 50%;
  width: max(100%, 86rem);
  opacity: 0.055;
  transform: translateX(-50%);
}

.background__municipal-asset--news {
  top: 14%;
  left: -5rem;
  width: 80%;
  opacity: 0.5;
}

.background__municipal-asset--green-dots {
  top: 21%;
  left: 39%;
  width: 13.75rem;
  opacity: 0.15;
}

.background__municipal-asset--crest {
  top: 27%;
  right: -1.5rem;
  width: 19.375rem;
  opacity: 0.15;
}

.background__municipal-asset--grey-curve {
  top: 43%;
  left: 0;
  width: 100%;
  min-height: 28rem;
  opacity: 0.5;
  object-fit: cover;
}

.background__municipal-asset--tall-palm {
  top: 48%;
  right: 0;
  width: min(34vw, 31rem);
  opacity: 0.1;
}

.background__municipal-asset--turtle {
  top: 28rem;
  right: -2.75rem;
  left: auto;
  width: min(18vw, 10rem);
  opacity: 0.28;
}

.background__municipal-asset--red-dots {
  top: 72%;
  left: -7.75rem;
  width: 17.5625rem;
  opacity: 0.5;
}

.background__municipal-asset--map {
  right: -5%;
  bottom: 2%;
  width: 46%;
  opacity: 0.09;
}

.background__municipal-asset--palm {
  bottom: 8%;
  left: -1px;
  width: min(50vw, 44.625rem);
  opacity: 0.1;
}

.background--ville-photo .background__gradient {
  background:
    linear-gradient(
      180deg,
      rgb(245 251 251 / 0.82) 0%,
      rgb(245 251 251 / 0.88) 35%,
      rgb(255 248 245 / 0.92) 70%,
      rgb(247 255 254 / 0.96) 100%
    ),
    radial-gradient(circle at 15% 20%, rgb(0 127 139 / 0.1), transparent 42%),
    radial-gradient(circle at 85% 12%, rgb(255 196 202 / 0.12), transparent 38%);
}

.background--manager {
  background: #f7fcf9;
}

.background--manager .background__gradient {
  background:
    radial-gradient(circle at 15% 20%, rgb(6 123 58 / 0.16), transparent 42%),
    radial-gradient(circle at 72% 82%, rgb(247 232 22 / 0.22), transparent 42%),
    linear-gradient(180deg, #f7fcf9 0%, #fefce8 52%, #fffef5 100%);
}

.background--admin {
  background: #edf2ef;
}

.background--admin .background__gradient {
  background:
    radial-gradient(circle at 100% 0%, rgb(214 53 22 / 0.05), transparent 34%),
    radial-gradient(circle at 0% 100%, rgb(6 123 58 / 0.06), transparent 38%),
    radial-gradient(circle at 72% 42%, rgb(247 232 22 / 0.05), transparent 36%);
}

.background--proposal {
  background: #fffef5;
}

.background--proposal .background__gradient {
  background:
    radial-gradient(circle at 72% 82%, rgb(247 232 22 / 0.24), transparent 42%),
    radial-gradient(circle at 85% 12%, rgb(214 53 22 / 0.2), transparent 40%),
    linear-gradient(180deg, #fffef5 0%, #fefce8 48%, #fff5f3 100%);
}

.background--proposal.background--ville-photo .background__gradient {
  background:
    linear-gradient(
      180deg,
      rgb(255 254 245 / 0.8) 0%,
      rgb(254 252 232 / 0.88) 45%,
      rgb(255 245 243 / 0.94) 100%
    ),
    radial-gradient(circle at 78% 78%, rgb(247 232 22 / 0.16), transparent 42%),
    radial-gradient(circle at 88% 12%, rgb(214 53 22 / 0.1), transparent 40%);
}

.background--ville-photo .background__orb {
  opacity: 0.28;
}

.background__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.22;
  z-index: 0;
}

/*
 * Illustrations Remire : calque sticky viewport (hors parallax).
 * Anciennement en % de la hauteur page → hors écran derrière le hero.
 */
.background--brand-deco {
  overflow: visible;
}

.background__brand {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.background__brand-pin {
  position: sticky;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: visible;
}

.background__deco {
  position: absolute;
  display: block;
  max-width: none;
  pointer-events: none;
  object-fit: contain;
  user-select: none;
}

.background__deco--tortue {
  left: clamp(-1.25rem, -0.5vw, 0.75rem);
  bottom: clamp(5.5rem, 14vh, 10rem);
  width: min(30vw, 16rem);
  height: auto;
  opacity: 0.32;
}

.background__deco--palmier {
  right: clamp(-4rem, -3vw, -0.5rem);
  bottom: clamp(2rem, 6vh, 5rem);
  width: min(36vw, 21rem);
  height: auto;
  opacity: 0.28;
}

@media (max-width: 900px) {
  .background__deco--tortue {
    width: min(38vw, 10rem);
    bottom: clamp(4rem, 10vh, 7rem);
    opacity: 0.26;
  }

  .background__deco--palmier {
    width: min(44vw, 12rem);
    opacity: 0.22;
  }
}

@media (max-width: 560px) {
  .background__deco--palmier {
    display: none;
  }

  .background__deco--tortue {
    width: min(42vw, 8.5rem);
    bottom: clamp(3.25rem, 8vh, 5rem);
    opacity: 0.24;
  }
}

.background__layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.background__layer-shift {
  position: absolute;
  inset: -12% 0;
  will-change: transform;
}

.background__illustration-shift {
  position: absolute;
  inset: 0;
}

.background__gradient {
  position: absolute;
  inset: 0;
}

.background__content {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  width: 100%;
  min-height: 0;
}

.background--public .background__content {
  padding-bottom: clamp(5rem, 8vw, 8rem);
}

.background:not(.background--scrollable) .background__content {
  min-height: auto;
}

.background__orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(48px);
  opacity: 0.8;
  z-index: 0;
}

.background__orb--green {
  width: 20rem;
  height: 20rem;
  top: 6%;
  left: -4rem;
  background: var(--rm-teal, #50bac7);
}

.background__orb--yellow {
  width: 18rem;
  height: 18rem;
  right: 6%;
  bottom: 10%;
  background: var(--rm-peach, #fbd6a2);
}

.background__orb--red {
  width: 18rem;
  height: 18rem;
  top: 14%;
  right: 8%;
  background: var(--rm-rose, #ffc4ca);
  opacity: 0.55;
}

.background--admin .background__orb--green {
  width: 16rem;
  height: 16rem;
  left: -3rem;
  bottom: 8%;
  top: auto;
  opacity: 0.45;
}

.background--admin .background__orb--red {
  top: 4%;
  right: 4%;
  opacity: 0.35;
}

@media (prefers-reduced-motion: reduce) {
  .background__layer-shift,
  .background__illustration-shift {
    transform: none !important;
  }
}

@media (max-width: 900px) {
  .background__municipal-asset--news {
    left: -2rem;
    width: 100%;
  }

  .background__municipal-asset--green-dots {
    left: 58%;
    width: 10rem;
  }

  .background__municipal-asset--crest {
    right: -5rem;
    width: 16rem;
  }

  .background__municipal-asset--turtle {
    right: -2.5rem;
    left: auto;
    width: 9rem;
  }

  .background__municipal-asset--map {
    right: -14%;
    width: 70%;
  }
}

@media (max-width: 560px) {
  .background__municipal-asset--top-dots {
    left: -18.5rem;
  }

  .background__municipal-asset--top-wave {
    width: 70rem;
  }

  .background__municipal-asset--news {
    top: 17%;
    width: 125%;
    opacity: 0.35;
  }

  .background__municipal-asset--green-dots {
    left: 64%;
    width: 8rem;
  }

  .background__municipal-asset--crest {
    right: -6rem;
    width: 13rem;
  }

  .background__municipal-asset--grey-curve {
    width: 155%;
  }

  .background__municipal-asset--tall-palm {
    right: -5rem;
    width: 15rem;
  }

  .background__municipal-asset--turtle {
    top: 24rem;
    right: -3rem;
    left: auto;
    width: 8rem;
    opacity: 0.24;
  }

  .background__municipal-asset--red-dots {
    left: -9rem;
    width: 15rem;
  }

  .background__municipal-asset--map {
    right: -34%;
    width: 105%;
  }

  .background__municipal-asset--palm {
    width: 75%;
  }
}
