/* ============================================
   TECNO srl — Design System
   ============================================ */



/* @font-face — Codec Pro (file OTF in assets/fonts/) */
@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/codec_pro_regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Codec Pro';
  src: url('../fonts/codec_pro_bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* --- Variabili --- */
:root {
  --primary: #0076bc;
  --primary-dark: #005a8e;
  --primary-light: #e8f4fc;
  --accent: #25F5FC;
  --accent-dark: #12C8CE;
  --surface: #fafafa;
  --surface-alt: #f0f4f8;
  --dark: #1a2332;
  --muted: #5a6a7a;
  --border: #d1dce8;
  --white: #ffffff;
  --neuro-light: rgba(255, 255, 255, 0.8);
  --neuro-dark: rgba(200, 210, 220, 0.5);
  --shadow-neuro: 6px 6px 15px var(--neuro-dark), -6px -6px 15px var(--neuro-light);
  --shadow-neuro-sm: 3px 3px 8px var(--neuro-dark), -3px -3px 8px var(--neuro-light);
  --shadow-neuro-inset: inset 3px 3px 8px var(--neuro-dark), inset -3px -3px 8px var(--neuro-light);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --nav-h: 72px;
  --transition: 0.3s ease;
}

/* --- Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Codec Pro', sans-serif;
  color: var(--dark);
  background: var(--surface);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- Limite di sicurezza loghi (bassa risoluzione) --- */
img[src*="tecnosrl_logo_bianco"],
img[src*="tecnosrl_logo_blu"] {
  max-width: 150px !important;
  object-fit: contain;  }

img,
video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
}

/* --- Loader --- */
#loader {
  position: fixed;
  inset: 0;
  background: var(--primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#loader img {
  width: 150px;
  height: auto;
  animation: loaderBounce 1.2s ease-in-out infinite;
}

@keyframes loaderBounce {

  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }

  50% {
    transform: translateY(-8px);
    opacity: 0.85;
  }
}

/* --- Navbar --- */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  transition: background var(--transition), box-shadow var(--transition), height var(--transition);
}

#navbar.transparent {
  background: transparent;
  height: calc(var(--nav-h) + 16px);
}

/* Sfumatura navbar — scende 80px oltre il bordo inferiore */
#navbar.transparent::before {
  content: '';
  position: absolute;
  inset: 0;
  bottom: -80px;
  background: linear-gradient(to bottom, rgba(0, 8, 20, .85) 0%, rgba(0, 8, 20, .45) 55%, rgba(0, 8, 20, .0) 100%);
  pointer-events: none;
  z-index: -1;
}

#navbar.scrolled,
#navbar.solid {
  background: var(--primary);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.08);
}

#navbar.scrolled::before,
#navbar.solid::before {
  display: none;
}

.nav-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-logo img {
  height: 38px;
}

/* --- Hamburger --- */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

/* --- Drawer Menu --- */
#menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: var(--primary-dark);
  z-index: 600;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

#menu-drawer.open {
  transform: translateX(0);
}

#menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 590;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

#menu-overlay.show {
  opacity: 1;
  visibility: visible;
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition);
}

.drawer-close:hover {
  color: #fff;
}

.drawer-nav {
  flex: 1;
  padding: 16px 0;
}

.drawer-item {
  display: block;
  width: 100%;
  padding: 14px 24px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: all 0.3s;
}

.drawer-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
}

.drawer-item.active {
  color: var(--accent);
  background: rgba(0, 0, 0, 0.15);
  border-left: 4px solid var(--accent);
  padding-left: 20px;
}

.drawer-item .chevron,
.drawer-accordion-btn .chevron {
  transition: transform var(--transition);
  flex-shrink: 0;
}

.drawer-item.open .chevron,
.drawer-accordion-btn.open .chevron {
  transform: rotate(180deg);
}

.drawer-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition);
  background: rgba(0, 0, 0, 0.15);
}

