/* AIMC — Sito rinnovato (mobile-first)
   Colori ispirati al brand (blu #114581, teal #57c1b6) con look moderno. */

:root {
  --blu: #114581;
  --blu-chiaro: #227bc3;
  --blu-scuro: #0b2f5c;
  --teal: #57c1b6;
  --teal-scuro: #2e9c92;
  --testo: #2d3a45;
  --intestazione: #14202c;
  --chiaro: #ffffff;
  --grigio-bg: #f4f7fb;
  --grigio-muto: #5f6f7e;
  --bordo: #dbe4ee;
  --ombra: 0 10px 30px rgba(11, 47, 92, .10);
  --ombra-piccola: 0 4px 14px rgba(11, 47, 92, .08);
  --raggio: 14px;
  --raggio-piccolo: 10px;
  --gradiente: linear-gradient(135deg, var(--blu-scuro), var(--blu) 60%, var(--blu-chiaro));
  --font-testo: 'Muli', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  --font-titolo: 'Questrial', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: var(--font-testo);
  font-size: 16px;
  line-height: 1.75;
  color: var(--testo);
  background: var(--chiaro);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-titolo);
  color: var(--intestazione);
  line-height: 1.25;
  font-weight: 500;
  margin-bottom: .55em;
}
h1 { font-size: clamp(30px, 5vw, 46px); }
h2 { font-size: clamp(24px, 4vw, 32px); }
h3 { font-size: clamp(19px, 3vw, 23px); }
h4 { font-size: 18px; }

a { color: var(--blu); text-decoration: none; }
a:hover { color: var(--blu-chiaro); text-decoration: underline; }
p { margin-bottom: 1em; }
img { max-width: 100%; height: auto; display: inline-block; }
figure { margin: 0; }

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

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 2000;
  background: var(--blu-scuro); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bordo);
  transition: box-shadow .25s;
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(11, 47, 92, .12); }

