/* IT310RESPONSIVE_DEVICE_PASS2J
   Correção arquitetural de background mobile.
   Escopo: uma única camada de fundo estável no mobile; preserva PASS2H/PASS2I menus aprovados, FixtureBridge/Ferramentas, desktop, backend, motores, rotas, QR/donate e identidade. */

@media (max-width:960px){
  html.it-device-runtime-ready,
  html.it-dr-ready,
  html.it-dr-phone,
  html.it-dr-phone-small,
  html.it-dr-tablet{
    background:#02040a!important;
    overflow-x:hidden!important;
    overscroll-behavior-x:none!important;
  }

  body{
    background:#02040a!important;
    background-image:none!important;
    background-attachment:scroll!important;
    background-position:center top!important;
    overflow-x:hidden!important;
    isolation:isolate!important;
    min-height:100vh!important;
  }

  /* PASS2J: o mobile usa uma única camada real, criada pelo Device Runtime.
     As camadas antigas ficam desligadas para impedir duplicidade, fixed legado,
     parallax, partículas e micro-repaint durante o scroll. */
  body > .bg,
  body .bg:not(.it-mobile-bg-root),
  body > .space-bg,
  body .space-bg,
  body > .stars,
  body .stars,
  body > .home-lab-bg,
  body .home-lab-bg,
  body > .software-lab-bg,
  body .software-lab-bg,
  body > .ixdesk-bg-layer,
  body .ixdesk-bg-layer,
  body > .ixdesk-mountains,
  body .ixdesk-mountains,
  body > .infotech-particles,
  body .infotech-particles,
  body::before,
  body::after{
    display:none!important;
    visibility:hidden!important;
    opacity:0!important;
    animation:none!important;
    transition:none!important;
    transform:none!important;
    will-change:auto!important;
    background-image:none!important;
    background-attachment:scroll!important;
    pointer-events:none!important;
  }

  body > .it-mobile-bg-root{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    position:fixed!important;
    left:0!important;
    top:0!important;
    right:auto!important;
    bottom:auto!important;
    width:var(--it-bg-frozen-w,100vw)!important;
    min-width:100vw!important;
    max-width:none!important;
    height:calc(var(--it-bg-frozen-h,100vh) + 96px)!important;
    min-height:calc(var(--it-bg-frozen-h,100vh) + 96px)!important;
    max-height:none!important;
    z-index:0!important;
    pointer-events:none!important;
    overflow:hidden!important;
    contain:layout paint style!important;
    transform:translate3d(0,0,0)!important;
    translate:none!important;
    scale:1!important;
    rotate:0deg!important;
    will-change:auto!important;
    animation:none!important;
    transition:none!important;
    backface-visibility:hidden!important;
    -webkit-backface-visibility:hidden!important;
    background-color:#02040a!important;
    background-image:
      radial-gradient(circle at 18% 25%,rgba(0,245,255,.20),transparent 30%),
      radial-gradient(circle at 88% 18%,rgba(255,0,212,.13),transparent 30%),
      linear-gradient(90deg,rgba(2,4,10,.92),rgba(2,4,10,.52),rgba(2,4,10,.86)),
      linear-gradient(rgba(0,0,0,.16),rgba(0,0,0,.62)),
      image-set(url('/assets/backgrounds/infotech-bg-tools.webp') type('image/webp'),url('/assets/backgrounds/infotech-bg-tools-fallback.jpg') type('image/jpeg'))!important;
    background-size:cover,cover,cover,cover,cover!important;
    background-position:center top,center top,center top,center top,left center!important;
    background-repeat:no-repeat!important;
    background-attachment:scroll!important;
  }

  body.infotech-public-page.home-lab-reference4 > .it-mobile-bg-root,
  body.infotech-public-page.sistemas-home-standard1 > .it-mobile-bg-root,
  body.infotech-public-page.software-app-page > .it-mobile-bg-root,
  body.infotech-public-page.software-product-axis2 > .it-mobile-bg-root{
    background-image:
      linear-gradient(180deg,rgba(0,0,0,.46) 0%,rgba(0,0,0,.36) 42%,rgba(0,0,0,.76) 100%),
      linear-gradient(90deg,rgba(0,0,0,.76),rgba(0,0,0,.24),rgba(0,0,0,.72)),
      image-set(url('/assets/backgrounds/infotech-bg-home-1200.webp') type('image/webp'),url('/assets/backgrounds/infotech-bg-home.jpg') type('image/jpeg'))!important;
    background-size:cover,cover,cover!important;
    background-position:center top,center top,60% top!important;
    background-repeat:no-repeat!important;
    background-attachment:scroll!important;
  }

  body.ixdesk-software-page > .it-mobile-bg-root{
    background-image:
      radial-gradient(circle at 18% 25%,rgba(0,245,255,.16),transparent 28%),
      radial-gradient(circle at 82% 18%,rgba(255,0,212,.11),transparent 30%),
      linear-gradient(90deg,rgba(2,4,10,.90),rgba(2,4,10,.54),rgba(2,4,10,.90)),
      image-set(url('/assets/backgrounds/infotech-bg-tools.webp') type('image/webp'),url('/assets/backgrounds/infotech-bg-tools-fallback.jpg') type('image/jpeg'))!important;
    background-size:cover,cover,cover,cover!important;
    background-position:center top,center top,center top,left center!important;
    background-repeat:no-repeat!important;
    background-attachment:scroll!important;
  }

  body > :not(.it-mobile-bg-root):not(script):not(style):not(link){
    position:relative;
    z-index:1;
  }

  .it-global-header,
  .it-top,
  .fixture-site-header,
  header,
  main,
  footer,
  .app-shell,
  .sidebar,
  .ava-widget,
  .avadog,
  .pwa-install-prompt,
  .install-prompt,
  .app-install-popup{
    isolation:auto;
  }

  body.it-sidebar-mobile.it-sidebar-open > .it-mobile-bg-root,
  body.it-tools-bg.it-sidebar-mobile.it-sidebar-open > .it-mobile-bg-root{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
  }
}

