/* =========================================================================
   Portale Accordo Quadro — Servizi Applicativi Cloud
   Design language modelled on Bootstrap Italia / Designers Italia.
   Hand-rolled, dependency-free.
   ========================================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --primary: #0059b3;
  --primary-dark: #00478f;
  --primary-light: #0073e6;
  --tertiary: #003354;
  --dark: #17324d;
  --secondary: #5e7887;
  --success: #008758;
  --warning: #a66300;
  --danger: #d92828;

  --azzurrino: #e5eef8;
  --azzurrino-soft: #f2f7fc;
  --light: #e9e6f2;
  --border: #c5c7c9;
  --border-soft: #e3e4e6;

  --text: #17324d;
  --text-muted: #435960;
  --text-invert: #ffffff;

  --bg: #ffffff;
  --bg-alt: #f9fafb;

  --font-sans: "Titillium Web", -apple-system, BlinkMacSystemFont, "Segoe UI", Geneva, Tahoma, sans-serif;

  --radius: 4px;
  --radius-lg: 8px;

  --shadow-sm: 0 1px 4px rgba(0, 43, 85, 0.1);
  --shadow: 0 4px 12px rgba(0, 43, 85, 0.12);
  --shadow-lg: 0 12px 32px rgba(0, 43, 85, 0.16);

  --header-h: 176px; /* fallback — site.js measures the real height at runtime */
  --container: 1140px;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- 2. Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
svg { display: block; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  font-weight: 700;
  line-height: 1.2;
  color: var(--dark);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.85rem, 1.2rem + 2vw, 2.75rem); }