.drawer-submenu.open {
  max-height: 200px;
}

.drawer-submenu a {
  display: block;
  padding: 10px 24px 10px 44px;
  color: rgba(255, 255, 255, 0.65);
  font-size: .88rem;
  transition: color var(--transition), background var(--transition);
}

.drawer-submenu a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.drawer-submenu a.active {
  color: var(--accent);
}

.drawer-socials {
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 28px;
  align-items: center;
  margin-top: auto;
}

.drawer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.3s;
}

.drawer-socials a:hover {
  color: var(--accent);
}


/* --- Nav Right --- */
.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.75);
  transition: color var(--transition);
}

.nav-social:hover {
  color: var(--accent);
}


/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .92rem;
  letter-spacing: .03em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 118, 188, .35);
  animation: haloPulsePrimary 1.5s infinite;
}

.btn-accent {
  background: var(--accent);
  color: var(--dark);
}

.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 245, 252, .18);
  animation: haloPulseAccent 1.5s infinite;
}

.btn-outline-white {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, .7);
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, .12);
  border-color: #fff;
  transform: translateY(-2px);
}

.btn-ghost {
  background: var(--surface-alt);
  color: var(--dark);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--border);
}

@keyframes bounce {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(8px);
  }
}

@keyframes haloPulsePrimary {
  0% {
    box-shadow: 0 8px 24px rgba(0, 118, 188, .35), 0 0 0 0 rgba(0, 118, 188, .3);
  }

  70% {
    box-shadow: 0 8px 24px rgba(0, 118, 188, .35), 0 0 0 10px rgba(0, 118, 188, 0);
  }

  100% {
    box-shadow: 0 8px 24px rgba(0, 118, 188, .35), 0 0 0 0 rgba(0, 118, 188, 0);
  }
}

@keyframes haloPulseAccent {
  0% {
    box-shadow: 0 6px 16px rgba(37, 245, 252, .18), 0 0 0 0 rgba(37, 245, 252, .3);
  }

  70% {
    box-shadow: 0 6px 16px rgba(37, 245, 252, .18), 0 0 0 10px rgba(37, 245, 252, 0);
  }

  100% {
    box-shadow: 0 6px 16px rgba(37, 245, 252, .18), 0 0 0 0 rgba(37, 245, 252, 0);
  }
}

/* --- Cards Neumorphic --- */
.card-neuro {
  background: var(--surface);
  box-shadow: var(--shadow-neuro);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.section-alt .card-neuro {
  background: #fff;
}

a.card-neuro:hover,
.card-neuro[onclick]:hover {
  box-shadow: 12px 12px 28px var(--neuro-dark), -6px -6px 18px var(--neuro-light);
  transform: translateY(-4px);
}

.card-neuro-sm {
  background: var(--surface);
  box-shadow: var(--shadow-neuro-sm);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.section-alt .card-neuro-sm {
  background: var(--surface-alt);
}

a.card-neuro-sm:hover,
.card-neuro-sm[onclick]:hover {
  box-shadow: 6px 6px 16px var(--neuro-dark), -4px -4px 10px var(--neuro-light);
  transform: translateY(-2px);
}

/* --- Hero Video --- */
.hero-wrap {
  position: relative;
  width: 100%;
  height: 102vh;
  min-height: 580px;
  overflow: hidden;
  border-bottom: 1.5px solid #fff;
}

.hero-wrap video,
.hero-wrap .hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, .3), rgba(0, 0, 0, .3)),
    linear-gradient(to bottom, rgba(0, 10, 25, .2) 0%, rgba(0, 10, 25, .45) 50%, rgba(0, 10, 25, .8) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 0 24px;
  color: #fff;
  gap: 20px;
}

/* --- Section Banner (sezioni home con foto sfondo) --- */
.banner-section {
  position: relative;
  min-height: 65vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1.5px solid #fff;
}

.banner-section .container {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
}

