/* Caratteri ospitati sul sito (file variabili: un solo file copre tutti i pesi) */
@font-face {
  font-family: 'Urbanist';
  src: url('/fonts/urbanist.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Karla';
  src: url('/fonts/karla.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* Colori: ROSSO per il testo evidenziato, NERO per il testo normale, GRIGIO per i dettagli */
:root {
  --red: #e2001a;
  --red-dark: #b30015;
  --red-soft: #f3a6ad;
  --black: #111111;
  --grey: #6f6f6f;
  --grey-line: #dcdcdc;
  --grey-bg: #f4f4f4;
  --grey-map: #e4e4e4;
  --white: #ffffff;
  --radius: 14px;
  --font-head: 'Urbanist', system-ui, sans-serif;
  --font-body: 'Karla', system-ui, sans-serif;
}

* { box-sizing: border-box; }
/* Niente lampo blu o grigio al tocco su telefono, su nessun elemento */
html { -webkit-tap-highlight-color: transparent; }
a, button, .btn, .map, .map *, .country-list li { -webkit-tap-highlight-color: transparent; }
.map, .map *, .country-list li, .btn, .nav-toggle { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.map *:focus, .country-list li:focus { outline: none; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; margin: 0 0 0.6em; color: var(--black); }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 700; letter-spacing: -0.01em; max-width: 24ch; }
h3 { font-size: 1.35rem; font-weight: 700; }
h1 em, h2 em { font-style: normal; color: var(--red); }
p { margin: 0 0 1em; }
strong { color: var(--red); font-weight: 700; }

.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.eyebrow {
  color: var(--grey);
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  margin-bottom: 0.9em;
}
.eyebrow::before { content: ''; display: inline-block; width: 26px; height: 2px; background: var(--red); vertical-align: middle; margin-right: 10px; }
.lead { font-size: 1.15rem; color: var(--black); max-width: 52ch; }

/* Pulsanti */
.btn {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 26px;
  border-radius: 999px;
  border: 2px solid var(--red);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn:focus-visible { outline: 3px solid var(--black); outline-offset: 3px; }
.btn-small { padding: 9px 18px; font-size: 0.92rem; }
.btn[disabled] { opacity: 0.6; cursor: wait; }

/* Logo */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 40px; height: 40px; }
.brand span { font-family: var(--font-head); font-weight: 800; font-size: 1.55rem; letter-spacing: -0.02em; color: var(--red); line-height: 1; }
.brand-small img { width: 30px; height: 30px; }
.brand-small span { font-size: 1.2rem; }

/* Testata */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--grey-line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) { color: var(--black); text-decoration: none; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--red); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--black); transition: transform 0.2s, opacity 0.2s; }

/* Apertura con cartina */
.hero { padding: clamp(24px, 4vw, 48px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--grey-line); overflow: hidden; }
/* overflow: hidden ferma la cartina sulla linea di stacco con la sezione successiva */
.hero-inner { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 30px; align-items: center; }
.hero-cta { margin-top: 1.8em; }
.country-list { list-style: none; padding: 0; margin: 1.4em 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.country-list li {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--grey);
  border: 1px solid var(--grey-line);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: default;
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}
.country-list li.active { background: var(--red); border-color: var(--red); color: var(--white); }

.map { width: 100%; height: auto; display: block; overflow: visible; touch-action: manipulation; }
.map-base path { fill: var(--grey-map); stroke: var(--white); stroke-width: 1; stroke-linejoin: round; }
.country { cursor: pointer; outline: none; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.country path { fill: var(--red-soft); stroke: var(--white); stroke-width: 1; stroke-linejoin: round; transition: fill 0.25s; }
.country text {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 15px;
  text-anchor: middle;
  fill: var(--black);
  stroke: var(--white);
  stroke-width: 3.5px;
  paint-order: stroke;
  stroke-linejoin: round;
  pointer-events: none;
  transition: fill 0.25s, stroke 0.25s;
}
.country.active { transform: scale(1.09); }
.country.active path { fill: var(--red); }
/* L'ombra è costosa da ridisegnare a ogni fotogramma: solo dove c'è un mouse */
@media (hover: hover) and (pointer: fine) {
  .country.active path { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28)); }
}
.country.active text { fill: var(--white); stroke: var(--red-dark); }
.country:focus-visible path { stroke: var(--black); stroke-width: 2; }

/* Sezioni */
.section { padding: clamp(70px, 10vw, 120px) 0; }
.section-alt { background: var(--grey-bg); border-block: 1px solid var(--grey-line); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 2.2em; }
.card {
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  padding: 30px;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--red); transform: translateY(-3px); }
.card p { color: var(--black); margin: 0; }
.card-num { display: block; font-family: var(--font-head); font-weight: 800; color: var(--red); font-size: 0.95rem; margin-bottom: 18px; }

.companies {
  list-style: none;
  padding: 0;
  margin: 2.2em 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.companies li {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  padding: 28px 34px;
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  background: var(--white);
}
.companies img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 2em; }
.stat { border-top: 2px solid var(--grey-line); padding-top: 18px; }
.stat-value {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.6rem, 5.5vw, 4rem);
  line-height: 1;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.stat-label { color: var(--grey); font-size: 1.05rem; }

.join-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.join h2 { max-width: 26ch; }
.join .lead { margin: 0; }

/* Contatti */
.contact { display: grid; grid-template-columns: 1fr 1.3fr; gap: 60px; align-items: start; }
.form {
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  padding: 32px;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 500; font-size: 0.95rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--black);
  background: var(--white);
  border: 1px solid #bdbdbd;
  border-radius: 10px;
  padding: 12px 14px;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(226, 0, 26, 0.16); }
.field.invalid input, .field.invalid textarea { border-color: var(--red); background: #fff5f6; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; color: var(--grey); margin-bottom: 22px; }
.check input { margin-top: 4px; accent-color: var(--red); width: 18px; height: 18px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 16px 0 0; min-height: 1.6em; font-weight: 700; }
.form-status.ok { color: var(--black); }
.form-status.err { color: var(--red); }

/* Piè di pagina */
.site-footer { border-top: 1px solid var(--grey-line); padding: 30px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-inner p { margin: 0; color: var(--grey); font-size: 0.95rem; }
.footer-inner p a { color: var(--grey); }

/* Pagine di testo (privacy, 404) */
.page { padding: 70px 0 100px; }
.page h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.page h2 { font-size: 1.35rem; margin-top: 1.8em; max-width: none; }
.page p, .page li { max-width: 70ch; }

/* Animazione all'ingresso */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .country { transition: none; }
}

/* Tablet e telefono */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 10px; }
  .hero-map { order: -1; max-width: 560px; width: 100%; margin-inline: auto; }
  .cards { grid-template-columns: 1fr; }
  .companies { grid-template-columns: repeat(2, 1fr); }
  .companies li { height: 120px; padding: 22px; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 34px; }
  .contact { grid-template-columns: 1fr; gap: 30px; }
  .join-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 760px) {
  .nav-toggle { display: flex; flex-direction: column; gap: 5px; }
  .nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--grey-line);
    padding: 10px 20px 22px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: 12px 0; border-bottom: 1px solid var(--grey-line); }
  .nav .btn { margin-top: 16px; text-align: center; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .brand span { font-size: 1.35rem; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .form { padding: 22px; }
  .country text { font-size: 19px; }
}
