/* ==========================================================================
   EERIS — Foglio di stile
   Indice: 1 Font · 2 Variabili · 3 Base · 4 Tipografia · 5 Componenti
           6 Header · 7 Sezioni · 8 Modulo · 9 Footer · 10 Lightbox
           11 Animazioni · 12 Responsive · 13 Pagine legali
   ========================================================================== */

/* 1. FONT (ospitati in locale: nessuna richiesta a server esterni) */
@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-latin.woff2") format("woff2");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* 2. VARIABILI (palette originale EERIS) */
:root {
  --white: #ffffff;
  --light: #f4f4f5;
  --accent: #ef454b;
  --accent-dark: #d1343a;
  --accent-text: #c9282e;   /* rosso più scuro per testi piccoli su chiaro (contrasto AA) */
  --key2: #3a3d42;
  --dark: #232427;
  --black: #16171a;

  --text: var(--dark);
  --text-soft: rgba(35, 36, 39, .72);
  --line: rgba(35, 36, 39, .14);
  --bg: var(--white);

  --font-head: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --container: 1250px;
  --gutter: 32px;
  --header-h: 78px;
  --radius: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow-card: 0 40px 80px -48px rgba(22, 23, 26, .38);
}

/* 3. BASE */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
[hidden] { display: none !important; }
main:focus { outline: none; }
:focus-visible { outline: 3px solid rgba(239, 69, 75, .55); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--white); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 3000;
  padding: 10px 18px;
  background: var(--black); color: var(--white);
  font-weight: 600; border-radius: 0 0 8px 8px;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; }

/* Icone */
.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-xs { width: 12px; height: 12px; stroke-width: 3; }
.icon-lg { width: 22px; height: 22px; stroke-width: 1.75; }
.icon-xl { width: 26px; height: 26px; stroke-width: 1.75; }
.icon-accent { color: var(--accent); }
.flip { transform: rotate(180deg); }

/* 4. TIPOGRAFIA */
.title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.title-xl { font-size: clamp(38px, 6.2vw, 86px); line-height: .98; letter-spacing: -.035em; text-transform: uppercase; }
.title-lg { font-size: clamp(30px, 4.2vw, 54px); line-height: 1.04; letter-spacing: -.03em; text-transform: uppercase; }
.title-md { font-size: clamp(26px, 2.8vw, 36px); line-height: 1.1; text-transform: uppercase; }
.title-sm { font-size: 19px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.title-xs { font-size: 13px; line-height: 1.3; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.accent { color: var(--accent); }
.accent-text { color: var(--accent); }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
  font-family: var(--font-head);
  font-size: 12px; font-weight: 700; line-height: 1.4;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-soft);
}
.dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--accent); }
.eyebrow-inherit .dot { background: currentColor; }

.lead { font-size: 18px; line-height: 1.6; color: var(--text-soft); }
.lead-xl { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.5; color: var(--text); font-weight: 500; }
.small { font-size: 15px; line-height: 1.55; color: var(--text-soft); }
.muted { opacity: .7; }

/* 5. COMPONENTI */

/* Pulsanti */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 28px;
  border: 1.5px solid transparent; border-radius: 999px;
  font-family: var(--font-head);
  font-size: 13px; font-weight: 700; line-height: 1;
  letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.btn-arrow { transition: transform .25s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }
.btn-sm { height: 42px; padding: 0 20px; font-size: 12px; }
.btn-lg { height: 60px; padding: 0 34px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .65; cursor: wait; transform: none !important; }

