/* =========================================================
   Eco Impianti S.r.l. — foglio di stile principale
   Nessuna dipendenza esterna: font Roboto self-hosted.
   ========================================================= */

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/roboto-latin.woff2") format("woff2");
}

:root {
  --blue: #4a87cb;
  --blue-dark: #2a52a1;
  --red: #df6160;
  --brick: #a52a2a;
  --dark: #515151;
  --dark-2: #444;
  --heading: #333;
  --text: #5e5e5e;
  --muted: #888;
  --light: #f4f5f7;
  --white: #fff;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .08);
  --container: 1170px;
  --font: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color .2s; }
a:hover { color: var(--red); }

h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; margin: 0 0 .6em; font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 10px; top: -60px; z-index: 1000;
  background: var(--blue); color: #fff; padding: 10px 16px; border-radius: 6px;
}
.skip-link:focus { top: 10px; color: #fff; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.icon { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* ---------------- Header ---------------- */

.topbar { background: var(--white); }
.topbar .container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  min-height: 130px;
}
.topbar-info { display: flex; gap: 28px; font-size: 13px; line-height: 1.5; color: var(--heading); }
.topbar-info .item { display: flex; gap: 8px; align-items: flex-start; }
.topbar-info .icon { color: var(--muted); margin-top: 3px; }
.logo img { width: 200px; }
.topbar-social { justify-self: end; }
.social-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid #ddd; color: var(--heading);
}
.social-btn:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.social-btn .icon { width: 14px; height: 14px; }

.navbar { background: var(--dark); position: sticky; top: 0; z-index: 100; }
.navbar .container { display: flex; align-items: center; min-height: 64px; }

.menu { list-style: none; margin: 0; padding: 0; display: flex; }
.menu > li { position: relative; }
.menu a, .menu button {
  display: block;
  padding: 21px 24px;
  font: 700 15px/22px var(--font);
  text-transform: uppercase;
  color: #fff;
  background: none; border: 0; cursor: pointer;
}
.menu > li:first-child > a { padding-left: 0; }
.menu a:hover, .menu button:hover, .menu .is-active > a, .menu a[aria-current="page"] { color: var(--red); }

.submenu {
  list-style: none; margin: 0; padding: 8px 0;
  position: absolute; top: 100%; left: 0; min-width: 220px;
  background: var(--dark);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.submenu a { padding: 10px 22px; }
.has-sub:hover > .submenu,
.has-sub:focus-within > .submenu,
.has-sub.open > .submenu { opacity: 1; visibility: visible; transform: none; }
.has-sub > button .caret { display: inline-block; margin-left: 6px; width: 10px; height: 10px; vertical-align: middle; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none; border: 0; color: #fff; cursor: pointer;
  width: 48px; height: 48px; padding: 12px;
}
.nav-toggle span { display: block; height: 2px; background: currentColor; margin: 5px 0; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  display: grid; place-items: center;
  min-height: 460px;
  padding: 60px 0;
  color: #fff;
  background: #a2a2a2 center / cover no-repeat;
  text-align: center;
  overflow: hidden;
}
.hero::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
.hero > * { position: relative; }
.hero h1 {
  color: #fff;
  font-size: clamp(26px, 4vw, 46px);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.6;
  max-width: 1000px;
  margin: 0 auto;
}

.hero--home { background-color: #a2a2a2; min-height: 520px; }
.hero--home::before { display: none; }
.hero--home .hero-mark {
  position: absolute; inset: 0;
  background: url("../img/hero-logo.jpg") center / contain no-repeat;
  opacity: .35; mix-blend-mode: multiply;
}
.hero--home h1 {
  text-transform: none;
  font-size: clamp(18px, 2.4vw, 28px);
  line-height: 1.45;
  text-align: left;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

/* ---------------- Sezioni ---------------- */

.section { padding: 90px 0; }
.section--light { background: var(--light); }
.section--bg { background: center / cover no-repeat; position: relative; }
.section-title { text-align: center; font-size: clamp(26px, 3vw, 36px); margin-bottom: 50px; }
.section-title small { display: block; font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: .1em; margin-bottom: 10px; }
.title-blue { color: var(--blue); }

/* Chi siamo */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.about-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.about-gallery img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.about-gallery img:nth-child(3) { grid-column: 2; }
.about h2 { color: var(--blue); font-size: 36px; }

/* Features */
.features { background-image: url("../img/bg-features.jpg"); }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; text-align: center; }
.feature .badge {
  display: inline-grid; place-items: center;
  width: 76px; height: 76px; border-radius: 50%;
  background: #fff; color: var(--blue); box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.feature .badge .icon { width: 30px; height: 30px; }
.feature h3 { font-size: 18px; }
.feature p { max-width: 280px; margin: 0 auto; font-size: 14px; }

/* Copertura completa */
.coverage { background-image: url("../img/bg-copertura.jpg"); }
.coverage::before { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .55); }
.coverage > .container { position: relative; }
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 40px 24px; text-align: center; min-height: 190px;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 14px 34px rgba(0, 0, 0, .12); }
.card .icon { width: 40px; height: 40px; color: var(--blue); margin: 0 auto 14px; }
.card h3 { font-size: 16px; margin: 0; }

/* Perchè sceglierci */
.why { background-image: url("../img/bg-perche.jpg"); }
.why::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.1) 0%, rgba(255,255,255,.75) 45%, rgba(255,255,255,.9) 100%); }
.why .container { position: relative; display: flex; justify-content: flex-end; }
.why-box { width: min(100%, 520px); }
.why-box h2 { font-size: clamp(28px, 3vw, 38px); }
.why-item { display: flex; gap: 22px; align-items: flex-start; margin-top: 30px; }
.why-item .badge {
  flex: none; display: grid; place-items: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--blue); color: #fff;
}
.why-item .badge .icon { width: 26px; height: 26px; }
.why-item h3 { font-size: 17px; margin-bottom: 6px; }

