/* ==========================================================
   ITG Impianti — foglio di stile principale
   Indice: 1 Variabili · 2 Base · 3 Header · 4 Bottoni · 5 Hero
           6 Sezioni · 7 Servizi · 8 Gallery · 9 CTA/Form · 10 Footer
           11 Animazioni
   Il layout responsive è in responsive.css
   ========================================================== */

/* 1. VARIABILI ------------------------------------------- */
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Colori */
  --blue: #1f2fe0;          /* blu ITG (dal logo) */
  --blue-dark: #1623b3;
  --blue-light: #7f8dff;    /* blu per fondi scuri (contrasto) */
  --navy: #0a1224;          /* blu molto scuro */
  --ink: #16181d;           /* antracite */
  --white: #fff;
  --grey-50: #f3f5f8;
  --grey-200: #d9dee7;
  --grey-500: #5b6475;      /* testo secondario */
  --line: #d9dee7;

  /* Tipografia */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-body: 1.0625rem;
  --fs-h1: clamp(2.5rem, 8vw, 6.5rem);
  --fs-h2: clamp(1.9rem, 4.2vw, 3.5rem);

  /* Spaziature e dimensioni */
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: clamp(4rem, 9vw, 8rem);
  --container: 1200px;
  --header-h: 96px;
  --header-h-small: 68px;

  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* 2. BASE ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h-small); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-weight: 800; line-height: 1.05; letter-spacing: -.02em; margin: 0; text-transform: uppercase; }
p { margin: 0 0 var(--space-2); }
ul, ol { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }

.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }

:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 3px; }
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--blue); color: #fff; padding: .75rem 1rem; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* 3. HEADER ---------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  height: var(--header-h);
  transition: height .3s var(--ease);
}
.site-header.is-compact { box-shadow: 0 6px 24px rgba(10, 18, 36, .08); }
.site-header.is-compact .header-inner { height: var(--header-h-small); }

/* Logo: il file originale NON viene modificato.
   Si mostra solo la parte centrale con un "finestra" CSS (ritaglio visivo, nessuna alterazione dell'immagine). */