.btn-primary { background: var(--accent); color: var(--white); box-shadow: 0 14px 28px -16px var(--accent); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); box-shadow: 0 18px 32px -14px var(--accent); }
.btn-outline { background: transparent; color: currentColor; border-color: rgba(35, 36, 39, .28); }
.btn-outline:hover { border-color: currentColor; background: rgba(35, 36, 39, .05); }
.section-dark .btn-outline, .btn-outline-light { border-color: rgba(255, 255, 255, .55); }
.section-dark .btn-outline:hover, .btn-outline-light:hover { border-color: var(--white); background: rgba(255, 255, 255, .1); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-dark:hover { background: var(--key2); transform: translateY(-2px); }
.btn-white { background: var(--white); color: var(--black); }
.btn-white:hover { background: var(--light); transform: translateY(-2px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 48px; height: 48px; padding: 0;
  border: 1.5px solid transparent; border-radius: 50%;
  background: transparent; color: currentColor;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}
.icon-btn:hover { background: rgba(35, 36, 39, .07); }
.icon-btn-outline { border-color: rgba(35, 36, 39, .22); }
.icon-btn-outline:hover { border-color: currentColor; background: transparent; }
.icon-btn-light { color: var(--white); }
.icon-btn-light:hover { background: rgba(255, 255, 255, .12); }
.icon-btn-light.icon-btn-outline { border-color: rgba(255, 255, 255, .35); }

/* Link testuale con sottolineatura animata */
.text-link {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-head); font-size: 14px; font-weight: 600; letter-spacing: .02em;
  color: inherit; opacity: .88;
  transition: opacity .2s ease;
}
.text-link > span, .text-link:not(:has(span)) { background: linear-gradient(var(--accent), var(--accent)) left bottom / 0 2px no-repeat; padding: 4px 0; transition: background-size .3s ease; }
.text-link:hover { opacity: 1; }
.text-link:hover > span, .text-link:not(:has(span)):hover { background-size: 100% 2px; }
.text-link-sm { font-family: var(--font-text); font-size: 15px; font-weight: 500; letter-spacing: 0; }

/* Badge icone */
.badge {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 62px; height: 62px; border-radius: 50%;
}
.badge-outline { border: 1.5px solid var(--line); color: var(--accent); }
.badge-accent { background: var(--accent); color: var(--white); }

/* Elenco servizi */
.check-list {
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px;
  align-self: stretch;
  margin-top: 22px; border-top: 1px solid var(--line);
}
.check-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 500; line-height: 1.35;
}
.check-list li::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--accent); }

/* Chip filtri */
.chip {
  display: inline-flex; align-items: center; height: 44px; padding: 0 20px;
  border: 1.5px solid rgba(255, 255, 255, .28); border-radius: 999px;
  background: transparent; color: rgba(255, 255, 255, .9);
  font-family: var(--font-head); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}
.chip:hover { border-color: var(--white); color: var(--white); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--white); }

/* 6. HEADER */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, box-shadow .3s ease;
}
/* Lo sfondo sfocato sta su uno pseudo-elemento: un backdrop-filter sull'header
   stesso "intrappolerebbe" il menu mobile (position: fixed) al suo interno. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 14px 34px -26px rgba(35, 36, 39, .55); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; height: 100%; }
.logo { display: inline-flex; flex: none; line-height: 0; }
.logo img { height: 30px; width: auto; }
.logo-lg img { height: 40px; }
.main-nav { display: flex; align-items: center; gap: 34px; }
.nav-link {
  position: relative; padding: 6px 0;
  font-family: var(--font-head); font-size: 14px; font-weight: 600; letter-spacing: .02em;
  color: rgba(35, 36, 39, .86);
  transition: color .2s ease;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.nav-link:hover, .nav-link.is-active { color: var(--text); }
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: 24px; }
.menu-toggle { display: none; }

.mobile-menu {
  position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; z-index: 990;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: 32px 24px calc(32px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  background: var(--white);
  animation: menu-in .3s var(--ease);
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }
.mobile-nav { display: flex; flex-direction: column; }
.mobile-nav a {
  padding: 14px 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-head); font-size: 26px; font-weight: 800; letter-spacing: -.02em; text-transform: uppercase;
}
.mobile-nav a:active { color: var(--accent); }
.mobile-menu-actions { display: flex; flex-direction: column; gap: 12px; }

.quick-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 980;
  display: none; align-items: center; gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -14px 34px -26px rgba(35, 36, 39, .55);
}
.quick-bar .icon-btn { width: 50px; height: 50px; }
.quick-bar .btn { flex: 1; min-width: 0; height: 50px; padding: 0 12px; font-size: 12px; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; }

.whatsapp-float {
  position: fixed; right: 26px; bottom: 26px; z-index: 980;
  display: inline-flex; align-items: center; gap: 10px;
  height: 54px; padding: 0 22px 0 18px;
  border: 1px solid rgba(22, 23, 26, .1); border-radius: 999px;
  background: var(--white); color: var(--black);
  font-family: var(--font-head); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 16px 36px -14px rgba(22, 23, 26, .45);
  transition: transform .25s ease, color .25s ease;
}
.whatsapp-float:hover { transform: translateY(-3px); color: var(--accent); }

/* 7. SEZIONI */
.section { padding: 130px 0 140px; scroll-margin-top: var(--header-h); }
.section-light { background: var(--light); }
.section-dark { background: var(--black); color: var(--white); --text-soft: rgba(255, 255, 255, .7); --line: rgba(255, 255, 255, .16); }
.section-accent { background: var(--accent); color: var(--white); --text-soft: rgba(255, 255, 255, .92); --line: rgba(255, 255, 255, .4); }
.section-head {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: end; gap: 64px;
}
.section-head-ruled { padding-bottom: 56px; border-bottom: 1px solid var(--line); }
.section-head .eyebrow { margin-bottom: 20px; }