.banner-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.banner-overlay {
  position: absolute;
  inset: 0;
}

.banner-overlay-left {
  background:
    linear-gradient(rgba(0, 0, 0, .1), rgba(0, 0, 0, .1)),
    linear-gradient(to right, rgba(0, 10, 25, .7) 0%, rgba(0, 10, 25, .3) 60%, rgba(0, 10, 25, .0) 100%);
}

.banner-overlay-right {
  background:
    linear-gradient(rgba(0, 0, 0, .1), rgba(0, 0, 0, .1)),
    linear-gradient(to left, rgba(0, 10, 25, .7) 0%, rgba(0, 10, 25, .3) 60%, rgba(0, 10, 25, .0) 100%);
}

.banner-overlay-dark {
  background: rgba(0, 0, 0, .45);
}

.banner-content {
  padding: 80px 0 100px;
  color: #fff;
  max-width: 580px;
}

.banner-content-right {
  margin-left: auto;
}

/* --- Page Hero (pagine interne) --- */
.page-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding-top: var(--nav-h);
  border-bottom: 1.5px solid #fff;
}

.page-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .25)),
    linear-gradient(to top, rgba(0, 10, 25, .75) 0%, rgba(0, 10, 25, .15) 100%);
}

.page-hero-content {
  position: relative;
  z-index: 2;
  padding: 48px 0 80px;
  color: #fff;
  width: 100%;
}

.page-hero-content .display {
  margin-bottom: 32px;
}

/* --- Page Header (testo su sfondo grigio, senza foto) --- */
.page-header {
  background: #374151;
  position: relative;
  overflow: hidden;
  padding-top: var(--nav-h);
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  border-bottom: 1.5px solid #fff;
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('../images/tecnosrl_sfondo_astratto_anelli.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

.page-header .container {
  position: relative;
  z-index: 1;
  padding-top: 48px;
  padding-bottom: 80px;
  width: 100%;
  color: #fff;
}

.page-header .display {
  margin-bottom: 32px;
}

/* --- Sezioni standard --- */
.section {
  padding: 96px 0;
}

.section-alt {
  background: var(--surface-alt);
}

.section-primary {
  background: var(--primary);
  color: #fff;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Tipografia --- */
.display {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.02em;
}

.h1 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.12;
}

.h2 {
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
}

.h3 {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
}

.lead {
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  font-weight: 400;
  line-height: 1.7;
  color: var(--muted);
}

.section-tag,
.section-tag-white {
  display: none !important;
}

.carousel-wrapper {
  position: relative;
  width: 100%;
}

@media (max-width: 1024px) {
  .carousel-wrapper {
    position: relative;
    width: 100vw !important;
    left: auto !important;
    transform: none !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
  }
}

.carousel-fullwidth {
  position: relative;
  width: 100vw !important;
  left: auto !important;
  transform: none !important;
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
}

@media (min-width: 1025px) {
  .carousel-fullwidth .carousel-mobile-grid {
    padding: 24px 0 32px;
    margin: -24px 0 -24px 0;
  }

  .carousel-fullwidth .carousel-mobile-grid::before,
  .carousel-fullwidth .carousel-mobile-grid::after {
    content: "";
    flex: 0 0 5vw;
    width: 5vw;
  }
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
}

.carousel-nav:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 22px rgba(0, 118, 188, 0.3);
}

.carousel-nav.disabled {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.carousel-nav.prev {
  left: 10px;
}

.carousel-nav.next {
  right: 10px;
}



/* --- Caroselli Scrollabili --- */
.carousel-mobile-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 24px 0 32px;
  margin: -24px 0 -24px 0;
  align-items: stretch;
}

@media (min-width: 1025px) {
  .carousel-mobile-grid {
    justify-content: center;
    scroll-snap-type: none;
  }

  .carousel-mobile-features {
    scroll-snap-type: none;
  }

  .carousel-fullwidth .carousel-mobile-grid {
    scroll-snap-type: none;
  }

  .sticky-desktop {
    position: sticky;
    top: 120px;
  }
}

.grid-2-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
}

