/* ==========================================================================
   B.CAM Servizi Ambientali SRLS — Crisp White & Eco-Green Precision CSS
   Palette estratta direttamente dal nuovo logo vettoriale B.CAM:
   - Brand Logo Green:       #56AC50
   - Primary Action Green:   #41923B
   - Fresh Light Green:      #72BE6C
   - Dark Accent Green:      #265B22
   - Soft Shaded White Wash: #FFFFFF -> #F4FAF3 -> #E5F4E3
   ========================================================================== */

:root {
  --brand-logo: #56AC50;
  --brand-primary: #41923B;
  --brand-light: #72BE6C;
  --brand-dark: #265B22;
  --eco-wash-50: #F4FAF3;
  --eco-wash-100: #E5F4E3;
  --eco-border: #CBE8C8;
  --eco-glow: rgba(86, 172, 80, 0.16);
  --font-display: 'Plus Jakarta Sans', 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  overflow-x: clip;
  overflow-anchor: none;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

section[id] {
  scroll-margin-top: 100px;
}

#home {
  scroll-margin-top: 0;
}

body {
  font-family: var(--font-body);
  color: #1e2920;
  background-color: #ffffff;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
}

.font-mono-tech {
  font-family: var(--font-mono);
}

/* Accent underline echoing the horizontal bar in the official logo */
.section-accent-line {
  width: 64px;
  height: 4px;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-logo), var(--brand-light));
}

/* ==========================================================================
   Top Operational Marquee Ticker Bar
   ========================================================================== */
.marquee-bar {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0%, #000 4%, #000 96%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 4%, #000 96%, transparent 100%);
}

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: marquee-scroll 34s linear infinite;
}

.marquee-bar:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 2rem;
  padding-right: 2rem;
}

@keyframes marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-bar {
    mask-image: none;
    -webkit-mask-image: none;
  }

  .marquee-track {
    animation: none;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 0.35rem;
  }

  .marquee-group[aria-hidden="true"] {
    display: none;
  }
}

/* ==========================================================================
   Header & White/Soft-Green Surfaces
   ========================================================================== */
.glass-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(203, 232, 200, 0.8);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.glass-header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 30px -12px rgba(65, 146, 59, 0.14);
}

.eco-wash-surface {
  background: linear-gradient(180deg, #ffffff 0%, #f4faf3 50%, #ffffff 100%);
}

.bento-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #d9eed7;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.32s ease;
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: rgba(86, 172, 80, 0.55);
  box-shadow: 0 20px 40px -14px rgba(65, 146, 59, 0.14),
              0 8px 18px -6px rgba(15, 23, 42, 0.05);
}

/* Clickable Service Index Card ("I Nostri Servizi" 3x2) */
.service-index-card {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.28s ease;
}

.service-index-card:hover {
  transform: translateY(-5px);
  border-color: var(--brand-logo);
  box-shadow: 0 22px 42px -14px rgba(86, 172, 80, 0.18),
              0 8px 20px -8px rgba(15, 23, 42, 0.06);
}

.service-index-card img {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-index-card:hover img {
  transform: scale(1.05);
}

/* ==========================================================================
   Full-Width Photographic Hero Slider (Responsive liasasrl.it Style)
   ========================================================================== */
.hero-slider {
  position: relative;
  overflow: hidden;
  height: 420px;
}

@media (min-width: 640px) {
  .hero-slider {
    height: 490px;
  }
}

@media (min-width: 1024px) {
  .hero-slider {
    height: 560px;
  }
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

.hero-slide-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 6s ease-out;
}

.hero-slide.active .hero-slide-img {
  transform: scale(1);
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.3s ease;
}

.hero-dot.active {
  width: 28px;
  background: var(--brand-logo);
  border-color: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-slide-img {
    transition: none;
    transform: none;
  }
}

/* ==========================================================================
   LED Indicators, Shimmer & Micro-Interactions
   ========================================================================== */
@keyframes pulse-live {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(86, 172, 80, 0.58);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(86, 172, 80, 0);
  }
}

@keyframes shimmer-sweep {
  0% {
    transform: translateX(-120%) skewX(-18deg);
  }
  100% {
    transform: translateX(220%) skewX(-18deg);
  }
}

.status-dot-live {
  position: relative;
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  background-color: var(--brand-logo);
  animation: pulse-live 2s infinite;
}

.btn-shimmer {
  position: relative;
  overflow: hidden;
}

.btn-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-120%) skewX(-18deg);
}

.btn-shimmer:hover::after {
  animation: shimmer-sweep 0.85s ease forwards;
}

/* ==========================================================================
   Scroll-Reveal Animations
   ========================================================================== */
.reveal, .reveal-left, .reveal-right {
  opacity: 0;
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal {
  transform: translateY(20px);
}

.reveal-left {
  transform: translateX(-20px);
}

.reveal-right {
  transform: translateX(20px);
}

.reveal.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   Navigation, FAQ Accordions, Modals & Floating Chat
   ========================================================================== */
.nav-link.is-active,
.nav-link.active {
  color: var(--brand-primary);
}

details > summary {
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}
details[open] summary .faq-chevron {
  transform: rotate(180deg);
}

/* Modals */
.modal-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Floating Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  z-index: 1100;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Floating WhatsApp Widget */
.floating-chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 998;
}

.floating-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 350px;
  max-width: calc(100vw - 32px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-chat-window.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Mobile sticky bar (Light White + Soft Green Border) */
@media (max-width: 768px) {
  .mobile-cta-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid #CBE8C8;
    padding: 0.6rem 0.85rem;
    box-shadow: 0 -8px 25px rgba(65, 146, 59, 0.08);
  }

  body {
    padding-bottom: 72px;
  }

  .floating-chat-bubble {
    bottom: 82px;
    right: 14px;
  }

  .floating-chat-window {
    bottom: 148px;
    right: 14px;
  }

  .toast-notification {
    bottom: 86px;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: #f4faf3;
}
::-webkit-scrollbar-thumb {
  background: #b6dab4;
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: #56AC50;
}
