/**
 * IMT Public Site — Unified premium background
 * Scoped to body.imt-public-site only (admin/panel unaffected).
 * White canvas + subtle floating light shapes.
 */

/* ── Base surface (wins over premium-inner-shell / home white overrides) ── */
html:has(body.imt-public-site:not(.dark)) {
  background-color: #ffffff;
}

body.imt-public-site:not(.dark),
body.imt-public-site.premium-inner-site:not(.dark),
body.imt-public-site.is-home-page:not(.dark) {
  position: relative;
  min-height: 100%;
  overflow-x: hidden;
  background-color: #ffffff !important;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(87, 134, 199, 0.08), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(220, 233, 250, 0.55), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f8fafd 100%) !important;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* ── Floating shapes layer ── */
body.imt-public-site .imt-bg-shapes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

body.imt-public-site .imt-bg-shapes .shape {
  position: absolute;
  display: block;
  border-radius: 999px;
  background: rgba(87, 134, 199, 0.08);
  filter: blur(18px);
  opacity: 0.48;
  will-change: transform, opacity;
  animation: imtFloatShape 32s ease-in-out infinite alternate;
}

body.imt-public-site .imt-bg-shapes .shape-1 {
  width: 280px;
  height: 280px;
  top: 8%;
  inset-inline-start: -80px;
  animation-duration: 34s;
}

body.imt-public-site .imt-bg-shapes .shape-2 {
  width: 220px;
  height: 220px;
  top: 22%;
  inset-inline-end: -70px;
  background: rgba(220, 233, 250, 0.72);
  animation-duration: 38s;
  animation-delay: -8s;
}

body.imt-public-site .imt-bg-shapes .shape-3 {
  width: 180px;
  height: 180px;
  top: 58%;
  inset-inline-start: 8%;
  background: rgba(238, 244, 252, 0.82);
  animation-duration: 36s;
  animation-delay: -14s;
}

body.imt-public-site .imt-bg-shapes .shape-4 {
  width: 320px;
  height: 320px;
  bottom: -120px;
  inset-inline-end: 12%;
  background: rgba(87, 134, 199, 0.06);
  animation-duration: 42s;
  animation-delay: -20s;
}

@keyframes imtFloatShape {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.4;
  }

  50% {
    transform: translate3d(18px, -22px, 0) scale(1.03);
    opacity: 0.52;
  }

  100% {
    transform: translate3d(-14px, 18px, 0) scale(0.98);
    opacity: 0.42;
  }
}

/*
 * Transparent app shells — required so fixed shapes + body gradient
 * are visible (premium-home-ui-v2 / imt-home-refine paint #app white).
 */
body.imt-public-site:not(.dark) #app,
body.imt-public-site:not(.dark) .main-content,
body.imt-public-site:not(.dark) main,
body.imt-public-site:not(.dark) .premium-inner-main,
body.imt-public-site.is-home-page:not(.dark) #app,
body.imt-public-site.is-home-page:not(.dark) .main-content,
body.imt-public-site.is-home-page:not(.dark) main,
body.imt-public-site.is-home-page:not(.dark) .home-page {
  background-color: transparent !important;
  background-image: none !important;
}

/* ── Content stacking ── */
body.imt-public-site #app,
body.imt-public-site .premium-inner-main,
body.imt-public-site footer {
  position: relative;
  z-index: 1;
}

/* Keep header/nav above inner heroes so dropdowns are not covered */
body.imt-public-site header,
body.imt-public-site .navbar,
body.imt-public-site .imt-navbar {
  position: relative;
  z-index: 1020;
}

/* ── Suppress legacy background layers ── */
body.imt-public-site .premium-pupil-bg,
body.imt-public-site .bubbles-container,
body.imt-public-site .premium-home-bg-accent,
body.imt-public-site .premium-montessori-float-layer,
body.imt-public-site .imt-home-bubbles,
body.imt-public-site .home-page::before {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Page wrapper harmonization (inner divs only — not body) ── */
body.imt-public-site:not(.dark) .blog-page,
body.imt-public-site:not(.dark) .about-page {
  background: transparent !important;
  background-image: none !important;
}

body.imt-public-site.success-partners-page .sp-page,
body.imt-public-site .sp-page {
  background: transparent;
}

/* ── Optional surface card token (reuse only) ── */
body.imt-public-site .imt-surface-card {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(87, 134, 199, 0.1);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

/* ── Dark mode: static dark canvas, no shapes ── */
body.imt-public-site.dark {
  background-color: #0f172a !important;
  background-image: none !important;
}

body.imt-public-site.dark .imt-bg-shapes {
  display: none;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  body.imt-public-site .imt-bg-shapes .shape {
    opacity: 0.34;
    filter: blur(14px);
  }

  body.imt-public-site .imt-bg-shapes .shape-3,
  body.imt-public-site .imt-bg-shapes .shape-4 {
    display: none;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  body.imt-public-site .imt-bg-shapes .shape {
    animation: none !important;
    transform: none !important;
    opacity: 0.34;
  }
}