.grid-3-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: start;
  max-width: 860px;
}

.carousel-mobile-grid::-webkit-scrollbar {
  display: none;
}

.carousel-mobile-grid>* {
  flex: 0 0 300px;
  max-width: 340px;
  scroll-snap-align: start;
  height: auto;
  align-self: stretch;
}

.carousel-mobile-features {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 24px 0 32px;
  margin: -24px 0 -24px 0;
  align-items: stretch;
}

@media (min-width: 1025px) {
  .carousel-mobile-features {
    justify-content: center;
  }
}

.carousel-mobile-features::-webkit-scrollbar {
  display: none;
}

.carousel-mobile-features>* {
  flex: 0 0 220px;
  max-width: 280px;
  scroll-snap-align: center;
  height: auto;
  align-self: stretch;
}

@media (max-width: 1024px) {
  .scroll-hint {
    display: flex;
  }

  .carousel-mobile-grid>*,
  .carousel-mobile-features>* {
    flex: 0 0 80vw;
    max-width: 340px;
  }

  .carousel-mobile-features>* {
    flex: 0 0 75vw;
    max-width: 300px;
  }
}

/* --- Content Placeholder (sviluppo) --- */
.content-ph {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff9e6;
  border: 2px dashed #f5c842;
  border-radius: 8px;
  padding: 14px 18px;
  color: #7a5c00;
  font-size: .88rem;
  line-height: 1.6;
  margin: 12px 0;
}

.content-ph strong {
  display: block;
  margin-bottom: 2px;
}

/* --- Img Placeholder --- */
.img-ph {
  background: rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-neuro .img-ph {
  background: rgba(0, 118, 188, 0.05);
}

.img-ph span {
  color: #7a9ab5;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: center;
  padding: 12px;
}

/* --- Animazioni Scroll --- */
.fade-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .65s ease, transform .65s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity .65s ease, transform .65s ease;
}

.fade-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity .65s ease, transform .65s ease;
}

.fade-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.d1 {
  transition-delay: .1s;
}

.d2 {
  transition-delay: .2s;
}

.d3 {
  transition-delay: .3s;
}

.d4 {
  transition-delay: .4s;
}

.d5 {
  transition-delay: .5s;
}

/* --- Stats Counter --- */
.stat-number {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* --- Recensioni Carosello --- */
.reviews-track {
  display: flex;
  gap: 24px;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}

.review-card {
  flex-shrink: 0;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: var(--radius);
  padding: 32px;
  color: #fff;
  width: 340px;
}

.review-stars {
  color: var(--accent);
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

.review-text {
  font-size: .95rem;
  line-height: 1.7;
  opacity: .9;
  margin-bottom: 20px;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.review-name {
  font-weight: 700;
  font-size: .9rem;
}

.review-role {
  font-size: .8rem;
  opacity: .65;
}

.carousel-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 28px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .3);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  border: none;
}

.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

/* --- Griglia Applicazioni alternata --- */
.app-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 420px;
  max-height: 600px;
}

.app-row:nth-child(even) .app-img {
  order: 2;
}

.app-img {
  overflow: hidden;
  max-height: 600px;
}

.app-img img,
.app-img video,
.app-img .img-ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-text {
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 768px) {
  .app-row {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .app-row:nth-child(even) .app-img {
    order: 0;
  }

  .app-text {
    padding: 40px 24px;
  }
}

/* --- Card overlay (settori senza video) --- */
.app-card-overlay {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform .3s ease, box-shadow .3s ease;
}

.app-card-overlay:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .2);
}

.app-card-overlay-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform .4s ease;
}

.app-card-overlay:hover .app-card-overlay-bg {
  transform: scale(1.05);
}

.app-card-overlay-dim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .4) 50%, rgba(0, 0, 0, .15) 100%);
}

