:root {
  --bg: #ebf4f8;

  /* Surfaces */
  --card: #ffffff;
  --card2: rgba(255, 255, 255, .72);

  /* Typography */
  --text: #0f172a;
  --muted: #475569;

  /* Brand accents (adapted for light background) */
  --brand: #0ea5a4;   /* teal */
  --brand2: #2563eb;  /* blue */

  /* UI */
  --border: rgba(15, 23, 42, .12);
  --shadow: 0 14px 34px rgba(2, 8, 23, .12);
  --radius: 18px;
  --max: 1080px;
  --gap: 18px;
}

* {
  box-sizing: border-box;
}

/* Fix per altezza intera e sticky footer */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial;
  /* Background con attachment fixed per evitare stacchi di colore su pagine lunghe */
  background:
    radial-gradient(1200px 600px at 18% -10%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 60%),
    radial-gradient(1000px 500px at 82% 0%, color-mix(in srgb, var(--brand2) 14%, transparent), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  
  /* Layout Flexbox per spingere il footer in basso */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: .92;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 18px 0;
  width: 100%;
  flex: 1 0 auto; /* Permette al contenuto di espandersi e spingere il footer */
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 14px;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
  letter-spacing: .2px;
}

.brand img {
  height: 40px;
  width: auto;
  display: block;
  transform: scale(1.4);
  transform-origin: left center;
}

.navRight {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.menu {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.menu a {
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.menu a.active, .menu a:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(2, 8, 23, .04);
}

.lang {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .65);
  border-radius: 999px;
  padding: 6px;
}

.lang a {
  font-size: .92rem;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
}

.lang a.active, .lang a:hover {
  color: var(--text);
  border-color: var(--border);
  background: rgba(2, 8, 23, .04);
}

/* Hero Section */
.hero {
  padding: 46px 10px 20px;
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 22px;
  align-items: start;
}

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

.h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  margin: 0 0 12px;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 18px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
}

.badge {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  font-size: .95rem;
}

/* Cards & Grid */
.card {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .78);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card.pad {
  padding: 18px;
}

.kpi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.kpi .box {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, .7);
}

.kpi .n {
  font-size: 1.2rem;
  font-weight: 800;
}

.kpi .t {
  color: var(--muted);
  font-size: .93rem;
}

.section {
  margin-top: 26px;
}

.h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

@media (max-width: 920px) {
  .grid3 {
    grid-template-columns: 1fr;
  }
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}

@media (max-width: 920px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

.item {
  padding: 16px;
}

.item h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.item p {
  margin: 0;
  color: var(--muted);
}

.pill {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: .9rem;
  background: rgba(255, 255, 255, .65);
}

/* Buttons */
.ctaRow {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .8);
  color: var(--text);
  font-weight: 760;
}

.btn.primary {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--brand) 18%, transparent),
    color-mix(in srgb, var(--brand2) 14%, transparent)
  );
}

.btn:hover {
  transform: translateY(-1px);
  transition: .15s;
}

/* Footer con sfondo RGB e allineamento */
.footer {
  flex-shrink: 0;
  margin-top: 50px;
  padding: 40px 0;
  width: 100%;
  display: flex;
  justify-content: center;
  background: linear-gradient(
    to right,
    rgb(222, 243, 248) 0%,
    rgb(238, 246, 252) 50%,
    rgb(225, 236, 250) 100%
  );
}

.footer-content {
  width: 100%;
  max-width: var(--max);
  padding: 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: .95rem;
}

.footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Utils */
.small {
  font-size: .92rem;
  color: var(--muted);
}

.hr {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

pre {
  padding: 14px;
  border-radius: 14px;
  overflow: auto;
  border: 1px solid var(--border);
  background: rgba(2, 8, 23, .06);
}