.logo { display: block; height: 76px; aspect-ratio: 720 / 565; overflow: hidden; flex: none; transition: height .3s var(--ease); }
.logo img { width: 145%; max-width: none; margin-left: -20.83%; margin-top: -30.56%; }
.site-header.is-compact .logo { height: 54px; }
.logo-plate { height: 96px; background: #fff; }

.nav { display: flex; align-items: center; gap: var(--space-4); }
.nav-list { display: flex; gap: var(--space-3); }
.nav-list a {
  position: relative; display: block; padding: .5rem 0;
  font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
}
.nav-list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px;
  background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav-list a:hover::after, .nav-list a.is-active::after { transform: scaleX(1); }

.menu-toggle {
  display: none; width: 48px; height: 48px; padding: 0; border: 0; background: none; cursor: pointer;
  position: relative;
}
.menu-toggle span {
  position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink);
  transition: transform .3s var(--ease), opacity .2s;
}
.menu-toggle span:nth-child(1) { top: 16px; }
.menu-toggle span:nth-child(2) { top: 23px; }
.menu-toggle span:nth-child(3) { top: 30px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 4. BOTTONI --------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 52px; padding: .9rem 1.75rem;
  font: inherit; font-size: .8125rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  border: 2px solid transparent; border-radius: 2px; cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-outline:hover { background: #fff; color: var(--navy); border-color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--grey-50); }
.nav-cta { min-height: 44px; padding: .6rem 1.2rem; }

/* 5. HERO ------------------------------------------------ */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h));
  display: flex; flex-direction: column; justify-content: center;
  background: var(--navy); color: #fff;
  padding: var(--space-5) 0 6rem;
}
.hero-bg, .feature-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -3; }
.hero-shade {
  position: absolute; inset: 0; z-index: -2;
  background: linear-gradient(90deg, rgba(10, 18, 36, .94) 0%, rgba(10, 18, 36, .75) 55%, rgba(10, 18, 36, .45) 100%);
}
.hero-orbit {
  position: absolute; right: -8%; top: 50%; width: min(60vw, 760px); transform: translateY(-50%);
  z-index: -1; fill: none; stroke: var(--blue); stroke-width: 2; opacity: .55;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .75rem; margin-bottom: var(--space-3);
  font-size: .8125rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--blue-light);
}
.eyebrow::before { content: ""; width: 40px; height: 2px; background: var(--blue-light); }
.hero h1 { font-size: var(--fs-h1); line-height: .95; letter-spacing: -.03em; margin-bottom: var(--space-3); }
.hero-sub { max-width: 40rem; font-size: clamp(1.15rem, 2vw, 1.5rem); font-weight: 500; line-height: 1.4; color: #fff; }
.hero-text { max-width: 36rem; color: #c3cbdc; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.hero-tags {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  display: flex; gap: var(--space-4); padding: 1.1rem 0;
  border-top: 1px solid rgba(255, 255, 255, .18);
  font-size: .75rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: #aab4cb;
}

/* 6. SEZIONI --------------------------------------------- */
.section { padding: var(--space-6) 0; }
.section-alt { background: var(--grey-50); }
.section-dark { background: var(--navy); color: #fff; }
.section-dark p { color: #c3cbdc; }

.section-num {
  display: block; margin-bottom: var(--space-2);
  font-size: .8125rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--blue);
}
.section-num.on-dark { color: var(--blue-light); }
.section-head { max-width: 46rem; margin-bottom: var(--space-5); }
.section-head h2, #contatti h2 { font-size: var(--fs-h2); margin-bottom: var(--space-3); }
.section-head p { color: var(--grey-500); }
.section-dark .section-head p { color: #c3cbdc; }
.lead { font-size: 1.35rem; font-weight: 600; color: var(--ink) !important; line-height: 1.4; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: start; }
.split .section-head { margin-bottom: 0; }
.prose p { font-size: 1.15rem; color: var(--grey-500); }
.prose p:first-child { color: var(--ink); font-weight: 500; }

/* Categorie impianti */
.categories { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--ink); }
.category { padding: var(--space-3) var(--space-3) var(--space-3) 0; border-right: 1px solid var(--line); }
.category + .category { padding-left: var(--space-3); }
.category:last-child { border-right: 0; }
.category h3 { font-size: 1.5rem; margin-bottom: var(--space-1); }
.category p { color: var(--grey-500); margin: 0; }

/* Fotovoltaico */
.feature { position: relative; isolation: isolate; overflow: hidden; background: var(--navy); color: #fff; padding: var(--space-6) 0; }
.feature .hero-shade { background: linear-gradient(90deg, rgba(10, 18, 36, .92), rgba(10, 18, 36, .55)); }
.feature-inner { max-width: 44rem; margin-inline: 0 auto; margin-left: max(1rem, calc((100% - var(--container)) / 2)); }
.feature h2 { font-size: var(--fs-h2); margin-bottom: var(--space-3); }
.feature .lead { color: #fff !important; }
.feature p { color: #c3cbdc; }
.feature .btn { margin-top: var(--space-2); }

/* Industria: elenco tecnico */
.tech-list { border-top: 1px solid rgba(255, 255, 255, .25); }
.tech-list li {
  display: flex; align-items: baseline; gap: var(--space-3); padding: 1.1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .25);
  font-size: clamp(1.6rem, 3.5vw, 2.5rem); font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  transition: color .25s var(--ease), padding-left .3s var(--ease);
}
.tech-list li span { font-size: .8125rem; font-weight: 700; letter-spacing: .18em; color: var(--blue-light); }
.tech-list li:hover { color: var(--blue-light); padding-left: .75rem; }

/* 7. SERVIZI --------------------------------------------- */
.services { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); border-left: 1px solid var(--line); }
.service {
  position: relative; padding: var(--space-4) var(--space-3);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.service-num { display: block; margin-bottom: var(--space-5); font-size: 3rem; font-weight: 800; line-height: 1; color: var(--blue); transition: color .3s var(--ease); }
.service h3 { font-size: 1.25rem; margin-bottom: var(--space-2); }
.service p { color: var(--grey-500); margin: 0; font-size: 1rem; transition: color .3s var(--ease); }
.service:hover { background: var(--navy); color: #fff; }
.service:hover p { color: #c3cbdc; }
.service:hover .service-num { color: var(--blue-light); }

/* 8. GALLERY --------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-2); }
.shot { position: relative; margin: 0; overflow: hidden; background: var(--navy); grid-column: span 2; aspect-ratio: 4 / 3; }

.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.shot:hover img { transform: scale(1.04); }
.shot figcaption {
  position: absolute; left: 0; bottom: 0; padding: .6rem 1rem;
  background: var(--blue); color: #fff;
  font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.note { margin-top: var(--space-3); font-size: .875rem; color: var(--grey-500); }

/* Perché ITG */
.why { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.why-item { padding-top: var(--space-3); border-top: 4px solid var(--blue); }
.why-item h3 { font-size: 1.25rem; margin-bottom: var(--space-1); }
.why-item p { color: var(--grey-500); margin: 0; }

/* 9. CTA / FORM ------------------------------------------ */
.cta { background: var(--blue); color: #fff; padding: var(--space-5) 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.cta h2 { font-size: var(--fs-h2); margin-bottom: var(--space-1); }
.cta p { margin: 0; font-size: 1.15rem; }

.address { margin-top: var(--space-3); padding-left: var(--space-3); border-left: 4px solid var(--blue); font-size: 1.1rem; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 52px; padding: .8rem 1rem;
  font: inherit; color: var(--ink); background: var(--grey-50);
  border: 1px solid var(--grey-200); border-bottom: 2px solid var(--ink); border-radius: 0;
  transition: border-color .2s, background-color .2s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); background: #fff; }
.field input:user-invalid, .field select:user-invalid, .field textarea:user-invalid { border-bottom-color: #c0222d; }
.form-status { margin: var(--space-2) 0 0; font-weight: 500; min-height: 1.65em; }
.form-status.is-error { color: #b0151f; }
.form-status.is-ok { color: #11663a; }

/* 10. FOOTER --------------------------------------------- */
.site-footer { background: var(--navy); color: #c3cbdc; padding-top: var(--space-5); font-size: .95rem; }
.footer-inner { display: flex; justify-content: space-between; gap: var(--space-4); padding-bottom: var(--space-4); }
.footer-brand p { margin: var(--space-2) 0 0; }
.footer-brand strong { color: #fff; }
.footer-links { display: grid; gap: .5rem; }
.footer-links a { font-size: .8125rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: #fff; }
.footer-links a:hover { color: var(--blue-light); }
.footer-bottom { padding: 1.25rem 0; border-top: 1px solid rgba(255, 255, 255, .15); }

/* 11. ANIMAZIONI ----------------------------------------- */
/* Gli elementi sono nascosti solo se JavaScript è attivo (classe .js aggiunta da main.js) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

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