.app-card-overlay-content {
  position: relative;
  z-index: 2;
  padding: 32px;
}

@media (max-width: 900px) {
  .app-card-overlay {
    min-height: 300px;
  }

  .section .app-card-overlay {
    min-height: 300px;
  }

  /* stack into single column on small screens */
}

@media (max-width: 768px) {
  .section div[style*="grid-template-columns:repeat(3"] {
    grid-template-columns: 1fr !important;
  }

  .app-card-overlay-content {
    padding: 24px;
  }
}

/* --- Chatbot Widget --- */
.chatbot-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  /* La misura viene aggiornata da main.js per seguire tutta la pagina. */
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  /* Copre l'intero documento, inclusi i controlli flottanti della pagina. */
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: all .3s ease;
}

.chatbot-overlay.show {
  opacity: 1;
  visibility: visible;
}

#chatbot-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 64px;
  height: 64px;
  background: var(--primary);
  color: #fff;
  border: 1.5px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(0, 118, 188, .45);
  z-index: 800;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition), visibility var(--transition);
  animation: chatPulse 3s ease infinite;
}

#chatbot-btn.hide-at-bottom {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#chatbot-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 30px rgba(0, 118, 188, .55);
  animation: haloPulsePrimary 1.5s infinite;
}

#chatbot-btn svg {
  width: 26px;
  height: 26px;
}

@keyframes bounce-panel {

  0%,
  100% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.04);
  }

  60% {
    transform: scale(0.97);
  }
}

.chatbot-emphasis {
  animation: bounce-panel 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 0 0 4px var(--primary-light), 0 24px 60px rgba(0, 0, 0, 0.2) !important;
}

@keyframes chatPulse {

  0%,
  100% {
    box-shadow: 0 6px 24px rgba(0, 118, 188, .45);
  }

  50% {
    box-shadow: 0 6px 30px rgba(0, 118, 188, .7), 0 0 0 8px rgba(0, 118, 188, .1);
  }
}

#chatbot-panel {
  position: fixed;
  bottom: 116px;
  right: 28px;
  width: 360px;
  max-width: calc(100vw - 56px);
  background: #0d1b2a;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, .08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
  /* Il pannello viene portato dopo l'overlay nel body e resta interattivo. */
  z-index: 99999;
  transform: translateY(20px) scale(.95);
  opacity: 0;
  visibility: hidden;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  max-height: 520px;
}

#chatbot-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  visibility: visible;
}

.chat-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(255, 255, 255, .08);
  border: none;
  color: rgba(255, 255, 255, .6);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.chat-close:hover {
  background: rgba(255, 255, 255, .15);
  color: #fff;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 48px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: .88rem;
  line-height: 1.55;
  animation: bubbleIn .25s ease;
}

.chat-bubble.bot {
  background: rgba(255, 255, 255, .08);
  color: #e8f0f8;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.chat-bubble.user {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-counter {
  font-size: .7rem;
  color: rgba(255, 255, 255, .35);
  text-align: left;
  padding: 0 0 2px 16px;
  height: 17px;
  line-height: 15px;
  overflow: hidden;
}

.chat-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: .88rem;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color var(--transition), height 0.15s ease;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(255, 255, 255, .06);
  color: #e8f0f8;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, .35);
}

.chat-input:focus {
  border-color: var(--primary);
}

.chat-send {
  background: var(--primary);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}

.chat-send:hover {
  background: var(--primary-dark);
}

.chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chat-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
}

.chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .4);
  animation: typing .9s ease infinite;
}

.chat-typing span:nth-child(2) {
  animation-delay: .15s;
}

.chat-typing span:nth-child(3) {
  animation-delay: .3s;
}

@keyframes typing {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: .4;
  }

  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* --- Printer Modal --- */