h2 { font-size: clamp(1.55rem, 1.1rem + 1.5vw, 2.15rem); }
h3 { font-size: clamp(1.3rem, 1rem + 1vw, 1.65rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }

ul, ol { margin: 0 0 1rem; padding-left: 1.35rem; }
li { margin-bottom: .35rem; }

strong, b { font-weight: 700; }

hr { border: 0; border-top: 1px solid var(--border-soft); margin: 2rem 0; }

:focus-visible { outline: 3px solid #ffb700; outline-offset: 2px; border-radius: 2px; }

/* ---------- 3. Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.container-narrow { max-width: 860px; }

.section { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.section--tight { padding-block: clamp(1.75rem, 3vw, 2.75rem); }
.section--azzurrino { background: var(--azzurrino); }
.section--soft { background: var(--azzurrino-soft); }
.section--alt { background: var(--bg-alt); }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.lead { font-size: 1.125rem; color: var(--text-muted); }
.eyebrow {
  display: inline-block;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .5rem;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 1.5rem; }

.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;
}
.skiplinks a {
  position: absolute; left: 0; top: 0; z-index: 100;
  transform: translateY(-120%);
  background: var(--primary); color: #fff; padding: .75rem 1.25rem;
  text-decoration: none; font-weight: 600;
}
.skiplinks a:focus { transform: translateY(0); }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: inherit;
  font-size: .9375rem;
  font-weight: 600;
  line-height: 1.2;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .12s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.btn-tertiary { background: var(--tertiary); border-color: var(--tertiary); color: #fff; }
.btn-tertiary:hover { background: #002740; border-color: #002740; color: #fff; }

.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-white { background: #fff; border-color: #fff; color: var(--primary); }
.btn-white:hover { background: var(--azzurrino); border-color: var(--azzurrino); color: var(--primary-dark); }

.btn-ghost-white { background: transparent; border-color: rgba(255,255,255,.7); color: #fff; }
.btn-ghost-white:hover { background: rgba(255,255,255,.14); border-color: #fff; color: #fff; }

.btn-sm { padding: .5rem 1rem; font-size: .875rem; }
.btn-block { width: 100%; justify-content: center; }

.read-more {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 700; font-size: .9375rem; text-decoration: none;
  color: var(--primary);
}
.read-more::after { content: "›"; font-size: 1.25rem; line-height: 1; transition: transform .18s var(--ease); }
.read-more:hover::after { transform: translateX(3px); }

/* ---------- 5. Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

/* slim bar */
.header-slim { background: var(--primary); color: #fff; }
.header-slim .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 48px; gap: 1rem;
}
.header-slim__owner {
  color: #fff; text-decoration: none; font-size: .8125rem; font-weight: 600;
  letter-spacing: .02em; display: inline-flex; align-items: center; gap: .4rem;
}
.header-slim__owner:hover { color: #fff; text-decoration: underline; }
.header-slim__login {
  display: inline-flex; align-items: center; gap: .55rem;
  color: #fff; text-decoration: none; font-size: .875rem; font-weight: 600;
  padding: .35rem .5rem; border-radius: var(--radius);
}
.header-slim__login:hover { background: rgba(255,255,255,.14); color: #fff; }
.header-slim__login .icon-circle {
  width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.8);
  border-radius: 50%; display: grid; place-items: center;
}
.header-slim__login svg { width: 15px; height: 15px; }

/* center / brand bar */
.header-center { background: #fff; }
.header-center .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .85rem;
}
.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; color: var(--dark); }
.brand__mark { width: 46px; height: 46px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-size: 1.0625rem; font-weight: 700; color: var(--dark); }
.brand__tag { font-size: .8125rem; color: var(--text-muted); font-weight: 400; }

/* nav bar */
.header-nav { background: #fff; border-top: 1px solid var(--border-soft); }
.header-nav .container { display: flex; align-items: center; justify-content: space-between; }
/* The nav row carries its own compact brand for mobile, where .header-center is
   hidden. On desktop both would show and the branding would read twice. */
.header-nav .brand { display: none; }

.nav-toggle {
  display: none;
  background: none; border: 0; padding: .6rem; cursor: pointer; color: var(--primary);
}
.nav-toggle svg { width: 26px; height: 26px; }

.nav { display: flex; }
.nav__list { display: flex; list-style: none; margin: 0; padding: 0; gap: .25rem; }
.nav__list > li { margin: 0; position: relative; }

.nav__link {
  display: flex; align-items: center; gap: .35rem;
  padding: .95rem .9rem;
  font-size: .9375rem; font-weight: 600; color: var(--text-muted);
  text-decoration: none; background: none; border: 0; font-family: inherit;
  cursor: pointer; position: relative; white-space: nowrap;
}
.nav__link:hover { color: var(--primary); }
.nav__link::after {
  content: ""; position: absolute; left: .9rem; right: .9rem; bottom: 0;
  height: 3px; background: var(--primary); transform: scaleX(0); transform-origin: left;
  transition: transform .2s var(--ease);
}
.nav__link:hover::after,
.nav__item.is-open > .nav__link::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav__link[aria-current="page"] { color: var(--primary); }
.nav__caret { width: 12px; height: 12px; transition: transform .2s var(--ease); }
.nav__item.is-open .nav__caret { transform: rotate(180deg); }

.nav__dropdown {
  position: absolute; top: 100%; left: 0; min-width: 268px;
  background: #fff; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow); padding: .5rem 0; margin: 0; list-style: none;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
  border-top: 3px solid var(--primary);
}
.nav__item.is-open .nav__dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
/* keep the right-most dropdowns inside the viewport */
.nav__list > li:nth-last-child(-n+2) .nav__dropdown { left: auto; right: 0; }
.nav__dropdown li { margin: 0; }
.nav__dropdown a {
  display: block; padding: .6rem 1.1rem; font-size: .9375rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
}
.nav__dropdown a:hover { background: var(--azzurrino-soft); color: var(--primary); }
.nav__dropdown a[aria-current="page"] { color: var(--primary); }

.nav__close { display: none; }

@media (max-width: 991px) {
  :root { --header-h: 104px; }
  .nav-toggle { display: block; }
  .header-center { display: none; }
  .header-slim .container { min-height: 56px; }
  .header-nav .container { justify-content: flex-start; padding-block: .15rem; }
  .header-nav .brand { display: flex; }

  .nav {
    position: fixed; inset: 0 auto 0 0; width: min(340px, 88vw);
    background: #fff; z-index: 70; flex-direction: column;
    transform: translateX(-102%); transition: transform .28s var(--ease);
    box-shadow: var(--shadow-lg); overflow-y: auto; padding-bottom: 2rem;
  }
  body.nav-open .nav { transform: translateX(0); }
  body.nav-open { overflow: hidden; }

  .nav__close {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-soft);
  }
  .nav__close button { background: none; border: 0; cursor: pointer; color: var(--primary); padding: .35rem; }
  .nav__close svg { width: 22px; height: 22px; }

  .nav__list { flex-direction: column; gap: 0; padding: .5rem 0; }
  .nav__list > li { border-bottom: 1px solid var(--border-soft); }
  .nav__link { padding: .95rem 1.25rem; justify-content: space-between; width: 100%; }
  .nav__link::after { display: none; }
  .nav__item.is-open > .nav__link { color: var(--primary); }

  .nav__dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border-top: 0; border-radius: 0; padding: 0;
    display: none; background: var(--azzurrino-soft);
  }
  .nav__item.is-open .nav__dropdown { display: block; }
  .nav__dropdown a { padding: .7rem 1.25rem .7rem 2rem; }

  .nav-backdrop {
    position: fixed; inset: 0; background: rgba(23,50,77,.5); z-index: 65;
    opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s;
  }
  body.nav-open .nav-backdrop { opacity: 1; visibility: visible; }
}

/* ---------- 6. Main offset ---------- */
.main { flex: 1 0 auto; padding-top: var(--header-h); }

/* ---------- 7. Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--tertiary) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -12%; top: -30%;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.09) 0%, rgba(255,255,255,0) 68%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
  padding-block: clamp(2.5rem, 5vw, 4.25rem);
}
/* grid/flex children default to min-width:auto — without this the slider track
   (4 slides at 100% each) forces the column to its intrinsic width and the page
   scrolls sideways. */
.hero__grid > * { min-width: 0; }
.hero h1 { color: #fff; margin-bottom: 1rem; }
.hero__sub { color: rgba(255,255,255,.88); font-size: 1.0625rem; max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* hero slider */
.slider {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(2px);
}
.slider__viewport { overflow: hidden; min-width: 0; }
.slider__track { display: flex; transition: transform .5s var(--ease); }
.slider__slide { flex: 0 0 100%; min-width: 0; display: flex; gap: 1.25rem; align-items: center; }
.slider__slide > div { min-width: 0; }
.slider__slide img { width: 92px; flex: none; }
.slider__badge {
  display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: #9fd0ff; margin-bottom: .5rem;
}
.slider__title { color: #fff; font-size: 1.0625rem; font-weight: 600; line-height: 1.45; margin: 0; }
.slider__nav { display: flex; align-items: center; gap: .75rem; margin-top: 1.5rem; }
.slider__dots { display: flex; gap: .4rem; margin-right: auto; }
.slider__dot {
  width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.35); transition: background .2s, width .2s var(--ease);
}
.slider__dot[aria-current="true"] { background: #fff; width: 26px; border-radius: 5px; }
.slider__btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.5);
  background: transparent; color: #fff; cursor: pointer; display: grid; place-items: center;
  transition: background .2s;
}
.slider__btn:hover { background: rgba(255,255,255,.16); }
.slider__btn svg { width: 16px; height: 16px; }

@media (max-width: 480px) {
  .slider { padding: 1.25rem; }
  .slider__slide { flex-direction: column; align-items: flex-start; gap: .85rem; }
  .slider__slide img { width: 68px; }
}

/* ---------- 8. Page hero (inner pages) ---------- */
.page-hero {
  background: var(--tertiary);
  color: #fff;
  padding-block: clamp(2rem, 4vw, 3.25rem);
}
.page-hero h1 { color: #fff; margin-bottom: .35rem; }
.page-hero p { color: rgba(255,255,255,.85); max-width: 70ch; margin: 0; }

.breadcrumb { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1rem; font-size: .875rem; }
.breadcrumb li { margin: 0; color: rgba(255,255,255,.7); }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; opacity: .6; }
.breadcrumb a { color: rgba(255,255,255,.9); text-decoration: none; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }

/* ---------- 9. Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: box-shadow .22s var(--ease), transform .22s var(--ease), border-color .22s var(--ease);
  /* No `height: 100%` here — a definite cross-size stops flex/grid `stretch`,
     which left cards in a row at ragged heights. Stretch handles it. */
}
.cards-carousel__viewport { align-items: stretch; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: #cfe0f2; }
.card__icon {
  width: 52px; height: 52px; border-radius: var(--radius);
  background: var(--azzurrino); color: var(--primary);
  display: grid; place-items: center; flex: none;
}
.card__icon svg { width: 26px; height: 26px; }
.card__tag {
  display: inline-block; align-self: flex-start;
  font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  background: var(--azzurrino); color: var(--primary);
  padding: .25rem .55rem; border-radius: 3px;
}
.card__tag--accessorio { background: #e0f5e4; color: var(--success); }
.card h3, .card h4 { margin: 0; font-size: 1.0625rem; line-height: 1.35; }
.card p { color: var(--text-muted); font-size: .9375rem; margin: 0; }
.card .read-more { margin-top: auto; padding-top: .5rem; }

/* card carousel */
.cards-carousel { position: relative; }
.cards-carousel__viewport {
  display: flex; gap: 1.5rem; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; padding-bottom: 1rem; scrollbar-width: thin;
}
.cards-carousel__viewport::-webkit-scrollbar { height: 6px; }
.cards-carousel__viewport::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.cards-carousel__viewport > * { flex: 0 0 clamp(250px, 31%, 340px); scroll-snap-align: start; }
.cards-carousel__nav { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .25rem; }
.carousel-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--primary);
  background: #fff; color: var(--primary); cursor: pointer; display: grid; place-items: center;
  transition: background .2s, color .2s, opacity .2s;
}
.carousel-btn:hover:not(:disabled) { background: var(--primary); color: #fff; }
.carousel-btn:disabled { opacity: .3; cursor: default; }
.carousel-btn svg { width: 16px; height: 16px; }

/* ---------- 10. Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }

/* Long values (a full currency figure) need a roomier track. The default grid
   min is a *fixed* 200px, so an oversized number does not widen its column — it
   silently spills out of the card. Use this wherever a stat can run long. */
.stats--wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }

.stat {
  background: #fff; border-radius: var(--radius-lg); padding: 1.75rem 1.5rem;
  border-left: 5px solid var(--primary); box-shadow: var(--shadow-sm); text-align: left;
  min-width: 0;
}
.stat__value {
  font-size: clamp(1.9rem, 1.2rem + 2.2vw, 2.75rem);
  font-weight: 700; color: var(--primary); line-height: 1.05;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  /* a grouped number has no break opportunity — let it scale, not overflow */
  min-width: 0; overflow-wrap: break-word;
}
.stat__value small { font-size: .5em; font-weight: 600; margin-left: .15em; }
.stat__label { font-size: .9375rem; color: var(--text-muted); font-weight: 600; margin-top: .35rem; }

/* ---------- 11. Steps / timeline ---------- */
.steps { list-style: none; padding: 0; margin: 0; position: relative; }
.steps::before {
  content: ""; position: absolute; left: 27px; top: 12px; bottom: 12px;
  width: 2px; background: linear-gradient(var(--primary), var(--azzurrino));
}
.step { position: relative; padding-left: 4.75rem; margin-bottom: 2.5rem; }
.step:last-child { margin-bottom: 0; }
.step__num {
  position: absolute; left: 0; top: 0;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-size: 1.25rem; font-weight: 700;
  box-shadow: 0 0 0 6px #fff;
}
.step h3 {
  font-size: .9375rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary); margin-bottom: .6rem;
}
.step p, .step ul { color: var(--text-muted); }