/* Hai un progetto */
.project { background-image: url("../img/bg-progetto.jpg"); }
.project::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.92) 0%, rgba(255,255,255,.75) 55%, rgba(255,255,255,.2) 100%); }
.project .container { position: relative; }
.project h2 { color: var(--blue); font-size: clamp(28px, 3vw, 38px); }
.project p { max-width: 640px; color: var(--heading); }

/* Partner */
.partners { overflow: hidden; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 60px; width: max-content; animation: marquee 22s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track img { height: 70px; width: auto; }
@keyframes marquee { to { transform: translateX(calc(-50% - 30px)); } }

/* Bottoni */
.btn {
  display: inline-block;
  padding: 14px 34px;
  border: 0; border-radius: 30px;
  background: var(--blue); color: #fff;
  font: 700 13px/1 var(--font); text-transform: uppercase; letter-spacing: .04em;
  cursor: pointer; transition: background .2s, transform .2s;
}
.btn:hover { background: var(--dark); color: #fff; }
.btn:disabled { opacity: .6; cursor: wait; }

/* ---------------- Pagine servizio ---------------- */

.service h2 { color: var(--blue-dark); font-size: 24px; margin-top: 10px; }
.service .lead { margin-bottom: 50px; }
.list-arrow { list-style: none; padding: 0; margin: 0 0 30px; }
.list-arrow li { position: relative; padding-left: 22px; margin-bottom: 22px; }
.list-arrow li::before {
  content: ""; position: absolute; left: 2px; top: .62em;
  border: 5px solid transparent; border-left: 6px solid var(--blue);
}
.list-arrow ul { list-style: none; padding: 10px 0 0 10px; }
.list-arrow ul li { margin-bottom: 10px; }
.hl { color: var(--brick); font-weight: 400; }
.hl-blue { color: var(--blue-dark); }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; margin-top: 40px; }
.gallery--4 { grid-template-columns: repeat(2, 1fr); }
.gallery figure { margin: 0; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); }
.gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .4s; }
.gallery figure:hover img { transform: scale(1.04); }
.gallery figcaption { padding: 12px 16px; font-weight: 500; color: var(--heading); background: #fff; }

/* ---------------- Contatti / Lavora con noi ---------------- */

.map-wrap { position: relative; height: 380px; background: #e5e3df; }
.map-wrap iframe { border: 0; width: 100%; height: 100%; display: block; }
.map-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px;
  background: #e8e8e8 url("../img/bg-features.jpg") center / cover;
}
.map-placeholder p { max-width: 460px; font-size: 13px; color: var(--heading); }
.map-placeholder .btn { margin: 6px; }
.btn--ghost { background: #fff; color: var(--blue); box-shadow: var(--shadow); }
.btn--ghost:hover { background: var(--blue); color: #fff; }

.info-strip { background: var(--light); padding: 30px 0; }
.info-strip .container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.info-strip .item { display: flex; gap: 16px; align-items: center; font-size: 13px; line-height: 1.5; }
.info-strip .badge {
  flex: none; display: grid; place-items: center;
  width: 54px; height: 54px; border-radius: 50%; background: #fff; color: var(--blue);
}
.info-strip .badge .icon { width: 20px; height: 20px; }
.info-strip .label { color: var(--muted); display: block; }
.info-strip strong { color: var(--heading); font-weight: 500; }

.form-section { max-width: 760px; margin: 0 auto; text-align: center; }
.form-section h1 { font-size: clamp(26px, 3vw, 34px); }
.form { display: grid; gap: 18px; margin-top: 30px; text-align: left; }
.form input[type="text"], .form input[type="email"], .form input[type="tel"], .form textarea {
  width: 100%;
  padding: 14px 22px;
  border: 1px solid #ddd; border-radius: 26px;
  font: 400 14px var(--font); color: var(--heading);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.form textarea { border-radius: 20px; min-height: 140px; resize: vertical; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(74, 135, 203, .18); }
.form .file-field label { display: block; font-weight: 500; color: var(--heading); margin-bottom: 8px; }
.form .file-field small { display: block; color: var(--muted); margin-top: 4px; }
.form .consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.form .consent input { margin-top: 4px; }
.form .actions { text-align: center; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.alert { padding: 14px 20px; border-radius: 10px; font-size: 14px; text-align: left; }
.alert[hidden] { display: none; }
.alert--ok { background: #e7f5ea; color: #1e6b32; border: 1px solid #b7e0c1; }
.alert--err { background: #fdecec; color: #8f2424; border: 1px solid #f3c2c2; }

/* ---------------- Pagine legali ---------------- */

.page-title { background: var(--light); padding: 60px 0 40px; border-bottom: 1px solid #e6e8eb; }
.page-title h1 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 8px; }
.page-title p { margin: 0; color: var(--muted); }
.legal { max-width: 880px; }
.legal h2 { font-size: 20px; color: var(--blue-dark); margin: 36px 0 12px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 8px; }
.legal-updated { font-size: 13px; color: var(--muted); }
.legal code { background: var(--light); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 14px; }
.legal th, .legal td { border: 1px solid #e3e5e8; padding: 10px 12px; text-align: left; vertical-align: top; }
.legal th { background: var(--light); color: var(--heading); }
.legal-status { font-size: 13px; color: var(--muted); margin-left: 10px; }
.form .consent a { text-decoration: underline; }

/* ---------------- Footer ---------------- */

.footer-cta { background: linear-gradient(120deg, var(--blue-dark), var(--blue)); color: #fff; padding: 44px 0; }
.footer-cta .container { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-cta h2 { color: #fff; font-size: clamp(20px, 2.2vw, 26px); margin-bottom: 6px; }
.footer-cta p { margin: 0; opacity: .9; }
.footer-cta-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn .icon { width: 15px; height: 15px; vertical-align: -3px; margin-right: 6px; }
.btn--white { background: #fff; color: var(--blue-dark); }
.btn--white:hover { background: var(--dark); color: #fff; }
.btn--outline { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .8); }
.btn--outline:hover { background: #fff; color: var(--blue-dark); }

.site-footer { background: var(--dark); color: #d9dadc; font-size: 14px; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--red); }

.footer-main {
  display: grid;
  grid-template-columns: 1.3fr .9fr 1.1fr 1.2fr;
  gap: 40px;
  padding-top: 64px; padding-bottom: 50px;
}
.footer-title {
  color: #fff; font-size: 15px; text-transform: uppercase; letter-spacing: .06em;
  margin: 0 0 18px; padding-bottom: 10px; position: relative;
}
.footer-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 34px; height: 2px; background: var(--blue); }
.footer-links + .footer-title { margin-top: 26px; }

.footer-logo { display: inline-block; background: #fff; border-radius: var(--radius); padding: 10px 16px; margin-bottom: 18px; }
.footer-logo img { width: 160px; }
.footer-brand p { line-height: 1.65; margin-bottom: 18px; }
.social-btn--dark { border-color: rgba(255, 255, 255, .3); color: #fff; }

.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #d9dadc; display: inline-block; transition: color .2s, transform .2s; }
.footer-links a:hover { color: #fff; transform: translateX(4px); }

.footer-contacts { list-style: none; padding: 0; margin: 0; }
.footer-contacts li { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; line-height: 1.5; }
.footer-contacts .icon { color: var(--blue); width: 17px; height: 17px; margin-top: 2px; }

.footer-map { height: 190px; border-radius: var(--radius); overflow: hidden; }
.footer-map .map-placeholder p { font-size: 12px; margin-bottom: 8px; }
.footer-map .btn { padding: 10px 18px; font-size: 11px; margin: 3px; }
.site-footer .btn--ghost { color: var(--blue); }
.site-footer .btn--ghost:hover { color: #fff; }

.footer-legal { background: var(--dark-2); padding: 22px 0; font-size: 12.5px; color: #b9babc; }
.footer-legal .container { display: flex; justify-content: space-between; align-items: center; gap: 16px 30px; flex-wrap: wrap; }
.footer-company p { margin: 0; line-height: 1.8; }
.footer-company p > * + *::before { content: "·"; margin: 0 8px; color: #888; }
.footer-company strong { color: #fff; font-weight: 500; }
.footer-company .nowrap { white-space: nowrap; }
.footer-policy { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.footer-policy a, .link-btn { color: #d9dadc; font: inherit; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--red); }
.link-btn[hidden] { display: none; }

@media (max-width: 991px) {
  .footer-main { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .footer-main { grid-template-columns: 1fr; gap: 34px; padding-top: 48px; }
  .footer-cta .container { flex-direction: column; align-items: flex-start; }
  .footer-company p > * { display: block; }
  .footer-company p > * + *::before { content: none; }
  .footer-map { height: 220px; }
}

.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--blue); color: #fff; cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.to-top.show { opacity: 1; visibility: visible; }
.to-top .icon { width: 18px; height: 18px; }

/* Animazione comparsa */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- Responsive ---------------- */

@media (max-width: 991px) {
  .topbar .container { grid-template-columns: 1fr auto; min-height: 96px; }
  .topbar-info { display: none; }
  .logo img { width: 160px; }

  .nav-toggle { display: block; }
  .menu {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column;
    background: var(--dark-2);
    max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .menu.open { display: flex; }
  .menu a, .menu button, .menu > li:first-child > a { padding: 14px 20px; width: 100%; text-align: left; }
  .submenu { position: static; opacity: 1; visibility: visible; transform: none; display: none; background: rgba(0,0,0,.15); padding: 0; }
  .has-sub:hover > .submenu, .has-sub:focus-within > .submenu { display: none; }
  .has-sub.open > .submenu { display: block; }
  .submenu a { padding-left: 40px; }

  .about { grid-template-columns: 1fr; gap: 40px; }
  .about-gallery { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .about-gallery img:nth-child(3) { grid-column: auto; }
  .features-grid, .cards-3 { grid-template-columns: 1fr; }
  .info-strip .container { grid-template-columns: 1fr 1fr; }
  .why::before { background: rgba(255, 255, 255, .85); }
}

@media (max-width: 640px) {
  .section { padding: 60px 0; }
  .hero { min-height: 340px; }
  .hero--home { min-height: 380px; }
  .gallery, .gallery--4 { grid-template-columns: 1fr; }
  .info-strip .container, .footer-grid { grid-template-columns: 1fr; }
  .marquee-track img { height: 50px; }
  .why-item .badge { width: 52px; height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