.printer-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  animation: modalFadeIn .3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.printer-modal {
  background: #fff;
  border-radius: 20px;
  max-width: 920px;
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .2);
  animation: modalSlideIn .35s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
}

.printer-modal-scroll {
  width: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  position: relative;
  flex: 1;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Closing Animations */
.printer-modal-overlay.closing {
  animation: modalFadeOut .3s ease forwards;
}

.printer-modal-overlay.closing .printer-modal {
  animation: modalSlideOut .3s cubic-bezier(.4, 0, .2, 1) forwards;
}

@keyframes modalFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes modalSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(30px) scale(.97);
  }
}

.printer-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: var(--surface-alt);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  z-index: 10;
  transition: all var(--transition);
}

.printer-modal-close:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.printer-modal .btn {
  min-height: 48px;
  padding: 10px 20px;
  line-height: 1.2;
}

.printer-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.printer-modal-img {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  border-right: 1px solid var(--border);
}

.printer-modal-img img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
}

.printer-modal-info {
  padding: 40px;
}

.printer-modal-tag {
  background: var(--primary-light);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
}

@media (max-width: 768px) {
  .printer-modal-overlay {
    padding: 16px;
  }

  .printer-modal-body {
    grid-template-columns: 1fr;
  }

  .printer-modal-img {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px;
  }

  .printer-modal-img img {
    max-height: 220px;
  }

  .printer-modal-info {
    padding: 20px;
  }

  .printer-modal {
    border-radius: 16px;
  }
}

/* --- Mappa Leaflet --- */
#map {
  width: 100%;
  height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-neuro);
}

/* --- Form --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  color: var(--dark);
  background: var(--surface);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 118, 188, .1);
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

/* --- Footer --- */
#footer {
  background: var(--primary);
  color: rgba(255, 255, 255, .85);
  padding: 64px 0 8px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-logo {
  height: 36px;
  margin-bottom: 16px;
}

.footer-desc {
  font-size: .88rem;
  line-height: 1.7;
  opacity: .7;
}

.footer-heading {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: .88rem;
  opacity: .7;
  transition: opacity var(--transition);
}

.footer-links a:hover {
  opacity: 1;
  color: var(--accent);
}

.footer-socials {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

.footer-socials a {
  color: rgba(255, 255, 255, .6);
  transition: color var(--transition);
}

.footer-socials a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 28px;
  padding-bottom: 24px;
  margin-top: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .8rem;
  opacity: .5;
}

.footer-bottom a {
  color: inherit;
  transition: color var(--transition);
}

.footer-bottom a:hover {
  color: var(--accent);
}

/* --- Google Badge --- */
.footer-google {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.google-badge-outer {
  display: inline-flex;
  padding: 1.5px;
  /* Bordo bianco esterno sottile */
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  margin: 0;
}

.google-badge-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  padding: 4px;
  /* Spessore del bordo colorato */
  background: conic-gradient(from -45deg,
      #EA4335 0deg 90deg,
      #4285F4 90deg 180deg,
      #34A853 180deg 270deg,
      #FBBC05 270deg 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.google-badge-content {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.google-badge-rating {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1;
  margin-bottom: 4px;
  font-family: sans-serif;
}

.google-badge-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 6px;
}

.google-badge-stars svg {
  width: 18px;
  height: 18px;
  fill: #FBBC05;
}

.google-badge-stars svg.half {
  fill: #FBBC05;
}

.google-badge-logo {
  font-family: Arial, sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
}