.topbar {
  background: var(--blu-scuro);
  color: #d6e4f6;
  font-size: 13px;
  padding: 7px 0;
}
.topbar .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topbar a { color: #d6e4f6; }
.topbar a:hover { color: #fff; text-decoration: none; }
.topbar .topbar-links { display: flex; gap: 18px; align-items: center; }

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 46px; height: 46px; object-fit: contain; border-radius: 50%; background: #fff; padding: 2px; box-shadow: 0 2px 8px rgba(11,47,92,.18); }
.brand .brand-text { line-height: 1.15; }
.brand .site-name { font-family: var(--font-titolo); font-size: 20px; color: var(--blu-scuro); letter-spacing: .3px; }
.brand .site-sub { font-size: 11.5px; color: var(--grigio-muto); display: block; }
.brand:hover { text-decoration: none; }

/* ---------- Navigazione desktop ---------- */
.site-nav ul { list-style: none; display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav > ul > li > a {
  display: block;
  padding: 10px 11px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--testo);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all .18s;
}
.site-nav > ul > li > a:hover { color: var(--blu); background: #eef4fb; text-decoration: none; }
.site-nav > ul > li.active > a {
  color: var(--blu);
  background: #e9f4fb;
  border-color: rgba(34, 123, 195, .35);
}
.site-nav li.has-children { position: relative; }
.site-nav li.has-children > a::after {
  content: '▾';
  font-size: 10px;
  margin-left: 5px;
  opacity: .7;
}
.site-nav li.has-children > .submenu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #fff;
  border: 1px solid var(--bordo);
  border-radius: var(--raggio-piccolo);
  min-width: 230px;
  box-shadow: var(--ombra);
  z-index: 60;
  padding: 8px;
  flex-direction: column;
  align-items: stretch;
  animation: dropIn .18s ease;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.site-nav li.has-children:hover > .submenu { display: flex; }
.site-nav .submenu a {
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--testo);
}
.site-nav .submenu a:hover { background: var(--grigio-bg); color: var(--blu); text-decoration: none; }
.site-nav .submenu li.active a { background: #e9f4fb; color: var(--blu); }

.menu-toggle {
  display: none;
  background: var(--blu);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-testo);
  line-height: 1;
  box-shadow: var(--ombra-piccola);
}
.menu-toggle:hover { background: var(--blu-chiaro); }

/* drawer menu mobile */
.menu-backdrop { display: none; position: fixed; inset: 0; background: rgba(11, 20, 35, .5); z-index: 940; }
.menu-backdrop.open { display: block; }

/* ---------- Hero home ---------- */
.hero {
  position: relative;
  color: #fff;
  background: var(--gradiente);
  overflow: hidden;
  padding: clamp(56px, 10vw, 110px) 0;
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(87, 193, 182, .35), transparent 60%);
  top: -160px; right: -120px;
}
.hero::after {
  content: '';
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 123, 195, .4), transparent 60%);
  bottom: -140px; left: -100px;
}
.hero .container { position: relative; z-index: 2; }
.hero .hero-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(87, 193, 182, .15);
  border: 1px solid rgba(87, 193, 182, .4);
  padding: 6px 16px;
  border-radius: 40px;
  margin-bottom: 18px;
}
.hero h1 { color: #fff; font-size: clamp(34px, 6vw, 58px); margin-bottom: 10px; }
.hero .hero-sub { font-size: clamp(16px, 2.4vw, 20px); color: #cfe1f6; margin-bottom: 20px; }
.hero .hero-text { max-width: 780px; margin: 0 auto 26px; color: #e4eefb; font-size: 16.5px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .btn-inverse { background: #fff; color: var(--blu); border-color: #fff; }
.hero .btn-inverse:hover { background: var(--teal); color: var(--blu-scuro); border-color: var(--teal); }

/* ---------- Page hero ---------- */
.page-hero {
  position: relative;
  background: var(--gradiente);
  color: #fff;
  padding: clamp(28px, 5vw, 48px) 0;
  overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(87, 193, 182, .28), transparent 60%);
  right: -60px; top: -80px;
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 { color: #fff; font-size: clamp(26px, 4.4vw, 38px); margin: 6px 0 0; }
.breadcrumb { font-size: 13px; color: #cfe1f6; }
.breadcrumb a { color: #eaf3fd; font-weight: 600; }
.breadcrumb a:hover { color: var(--teal); text-decoration: none; }

/* ---------- Contenuto ---------- */
.main-content { padding: clamp(34px, 6vw, 60px) 0; }
.content-card {
  background: #fff;
  border: 1px solid var(--bordo);
  border-radius: var(--raggio);
  padding: clamp(22px, 4vw, 42px);
  box-shadow: var(--ombra-piccola);
}
.content-card h2 {
  color: var(--blu-scuro);
  padding-bottom: 10px;
  border-bottom: 3px solid var(--teal);
  margin-bottom: 20px;
}
.content-card h3 { color: var(--blu); margin-top: 18px; }
.content-card ul, .content-card ol { padding-left: 24px; margin-bottom: 1.2em; }
.content-card li { margin-bottom: .45em; }
.content-card blockquote {
  border-left: 4px solid var(--teal);
  background: #f0faf8;
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
  margin: 1.2em 0;
  font-style: italic;
}

/* ---------- Tabelle (contenuti recuperati) ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 1.4em 0;
  border: 1px solid var(--bordo);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 480px;
}
.table-wrap th, .table-wrap td {
  padding: 11px 14px;
  border-bottom: 1px solid #e8eef6;
  vertical-align: top;
  text-align: left;
}
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap tr:first-child td {
  background: var(--blu);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  font-family: var(--font-titolo);
  letter-spacing: .3px;
}
.table-wrap tr:first-child td a, .table-wrap tr:first-child td strong { color: #fff; }
.table-wrap tr:nth-child(even) td { background: #f8fafd; }
.table-wrap tr:hover td { background: #eef4fb; }
.table-wrap tr:first-child:hover td { background: var(--blu); }

table.data-table {
  width: 100%; border-collapse: collapse; font-size: 14px; min-width: 400px;
}
table.data-table th {
  background: var(--blu); color: #fff; text-align: left; padding: 11px 14px;
  font-family: var(--font-titolo); font-weight: 500; white-space: nowrap;
}
table.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--bordo); }

/* ---------- Griglie e card ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 20px;
  margin: 24px 0;
}
.card {
  display: flex; flex-direction: column;
  border: 1px solid var(--bordo);
  border-radius: var(--raggio);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--ombra-piccola);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--ombra); }
.card .card-body { padding: 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { color: var(--blu-scuro); font-size: 18px; margin: 0; }
.card .card-desc { font-size: 14.5px; color: var(--grigio-muto); flex: 1; }
.card .btn { align-self: flex-start; margin-top: 6px; }

/* ---------- Quote / prezzi ---------- */
.price-card {
  border: 1px solid var(--bordo);
  border-radius: var(--raggio);
  padding: 26px 18px;
  text-align: center;
  background: linear-gradient(180deg, #fbfdff, #f4f7fb);
  box-shadow: var(--ombra-piccola);
}
.price-card .cat { font-weight: 700; color: var(--blu); font-size: 15px; }
.price-card .prezzo {
  font-family: var(--font-titolo);
  font-size: clamp(30px, 5vw, 40px);
  color: var(--blu-scuro);
  margin: 10px 0;
}
.price-card .prezzo small { font-size: 14px; color: var(--grigio-muto); }
.price-card .anno { display: inline-block; font-size: 12px; font-weight: 700; background: var(--teal); color: var(--blu-scuro); border-radius: 30px; padding: 3px 12px; }

/* ---------- Info box ---------- */
.info-box {
  background: linear-gradient(180deg, #f4fbfa, #edf8f6);
  border-left: 5px solid var(--teal);
  padding: 18px 22px;
  border-radius: 0 var(--raggio-piccolo) var(--raggio-piccolo) 0;
  margin: 20px 0;
  font-size: 15px;
}
.info-box strong { color: var(--blu-scuro); }
.info-box.success {
  background: linear-gradient(180deg, #eef9f0, #e3f5e7);
  border-left-color: #2f9e44;
}
.info-box.success strong { color: #17692a; }
.info-box.error {
  background: linear-gradient(180deg, #fdf0f0, #f9e5e5);
  border-left-color: #d64545;
}
.info-box.error strong { color: #a02020; }
.info-box.error ul { margin: 10px 0 0 18px; padding: 0; }
.hp-field { position: absolute; left: -9999px; top: -9999px; height: 0; width: 0; overflow: hidden; }

/* ---------- Form ---------- */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .4px;
  margin-bottom: 7px; color: var(--blu-scuro);
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--bordo);
  border-radius: var(--raggio-piccolo);
  font-size: 15px;
  font-family: var(--font-testo);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--blu-chiaro);
  box-shadow: 0 0 0 4px rgba(34, 123, 195, .15);
}

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blu);
  color: #fff;
  border: 1px solid transparent;
  padding: 12px 24px;
  border-radius: 40px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-testo);
  transition: all .2s;
  box-shadow: var(--ombra-piccola);
}
.btn:hover { background: var(--blu-scuro); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-teal { background: var(--teal); color: var(--blu-scuro); }
.btn-teal:hover { background: var(--teal-scuro); }
.btn-ghost { background: transparent; border: 1px solid var(--blu); color: var(--blu); box-shadow: none; }
.btn-ghost:hover { background: #eef4fb; color: var(--blu); transform: none; }

/* ---------- Galleria foto ---------- */
.foto-sezione { margin-top: 30px; }
.foto-sezione h2 {
  font-size: clamp(19px, 3vw, 23px);
  color: var(--blu-scuro);
  padding-bottom: 8px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px;
}
.foto-sezione h2::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, var(--teal), transparent); }
.foto-conteggio { font-size: 13px; color: var(--grigio-muto); margin-bottom: 12px; }
.foto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: 10px;
}
.foto-grid img {
  width: 100%; height: 150px; object-fit: cover;
  border-radius: var(--raggio-piccolo);
  border: 1px solid var(--bordo);
  background: var(--grigio-bg);
  cursor: zoom-in;
  transition: transform .3s, box-shadow .2s;
}
.foto-grid img:hover { transform: scale(1.03); box-shadow: var(--ombra); }

/* ---------- Hub gallerie ---------- */
.foto-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 14px; margin-top: 14px; }
.foto-card a { display: block; border: 1px solid var(--bordo); border-radius: var(--raggio-piccolo); overflow: hidden; background: #fff; text-decoration: none; transition: box-shadow .2s, transform .2s; }
.foto-card a:hover { box-shadow: var(--ombra); transform: translateY(-3px); }
.foto-card img { width: 100%; height: 140px; object-fit: cover; display: block; }
.foto-card-titolo { display: block; font-weight: 700; color: var(--blu-scuro); padding: 10px 12px 2px; }
.foto-card-n { display: block; font-size: 13px; color: var(--grigio-muto); padding: 0 12px 10px; }

/* ---------- Paginazione ---------- */
.paginazione { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 22px 0 6px; }
.pag-btn, .pag-num { display: inline-block; padding: 8px 14px; border: 1px solid var(--bordo); border-radius: 999px; background: #fff; color: var(--blu); text-decoration: none; font-weight: 600; }
.pag-btn:hover, .pag-num:hover { border-color: var(--teal); }
.pag-corrente { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--blu); color: #fff; font-weight: 700; }

/* ---------- Lightbox ---------- */
.lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(8, 16, 30, .94);
  z-index: 1200;
  align-items: center; justify-content: center;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(94vw, 1200px);
  max-height: 86vh;
  border-radius: var(--raggio-piccolo);
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
  background: #fff;
  object-fit: contain;
}
.lightbox .lb-caption {
  position: absolute; bottom: 16px; left: 0; right: 0;
  text-align: center; color: #dfe9f5; font-size: 14px; padding: 0 90px;
}
.lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; font-size: 28px; cursor: pointer; line-height: 1;
  transition: background .2s;
}
.lightbox .lb-nav:hover { background: rgba(87, 193, 182, .5); }
.lightbox .lb-prev { left: 18px; }
.lightbox .lb-next { right: 18px; }
.lightbox .lb-close {
  position: absolute; top: 16px; right: 20px;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; font-size: 22px; cursor: pointer;
}
.lightbox .lb-close:hover { background: rgba(255,255,255,.3); }

/* ---------- Documenti ---------- */
.doc-list { list-style: none; padding-left: 0 !important; }
.doc-list li {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--bordo);
  border-radius: var(--raggio-piccolo);
  margin-bottom: 10px;
  background: #fff;
  transition: box-shadow .15s, border-color .15s;
}
.doc-list li:hover { box-shadow: var(--ombra-piccola); border-color: var(--blu-chiaro); }
.doc-list .doc-ico {
  flex: 0 0 44px; width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blu), var(--blu-chiaro));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; letter-spacing: .4px;
}
.doc-title { font-weight: 700; color: var(--blu-scuro); }
.doc-meta { font-size: 12.5px; color: var(--grigio-muto); }
.doc-dl { margin-left: auto; white-space: nowrap; }
.doc-dl .btn { padding: 9px 18px; font-size: 13px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--blu-scuro);
  color: #c8d6ea;
  padding: 50px 0 0;
  margin-top: 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 30px;
  padding-bottom: 30px;
}
.site-footer h4 {
  color: #fff; font-size: 16px; margin-bottom: 14px;
  position: relative; padding-bottom: 8px;
}
.site-footer h4::after { content: ''; position: absolute; left: 0; bottom: 0; width: 30px; height: 2px; background: var(--teal); }
.site-footer a { color: #c8d6ea; }
.site-footer a:hover { color: var(--teal); text-decoration: none; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 7px; font-size: 14px; }
.footer-contact li { display: flex; gap: 8px; align-items: baseline; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 18px 0;
  font-size: 13px;
  text-align: center;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: 22px; bottom: 22px;
  width: 48px; height: 48px;
  border: 0; border-radius: 14px;
  background: var(--blu); color: #fff;
  font-size: 20px; cursor: pointer;
  box-shadow: var(--ombra);
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: all .25s;
  z-index: 800;
}
.back-to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.back-to-top:hover { background: var(--blu-chiaro); }

/* ---------- Reveal scroll ---------- */
.reveal { transition: opacity .6s ease, transform .6s ease; }
html.js .reveal { opacity: 0; transform: translateY(24px); }
html.js .reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, .98);
  }
  .menu-toggle { display: inline-flex; }
  .site-nav {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(86vw, 340px);
    background: #fff;
    box-shadow: -12px 0 40px rgba(0,0,0,.18);
    transform: translateX(105%);
    transition: transform .3s ease;
    z-index: 960;
    overflow-y: auto;
    padding: 20px;
  }
  .site-nav.open { transform: none; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
  .site-nav > ul > li > a { padding: 12px 12px; font-size: 15px; border-radius: 10px; }
  .site-nav li.has-children.open > .submenu {
    display: flex; flex-direction: column; position: static;
    box-shadow: none; border: 0; padding: 0 0 0 12px; animation: none;
  }
  .site-nav li.has-children:hover > .submenu { display: none; }
  .site-nav li.has-children.open:hover > .submenu { display: flex; }
  .site-nav > ul > li.active > a { background: #e9f4fb; }
}

@media (max-width: 600px) {
  .topbar .container { justify-content: center; }
  .header-main { padding: 8px 0; }
  .brand .site-sub { display: none; }
  .content-card { padding: 20px 14px; }
  .hero { text-align: center; }
  .foto-grid img { height: 130px; }
  .doc-list li { flex-wrap: wrap; }
  .doc-dl { width: 100%; margin-left: 58px; }
  .lightbox .lb-nav { display: none; }
}