/* Analisi del sito · Evolution Clima — stessa identità del sito pubblico (colori, carattere da titolo),
   impaginata come cruscotto: prima la sintesi, poi i numeri, poi i dettagli. */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal; font-weight: 600 800; font-display: swap;
  src: url("../assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
}
:root {
  --green: #12904a; --green-700: #0c6e39; --green-800: #0a5730; --green-900: #0c3d28; --green-050: #eaf5ee;
  --blue: #2b9cd8; --blue-700: #1c7bad; --blue-050: #e8f4fb;
  --sun: #f2c009; --sun-soft: #f8d64b;
  --ink: #16201b; --muted: #55625b; --line: #e4e6e1; --cream: #fbfaf6; --sand: #f2f1ea; --white: #fff;
  --rosso: #b23a2f;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  --r: 16px; --r-lg: 22px;
  --ombra: 0 2px 6px rgba(16,40,28,.05), 0 12px 28px rgba(12,61,40,.07);
  --focus: 0 0 0 3px #fff, 0 0 0 6px var(--blue-700);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: 1.9rem; }
h2.titolo-sezione { font-size: 1.35rem; margin: clamp(26px, 4vw, 40px) 0 12px; }
h3 { font-size: 1.05rem; margin-bottom: 10px; }
p { margin: 0 0 .8em; }
.muto { color: var(--muted); }
a { color: var(--green-700); }
button { font: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--green-900); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 1000; font-weight: 600; }
.skip-link:focus { top: 8px; }
[hidden] { display: none !important; }
.contenitore { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }

/* Testata */
.testata { position: sticky; top: 0; z-index: 50; background: rgba(251,250,246,.92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.testata-interna { display: flex; align-items: center; gap: 16px; min-height: 68px; flex-wrap: wrap; padding-block: 8px; }
.marchio img { height: 40px; width: auto; display: block; }
.testata-titolo { display: flex; flex-direction: column; line-height: 1.15; }
.sopratitolo { font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--green-700); }
.testata-titolo strong { font-family: var(--display); font-size: 1.05rem; }
.testata-azioni { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.periodi { display: inline-flex; background: var(--sand); border-radius: 999px; padding: 3px; }
.periodo { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .92rem; color: var(--muted); min-height: 36px; }
.periodo[aria-pressed="true"] { background: var(--green-700); color: #fff; box-shadow: var(--ombra); }
.utente { font-size: .88rem; color: var(--muted); }
.btn-ghost { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-weight: 700; color: var(--green-800); min-height: 36px; }
.btn-ghost:hover { background: var(--green-050); }

/* Schede */
.scheda { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: 0 1px 2px rgba(16,40,28,.05); }
.scheda--verde { background: linear-gradient(135deg, var(--green-800), var(--green-900)); color: #fff; border-color: var(--green-900); box-shadow: var(--ombra); }

/* Accesso */
.accesso { display: grid; place-items: center; min-height: calc(100vh - 140px); padding-block: 40px; }
.accesso-scheda { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 6px; padding: 28px; }
.accesso-scheda h1 { margin-bottom: 4px; }
.accesso-scheda label { font-weight: 600; font-size: .95rem; margin-top: 10px; }
.accesso-scheda input { font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; min-height: 48px; }
.accesso-scheda input:focus { border-color: var(--blue-700); }
.btn-primario { margin-top: 14px; background: var(--green-700); color: #fff; border: 0; border-radius: 999px; padding: 14px 22px; font-weight: 700; min-height: 48px; }
.btn-primario:hover { background: var(--green-800); }
.btn-primario[disabled] { opacity: .6; cursor: progress; }
.errore { color: var(--rosso); font-size: .95rem; min-height: 1.3em; margin: 6px 0 0; }

/* Stato e sintesi */
.stato { min-height: 1.4em; margin: 18px 0 0; color: var(--muted); font-size: .95rem; }
.stato.errore { color: var(--rosso); }
.sintesi { margin-top: 18px; padding: clamp(22px, 3.5vw, 32px); }
.sintesi-testo { font-family: var(--display); font-weight: 700; font-size: clamp(1.25rem, 2.6vw, 1.75rem); line-height: 1.25; margin: 0 0 12px; max-width: 34ch; text-wrap: balance; }
.sintesi-nota { margin: 0; color: rgba(255,255,255,.78); font-size: .9rem; }
.link { background: none; border: 0; padding: 0; color: #fff; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* KPI */
.kpi { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.kpi-voce { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-nome { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi-valore { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-valore small { font-family: var(--font); font-size: .95rem; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.kpi-delta { font-size: .88rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.kpi-delta.su { color: var(--green-700); }
.kpi-delta.giu { color: var(--rosso); }
.kpi-delta i { font-style: normal; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--sand); font-size: .75rem; }
.kpi-delta.su i { background: var(--green-050); }
.kpi-delta.giu i { background: #f8e9e7; }
.kpi-spiega { font-size: .84rem; color: var(--muted); }

/* Grafico */
.grafico { margin: 0; padding: 18px 18px 12px; }
.grafico svg { display: block; width: 100%; height: auto; }
.grafico .barra { fill: var(--green-700); }
.grafico .barra:hover { fill: var(--blue-700); }
.grafico .asse { stroke: var(--line); stroke-width: 1; }
.grafico .etichetta { font: 600 13px var(--font); fill: var(--muted); }
.grafico .valore { font: 700 14px var(--font); fill: var(--green-900); }
.grafico-legenda { display: flex; gap: 18px; flex-wrap: wrap; font-size: .86rem; color: var(--muted); margin: 8px 2px 0; }
.grafico-legenda b { color: var(--ink); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Imbuto */
.imbuto { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); padding: 14px; }
.tappa { background: var(--sand); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.tappa.sito { background: var(--blue-050); }
.tappa.gestionale { background: var(--green-050); }
.tappa-nome { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: block; }
.tappa-valore { font-family: var(--display); font-size: 1.7rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tappa-pct { font-size: .84rem; color: var(--muted); display: block; }

/* Elenchi con barre */
.griglia-due { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 18px; }
.elenco ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.elenco li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; font-size: .95rem; }
.elenco .nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.elenco .n { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--green-900); }
.elenco .barra { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--sand); overflow: hidden; }
.elenco .barra > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-700), var(--blue-700)); width: var(--w, 0%); }
.elenco .vuoto { color: var(--muted); font-size: .93rem; }
.nota-fonti { margin: 26px 0 50px; font-size: .86rem; color: var(--muted); max-width: 70ch; }

@media (min-width: 700px) {
  .kpi { grid-template-columns: repeat(3, 1fr); }
  .imbuto { grid-template-columns: repeat(6, 1fr); }
  .griglia-due { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .testata-titolo strong { display: none; }
  .utente { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .elenco .barra > i { transition: width .6s cubic-bezier(.22,.61,.36,1); }
}