@media (max-width: 560px) {
  .steps::before { display: none; }
  .step { padding-left: 0; padding-top: 4.25rem; }
  .step__num { width: 48px; height: 48px; font-size: 1.1rem; }
}

/* ---------- 12. Accordion ---------- */
.accordion { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }
.accordion + .accordion { margin-top: 1rem; }
.accordion__item + .accordion__item { border-top: 1px solid var(--border-soft); }
.accordion__trigger {
  width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  background: #fff; border: 0; padding: 1.1rem 1.35rem; cursor: pointer;
  font-family: inherit; font-size: 1rem; font-weight: 700; color: var(--dark);
  text-align: left; line-height: 1.4; transition: background .18s;
}
.accordion__trigger:hover { background: var(--azzurrino-soft); }
.accordion__trigger[aria-expanded="true"] { color: var(--primary); background: var(--azzurrino-soft); }
.accordion__icon {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--azzurrino); color: var(--primary);
  display: grid; place-items: center; transition: transform .22s var(--ease);
  margin-top: 2px;
}
.accordion__icon svg { width: 12px; height: 12px; }
.accordion__trigger[aria-expanded="true"] .accordion__icon { transform: rotate(180deg); background: var(--primary); color: #fff; }
.accordion__panel { display: none; padding: 0 1.35rem 1.35rem; color: var(--text-muted); }
.accordion__panel.is-open { display: block; }
.accordion__panel > :first-child { margin-top: 0; }

/* ---------- 13. Prose blocks ---------- */
.prose { max-width: 76ch; }
.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 2rem; }
.prose > :first-child { margin-top: 0; }
.prose ul li { margin-bottom: .5rem; }

