/* ==========================================================================
   MG Clima — foglio di stile principale
   ========================================================================== */
/* Manrope self-hosted (variabile 400-800): evita il CSS bloccante di Google Fonts */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/manrope/manrope-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/manrope/manrope-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --mg-primary: #0069b4;
  --mg-primary-rgb: 0, 105, 180;
  --mg-primary-dark: #004f88;
  --mg-primary-light: #e8f2fa;
  --mg-accent: #3fa9f5;
  --mg-dark: #0b1d2e;
  --mg-dark-2: #102a42;
  --mg-text: #4c5c6b;
  --mg-title: #0b1d2e;
  --mg-border: #e2e8ef;
  --mg-soft: #f3f7fb;
  --mg-white: #fff;
  --mg-radius: 16px;
  --mg-radius-sm: 10px;
  --mg-shadow: 0 10px 30px rgba(11, 29, 46, .08);
  --mg-shadow-lg: 0 24px 50px rgba(11, 29, 46, .14);
  --mg-font: "Manrope", Helvetica, Arial, sans-serif;
  --mg-header-h: 88px;
  --mg-ease: cubic-bezier(.22, .61, .36, 1);
}

html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  font-family: var(--mg-font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--mg-text);
  background: var(--mg-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--mg-font);
  color: var(--mg-title);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
}
a { color: var(--mg-primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--mg-primary-dark); }
img { max-width: 100%; height: auto; }
::selection { background: var(--mg-primary); color: #fff; }

.mg-skip-link { position: absolute; top: 10px; left: 10px; z-index: 2000; background: var(--mg-primary); color: #fff; padding: .5rem 1rem; border-radius: 8px; }

/* ---------- Utility ---------- */
.mg-section { padding: 100px 0; }
.mg-section-sm { padding: 70px 0; }
.mg-bg-soft { background: var(--mg-soft); }
.mg-section-head { max-width: 760px; margin: 0 auto 50px; }
.mg-section-head.d-flex { max-width: none; }
.mg-section-head:not(.text-center):not(.d-flex) { margin-left: 0; }
.mg-section-title { font-size: clamp(1.75rem, 3.4vw, 2.6rem); font-weight: 800; margin-bottom: 1.1rem; }
.mg-lead { font-size: 1.08rem; color: var(--mg-text); }
.mg-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mg-primary);
  margin-bottom: .9rem;
}
.mg-eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }
.text-center .mg-eyebrow::after { content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }
.mg-eyebrow-light { color: #cfe6f7; }
.mg-divider { display: block; width: 60px; height: 3px; border-radius: 3px; background: var(--mg-primary); margin: 2rem 0; }
.mg-sticky { position: sticky; top: 110px; }
.mg-rounded-img { border-radius: var(--mg-radius); width: 100%; object-fit: cover; }

/* ---------- Bottoni ---------- */
.btn-mg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .85rem 1.6rem;
  border-radius: 50px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background .25s var(--mg-ease), color .25s var(--mg-ease), border-color .25s var(--mg-ease), transform .25s var(--mg-ease), box-shadow .25s var(--mg-ease);
  white-space: nowrap;
}
.btn-mg svg { width: 18px; height: 18px; flex-shrink: 0; transition: transform .25s var(--mg-ease); }
.btn-mg:hover svg { transform: translateX(3px); }
.btn-mg-sm { padding: .6rem 1.15rem; font-size: .88rem; }
.btn-mg-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-mg-primary { background: var(--mg-primary); color: #fff; box-shadow: 0 8px 20px rgba(var(--mg-primary-rgb), .28); }
.btn-mg-primary:hover, .btn-mg-primary:focus { background: var(--mg-primary-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(var(--mg-primary-rgb), .38); }
.btn-mg-outline { background: transparent; color: var(--mg-primary); border-color: rgba(var(--mg-primary-rgb), .35); }
.btn-mg-outline:hover, .btn-mg-outline:focus { background: var(--mg-primary); border-color: var(--mg-primary); color: #fff; }
.btn-mg-white { background: #fff; color: var(--mg-primary); }
.btn-mg-white:hover, .btn-mg-white:focus { background: var(--mg-dark); color: #fff; transform: translateY(-2px); }
.btn-mg-white-outline { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .6); backdrop-filter: blur(4px); }
.btn-mg-white-outline:hover, .btn-mg-white-outline:focus { background: #fff; color: var(--mg-primary); border-color: #fff; }
.btn-mg:focus-visible, .mg-nav-link:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid rgba(var(--mg-primary-rgb), .45); outline-offset: 3px; }

/* ---------- Header ---------- */
.mg-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1030;
  padding: 14px 0;
  transition: background .3s ease, box-shadow .3s ease, padding .3s ease;
}
.mg-header::before {
  content: "";
  position: absolute; inset: 0 0 -40px 0;
  background: linear-gradient(180deg, rgba(5, 18, 32, .55), rgba(5, 18, 32, 0));
  pointer-events: none;
  transition: opacity .3s ease;
}
.mg-header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.mg-logo { display: inline-flex; align-items: center; gap: .8rem; color: #fff; flex-shrink: 0; }
.mg-logo img { width: 60px; height: 60px; transition: width .3s ease, height .3s ease; }
.mg-logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.mg-logo-text strong { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; color: #fff; transition: color .3s ease; }
.mg-logo-text small { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .75); transition: color .3s ease; }
.mg-logo:hover { color: #fff; }

.mg-nav-list { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.mg-nav-item { position: relative; display: flex; align-items: center; }
.mg-nav-link {
  display: inline-block;
  padding: .6rem .95rem;
  font-weight: 600;
  font-size: .96rem;
  color: #fff;
  border-radius: 50px;
  transition: color .2s ease, background .2s ease;
}
.mg-nav-link:hover, .mg-nav-item.active > .mg-nav-link { color: #fff; background: rgba(255, 255, 255, .14); }
.mg-nav-toggle { background: none; border: 0; padding: 0 .2rem 0 0; margin-left: -.55rem; color: #fff; display: inline-flex; }
.mg-nav-toggle svg { width: 16px; height: 16px; transition: transform .25s ease; }
/* voci con sottomenu: lo sfondo è sulla voce intera, così include anche la freccia */
.mg-nav .mg-nav-item.has-dropdown { border-radius: 50px; transition: background .2s ease; }
.mg-nav .mg-nav-item.has-dropdown > .mg-nav-link { padding-right: .3rem; background: none !important; }
.mg-nav .mg-nav-item.has-dropdown > .mg-nav-toggle { margin-left: 0; padding: 0 .8rem 0 0; align-self: stretch; align-items: center; }
.mg-nav .mg-nav-item.has-dropdown:hover, .mg-nav .mg-nav-item.has-dropdown.active { background: rgba(255, 255, 255, .14); }
.mg-header.is-scrolled .mg-nav .mg-nav-item.has-dropdown:hover, .mg-header.is-scrolled .mg-nav .mg-nav-item.has-dropdown.active,
.mg-header.is-light:not(.is-scrolled) .mg-nav .mg-nav-item.has-dropdown:hover, .mg-header.is-light:not(.is-scrolled) .mg-nav .mg-nav-item.has-dropdown.active { background: var(--mg-primary-light); }
.mg-header.is-scrolled .mg-nav .mg-nav-item.has-dropdown:hover > .mg-nav-toggle, .mg-header.is-scrolled .mg-nav .mg-nav-item.has-dropdown.active > .mg-nav-toggle,
.mg-header.is-light:not(.is-scrolled) .mg-nav .mg-nav-item.has-dropdown:hover > .mg-nav-toggle, .mg-header.is-light:not(.is-scrolled) .mg-nav .mg-nav-item.has-dropdown.active > .mg-nav-toggle { color: var(--mg-primary); }
.mg-header.is-scrolled .mg-nav .mg-nav-item.has-dropdown:hover > .mg-nav-link, .mg-header.is-light:not(.is-scrolled) .mg-nav .mg-nav-item.has-dropdown:hover > .mg-nav-link { color: var(--mg-primary); }
.mg-nav .mg-nav-item.has-dropdown:hover .mg-nav-toggle svg { transform: rotate(180deg); }
.mg-nav .mg-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 250px;
  list-style: none;
  margin: 0;
  padding: .6rem;
  background: #fff;
  border-radius: var(--mg-radius-sm);
  box-shadow: var(--mg-shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.mg-nav .mg-dropdown::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.mg-nav .mg-nav-item.has-dropdown:hover .mg-dropdown,
.mg-nav .mg-nav-item.has-dropdown:focus-within .mg-dropdown,
.mg-nav .mg-nav-item.has-dropdown.open .mg-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.mg-nav .mg-dropdown a { display: block; padding: .6rem .9rem; border-radius: 8px; color: var(--mg-title); font-weight: 600; font-size: .93rem; }
.mg-nav .mg-dropdown a:hover, .mg-nav .mg-dropdown a.active { background: var(--mg-primary-light); color: var(--mg-primary); }

.mg-header-actions { display: flex; align-items: center; gap: 1rem; }
.mg-header-phone { align-items: center; gap: .5rem; color: #fff; font-weight: 700; font-size: .95rem; }
.mg-header-phone svg { width: 18px; height: 18px; fill: currentColor; }
.mg-header-phone:hover { color: #cfe6f7; }

.mg-burger { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--mg-primary); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.mg-burger span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }

/* header "solido" dopo lo scroll */
.mg-header.is-scrolled { background: rgba(255, 255, 255, .97); box-shadow: 0 6px 24px rgba(11, 29, 46, .08); padding: 8px 0; backdrop-filter: blur(8px); }
.mg-header.is-scrolled::before { opacity: 0; }
.mg-header.is-scrolled .mg-logo img { width: 50px; height: 50px; }
/* logo: negative sulla testata trasparente, normale sulla testata bianca */
.mg-header .mg-logo-normal { display: none; }
.mg-header.is-scrolled .mg-logo-negative, .mg-header.is-light .mg-logo-negative { display: none; }
.mg-header.is-scrolled .mg-logo-normal, .mg-header.is-light .mg-logo-normal { display: block; }
.mg-header.is-scrolled .mg-logo-text strong { color: var(--mg-title); }
.mg-header.is-scrolled .mg-logo-text small { color: var(--mg-text); }
.mg-header.is-scrolled .mg-nav-link, .mg-header.is-scrolled .mg-nav-toggle, .mg-header.is-scrolled .mg-header-phone { color: var(--mg-title); }
.mg-header.is-scrolled .mg-nav-link:hover, .mg-header.is-scrolled .mg-nav-item.active > .mg-nav-link { color: var(--mg-primary); background: var(--mg-primary-light); }

/* offcanvas mobile */
.mg-offcanvas { width: min(380px, 88vw) !important; border-left: 0 !important; }
.mg-offcanvas .offcanvas-header { padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--mg-border); }
.mg-offcanvas .offcanvas-body { padding: 1rem 1.4rem 2rem; display: flex; flex-direction: column; }
.mg-offcanvas-close { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--mg-border); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--mg-title); }
.mg-offcanvas-close svg { width: 18px; height: 18px; }
.mg-mobile-nav { list-style: none; margin: 0; padding: 0; }
.mg-mobile-nav .mg-nav-item { flex-wrap: wrap; justify-content: space-between; border-bottom: 1px solid var(--mg-border); }
.mg-mobile-nav .mg-nav-link { color: var(--mg-title); padding: .95rem 0; font-size: 1.05rem; border-radius: 0; flex: 1; }
.mg-mobile-nav .mg-nav-link:hover, .mg-mobile-nav .mg-nav-item.active > .mg-nav-link { background: none; color: var(--mg-primary); }
.mg-mobile-nav .mg-nav-toggle { color: var(--mg-title); margin: 0; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; background: var(--mg-soft); padding: 0; }
.mg-mobile-nav .mg-nav-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.mg-mobile-nav .mg-dropdown { list-style: none; margin: 0; padding: 0 0 .8rem .8rem; width: 100%; display: none; }
.mg-mobile-nav .mg-nav-item.open .mg-dropdown { display: block; }
.mg-mobile-nav .mg-dropdown a { display: block; padding: .45rem 0; color: var(--mg-text); font-weight: 600; }
.mg-mobile-nav .mg-dropdown a.active, .mg-mobile-nav .mg-dropdown a:hover { color: var(--mg-primary); }
.mg-offcanvas-contacts { margin-top: auto; padding-top: 2rem; display: flex; flex-direction: column; gap: .9rem; }
.mg-offcanvas-contacts > a:not(.btn-mg) { display: flex; align-items: center; gap: .7rem; color: var(--mg-title); font-weight: 600; }
.mg-offcanvas-contacts svg { width: 18px; height: 18px; fill: var(--mg-primary); }

/* ---------- Hero slider ---------- */
.mg-hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; background: var(--mg-dark); overflow: hidden; }
/* Chrome esclude dall'LCP le immagini che coprono l'intero viewport (le tratta da sfondo):
   lo slider è 1px più basso della hero, così la foto conta come LCP al posto del banner cookie */
.mg-hero-swiper { width: 100%; height: calc(100% - 1px); }
.mg-hero-slide { position: relative; display: flex; align-items: center; overflow: hidden; }
.mg-hero-slide picture, .mg-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mg-hero-bg { object-fit: cover; transform: scale(1.12); transition: transform 7s linear; }
.mg-hero-slide.swiper-slide-active .mg-hero-bg { transform: scale(1); }
.mg-hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 18, 32, .55) 0%, rgba(5, 18, 32, .45) 50%, rgba(5, 18, 32, .7) 100%); }
.mg-hero-content { position: relative; z-index: 2; color: #fff; padding-top: 60px; }
.mg-hero-title { font-size: clamp(2.3rem, 6vw, 4.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; color: #fff; margin-bottom: 1.2rem; }
.mg-hero-subtitle { font-size: clamp(1.02rem, 1.6vw, 1.3rem); color: rgba(255, 255, 255, .88); max-width: 720px; margin: 0 auto 2.2rem; }
.mg-hero-buttons { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.mg-hero-slide .mg-eyebrow, .mg-hero-slide .mg-hero-title, .mg-hero-slide .mg-hero-subtitle, .mg-hero-slide .mg-hero-buttons { opacity: 0; transform: translateY(30px); transition: opacity .8s var(--mg-ease), transform .8s var(--mg-ease); }
/* prima dell'init di Swiper le slide successive alla prima restano nascoste: le loro immagini lazy non partono e non tolgono banda all'LCP */
.mg-hero-swiper:not(.swiper-initialized) .mg-hero-slide:not(:first-child) { display: none; }
/* prima dell'avvio di Swiper (script caricati dopo l'evento load) i testi della prima slide sono già visibili */
.mg-hero-swiper:not(.swiper-initialized) .mg-hero-slide:first-child :is(.mg-eyebrow, .mg-hero-title, .mg-hero-subtitle, .mg-hero-buttons) { opacity: 1; transform: none; transition: none; }
.mg-hero-slide.swiper-slide-active .mg-eyebrow { opacity: 1; transform: none; transition-delay: .2s; }
.mg-hero-slide.swiper-slide-active .mg-hero-title { opacity: 1; transform: none; transition-delay: .35s; }
.mg-hero-slide.swiper-slide-active .mg-hero-subtitle { opacity: 1; transform: none; transition-delay: .5s; }
.mg-hero-slide.swiper-slide-active .mg-hero-buttons { opacity: 1; transform: none; transition-delay: .65s; }
.mg-hero-nav {
  position: absolute; top: 50%; z-index: 5;
  width: 56px; height: 56px; margin-top: -28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  transition: background .25s ease, border-color .25s ease;
}
.mg-hero-nav svg { width: 22px; height: 22px; }
.mg-hero-nav:hover { background: var(--mg-primary); border-color: var(--mg-primary); }
.mg-hero-prev { left: 30px; }
.mg-hero-next { right: 30px; }
.mg-hero-pagination { position: absolute; left: 0; right: 0; bottom: 42px !important; z-index: 5; display: flex; justify-content: center; gap: 0; }
/* area cliccabile 24px (target-size WCAG): il pallino visibile resta 12px grazie a padding + background-clip */
.mg-hero-pagination .swiper-pagination-bullet { width: 12px; height: 12px; padding: 6px; box-sizing: content-box; background-clip: content-box; margin: 0 !important; background: #fff; opacity: .45; transition: width .3s ease, opacity .3s ease; border-radius: 12px; }
.mg-hero-pagination .swiper-pagination-bullet-active { width: 36px; opacity: 1; background: #fff; }
.mg-hero-scroll { position: absolute; left: 50%; bottom: 90px; z-index: 5; width: 26px; height: 42px; margin-left: -13px; border: 2px solid rgba(255, 255, 255, .7); border-radius: 20px; }
.mg-hero-scroll span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 4px; background: #fff; animation: mg-scroll 1.8s ease-in-out infinite; }
@keyframes mg-scroll { 0% { opacity: 1; transform: translateY(0); } 80% { opacity: 0; transform: translateY(12px); } 100% { opacity: 0; } }

/* ---------- Page banner ---------- */
.mg-page-banner {
  position: relative;
  overflow: hidden;
  padding: calc(var(--mg-header-h) + 90px) 0 70px;
  background: radial-gradient(circle at 85% 20%, rgba(63, 169, 245, .35), transparent 45%), linear-gradient(135deg, var(--mg-primary-dark) 0%, var(--mg-primary) 60%, #1a86d1 100%);
  color: #fff;
}
.mg-page-banner.has-image { background: var(--mg-dark); }
/* testata alta: 2/3 dell'altezza della finestra, contenuti allineati in basso */
.mg-page-banner.mg-page-banner-tall {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 66.667vh;
  min-height: 66.667svh;
  padding: calc(var(--mg-header-h) + 40px) 0 60px;
}
.mg-page-banner.mg-page-banner-tall > .container { width: 100%; }
.mg-page-banner-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.mg-page-banner.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 45, 80, .82) 0%, rgba(0, 57, 99, .55) 45%, rgba(0, 79, 136, .2) 100%); }
.mg-page-banner .container { z-index: 2; }
.mg-page-banner-shape { position: absolute; right: -8%; top: -30%; width: 55%; height: 170%; transform: skewX(-18deg); background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02)); z-index: 1; }
.mg-page-banner-shape::after { content: ""; position: absolute; left: -22%; top: 0; width: 18%; height: 100%; background: rgba(255, 255, 255, .05); }
.mg-page-banner h1 { color: #fff; font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: .8rem; }
.mg-page-banner-subtitle { font-size: clamp(1.02rem, 1.6vw, 1.22rem); color: rgba(255, 255, 255, .88); max-width: 680px; margin-bottom: 1.2rem; }
.mg-page-banner-meta { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; color: #cfe6f7; margin-bottom: 1rem; }
.mg-page-banner-meta svg { width: 18px; height: 18px; fill: currentColor; }
.mg-page-banner-claim { text-align: right; font-size: .82rem; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; color: rgba(255, 255, 255, .7); line-height: 2; margin: 0 0 .5rem; }
.mg-page-banner-claim::after { content: ""; display: block; width: 50px; height: 2px; background: rgba(255, 255, 255, .6); margin: 1rem 0 0 auto; }
.mg-breadcrumbs nav { justify-content: flex-start !important; }
.mg-breadcrumbs .breadcrumb { margin: .4rem 0 0; font-size: .9rem; font-weight: 600; }
.mg-breadcrumbs .breadcrumb-item, .mg-breadcrumbs .breadcrumb-item a { color: rgba(255, 255, 255, .8); }
.mg-breadcrumbs .breadcrumb-item a:hover { color: #fff; }
.mg-breadcrumbs .breadcrumb-item.active, .mg-breadcrumbs .breadcrumb-item:last-child { color: #fff; }
.mg-breadcrumbs .breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, .5); }

/* ---------- Home: about ---------- */
.mg-about-media { position: relative; border-radius: var(--mg-radius); }
.mg-about-media img { width: 100%; aspect-ratio: 4 / 3.3; object-fit: cover; border-radius: var(--mg-radius); box-shadow: var(--mg-shadow-lg); }
#mg-home-about .mg-about-media img { aspect-ratio: 3 / 4; }
.mg-about-media-vertical img { aspect-ratio: 3 / 4; }
.mg-fade { position: relative; aspect-ratio: 3 / 4; border-radius: var(--mg-radius); box-shadow: var(--mg-shadow-lg); overflow: hidden; }
.mg-fade img { position: absolute; inset: 0; height: 100%; box-shadow: none; opacity: 0; transition: opacity 1.2s ease; }
.mg-fade img.is-active { opacity: 1; }
.mg-about-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.1rem; }
.mg-about-heading .mg-section-title { margin-bottom: 0; }
.mg-about-logo { flex: 0 0 auto; width: clamp(80px, 9vw, 120px); height: auto; }
.mg-about-headquarters { margin-bottom: 0; }
.mg-about-headquarters img { display: block; width: 100%; height: auto; aspect-ratio: 1690 / 931; object-fit: cover; border-radius: var(--mg-radius); box-shadow: var(--mg-shadow-lg); }
.mg-about-badge {
  position: absolute; right: -14px; bottom: -24px;
  background: var(--mg-primary); color: #fff;
  padding: 1.1rem 1.4rem; border-radius: var(--mg-radius-sm);
  box-shadow: 0 16px 30px rgba(var(--mg-primary-rgb), .35);
  display: flex; flex-direction: column; line-height: 1.2; max-width: 210px;
}
.mg-about-badge strong { font-size: 2rem; font-weight: 800; }
.mg-about-badge span { font-size: .85rem; font-weight: 600; opacity: .9; line-height: 1.6; text-transform: uppercase; letter-spacing: .06em; margin-top: .3rem; }
.mg-features { list-style: none; padding: 0; margin: 1.8rem 0 2.2rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.3rem 1.6rem; }
.mg-features li { display: flex; gap: .85rem; font-size: .92rem; line-height: 1.5; }
.mg-features strong { display: block; color: var(--mg-title); font-size: 1rem; margin-bottom: .2rem; }
.mg-features-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--mg-primary-light); color: var(--mg-primary); display: inline-flex; align-items: center; justify-content: center; }
.mg-features-icon svg { width: 24px; height: 24px; fill: currentColor; }
.mg-features-icon svg [fill="none"] { fill: none; }

/* ---------- Service cards (home slider) ---------- */
.mg-slider-wrap { position: relative; }
.mg-home-services { overflow: hidden; }
@media (min-width: 1200px) {
  .mg-container-wide { max-width: min(1560px, calc(100vw - 48px)); }
}
/* padding generoso per non tagliare l'ombra e il sollevamento in hover dei box */
.mg-services-swiper { padding: 20px 24px 70px !important; margin: -20px -24px -50px; }
.mg-service-card { height: 100%; display: flex; flex-direction: column; background: #fff; border-radius: var(--mg-radius); overflow: hidden; box-shadow: var(--mg-shadow); transition: transform .35s var(--mg-ease), box-shadow .35s var(--mg-ease); }
.mg-service-card:hover { transform: translateY(-6px); box-shadow: var(--mg-shadow-lg); }
.mg-service-card-image { display: block; overflow: hidden; aspect-ratio: 16 / 10; }
.mg-service-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--mg-ease); }
.mg-service-card:hover .mg-service-card-image img { transform: scale(1.06); }
.mg-service-card-body { position: relative; display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 2.4rem 1.6rem 1.6rem; }
.mg-service-card-icon { position: absolute; top: -30px; left: 1.6rem; width: 60px; height: 60px; border-radius: 16px; background: var(--mg-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 10px 22px rgba(var(--mg-primary-rgb), .35); }
.mg-service-card-icon svg { width: 32px; height: 32px; }
.mg-service-card-title { font-size: 1.3rem; margin-top: .9rem; margin-bottom: .6rem; }
.mg-service-card-title a { color: inherit; }
.mg-service-card-title a:hover { color: var(--mg-primary); }
.mg-service-card-body p { font-size: .94rem; margin-bottom: 1.4rem; }
.mg-slider-nav { position: absolute; top: 45%; z-index: 5; width: 50px; height: 50px; border-radius: 50%; border: 0; background: #fff; color: var(--mg-primary); box-shadow: var(--mg-shadow); display: inline-flex; align-items: center; justify-content: center; transition: background .25s ease, color .25s ease; }
.mg-slider-nav svg { width: 20px; height: 20px; }
.mg-slider-nav:hover { background: var(--mg-primary); color: #fff; }
.mg-slider-nav.swiper-button-disabled { opacity: .35; pointer-events: none; }
/* frecce nascoste quando tutti i box sono visibili */
.mg-slider-nav.swiper-button-lock { display: none; }
.mg-slider-prev { left: -70px; }
.mg-slider-next { right: -70px; }
.mg-slider-pagination { display: flex; justify-content: center; gap: 0; margin-top: 1.4rem; }
.mg-slider-pagination .swiper-pagination-bullet { width: 10px; height: 10px; padding: 7px; box-sizing: content-box; background-clip: content-box; margin: 0 !important; background: var(--mg-primary); opacity: .25; border-radius: 10px; transition: width .3s ease, opacity .3s ease; }
.mg-slider-pagination .swiper-pagination-bullet-active { width: 28px; opacity: 1; }
.mg-slider-pagination.swiper-pagination-lock { display: none; }

/* ---------- Services page ---------- */
.mg-service-row { width: 100%; display: flex; gap: 1.6rem; align-items: center; background: #fff; border: 1px solid var(--mg-border); border-radius: var(--mg-radius); padding: 1.4rem; transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease; }
.mg-service-row:hover { border-color: transparent; box-shadow: var(--mg-shadow-lg); transform: translateY(-4px); }
.mg-service-row-media { flex-shrink: 0; width: 130px; height: 130px; border-radius: 14px; overflow: hidden; background: var(--mg-primary-light); display: flex; align-items: center; justify-content: center; color: var(--mg-primary); }
.mg-service-row-media img { width: 100%; height: 100%; object-fit: cover; }
.mg-service-row-icon svg { width: 64px; height: 64px; }
.mg-service-row-body h3 { font-size: 1.2rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .4rem; }
.mg-service-row-body h3 a { color: inherit; }
.mg-service-row-body h3 a:hover { color: var(--mg-primary); }
.mg-service-row-body p { font-size: .94rem; margin-bottom: 1rem; }

/* ---------- Content (Htmlarea) ---------- */
.mg-content > *:last-child { margin-bottom: 0; }
.mg-content p { margin-bottom: 1.1rem; }
.mg-content h2, .mg-content h3, .mg-content h4 { margin: 2rem 0 .9rem; }
.mg-content h2 { font-size: 1.7rem; }
.mg-content h3 { font-size: 1.35rem; }
.mg-content h4 { font-size: 1.12rem; }
.mg-content > h2:first-child, .mg-content > h3:first-child, .mg-content > h4:first-child { margin-top: 0; }
.mg-content strong { color: var(--mg-title); }
.mg-content ul { list-style: none; padding-left: 0; margin-bottom: 1.3rem; }
.mg-content ul li { position: relative; padding-left: 1.8rem; margin-bottom: .6rem; }
.mg-content ul li::before { content: ""; position: absolute; left: 0; top: .5em; width: 18px; height: 18px; border-radius: 50%; background: var(--mg-primary-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='%230069b4' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; transform: translateY(-15%); }
.mg-content ol { padding-left: 1.2rem; }
.mg-content a { text-decoration: underline; text-underline-offset: 3px; }
.mg-content em { color: var(--mg-text); }
.mg-content img { border-radius: var(--mg-radius-sm); }

/* ---------- Service detail ---------- */
.mg-gallery-main { border-radius: var(--mg-radius); overflow: hidden; background: var(--mg-soft); min-width: 0; }
.mg-gallery-main img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.mg-gallery-thumbs-wrap { display: flex; align-items: center; gap: .6rem; margin-top: .8rem; }
/* min-width: 0 evita che Swiper, dentro un contenitore flex, si allarghi senza limiti */
.mg-gallery-thumbs { flex: 1; min-width: 0; }
.mg-gallery-thumbs .swiper-slide { border-radius: 10px; overflow: hidden; cursor: pointer; opacity: .55; transition: opacity .25s ease; border: 2px solid transparent; }
.mg-gallery-thumbs .swiper-slide-thumb-active { opacity: 1; border-color: var(--mg-primary); }
.mg-gallery-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.mg-gallery-nav { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--mg-border); background: #fff; color: var(--mg-title); display: inline-flex; align-items: center; justify-content: center; }
.mg-gallery-nav svg { width: 16px; height: 16px; }
.mg-gallery-nav:hover { background: var(--mg-primary); border-color: var(--mg-primary); color: #fff; }
.mg-check-box { margin-top: 2rem; padding: 1.8rem; border: 1px solid var(--mg-border); border-radius: var(--mg-radius); background: var(--mg-soft); }
.mg-check-list { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; gap: .75rem; }
.mg-check-list li { display: flex; align-items: center; gap: .8rem; font-weight: 600; color: var(--mg-title); }
.mg-check-list li span { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--mg-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.mg-check-list li svg { width: 14px; height: 14px; }
.mg-mini-service { display: flex; align-items: center; gap: 1rem; padding: 1.2rem 1.3rem; border-radius: var(--mg-radius); background: #fff; border: 1px solid var(--mg-border); color: var(--mg-title); height: 100%; transition: all .3s ease; }
.mg-mini-service > svg { width: 20px; height: 20px; margin-left: auto; flex-shrink: 0; color: var(--mg-primary); transition: transform .3s ease; }
.mg-mini-service strong { display: block; font-size: 1.05rem; }
.mg-mini-service small { display: block; color: var(--mg-text); font-size: .85rem; line-height: 1.4; margin-top: .15rem; }
.mg-mini-service:hover { border-color: var(--mg-primary); box-shadow: var(--mg-shadow); color: var(--mg-title); }
.mg-mini-service:hover > svg { transform: translateX(4px); }
.mg-mini-service-icon { flex-shrink: 0; width: 54px; height: 54px; border-radius: 14px; background: var(--mg-primary-light); color: var(--mg-primary); display: inline-flex; align-items: center; justify-content: center; }
.mg-mini-service-icon svg { width: 30px; height: 30px; }

/* video */
.mg-video-poster { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: var(--mg-radius); overflow: hidden; background: var(--mg-dark); aspect-ratio: 16 / 9; }
.mg-video-poster img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: transform .6s var(--mg-ease), opacity .3s ease; }
.mg-video-poster:hover img { transform: scale(1.04); opacity: 1; }
.mg-video-play { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%; background: var(--mg-primary); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 12px rgba(255, 255, 255, .2); transition: transform .3s ease; }
.mg-video-play svg { width: 32px; height: 32px; fill: currentColor; margin-left: 4px; }
.mg-video-poster:hover .mg-video-play { transform: scale(1.08); }
.mg-video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--mg-radius); display: block; }
.mg-video-caption { font-size: .9rem; margin: .6rem 0 0; text-align: center; }

/* documenti */
.mg-doc-card { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; padding: 1.6rem; border: 1px solid var(--mg-border); border-radius: var(--mg-radius); background: #fff; color: var(--mg-title); transition: all .3s ease; }
.mg-doc-card:hover { border-color: var(--mg-primary); box-shadow: var(--mg-shadow); color: var(--mg-title); transform: translateY(-4px); }
.mg-doc-card-icon { width: 54px; height: 54px; border-radius: 14px; background: var(--mg-primary-light); color: var(--mg-primary); display: inline-flex; align-items: center; justify-content: center; }
.mg-doc-card-icon svg { width: 28px; height: 28px; fill: currentColor; }
.mg-doc-card-name { font-weight: 700; line-height: 1.35; word-break: break-word; }
.mg-doc-card-link { margin-top: auto; display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; font-weight: 700; color: var(--mg-primary); }
.mg-doc-card-link svg { width: 16px; height: 16px; }
.mg-file-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .6rem; }
.mg-file-list a { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.1rem; border: 1px solid var(--mg-border); border-radius: var(--mg-radius-sm); color: var(--mg-title); font-weight: 600; }
.mg-file-list a svg { width: 20px; height: 20px; flex-shrink: 0; fill: var(--mg-primary); color: var(--mg-primary); }
.mg-file-list a svg:last-child { margin-left: auto; fill: none; }
.mg-file-list a:hover { border-color: var(--mg-primary); background: var(--mg-primary-light); }

/* ---------- Form ---------- */
.mg-form-box { background: #fff; border-radius: var(--mg-radius); padding: 2.4rem; box-shadow: var(--mg-shadow-lg); }
.mg-form-box-title { font-size: 1.6rem; font-weight: 800; margin-bottom: .6rem; }
.mg-form label, .mg-form .form-label { font-weight: 600; font-size: .9rem; color: var(--mg-title); margin-bottom: .35rem; }
.mg-form .form-control, .mg-form .form-select, .mg-form input[type="text"], .mg-form input[type="email"], .mg-form input[type="tel"], .mg-form select, .mg-form textarea {
  border: 1px solid var(--mg-border);
  border-radius: var(--mg-radius-sm);
  padding: .8rem 1rem;
  font-size: .95rem;
  background-color: var(--mg-soft);
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.mg-form .form-control:focus, .mg-form .form-select:focus, .mg-form input:focus, .mg-form select:focus, .mg-form textarea:focus { border-color: var(--mg-primary); background-color: #fff; box-shadow: 0 0 0 4px rgba(var(--mg-primary-rgb), .12); outline: 0; }
/* label flottanti: niente riquadro bianco dietro la label di textarea e select */
.mg-form .form-floating > label::after { background-color: transparent !important; }
.mg-form .form-floating > label { background: transparent; }
/* padding dei campi flottanti: spazio tra label e valore */
.mg-form .form-floating > .form-control, .mg-form .form-floating > .form-select { padding: 1.7rem 1rem .6rem; }
.mg-form .form-floating > .form-control:not(:focus):placeholder-shown { padding-top: 1rem; padding-bottom: 1rem; }
.mg-form .form-floating > textarea.form-control:not(:focus):placeholder-shown { padding-top: 1.7rem; }
.mg-form .form-floating > label { padding: 1rem 1rem; }
/* textarea del messaggio più alta */
.mg-form .form-floating > textarea#message { height: 180px; min-height: 180px; resize: vertical; }
.mg-form .form-check-input:checked { background-color: var(--mg-primary); border-color: var(--mg-primary); }
.mg-form .form-check-label, .mg-form .form-check { font-size: .88rem; font-weight: 500; }
.mg-form .invalid-feedback, .mg-form .text-danger { font-size: .82rem; }
.mg-form-contacts { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.2rem; }
.mg-form-contacts li { display: flex; align-items: center; gap: 1rem; line-height: 1.45; font-size: .95rem; }
.mg-form-contacts strong { display: block; color: var(--mg-title); }
.mg-form-contacts a { color: var(--mg-text); }
.mg-form-contacts a:hover { color: var(--mg-primary); }
.mg-icon-circle { flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%; background: var(--mg-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.mg-icon-circle svg { width: 22px; height: 22px; fill: currentColor; }
.mg-icon-whatsapp { background: #25d366; }

/* ---------- News ---------- */
.mg-news-card { width: 100%; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--mg-border); border-radius: var(--mg-radius); overflow: hidden; transition: transform .35s var(--mg-ease), box-shadow .35s var(--mg-ease), border-color .35s ease; }
.mg-news-card:hover { transform: translateY(-6px); box-shadow: var(--mg-shadow-lg); border-color: transparent; }
.mg-news-card-image { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.mg-news-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--mg-ease); }
.mg-news-card:hover .mg-news-card-image img { transform: scale(1.06); }
.mg-news-card-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding: 1.6rem; }
.mg-news-card-meta { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mg-primary); margin-bottom: .7rem; }
.mg-news-card-meta svg { width: 15px; height: 15px; fill: currentColor; }
.mg-news-card-title { font-size: 1.2rem; margin-bottom: .6rem; }
.mg-news-card-title a { color: inherit; }
.mg-news-card-title a:hover { color: var(--mg-primary); }
.mg-news-card-text { font-size: .94rem; margin-bottom: 1.3rem; }
/* slider news della home: padding per non tagliare ombra e sollevamento in hover */
.mg-home-news { overflow: hidden; }
.mg-news-swiper { padding: 20px 24px 70px !important; margin: -20px -24px -50px; }
.mg-article-cover { margin: 0 0 2rem; border-radius: var(--mg-radius); overflow: hidden; }
.mg-article-cover img { width: 100%; display: block; }
.mg-article-content { font-size: 1.04rem; }
.mg-article-paragraph { margin-top: 2.5rem; }
.mg-article-paragraph > h2 { font-size: 1.7rem; margin-bottom: 1rem; }
.mg-article-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; margin-top: 1.8rem; }
.mg-article-gallery a { display: block; border-radius: var(--mg-radius-sm); overflow: hidden; }
.mg-article-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .5s var(--mg-ease); }
.mg-article-gallery a:hover img { transform: scale(1.07); }
.mg-article-files { margin-top: 2.5rem; }
.mg-article-back { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--mg-border); }
.mg-article-back .btn-mg:hover svg { transform: translateX(-3px); }
.mg-pager .pagination { justify-content: center; gap: .4rem; flex-wrap: wrap; }
.mg-pager .page-link { border: 1px solid var(--mg-border); border-radius: 50% !important; color: var(--mg-title); min-width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.mg-pager .page-link:hover { background: var(--mg-primary-light); color: var(--mg-primary); }
.mg-pager .page-item.active .page-link { background: var(--mg-primary); border-color: var(--mg-primary); color: #fff; }
.mg-pager small { display: block; text-align: center; margin-top: .8rem; }

/* sidebar */
.mg-side-box { padding: 1.8rem; border-radius: var(--mg-radius); background: var(--mg-soft); }
.mg-side-box-title { font-size: 1.15rem; font-weight: 800; color: var(--mg-title); margin-bottom: 1rem; }
.mg-side-box-primary { background: linear-gradient(135deg, var(--mg-primary-dark), var(--mg-primary)); color: rgba(255, 255, 255, .88); }
.mg-side-box-primary .mg-side-box-title { color: #fff; }
.mg-side-box-phone { display: flex; align-items: center; gap: .6rem; font-size: 1.35rem; font-weight: 800; color: #fff; margin-bottom: 1.3rem; }
.mg-side-box-phone svg { width: 22px; height: 22px; fill: currentColor; }
.mg-side-box-phone:hover { color: #cfe6f7; }
.mg-side-news { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.mg-side-news a { display: flex; gap: .9rem; align-items: center; color: var(--mg-title); }
.mg-side-news img { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.mg-side-news small { display: block; color: var(--mg-primary); font-weight: 700; font-size: .78rem; }
.mg-side-news strong { display: block; font-size: .95rem; line-height: 1.35; }
.mg-side-news a:hover strong { color: var(--mg-primary); }
.mg-side-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.mg-side-links a { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: 12px; background: #fff; color: var(--mg-title); font-weight: 700; }
.mg-side-links a > svg { width: 18px; height: 18px; margin-left: auto; color: var(--mg-primary); }
.mg-side-links a:hover { color: var(--mg-primary); box-shadow: var(--mg-shadow); }
.mg-side-links-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--mg-primary-light); color: var(--mg-primary); display: inline-flex; align-items: center; justify-content: center; }
.mg-side-links-icon svg { width: 22px; height: 22px; }

/* ---------- Works ---------- */
.mg-work-card { position: relative; display: block; border-radius: var(--mg-radius); overflow: hidden; aspect-ratio: 1 / 1; background: var(--mg-dark); }
.mg-work-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--mg-ease); }
.mg-work-card-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.6rem; background: linear-gradient(180deg, rgba(5, 18, 32, 0) 35%, rgba(5, 18, 32, .85) 100%); color: #fff; }
.mg-work-card-title { font-size: 1.25rem; font-weight: 800; line-height: 1.25; }
.mg-work-card-text { font-size: .9rem; opacity: .85; margin-top: .3rem; }
.mg-work-card-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .9rem; margin-top: .8rem; color: #cfe6f7; }
.mg-work-card-link svg { width: 16px; height: 16px; }
.mg-work-card:hover img { transform: scale(1.07); }
.mg-empty { text-align: center; padding: 3.5rem 1.5rem; border: 2px dashed var(--mg-border); border-radius: var(--mg-radius); }
.mg-empty-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--mg-primary-light); color: var(--mg-primary); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.mg-empty-icon svg { width: 38px; height: 38px; fill: currentColor; }
.mg-empty-icon svg [fill="none"] { fill: none; }
.mg-empty p { max-width: 520px; margin: 0 auto 1.4rem; }

/* lightbox: gli SVG senza dimensioni intrinseche occupano tutto lo spazio (fancybox misura il contenuto) */
.fancybox__slide.has-image > .fancybox__content:has(> .fancybox-image[src$=".svg" i]) { width: 100%; height: 100%; }

/* ---------- Contacts ---------- */
.mg-contact-card { width: 100%; padding: 2rem 1.6rem; border-radius: var(--mg-radius); background: #fff; border: 1px solid var(--mg-border); transition: box-shadow .3s ease, transform .3s ease; }
.mg-contact-card:hover { box-shadow: var(--mg-shadow-lg); transform: translateY(-4px); }
.mg-contact-card h2 { font-size: 1.1rem; margin: 1.2rem 0 .5rem; }
.mg-contact-card p { margin: 0 0 .2rem; }
.mg-contact-card a { color: var(--mg-text); font-weight: 600; }
.mg-contact-card a:hover { color: var(--mg-primary); }
.mg-map { border-radius: var(--mg-radius); overflow: hidden; height: 380px; box-shadow: var(--mg-shadow); }
.mg-map iframe { width: 100%; height: 100%; border: 0; display: block; }
/* da desktop la mappa riempie lo spazio fino al fondo della colonna del form */
@media (min-width: 992px) {
  .mg-map-fill { flex: 1 1 auto; height: auto; min-height: 340px; }
}
.mg-office-card { width: 100%; background: #fff; border-radius: var(--mg-radius); overflow: hidden; box-shadow: var(--mg-shadow); }
.mg-office-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.mg-office-card-body { padding: 1.5rem; }
.mg-office-card-body h3 { font-size: 1.2rem; }
.mg-office-card-body p { display: flex; gap: .5rem; align-items: flex-start; font-size: .94rem; margin-bottom: .5rem; }
.mg-office-card-body p svg { width: 18px; height: 18px; fill: var(--mg-primary); flex-shrink: 0; margin-top: .25rem; }

/* ---------- CTA band ---------- */
.mg-cta-band { padding: 0 0 100px; }
.mg-bg-soft + .mg-cta-band, .mg-form-section + .mg-cta-band { padding-top: 100px; }
.mg-cta-band-inner {
  position: relative;
  overflow: hidden;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2rem;
  padding: 3.4rem 3.6rem;
  border-radius: calc(var(--mg-radius) + 8px);
  background: radial-gradient(circle at 90% 10%, rgba(63, 169, 245, .5), transparent 45%), linear-gradient(135deg, var(--mg-primary-dark), var(--mg-primary));
  color: rgba(255, 255, 255, .88);
}
.mg-cta-band-inner::after { content: ""; position: absolute; right: -60px; bottom: -120px; width: 320px; height: 320px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .06); }
.mg-cta-band-inner > * { position: relative; z-index: 1; }
.mg-cta-band h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; margin-bottom: .5rem; }
.mg-cta-band p { margin: 0; max-width: 560px; }
.mg-cta-band-buttons { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---------- State pages ---------- */
.mg-state-page { padding: calc(var(--mg-header-h) + 110px) 0 110px; background: radial-gradient(circle at 50% 0%, var(--mg-primary-light), #fff 60%); }
.mg-is-inner .mg-state-page { margin-top: 0; }
.mg-state-icon { width: 96px; height: 96px; border-radius: 50%; background: var(--mg-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1.6rem; box-shadow: 0 0 0 14px rgba(var(--mg-primary-rgb), .12); }
.mg-state-icon svg { width: 46px; height: 46px; }
.mg-state-code { font-size: clamp(5rem, 16vw, 9rem); font-weight: 800; line-height: 1; color: var(--mg-primary); margin-bottom: .5rem; letter-spacing: -.04em; }
.mg-state-page h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }

/* le pagine senza banner hanno l'header su sfondo chiaro */
.mg-header.is-light:not(.is-scrolled)::before { opacity: 0; }
.mg-header.is-light:not(.is-scrolled) .mg-logo-text strong, .mg-header.is-light:not(.is-scrolled) .mg-nav-link, .mg-header.is-light:not(.is-scrolled) .mg-nav-toggle, .mg-header.is-light:not(.is-scrolled) .mg-header-phone { color: var(--mg-title); }
.mg-header.is-light:not(.is-scrolled) .mg-logo-text small { color: var(--mg-text); }
.mg-header.is-light:not(.is-scrolled) .mg-nav-link:hover, .mg-header.is-light:not(.is-scrolled) .mg-nav-item.active > .mg-nav-link { color: var(--mg-primary); background: var(--mg-primary-light); }

/* ---------- Footer ---------- */
.mg-footer { background: var(--mg-dark); color: rgba(255, 255, 255, .7); padding-top: 90px; font-size: .95rem; }
.mg-footer a { color: rgba(255, 255, 255, .75); }
.mg-footer a:hover { color: #fff; }
.mg-footer-logo { display: inline-flex; align-items: center; gap: .9rem; margin-bottom: 1.3rem; }
.mg-footer-logo span { font-size: 1.4rem; font-weight: 800; color: #fff; }
.mg-footer-about { max-width: 360px; }
.mg-footer-title { color: #fff; font-weight: 800; font-size: 1.05rem; margin-bottom: 1.3rem; }
.mg-footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .65rem; }
.mg-footer-links a { position: relative; transition: color .2s ease, padding .2s ease; }
.mg-footer-links a:hover { padding-left: 6px; }
.mg-footer-contacts { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.mg-footer-contacts li { display: flex; gap: .8rem; align-items: flex-start; }
.mg-footer-contacts svg { width: 20px; height: 20px; fill: var(--mg-accent); flex-shrink: 0; margin-top: .2rem; }
.mg-social { display: flex; gap: .6rem; margin-top: 1.5rem; }
.mg-social a { width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, .08); display: inline-flex; align-items: center; justify-content: center; transition: background .25s ease, transform .25s ease; }
.mg-social a svg { width: 18px; height: 18px; fill: #fff; }
.mg-social a:hover { background: var(--mg-primary); transform: translateY(-3px); }
.mg-footer-bottom { margin-top: 70px; padding: 1.4rem 0; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; }
.mg-footer-legal-wrap { max-width: 720px; margin: 1.2rem auto 0; text-align: center; }
.mg-footer-legal { margin: 0; font-size: .78rem; color: rgba(255, 255, 255, .55); line-height: 1.6; }
.mg-gdpr-bar { background: #000; padding: 1rem 0; }
.mg-gdpr-bar #cookies-manager-list-of-choices-made { color: #cfd2cb; font-size: .82rem; }
@media (max-width: 991.98px) {
  #cookies-manager-list-of-choices-made div { display: inline-block !important; }
}

/* ---------- WhatsApp e back to top ---------- */
.mg-whatsapp-float {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 1021;
  width: 60px; height: 60px; border-radius: 50%;
  background: #25d366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, .45);
  animation: mg-whatsapp-breathe 2.6s ease-in-out infinite;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .25s ease;
}
.mg-whatsapp-float svg { width: 30px; height: 30px; fill: #fff; position: relative; z-index: 2; flex-shrink: 0; }
.mg-whatsapp-float:hover { transform: scale(1.1) rotate(6deg); box-shadow: 0 10px 30px rgba(37, 211, 102, .65); animation-play-state: paused; }
.mg-whatsapp-float-ring { position: absolute; inset: 0; border-radius: 50%; background: #25d366; opacity: .55; animation: mg-whatsapp-ping 2.2s cubic-bezier(0, 0, .2, 1) infinite; }
.mg-whatsapp-float:hover .mg-whatsapp-float-ring { animation-play-state: paused; opacity: 0; }
@keyframes mg-whatsapp-ping { 0% { transform: scale(1); opacity: .55; } 80%, 100% { transform: scale(1.7); opacity: 0; } }
@keyframes mg-whatsapp-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.mg-back-to-top {
  /* centrato sul bottone WhatsApp (60px) e distanziato sopra di esso */
  position: fixed; right: calc(1.5rem + 7px); bottom: calc(1.5rem + 60px + 32px); z-index: 1020;
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: var(--mg-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(var(--mg-primary-rgb), .35);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s, background .2s ease;
}
.mg-back-to-top svg { width: 20px; height: 20px; }
.mg-back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.mg-back-to-top:hover { background: var(--mg-primary-dark); }

/* ---------- Animazioni on scroll ---------- */
.mg-reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s var(--mg-ease), transform .8s var(--mg-ease); }
.mg-reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mg-whatsapp-float { animation: none; }
  .mg-whatsapp-float-ring, .mg-hero-scroll span { animation: none; display: none; }
  .mg-reveal { opacity: 1; transform: none; transition: none; }
  .mg-hero-bg { transition: none; transform: none; }
}

.grecaptcha-badge { display: none !important; }

/* ---------- Responsive ---------- */
/* da desktop il logo è più grande */
@media (min-width: 992px) {
  :root { --mg-header-h: 108px; }
  .mg-logo img { width: 80px; height: 80px; }
  .mg-logo-text strong { font-size: 1.35rem; }
  .mg-header.is-scrolled .mg-logo img { width: 62px; height: 62px; }
}
@media (max-width: 1399.98px) {
  .mg-slider-prev { left: -24px; }
  .mg-slider-next { right: -24px; }
}
@media (max-width: 1199.98px) {
  .mg-nav-link { padding: .55rem .7rem; font-size: .92rem; }
  .mg-logo-text small { display: none; }
}
@media (max-width: 991.98px) {
  :root { --mg-header-h: 76px; }
  .mg-section { padding: 75px 0; }
  .mg-sticky { position: static; }
  .mg-hero-nav { display: none; }
  .mg-about-badge { right: 12px; }
  .mg-cta-band-inner { padding: 2.6rem 2rem; }
  .mg-cta-band { padding-bottom: 75px; }
  .mg-bg-soft + .mg-cta-band, .mg-form-section + .mg-cta-band { padding-top: 75px; }
  .mg-footer { padding-top: 70px; }
  .mg-slider-nav { display: none; }
}
@media (max-width: 767.98px) {
  .mg-features { grid-template-columns: 1fr; }
  .mg-form-box { padding: 1.6rem 1.2rem; }
  .mg-page-banner { padding: calc(var(--mg-header-h) + 50px) 0 50px; }
  .mg-page-banner.mg-page-banner-tall { padding: calc(var(--mg-header-h) + 30px) 0 40px; }
  .mg-page-banner-shape { width: 80%; right: -40%; }
}
@media (max-width: 767.98px) {
  .row.g-5, .row.gx-5 { --bs-gutter-x: 1.5rem; }
  .row.g-5 { --bs-gutter-y: 2.5rem; }
}
@media (max-width: 575.98px) {
  body { font-size: 15px; }
  .mg-section { padding: 60px 0; }
  .mg-logo img { width: 50px; height: 50px; }
  .mg-logo-text strong { font-size: 1.05rem; }
  .mg-hero-buttons .btn-mg { width: 100%; }
  .mg-hero-scroll { display: none; }
  .mg-hero-pagination { bottom: 28px !important; }
  .mg-service-row { flex-direction: column; align-items: flex-start; }
  .mg-service-row-media { width: 100%; height: 160px; }
  .mg-cta-band-buttons, .mg-cta-band-buttons .btn-mg { width: 100%; }
  .mg-whatsapp-float { width: 52px; height: 52px; right: 1.1rem; bottom: 1.1rem; }
  .mg-whatsapp-float svg { width: 26px; height: 26px; }
  .mg-back-to-top { right: calc(1.1rem + 3px); bottom: calc(1.1rem + 52px + 28px); }
  .mg-about-badge { position: static; margin-top: 1rem; max-width: none; flex-direction: row; align-items: center; gap: .8rem; }
}