@media (max-width: 1024px) {
  :root {
    --nav-h: 60px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-contatti { order: 4; }
  .footer-google { order: 3; justify-content: flex-start; }

  .banner-content {
    padding: 60px 32px 80px;
  }

  .section {
    padding: 72px 0;
  }

  .grid-2-cols,
  .service-card-grid {
    grid-template-columns: 1fr !important;
    gap: 48px !important;
  }

  .grid-3-cols {
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
  }

  .carousel-wrapper {
    overflow: visible;
    /* Le frecce devono poter uscire leggermente se serve, ma non troppo */
  }

  .carousel-mobile-grid,
  .carousel-mobile-features {
    padding: 24px 0 32px !important;
    margin: -24px 0 -8px 0 !important;
    gap: 16px !important;
  }

  .carousel-mobile-grid::before,
  .carousel-mobile-features::before {
    content: "";
    flex: 0 0 80px;
    width: 80px;
  }

  .carousel-mobile-grid::after,
  .carousel-mobile-features::after {
    content: "";
    flex: 0 0 80px;
    width: 80px;
  }

  .carousel-mobile-grid>*,
  .carousel-mobile-features>* {
    flex: 0 0 280px !important;
    max-width: 80vw !important;
    scroll-snap-align: center !important;
  }
}

@media (max-width: 768px) {

  .banner-overlay-left,
  .banner-overlay-right {
    /* Su mobile trasformiamo il gradiente orizzontale in verticale. Aumentato per leggibilità scritte */
    background:
      linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .25)),
      linear-gradient(to top, rgba(0, 10, 25, .85) 0%, rgba(0, 10, 25, .4) 50%, rgba(0, 10, 25, .1) 100%) !important;
  }

  .grid-3-cols {
    grid-template-columns: 1fr !important;
  }

  .section {
    padding: 64px 0;
  }

  .banner-section {
    min-height: 45vh;
  }

  .page-hero {
    min-height: 35vh !important;
  }

  .page-hero-content .display,
  .banner-content .h1,
  .page-header .container .display {
    margin-bottom: 12px !important;
  }

  .banner-content {
    padding: 48px 24px 64px;
    max-width: 100%;
  }

  .page-hero-content {
    padding: 32px 24px 24px;
  }

  .nav-logo {
    position: static;
    transform: none;
    order: -1;
  }

  .nav-right {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }

  #chatbot-panel {
    width: calc(100vw - 72px);
    right: 16px;
    bottom: 104px;
  }

  /* Evita lo zoom automatico di Safari/iOS quando il campo riceve il focus. */
  .chat-input {
    font-size: 16px;
  }

  #chatbot-btn {
    bottom: 20px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 2rem;
  }
}

/* --- GTranslate Styling (Mimic old lang-btn) --- */
html[data-current-lang="it"] .gtranslate_wrapper a[data-gt-lang="it"],
html[data-current-lang="en"] .gtranslate_wrapper a[data-gt-lang="en"] {
  display: none !important;
}

.gtranslate_wrapper a {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff !important;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 5px 6px 5px 12px !important;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}

.gtranslate_wrapper a:hover {
  background: rgba(255, 255, 255, 0.25);
}

.gtranslate_wrapper a img {
  width: 20px !important;
  height: auto !important;
  border-radius: 2px;
  margin: 0 !important;
}

/* ============================================
   POPUP IMMAGINE
   ============================================ */

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 850;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.popup-overlay.show {
  opacity: 1;
  visibility: visible;
}

.popup-overlay.hide {
  opacity: 0;
  visibility: hidden;
}

.popup-box {
  position: relative;
  width: 100%;
  max-width: 500px;
  background: #fff;
  border-radius: 16px;
  isolation: isolate;
  margin: 40px auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  outline: 1px solid rgba(0, 0, 0, 0.07);
  outline-offset: -1px;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(.4, 0, .2, 1);
}

.popup-img {
  width: 100%;
  height: auto;
  display: block;
  flex-shrink: 0;
  border-radius: 16px;
}

.popup-overlay.show .popup-box {
  transform: scale(1) translateY(0);
}

.popup-overlay.hide .popup-box {
  transform: scale(0.92) translateY(20px);
}

.popup-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s ease;
}

.popup-close:hover {
  background: rgba(0, 0, 0, 0.75);
}

@media (max-width: 500px) {
  .popup-box {
    max-width: calc(100vw - 48px);
  }
}