/* ============================================================
   AVIS Comunale Bareggio ODV - Foglio di stile (CSS nativo, mobile-first)
   Palette: rosso #E30613 | blu #005A9C | bianco #FFFFFF | grigio #F8FAFC
   Contrasti verificati WCAG 2.1 AA (testo scuro su chiaro, bianco su rosso/blu scuro)
   ============================================================ */

/* Font: Inter/Roboto se installati, altrimenti font di sistema (nessuna richiesta esterna, GDPR-friendly).
   Per usare Inter self-hosted: carica il .woff2 in assets/fonts e aggiungi una regola @font-face. */

:root {
  --red: #E30613;
  --red-dark: #B8050F;   /* hover / testo rosso su bianco (contrasto 6.4:1) */
  --blue: #005A9C;
  --blue-dark: #004577;
  --white: #FFFFFF;
  --bg-alt: #F8FAFC;
  --text: #0F172A;
  --text-soft: #475569;  /* contrasto 7.5:1 su bianco */
  --border: #E2E8F0;
  --radius: 0.75rem;     /* rounded-xl */
  --radius-lg: 1rem;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);
  --font: "Inter", "Roboto", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --header-h: 4.5rem;
}

/* ---------- Reset leggero ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.65; color: var(--text); background: var(--white); }
img, svg { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--text); letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--blue); text-underline-offset: .15em; }
a:hover { color: var(--blue-dark); }
address { font-style: normal; }
table { border-collapse: collapse; width: 100%; }

/* ---------- Accessibilità ---------- */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.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;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 1000; background: var(--text); color: #fff;
  padding: .75rem 1rem; border-radius: var(--radius); transition: top .2s;
}
.skip-link:focus { top: 1rem; color: #fff; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: 1.25rem; }
.container-narrow { max-width: 52rem; }
.section { padding-block: 4rem; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 42rem; margin: 0 auto 2.5rem; }
.section-head h2 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
.section-lead { color: var(--text-soft); font-size: 1.0625rem; }
.eyebrow { color: var(--red-dark); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8125rem; margin-bottom: .75rem; }
.grid { display: grid; gap: 1.5rem; }
.note { color: var(--text-soft); font-size: .9rem; margin-top: 1.25rem; text-align: center; }
.mt { margin-top: 1.75rem; }

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  padding: .7rem 1.25rem; border-radius: var(--radius); border: 2px solid transparent;
  min-height: 2.75rem; /* target touch >= 44px */
  transition: background-color .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(227, 6, 19, .3); }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-secondary { background: var(--blue); color: #fff; }
.btn-secondary:hover { background: var(--blue-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-ghost:hover { background: var(--blue); color: #fff; }
.btn-lg { padding: .9rem 1.6rem; font-size: 1.0625rem; }
.btn-sm { padding: .5rem 1rem; font-size: .9375rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }
.brand {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .75rem; text-decoration: none; color: var(--text);
  background: transparent; border: 0; border-radius: 0; padding: 0;
  box-shadow: none;
}
.brand:hover { color: var(--text); }
.brand-logo { height: clamp(2.8rem, 6vw, 4.5rem); width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.125rem; color: var(--red-dark); }
.brand-text small { color: var(--text-soft); font-size: .8125rem; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  display: block; width: 1.4rem; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s;
}
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

/* Mobile: menu a tendina */
.nav {
  display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff;
  padding: 1rem 1.25rem 1.5rem; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.nav.is-open { display: block; }
.nav-list { display: flex; flex-direction: column; gap: .25rem; margin-bottom: 1rem; }
.nav-list a { display: block; padding: .75rem .5rem; color: var(--text); font-weight: 500; text-decoration: none; border-radius: var(--radius); }
.nav-list a:hover { background: var(--bg-alt); color: var(--red-dark); }
.nav-cta { width: 100%; }

@media (min-width: 62rem) {
  .nav-toggle { display: none; }
  .nav { display: flex; position: static; align-items: center; gap: 1.5rem; padding: 0; border: 0; box-shadow: none; background: transparent; }
  .nav-list { flex-direction: row; gap: .25rem; margin: 0; }
  .nav-list a { padding: .5rem .85rem; }
  .nav-cta { width: auto; }
}

@media (max-width: 28rem) {
  .header-inner { min-height: 4rem; }
  .brand { padding: .3rem .45rem; }
  .nav-cta { font-size: .9375rem; }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(0, 90, 156, .10), transparent 60%),
    radial-gradient(40rem 25rem at -10% 110%, rgba(227, 6, 19, .08), transparent 60%),
    var(--white);
  padding-block: 3.5rem 4rem;
}
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); font-weight: 800; }
.hero .accent { color: var(--red-dark); }
.lead { font-size: 1.15rem; color: var(--text-soft); max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.info-box {
  background: #fff; border: 1px solid var(--border); border-top: 5px solid var(--blue);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1.5rem;
}
.info-box-title { display: flex; align-items: center; gap: .5rem; font-size: 1.25rem; color: var(--blue-dark); }
.emoteca-date-box {
  margin: .25rem 0 .75rem; padding: .7rem .8rem; border-radius: .9rem;
  background: linear-gradient(135deg, rgba(227, 6, 19, .12), rgba(0, 90, 156, .10));
  border: 1px solid rgba(227, 6, 19, .18); text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.emoteca-date-box span {
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--red-dark);
}
.emoteca-date-box strong {
  display: block; margin-top: .15rem; font-size: 1.18rem; color: var(--red-dark); line-height: 1.2;
}
.hours li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px dashed var(--border); }
.hours strong { color: var(--text); }
.info-box-addr { display: flex; align-items: center; gap: .5rem; margin: 1rem 0 .5rem; color: var(--text-soft); }
.info-box-tel { font-weight: 700; }

@media (min-width: 62rem) {
  .hero { padding-block: 5.5rem 6rem; }
  .hero-grid { grid-template-columns: 1.3fr .9fr; gap: 4rem; }
}

/* ---------- Icone SVG (stroke) ---------- */
.icon { width: 1.35rem; height: 1.35rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.social-inline { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .75rem; }
.social-inline li { margin: 0; }
.social-pill {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .55rem .8rem; border-radius: 999px; text-decoration: none;
  font-size: .9rem; font-weight: 700; line-height: 1.2; transition: transform .2s, box-shadow .2s, border-color .2s;
  border: 1px solid transparent; box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
}
.social-pill:hover { transform: translateY(-1px); }
.social-pill .icon { width: 1rem; height: 1rem; }
.social-pill .social-tag {
  display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.2);
}
.social-facebook {
  background: linear-gradient(135deg, #1877F2, #0D5ED7); color: #fff;
}
.social-instagram {
  background: linear-gradient(135deg, #f58529, #dd2a7b 35%, #8134af 70%, #515bd4); color: #fff;
}

/* ---------- Card ---------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 1.5rem; }
.grid-4 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }
.value h3 { color: var(--blue-dark); font-size: 1.15rem; }
.value p { color: var(--text-soft); margin: 0; }
.value { border-top: 4px solid var(--red); }
@media (min-width: 40rem) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 48rem) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Step ---------- */
.steps { display: grid; gap: 1.5rem; grid-template-columns: 1fr; margin-bottom: 3rem; counter-reset: none; }
.step { position: relative; padding-top: 2.75rem; }
.step-num {
  position: absolute; top: -1.25rem; left: 1.5rem; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--red); color: #fff; font-weight: 800; font-size: 1.25rem; display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(227, 6, 19, .35);
}
.step h3 { font-size: 1.15rem; }
.step p { color: var(--text-soft); margin: 0; }
@media (min-width: 40rem) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62rem) { .steps { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Centri di raccolta ---------- */
.centro {
  display: flex; flex-direction: column; gap: .75rem; height: 100%;
  flex: 1 1 0; transition: box-shadow .2s, border-color .2s, transform .2s;
}
.centro:hover, .centro.is-open { box-shadow: var(--shadow-lg); border-color: var(--blue); }
.centro:hover { transform: translateY(-2px); }
.centro-head {
  display: flex; flex-direction: column; flex: 1 1 auto;
}
.centro-head h3 { font-size: 1.2rem; margin-bottom: .35rem; }
.badge {
  display: inline-block; background: #E6F0F8; color: var(--blue-dark); font-weight: 600; font-size: .8125rem;
  padding: .25rem .7rem; border-radius: 999px; margin-bottom: .6rem;
}
.centro-luogo {
  display: flex; align-items: center; gap: .5rem; color: var(--text-soft); margin: 0; line-height: 1.4;
}
.centro-luogo .icon {
  width: 1.05rem; height: 1.05rem; min-width: 1.05rem; margin-top: 0;
}
.centro-actions {
  display: flex; flex-direction: column; gap: .85rem; width: 100%; margin-top: auto; padding-top: .1rem;
}
.centro .btn,
.centro-toggle {
  width: 100%;
}
.centro .btn {
  min-height: 3.1rem;
  font-size: 1.04rem;
}
.centro-toggle {
  display: flex; align-items: center; justify-content: space-between; min-height: 3rem;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .6rem 1rem; font: inherit; font-weight: 600; color: var(--blue-dark); cursor: pointer;
}
.centro-toggle:hover { background: #EEF4FA; }
.chevron { transition: transform .2s; }
.centro-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.centro-det[hidden] { display: none; }
.centro-det p { color: var(--text-soft); }
.centro-prenotabile { margin: .5rem 0 0; font-weight: 600; color: var(--red-dark); font-size: .9375rem; }
.centro-links { display: flex; flex-direction: column; gap: .4rem; margin-top: .5rem; }
.centro-links a { font-weight: 600; }
.note-box { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: var(--radius); padding: 1rem 1.25rem; text-align: left; max-width: 52rem; margin-inline: auto; margin-top: 1.75rem; }

/* ---------- Download modulo iscrizione ---------- */
.download-card { display: grid; gap: 1.25rem; grid-template-columns: 1fr; border-left: 5px solid var(--red); margin-bottom: 2.5rem; }
.download-icon { width: 4rem; height: 4rem; border-radius: var(--radius); background: #E6F0F8; color: var(--blue-dark); display: grid; place-items: center; }
.download-icon .icon { width: 2.25rem; height: 2.25rem; }
.download-body h3 { font-size: 1.4rem; color: var(--blue-dark); }
.download-note { background: var(--bg-alt); border-radius: var(--radius); padding: .85rem 1rem; color: var(--text); font-size: .95rem; }
.download-help { color: var(--text-soft); margin: 0; }
.btn-meta { font-weight: 400; opacity: .9; }
@media (min-width: 40rem) { .download-card { grid-template-columns: auto 1fr; gap: 1.75rem; padding: 2rem; } }

/* ---------- Informazioni per il donatore ---------- */
.info-donare { margin-bottom: 2.5rem; }
.section-head-left { text-align: left; margin: 0 0 1.5rem; max-width: 52rem; }
.section-head-left h3 { font-size: 1.5rem; color: var(--blue-dark); }
.section-head-left p { color: var(--text-soft); }
.requisiti h4 { font-size: 1.1rem; color: var(--blue-dark); margin-bottom: .75rem; }
.requisiti p { color: var(--text-soft); }
.requisiti-note { font-size: .95rem; margin: 1rem 0 0; }
.requisiti-stop { border-top: 4px solid var(--red); }
.check-list li, .cross-list li { position: relative; padding-left: 1.9rem; margin-bottom: .6rem; }
.check-list li::before, .cross-list li::before {
  position: absolute; left: 0; top: .1rem; width: 1.3rem; height: 1.3rem; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; font-weight: 800; color: #fff;
}
.check-list li::before { content: "\2713"; background: var(--blue); }
.cross-list li::before { content: "\2715"; background: var(--red-dark); }
.info-extra { margin-top: 1.5rem; }

/* ---------- Form ---------- */
.form-wrap { padding: 1.5rem; }
.form-title { font-size: 1.4rem; color: var(--blue-dark); }
.form-intro { color: var(--text-soft); }
.form-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 40rem) { .form-grid { grid-template-columns: repeat(2, 1fr); } .form-wrap { padding: 2rem; } }

.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 0; }
.form > .field { margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .9375rem; }
.field label span { color: var(--red-dark); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="date"],
.field select, .field textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff; min-height: 2.9rem;
  padding: .65rem .85rem; border: 2px solid #94A3B8; border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 6rem; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 90, 156, .2);
}
.field [aria-invalid="true"] { border-color: var(--red-dark); }
.field-error { color: var(--red-dark); font-size: .875rem; font-weight: 600; margin: 0; min-height: 0; }
.field-error:empty { display: none; }

.field-check { display: grid; grid-template-columns: auto 1fr; column-gap: .75rem; align-items: start; }
.field-check input { width: 1.4rem; height: 1.4rem; margin-top: .15rem; accent-color: var(--red); }
.field-check label { font-weight: 400; }
.field-check .field-error { grid-column: 1 / -1; }

/* Honeypot: nascosto a utenti e screen reader, visibile ai bot */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.alert, .form-status.is-ok, .form-status.is-error {
  padding: .9rem 1rem; border-radius: var(--radius); font-weight: 600; margin-bottom: 1rem; border: 1px solid;
}
.alert-ok, .form-status.is-ok { background: #ECFDF3; color: #14532D; border-color: #86EFAC; }
.alert-err, .form-status.is-error { background: #FEF2F2; color: #7F1D1D; border-color: #FCA5A5; }
.form-status:empty { display: none; }

/* ---------- Contatti ---------- */
.contact-card h3, .map-card h3 { color: var(--blue-dark); font-size: 1.2rem; }
.contact-row { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .85rem; }
.contact-row .icon { color: var(--red-dark); margin-top: .2rem; }
.hours-table th, .hours-table td { padding: .65rem .75rem; border-bottom: 1px solid var(--border); text-align: left; }
.hours-table th { font-weight: 600; }
.hours-table td { text-align: right; font-weight: 700; }
.map-box {
  display: grid; place-items: center; min-height: 15rem; margin-bottom: 1rem; overflow: hidden;
  background: linear-gradient(135deg, #EAF2F9, #F8FAFC); border: 1px dashed #94A3B8; border-radius: var(--radius);
}
.map-box iframe { width: 100%; height: 20rem; border: 0; display: block; }

/* ---------- Footer ---------- */
.site-footer { background: #0B1B2E; color: #CBD5E1; padding-block: 3rem 1.5rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #FCA5A5; }
.site-footer :focus-visible { outline-color: #fff; }
/* Logo blu su fondo scuro: lo appoggio su una "pillola" bianca per mantenere il contrasto */
.brand-footer {
  background: transparent; padding: 0; border-radius: 0; box-shadow: none;
}
.brand-footer .brand-logo { height: clamp(2.2rem, 5vw, 3.5rem); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.footer-claim { margin-top: 1rem; max-width: 22rem; }
.footer-title { color: #fff; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; }
.footer-list li { margin-bottom: .45rem; }
.footer-address { font-style: normal; line-height: 1.8; }
.footer-address strong { color: #fff; }
.footer-social { margin-top: 1rem; }
.privacy { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .875rem; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem;
  margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .875rem;
}
.footer-bottom p { margin: 0; }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 1.3fr 1fr 1.3fr; } }