/* Hero */
.hero {
  position: relative; display: flex; align-items: flex-end;
  min-height: clamp(600px, calc(100vh - var(--header-h)), 880px);
  min-height: clamp(600px, calc(100svh - var(--header-h)), 880px);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; background: var(--light); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 70% center; }
.hero-container { position: relative; padding-top: 140px; }
.hero-panel {
  position: relative; width: min(780px, 66%);
  padding: 56px 56px 30px;
  background: var(--white);
}
.hero-panel::before, .quote-card::before {
  content: ""; position: absolute; top: 0; left: 0; width: 96px; height: 5px; background: var(--accent);
}
.hero-panel .eyebrow { margin-bottom: 22px; }
.hero-subtitle { max-width: 520px; margin-top: 24px; }
.hero-panel .btn-row { margin-top: 36px; }
.hero-shortcuts {
  display: flex; flex-wrap: wrap; gap: 6px 28px;
  margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line);
}

/* Servizi */
.services { display: flex; flex-direction: column; gap: 120px; margin-top: 96px; }
.service {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center; gap: 72px;
  scroll-margin-top: calc(var(--header-h) + 32px);
}
.service-reverse { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.service-reverse .service-photo { order: 2; }
.service-photo { position: relative; aspect-ratio: 4 / 3; background: var(--light); overflow: hidden; }
.service-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.service:hover .service-photo img { transform: scale(1.03); }
.service-number {
  position: absolute; left: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  width: 92px; height: 92px; background: var(--white); color: var(--accent);
  font-family: var(--font-head); font-size: 30px; font-weight: 800; letter-spacing: -.02em;
}
.service-reverse .service-number { left: auto; right: 0; }
.service-body { display: flex; flex-direction: column; align-items: flex-start; }
.service-body .title-md { margin: 26px 0 16px; }
.service-body > p { color: var(--text-soft); }
.service-body .btn { margin-top: 34px; }

/* Lavori */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line);
}
.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.tile { grid-column: span 4; height: 370px; animation: tile-in .5s var(--ease) both; }
.tile-7 { grid-column: span 7; }
.tile-5 { grid-column: span 5; }
.tile-6 { grid-column: span 6; }
.gallery.is-filtered .tile { grid-column: span 6; }
@keyframes tile-in { from { opacity: 0; transform: scale(.97); } }
.work-card {
  position: relative; display: block; width: 100%; height: 100%;
  margin: 0; padding: 0; border: 0; overflow: hidden;
  background: var(--dark); color: var(--white); text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.work-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.work-card:hover img { transform: scale(1.05); }
.work-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.work-shade { position: absolute; left: 0; right: 0; bottom: 0; height: 60%; background: linear-gradient(to top, rgba(22, 23, 26, .82), transparent); pointer-events: none; }
.work-caption { position: absolute; left: 24px; right: 76px; bottom: 22px; display: flex; flex-direction: column; gap: 6px; }
.work-category { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; opacity: .85; }
.work-title { font-family: var(--font-head); font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.work-zoom {
  position: absolute; right: 20px; bottom: 20px;
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; background: var(--accent);
  opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease;
}
.work-card:hover .work-zoom, .work-card:focus-visible .work-zoom { opacity: 1; transform: none; }
@media (hover: none) { .work-zoom { opacity: 1; transform: none; } }
.gallery-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px; margin-top: 40px; }
.gallery-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.gallery-cta .lead { color: var(--white); }

/* Chi siamo */
.about { overflow: hidden; }
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; gap: 96px; }
.about-visual { position: relative; padding: 0 0 72px 28px; }
.about-frame { position: absolute; top: -28px; left: 0; width: 62%; height: 58%; border: 2px solid var(--accent); }
.about-photo { position: relative; aspect-ratio: 4 / 5; background: rgba(35, 36, 39, .08); }
.about-detail {
  position: absolute; right: -40px; bottom: 0; width: 52%; aspect-ratio: 4 / 3;
  border: 10px solid var(--light); background: rgba(35, 36, 39, .08);
}
.about-photo img, .about-detail img { width: 100%; height: 100%; object-fit: cover; }
.about-content .lead-xl { margin-top: 32px; }
.about-text { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; color: var(--text-soft); }
.about-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
  margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line);
}