@media (min-width:961px){
  body > .it-mobile-bg-root{
    display:none!important;
  }
}

/* PASS2J final: camada única real injetada pelo Device Runtime.
   Esta regra vem por último para neutralizar as camadas anteriores e evitar qualquer disputa de repaint. */
@media (max-width:960px){
  html.it-mobile-bg-canvas-ready,
  html.it-mobile-bg-root-ready{
    background:#02040a!important;
  }

  html.it-mobile-bg-canvas-ready body > .bg,
  html.it-mobile-bg-canvas-ready body > .stars,
  html.it-mobile-bg-canvas-ready body > .space-bg,
  html.it-mobile-bg-canvas-ready body > .home-lab-bg,
  html.it-mobile-bg-canvas-ready body > .software-lab-bg,
  html.it-mobile-bg-canvas-ready body > .ixdesk-bg-layer,
  html.it-mobile-bg-canvas-ready body > .ixdesk-mountains,
  html.it-mobile-bg-canvas-ready body > .infotech-particles,
  html.it-mobile-bg-root-ready body > .bg,
  html.it-mobile-bg-root-ready body > .stars,
  html.it-mobile-bg-root-ready body > .space-bg,
  html.it-mobile-bg-root-ready body > .home-lab-bg,
  html.it-mobile-bg-root-ready body > .software-lab-bg,
  html.it-mobile-bg-root-ready body > .ixdesk-bg-layer,
  html.it-mobile-bg-root-ready body > .ixdesk-mountains,
  html.it-mobile-bg-root-ready body > .infotech-particles{
    display:none!important;
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
    animation:none!important;
    transition:none!important;
    transform:none!important;
  }

  body > .it-mobile-bg-root{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    position:fixed!important;
    left:0!important;
    top:0!important;
    right:auto!important;
    bottom:auto!important;
    width:var(--it-bg-frozen-w,var(--it-mobile-bg-lock-w,100vw))!important;
    min-width:100vw!important;
    max-width:none!important;
    height:var(--it-bg-frozen-h,var(--it-mobile-bg-lock-h,100lvh))!important;
    min-height:100lvh!important;
    max-height:none!important;
    z-index:0!important;
    pointer-events:none!important;
    overflow:hidden!important;
    contain:paint!important;
    isolation:isolate!important;
    transform:none!important;
    translate:none!important;
    scale:1!important;
    rotate:0deg!important;
    will-change:auto!important;
    backface-visibility:hidden!important;
    -webkit-backface-visibility:hidden!important;
    background-attachment:scroll!important;
    background-repeat:no-repeat!important;
    background-size:cover!important;
    background-position:center top!important;
  }

  body.it-bg-home > .it-mobile-bg-root,
  body.it-bg-earth > .it-mobile-bg-root,
  body.it-bg-clean > .it-mobile-bg-root{
    background:
      linear-gradient(90deg,rgba(0,0,0,.82),rgba(0,0,0,.46),rgba(0,0,0,.78)),
      linear-gradient(180deg,rgba(0,0,0,.24),rgba(0,0,0,.76)),
      image-set(url('/assets/backgrounds/infotech-bg-home-1200.webp') type('image/webp'),url('/assets/backgrounds/infotech-bg-home.jpg') type('image/jpeg')) center top/cover no-repeat!important;
  }

  body.it-bg-home > .it-mobile-bg-root{
    background:
      linear-gradient(180deg,rgba(0,0,0,.50) 0%,rgba(0,0,0,.34) 42%,rgba(0,0,0,.78) 100%),
      linear-gradient(90deg,rgba(0,0,0,.70),rgba(0,0,0,.12)),
      image-set(url('/assets/backgrounds/infotech-bg-home-1200.webp') type('image/webp'),url('/assets/backgrounds/infotech-bg-home.jpg') type('image/jpeg')) 62% top/cover no-repeat!important;
  }

  body.it-bg-tools > .it-mobile-bg-root,
  body.it-bg-space > .it-mobile-bg-root{
    opacity:.78!important;
    background:
      radial-gradient(circle at 18% 25%,rgba(0,245,255,.18),transparent 28%),
      radial-gradient(circle at 86% 18%,rgba(255,0,212,.13),transparent 30%),
      linear-gradient(90deg,rgba(0,0,0,.38),rgba(0,0,0,.12) 48%,rgba(0,0,0,.42)),
      image-set(url('/assets/backgrounds/infotech-bg-tools.webp') type('image/webp'),url('/assets/backgrounds/infotech-bg-tools-fallback.jpg') type('image/jpeg')) center top/cover no-repeat!important;
  }

  body > .it-mobile-bg-root::before,
  body > .it-mobile-bg-root::after{
    content:""!important;
    position:absolute!important;
    inset:0!important;
    pointer-events:none!important;
    animation:none!important;
    transition:none!important;
    transform:none!important;
    will-change:auto!important;
  }

  body > .it-mobile-bg-root::after{
    background:linear-gradient(180deg,rgba(0,0,0,.04),rgba(0,0,0,.22))!important;
  }

  html.it-mobile-bg-canvas-ready body > *:not(.it-mobile-bg-root),
  html.it-mobile-bg-root-ready body > *:not(.it-mobile-bg-root){
    position:relative;
  }

  body.it-bg-home header,
  body.it-bg-home main,
  body.it-bg-home footer,
  body.it-bg-earth header,
  body.it-bg-earth main,
  body.it-bg-earth footer,
  body.it-bg-clean header,
  body.it-bg-clean main,
  body.it-bg-clean footer,
  body.it-bg-tools header,
  body.it-bg-tools main,
  body.it-bg-tools footer,
  body.it-bg-tools .tools-page-shell{
    z-index:2!important;
  }
}