.callout {
  background: var(--azzurrino-soft);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout--success { background: #e8f6ef; border-left-color: var(--success); }
.callout--warning { background: #fdf4e5; border-left-color: var(--warning); }

.lot-card {
  background: #fff; border: 1px solid var(--border-soft); border-top: 5px solid var(--primary);
  border-radius: var(--radius-lg); padding: 1.75rem;
}
.lot-card h3 { font-size: 1.0625rem; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); }
.lot-card__meta { font-size: .875rem; color: var(--text-muted); font-weight: 600; }

.pill-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.pill-list li { margin: 0; }
.pill {
  display: inline-block; background: #fff; border: 1px solid var(--border-soft);
  border-radius: 999px; padding: .4rem .9rem; font-size: .875rem; color: var(--text-muted);
}

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  position: relative; padding-left: 1.85rem; margin-bottom: .6rem; color: var(--text-muted);
}
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .5em;
  width: 8px; height: 8px; border-radius: 2px; background: var(--primary);
}

/* ---------- 14. News ---------- */
.news-card {
  display: grid; grid-template-columns: 92px 1fr; gap: 1.5rem;
  background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 1.5rem; transition: box-shadow .22s var(--ease), transform .22s var(--ease);
}
.news-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.news-card__date {
  background: var(--azzurrino); border-radius: var(--radius); padding: .75rem .5rem;
  text-align: center; height: fit-content; color: var(--primary);
}
.news-card__day { display: block; font-size: 1.75rem; font-weight: 700; line-height: 1; }
.news-card__month { display: block; font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.news-card__year { display: block; font-size: .75rem; opacity: .75; }
.news-card__author { font-size: .8125rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.news-card h3 { margin: .35rem 0 .5rem; font-size: 1.25rem; }
.news-card p { color: var(--text-muted); font-size: .9375rem; }

@media (max-width: 520px) {
  .news-card { grid-template-columns: 1fr; gap: 1rem; }
  .news-card__date { display: flex; gap: .4rem; align-items: baseline; width: fit-content; padding: .4rem .75rem; }
  .news-card__day, .news-card__month, .news-card__year { display: inline; font-size: .9375rem; }
}

/* ---------- 15. Documents ---------- */
.filters {
  background: var(--azzurrino-soft); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: 1.5rem;
}
.filters__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.filters__actions { display: flex; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap; }

.doc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.doc {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 1.25rem; align-items: center;
  background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem; margin: 0;
  transition: box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.doc:hover { box-shadow: var(--shadow-sm); border-color: #cfe0f2; }
.doc__ext {
  width: 56px; height: 64px; border-radius: var(--radius); position: relative;
  background: #f4f6f8; border: 1px solid var(--border-soft);
  display: grid; place-items: end center; padding-bottom: .5rem;
  font-size: .6875rem; font-weight: 700; text-transform: uppercase; color: #fff;
}
.doc__ext::before {
  content: ""; position: absolute; inset: .35rem .35rem 1.6rem; border-radius: 2px;
  background: repeating-linear-gradient(#dfe3e7 0 2px, transparent 2px 5px);
}
.doc__ext span {
  position: relative; padding: .1rem .4rem; border-radius: 2px; background: var(--secondary);
}
.doc__ext[data-ext="pdf"] span { background: #ea4435; }
.doc__ext[data-ext="docx"] span, .doc__ext[data-ext="doc"] span { background: #4a88e3; }
.doc__ext[data-ext="xlsx"] span, .doc__ext[data-ext="xls"] span { background: #0c9d58; }
.doc__ext[data-ext="zip"] span { background: #a66300; }

.doc h3 { font-size: 1.0625rem; margin: 0 0 .25rem; }
.doc__meta { font-size: .8125rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.doc__meta strong { color: var(--text); font-weight: 600; }
.doc__cat {
  display: inline-block; font-size: .6875rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: .15rem .5rem; border-radius: 3px;
  background: var(--azzurrino); color: var(--primary);
}
.doc__actions { display: flex; gap: .5rem; }

@media (max-width: 720px) {
  .doc { grid-template-columns: 48px 1fr; }
  .doc__ext { width: 44px; height: 52px; }
  .doc__actions { grid-column: 1 / -1; }
}

.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-muted);
  border: 2px dashed var(--border-soft); border-radius: var(--radius-lg);
}

/* ---------- 16. Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.form-field { display: flex; flex-direction: column; gap: .35rem; }
.form-field--full { grid-column: 1 / -1; }

label { font-size: .875rem; font-weight: 700; color: var(--dark); }
label .req { color: var(--danger); }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
input[type="search"], select, textarea {
  font-family: inherit; font-size: 1rem; color: var(--text);
  padding: .7rem .85rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; width: 100%;
  transition: border-color .18s, box-shadow .18s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 89, 179, .16);
}
textarea { resize: vertical; min-height: 140px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%235c6f82' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; background-size: 12px; padding-right: 2.25rem; }

.form-error { font-size: .8125rem; color: var(--danger); font-weight: 600; display: none; }
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea { border-color: var(--danger); }
.form-field.has-error .form-error { display: block; }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .6rem; }
.check {
  display: flex; align-items: flex-start; gap: .65rem;
  background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: .75rem .9rem; cursor: pointer; font-size: .9rem; font-weight: 400; color: var(--text-muted);
  transition: border-color .18s, background .18s;
}
.check:hover { border-color: var(--primary); }
.check input { accent-color: var(--primary); width: 18px; height: 18px; margin: 1px 0 0; flex: none; }
.check:has(input:checked) { border-color: var(--primary); background: var(--azzurrino-soft); color: var(--text); }
.check.has-error { border-color: var(--danger); background: #fdeded; color: var(--text); }
.check.has-error input { accent-color: var(--danger); outline: 2px solid var(--danger); outline-offset: 2px; }
.check strong { color: var(--dark); }

fieldset { border: 0; padding: 0; margin: 0 0 2rem; }
legend { font-size: 1.125rem; font-weight: 700; color: var(--dark); padding: 0; margin-bottom: 1rem; }

.form-note { font-size: .8125rem; color: var(--text-muted); }

.form-success {
  display: none;
  background: #e8f6ef; border: 1px solid #9fd9c1; border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem; color: #005c3c; font-weight: 600; margin-bottom: 1.5rem;
}
.form-success.is-visible { display: block; }

.form-banner-error {
  display: none;
  background: #fdeded; border: 1px solid #f0b4b4; border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem; color: #8e1b1b; font-weight: 600; margin-bottom: 1.5rem;
}
.form-banner-error.is-visible { display: block; }

/* Honeypot: off-screen rather than display:none — some bots skip fields that
   are explicitly hidden, but fill in everything they can reach. Kept out of the
   accessibility tree and the tab order so no human ever meets it. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: auto; width: 1px; height: 1px; overflow: hidden;
}

/* While a submission is in flight. */
.btn[aria-busy="true"] { opacity: .65; cursor: progress; }

.form-panel {
  background: #fff; border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: clamp(1.5rem, 3vw, 2.5rem);
  box-shadow: var(--shadow-sm);
}

/* ---------- 17. Contact strip / CTA ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--tertiary) 0%, var(--primary) 100%);
  color: #fff;
}
.cta-band .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; padding-block: clamp(2rem, 4vw, 3rem);
}
.cta-band h2 { color: #fff; margin-bottom: .25rem; }
.cta-band p { color: rgba(255,255,255,.85); margin: 0; }

.contact-card {
  background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 1.5rem; display: flex; gap: 1rem; align-items: flex-start;
}
.contact-card__icon {
  width: 44px; height: 44px; border-radius: 50%; background: var(--azzurrino);
  color: var(--primary); display: grid; place-items: center; flex: none;
}
.contact-card__icon svg { width: 20px; height: 20px; }
.contact-card h3 { font-size: 1rem; margin-bottom: .2rem; }
.contact-card p { font-size: .9375rem; color: var(--text-muted); }

/* ---------- 18. Partners ---------- */
.partner-strip { background: var(--bg-alt); border-top: 1px solid var(--border-soft); padding-block: 2.5rem; }
.partner-strip__title {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); text-align: center; margin-bottom: 1.5rem;
}
.partner-grid {
  /* 168px yields 6 columns in the 1140px container, so 12 companies fill two
     even rows instead of leaving a ragged 5/5/2. */
  display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: .75rem; align-items: stretch; list-style: none; padding: 0; margin: 0;
}
.partner-grid li { margin: 0; }

/* Names are set as type, not as reproduced brand marks. */
.partner-name {
  display: flex; align-items: center; justify-content: center; height: 100%;
  min-height: 58px; padding: .7rem .85rem;
  background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius);
  font-size: .8125rem; font-weight: 700; line-height: 1.3; letter-spacing: .01em;
  color: var(--text-muted); text-align: center; text-decoration: none;
  transition: border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.partner-name:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-sm); }

.partner-logo {
  display: grid; place-items: center; height: 100%; min-height: 58px; padding: .6rem .75rem;
  background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.partner-logo:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
/* A colori: la resa in scala di grigi rendeva illeggibili i marchi più chiari
   (IBM, TIM). Su un portale istituzionale i marchi dei partner vanno mostrati
   nella loro versione cromatica. */
.partner-logo img {
  max-height: 34px; max-width: 100%; width: auto;
  transition: transform .22s var(--ease);
}
.partner-logo:hover img { transform: scale(1.04); }

/* Marchi pubblicati solo in versione negativa: su fondo chiaro sarebbero
   invisibili, quindi la tessera adotta il fondo scuro previsto dal marchio. */
.partner-logo--dark { background: var(--dark); border-color: var(--dark); }
.partner-logo--dark:hover { border-color: var(--primary-light); }
.partner-logo--dark img { filter: none; opacity: .92; }
.partner-logo--dark:hover img { opacity: 1; }

.company {
  background: #fff; border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem;
}
.company__head { display: flex; align-items: center; gap: 1rem; min-height: 34px; min-width: 0; }
.company__logo-wrap {
  display: grid; place-items: center; padding: .35rem .5rem;
  border-radius: var(--radius); max-width: 100%; min-width: 0;
}
.company__logo-wrap--dark { background: var(--dark); padding: .5rem .75rem; }
/* Altezza definita, non solo max-height: un SVG con viewBox molto grande e
   nessuna dimensione intrinseca farebbe collassare il contenitore e sparire
   il logo (era il caso di net-service.svg, 4808x1079).
   object-fit evita la distorsione quando max-width interviene. */
.company__logo { height: 34px; width: auto; max-width: 100%; object-fit: contain; }
.company__name { font-size: 1rem; margin: 0; color: var(--dark); line-height: 1.35; }
.company__role {
  font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: .2rem .5rem; border-radius: 3px; background: var(--azzurrino); color: var(--primary);
}
.company__role--mandataria { background: var(--primary); color: #fff; }
.company p { font-size: .9375rem; color: var(--text-muted); }

/* ---------- 19. Footer ---------- */
.footer { background: var(--tertiary); color: rgba(255,255,255,.82); margin-top: auto; }
.footer a { color: rgba(255,255,255,.82); text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer__main { padding-block: 3rem 2rem; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.footer__brand { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.footer__brand .brand__name, .footer__brand .brand__tag { color: #fff; }
.footer__brand .brand__tag { color: rgba(255,255,255,.7); }
.footer p { font-size: .9375rem; }
.footer h2 {
  font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase;
  color: #fff; margin-bottom: 1rem; padding-bottom: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.2);
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .5rem; font-size: .9375rem; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.16);
  padding-block: 1.25rem;
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem;
  align-items: center; justify-content: space-between;
  font-size: .8125rem;
}
.footer__legal { display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.footer__legal li { margin: 0; }

@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- 20. Back to top ---------- */
.back-to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff; border: 0; cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s, background .2s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); }
.back-to-top svg { width: 20px; height: 20px; }

/* ---------- 21. Reveal on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
  .reveal.is-in { opacity: 1; transform: none; }
}

@media print {
  .header, .footer, .back-to-top, .cta-band { display: none !important; }
  .main { padding-top: 0; }
}