/* Perché EERIS */
.features {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 72px; border-top: 2px solid var(--text);
}
.feature { display: flex; flex-direction: column; gap: 14px; padding: 40px 32px 8px; border-left: 1px solid var(--line); }
.feature:first-child { padding-left: 0; border-left: 0; }
.feature:last-child { padding-right: 0; }
.feature p { color: var(--text-soft); }
.feature-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 26px; }
.feature-index { font-family: var(--font-head); font-size: 13px; font-weight: 700; letter-spacing: .14em; color: rgba(35, 36, 39, .4); }

/* Contatti */
.section-accent { padding: 120px 0; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: end; gap: 80px; }
.contact-text { max-width: 420px; margin-top: 20px; }
.contact-box { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding-left: 56px; border-left: 1px solid var(--line); }
.contact-phone {
  font-family: var(--font-head); font-size: clamp(40px, 6vw, 84px); font-weight: 800;
  line-height: 1; letter-spacing: -.035em; white-space: nowrap;
  transition: opacity .25s ease;
}
.contact-phone:hover { opacity: .82; }
.contact-phone:focus-visible { outline-color: var(--white); outline-offset: 6px; }
.contact-box .btn-row { margin-top: 28px; }
.section-accent :focus-visible { outline-color: var(--white); }

/* 8. MODULO PREVENTIVO */
.quote-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; gap: 80px; }
.quote-aside { position: sticky; top: calc(var(--header-h) + 40px); display: flex; flex-direction: column; gap: 44px; }
.quote-aside .lead { margin-top: 20px; }
.steps { border-top: 2px solid var(--text); }
.step { display: flex; align-items: flex-start; gap: 22px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.step-number { flex: none; width: 34px; padding-top: 3px; font-family: var(--font-head); font-size: 13px; font-weight: 800; letter-spacing: .1em; color: var(--accent-text); }
.step .title-sm { margin-bottom: 6px; }
.quote-call { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.quote-card {
  position: relative; padding: 56px;
  background: var(--white); box-shadow: var(--shadow-card);
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.quote-form { display: flex; flex-direction: column; gap: 28px; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field:focus { outline: none; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.label {
  display: block; margin-bottom: 9px; padding: 0;
  font-family: var(--font-head); font-size: 13px; font-weight: 700; line-height: 1.35; letter-spacing: .04em;
}
.req { color: var(--accent-text); }
.control {
  width: 100%; height: 56px; margin: 0; padding: 0 18px;
  border: 1.5px solid rgba(35, 36, 39, .2); border-radius: var(--radius);
  background: var(--white); font-size: 16px; line-height: 1.4;
  outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.control::placeholder { color: rgba(35, 36, 39, .42); }
.control:hover { border-color: rgba(35, 36, 39, .4); }
.control:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(239, 69, 75, .18); }
.control-textarea { height: auto; min-height: 160px; padding: 16px 18px; resize: vertical; }
.control.is-invalid, .is-invalid .control { border-color: var(--accent-text); }
.hint { margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--text-soft); }
.hint-top { margin: -3px 0 12px; }
.error { margin-top: 8px; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--accent-text); }

.select-wrap, .input-wrap { position: relative; }
.select-wrap .control { padding: 0 38px 0 14px; cursor: pointer; text-overflow: ellipsis; }
.select-wrap .control:invalid { color: rgba(35, 36, 39, .5); }
.select-wrap option { color: var(--black); }
.select-wrap .icon { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); pointer-events: none; color: rgba(35, 36, 39, .6); }
.input-wrap .control { padding: 0 40px 0 14px; }
.input-suffix { position: absolute; top: 50%; right: 13px; transform: translateY(-50%); font-size: 14px; font-weight: 600; color: rgba(35, 36, 39, .5); pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.check-chip {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 20px 0 14px;
  border: 1.5px solid rgba(35, 36, 39, .2); border-radius: 999px;
  background: var(--white); font-size: 15px; font-weight: 600; line-height: 1;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: border-color .2s ease, background-color .2s ease;
}
.check-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-chip:hover { border-color: rgba(35, 36, 39, .5); }
.check-chip:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(239, 69, 75, .25); }
.check-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border: 1.5px solid rgba(35, 36, 39, .3); border-radius: 50%;
  color: transparent; transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.check-chip:has(input:checked) { border-color: var(--accent); background: #fdeeee; }
.check-chip:has(input:checked) .check-mark { border-color: var(--accent); background: var(--accent); color: var(--white); }
.is-invalid .check-chip { border-color: rgba(201, 40, 46, .6); }

/* Configuratore infissi */
.config {
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 16px 22px 18px;
  border-left: 4px solid var(--accent); background: rgba(35, 36, 39, .04);
  animation: tile-in .35s var(--ease) both;
}
.config + .config { margin-top: 20px; }
.config-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.config-count { flex: none; font-family: var(--font-head); font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--text-soft); }
.config-items { display: flex; flex-direction: column; gap: 14px; }
.config-item { padding: 14px 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.config-item-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 32px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.config-item-title { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.config-item-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.config-remove {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px;
  border: 0; background: none; color: var(--text-soft); font-size: 13px; font-weight: 600;
  transition: color .2s ease;
}
.config-remove:hover { color: var(--accent-text); }
.config-remove .icon { width: 16px; height: 16px; }
.config-body { display: flex; flex-direction: column; gap: 14px; }
.config-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.config-triple { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 12px; }
.config .label { font-size: 12px; }
.config-add { align-self: flex-start; }
.config-limit { font-size: 13px; color: var(--text-soft); }

/* Upload foto */
.drop {
  position: relative; display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; border: 1.5px dashed rgba(35, 36, 39, .28); border-radius: var(--radius);
  background: rgba(35, 36, 39, .025);
  transition: border-color .2s ease, background-color .2s ease;
}
.drop.is-dragover { border-color: var(--accent); background: #fdeeee; }
.drop-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--line); color: var(--accent);
}
.drop-button {
  padding: 0; border: 0; background: none; text-align: left;
  font-size: 15px; font-weight: 700;
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.drop .hint { margin-top: 4px; }
.files { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.files:empty { display: none; }
.file {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 8px; border-radius: 10px; background: rgba(35, 36, 39, .05); font-size: 14px;
}
.file img { width: 40px; height: 40px; flex: none; object-fit: cover; border-radius: 6px; background: var(--light); }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-size { flex: none; color: var(--text-soft); }
.file-remove {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-soft);
  transition: background-color .2s ease, color .2s ease;
}
.file-remove:hover { background: rgba(35, 36, 39, .1); color: var(--text); }

/* Consenso */
.consent { display: flex; align-items: flex-start; gap: 14px; }
.checkbox { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.is-invalid .checkbox { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.consent-label { font-size: 14px; line-height: 1.55; color: var(--text-soft); cursor: pointer; }
.consent-label a, .legal a { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

.submit-area { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.submit-error {
  padding: 16px 18px; border-left: 4px solid var(--accent); background: #fdeeee;
  font-size: 15px; font-weight: 600; line-height: 1.5;
}
.submit-error a { text-decoration: underline; }
.form-note { font-size: 13px; line-height: 1.5; text-align: center; color: var(--text-soft); }
.btn .spinner { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: var(--white); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.success { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding: 32px 0; }
.success:focus { outline: none; }
.success .btn { margin-top: 12px; }
.dev-note { padding: 12px 16px; border-radius: 10px; background: #fff6d6; font-size: 14px; }

/* 9. FOOTER */
.site-footer { padding: 96px 0 40px; background: var(--black); color: var(--white); --text-soft: rgba(255, 255, 255, .7); }
.footer-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 2fr) minmax(0, 2.5fr) minmax(0, 2.5fr); gap: 56px; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }
.footer-brand p { max-width: 380px; color: var(--text-soft); }
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.footer-list { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 40px;
  margin-top: 80px; padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, .16);
}
.footer-bottom .small { color: rgba(255, 255, 255, .7); font-size: 14px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 28px; }

/* 10. LIGHTBOX */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 76px 24px 28px; border: 0;
  background: rgba(22, 23, 26, .96); color: var(--white);
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; animation: fade-in .25s ease; }
.lightbox::backdrop { background: transparent; }
@keyframes fade-in { from { opacity: 0; } }
.lightbox-close { position: absolute; top: 16px; right: 20px; }
.lightbox-figure { display: flex; flex-direction: column; gap: 16px; min-height: 0; max-width: min(1200px, 100%); }
.lightbox-img { min-height: 0; max-width: 100%; max-height: calc(100dvh - 230px); object-fit: contain; background: var(--dark); }
.lightbox-caption { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.lightbox-caption > span:first-child { display: flex; flex-direction: column; gap: 6px; }
.lightbox-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; line-height: 1.25; }
.lightbox-counter { flex: none; font-family: var(--font-head); font-size: 13px; font-weight: 700; letter-spacing: .1em; opacity: .7; }
.lightbox-nav { display: flex; gap: 12px; }

/* 11. ANIMAZIONI DI COMPARSA (attive solo con JavaScript) */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* 12. RESPONSIVE */
@media (max-width: 1420px) {
  .whatsapp-float { right: 18px; bottom: 18px; width: 54px; padding: 0; justify-content: center; }
  .whatsapp-float-label { display: none; }
}
@media (max-width: 1200px) {
  .header-phone { display: none; }
  .main-nav { gap: 28px; }
}
@media (max-width: 1020px) {
  .main-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .header-actions { gap: 12px; }

  .section { padding: 96px 0 104px; }
  .section-head { grid-template-columns: 1fr; gap: 24px; }
  .section-head-ruled { padding-bottom: 40px; }

  .hero-panel { width: min(640px, 82%); padding: 44px 40px 26px; }

  .services { gap: 88px; margin-top: 64px; }
  .service, .service-reverse { grid-template-columns: 1fr; gap: 36px; }
  .service-reverse .service-photo { order: 0; }
  .service-reverse .service-number { left: 0; right: auto; }

  .filters { margin-top: 40px; }
  .tile, .tile-7, .tile-5 { grid-column: span 6; height: 300px; }
  .gallery:not(.is-filtered) .tile-6:last-child { grid-column: span 12; }

  .about-grid { grid-template-columns: 1fr; gap: 64px; }
  .about-visual { max-width: 560px; margin-right: 40px; }
  .about-photo { aspect-ratio: 5 / 4; }

  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 56px; }
  .feature { padding: 36px 28px; }
  .feature:nth-child(odd) { padding-left: 0; border-left: 0; }
  .feature:nth-child(even) { padding-right: 0; }
  .feature:nth-child(n+3) { border-top: 1px solid var(--line); }

  .quote-grid { grid-template-columns: 1fr; gap: 56px; }
  .quote-aside { position: static; gap: 36px; }

  .section-accent { padding: 96px 0; }
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .contact-box { padding: 40px 0 0; border-left: 0; border-top: 1px solid var(--line); }

  .footer-top { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 40px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  :root { --gutter: 20px; --header-h: 66px; }
  .header-cta { display: none; }
  .quick-bar { display: flex; }
  .whatsapp-float { display: none; }
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }

  .section { padding: 72px 0 80px; }
  .lead { font-size: 17px; }

  .hero { display: block; min-height: 0; }
  .hero-media { position: relative; height: clamp(230px, 58vw, 420px); }
  .hero-container { padding: 0; }
  .hero-panel { width: 100%; padding: 36px 20px 30px; }
  .hero-panel .btn-row { flex-direction: column; margin-top: 30px; }
  .hero-shortcuts { margin-top: 34px; }

  .services { gap: 72px; margin-top: 48px; }
  .service-number { width: 68px; height: 68px; font-size: 22px; }
  .service-body .btn { align-self: stretch; }

  .filters { flex-wrap: nowrap; margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter); overflow-x: auto; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .gallery { gap: 12px; }
  .tile, .tile-7, .tile-5, .gallery.is-filtered .tile { grid-column: span 12; height: auto; aspect-ratio: 4 / 3; }
  .gallery-bottom { flex-direction: column-reverse; align-items: flex-start; }

  .about-grid { gap: 48px; }
  .about-visual { margin-right: 20px; padding: 0 0 48px 16px; }
  .about-frame { top: -16px; }
  .about-detail { right: -20px; width: 50%; border-width: 6px; }

  .features { grid-template-columns: 1fr; margin-top: 44px; }
  .feature, .feature:nth-child(odd), .feature:nth-child(even) { padding: 30px 0; border-left: 0; }
  .feature + .feature { border-top: 1px solid var(--line); }
  .feature-top { margin-bottom: 14px; }

  .quote-grid { gap: 44px; }
  .quote-card { margin: 0 -8px; padding: 36px 20px 32px; }
  .quote-form { gap: 24px; }
  .field-pair { grid-template-columns: 1fr; }
  .config { margin: 0 -8px; padding: 18px 12px 20px; }
  .config-pair { grid-template-columns: 1fr; }
  .config-triple { grid-template-columns: 1fr 1fr; }
  .config-qty { grid-column: 1 / -1; }
  .config-add { align-self: stretch; }

  .section-accent { padding: 72px 0; }
  .contact-box .btn-row { flex-direction: column; align-self: stretch; }

  .site-footer { padding: 72px 0 40px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 40px 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; margin-top: 56px; }

  .lightbox { padding: 68px 12px 20px; }
}
@media (max-width: 520px) {
  /* i pulsanti lunghi vanno a capo invece di allargare la pagina */
  .btn { height: auto; min-height: 52px; padding: 12px 22px; white-space: normal; line-height: 1.25; }
  .btn-sm { min-height: 42px; padding: 8px 18px; }
  .btn-lg { min-height: 58px; padding: 14px 24px; font-size: 13px; }
  .quick-bar .btn { min-height: 50px; padding: 0 12px; white-space: nowrap; }
  .check-list { grid-template-columns: 1fr; }
  .chips { gap: 8px; }
  .check-chip { height: 44px; padding: 0 16px 0 12px; font-size: 14px; }
}

/* 13. PAGINE LEGALI E DI SERVIZIO */
.legal { padding: 72px 0 110px; }
.legal .container { max-width: 820px; }
.legal h1 { margin-bottom: 12px; }
.legal h2 { margin: 44px 0 12px; font-family: var(--font-head); font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.legal p, .legal li { color: var(--text-soft); }
.legal p + p { margin-top: 12px; }
.legal ul { margin: 12px 0; padding-left: 22px; list-style: disc; }
.legal li + li { margin-top: 6px; }
.legal li::marker { color: var(--accent); }
.legal .updated { margin-top: 0; font-size: 14px; }
.todo { background: #fff3c4; color: var(--text); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.page-simple { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; padding: 80px 0; }
.page-simple .btn-row { margin-top: 32px; }
.page-simple .lead { margin-top: 20px; max-width: 560px; }
@media (max-width: 768px) { .legal body, body.page-legal { padding-bottom: 0; } }
