/* Alleanza Ambiente - CSS leggero, mobile-first, senza framework.
   Palette "Filo d'azzurro": blu notte, filo azzurro intenso, sole come unico accento caldo.
   I 7 colori base sono modificabili da Wagtail (Impostazioni > Grafica): base.html li ridefinisce
   in un <style> dopo questo file. Le sfumature derivate si calcolano qui con color-mix(). */
:root {
  /* Colori base (predefiniti, uguali a core.models.DEFAULT_COLORS) */
  --primary: #0a2a5c;
  --secondary: #0067c0;
  --filo: #0080e0;
  --filo-light: #29b6f6;
  --accent: #ffb81c;
  --background: #f3f7fb;
  --text: #0d1b2e;
  /* Derivati */
  --primary-mid: color-mix(in srgb, var(--primary) 70%, var(--secondary));
  --accent-deep: color-mix(in srgb, var(--accent) 80%, #8a3b00);
  --accent-glow: color-mix(in srgb, var(--accent) 50%, transparent);
  --accent-rays: color-mix(in srgb, var(--accent) 15%, transparent);
  --background-2: color-mix(in srgb, var(--secondary) 9%, var(--background));
  --muted: color-mix(in srgb, var(--text) 78%, var(--background));
  --focus-ring: color-mix(in srgb, var(--secondary) 35%, transparent);
  --on-dark: #fff;
  --error: #a4001f;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; font-family: var(--font); font-size: 1.0625rem; line-height: 1.6; color: var(--text); background: var(--background); }
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; }
a { color: var(--secondary); }
a:hover { color: var(--primary); }
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--primary); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Intestazione e menu ---------- */
.site-header { position: sticky; top: 0; z-index: 80; background: var(--primary); color: var(--on-dark); box-shadow: 0 2px 14px rgba(0, 0, 0, .18); }
.site-header__inner { max-width: 72rem; margin: 0 auto; padding: .5rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-header__brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--on-dark); text-decoration: none; font-weight: 800; font-size: 1.1rem; letter-spacing: .01em; min-height: 48px; margin-right: auto; }
.site-header__brand:hover { color: var(--accent); }
.site-header__brand img { width: 40px; height: 40px; border-radius: 50%; background: #fff; }
.nav-toggle {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .4rem .8rem; font: inherit; font-weight: 700;
  color: var(--on-dark); background: transparent; border: 2px solid rgba(255, 255, 255, .5); border-radius: 999px; cursor: pointer;
}
.nav-toggle__icon, .nav-toggle__icon::before, .nav-toggle__icon::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; }
.nav-toggle__icon::before, .nav-toggle__icon::after { content: ""; position: absolute; left: 0; }
.nav-toggle__icon::before { top: -6px; }
.nav-toggle__icon::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after { top: 0; transform: rotate(-45deg); }
.no-js .nav-toggle { display: none; }
.site-nav { flex-basis: 100%; }
.js .site-header:not(.is-open) .site-nav { display: none; }
.site-nav__list, .site-nav__sub { list-style: none; margin: 0; padding: 0; }
.site-nav__list { display: flex; flex-direction: column; padding: .25rem 0 .75rem; }
.site-nav a, .site-nav__group {
  display: flex; align-items: center; gap: .4rem; width: 100%; min-height: 44px; padding: .5rem .6rem; font: inherit; font-weight: 700;
  color: var(--on-dark); background: none; border: 0; border-radius: 8px; text-decoration: none; text-align: left; cursor: pointer;
}
.site-nav a:hover, .site-nav__group:hover { color: var(--accent); background: rgba(255, 255, 255, .08); }
.site-nav a[aria-current="page"], .site-nav__item--group.is-active > .site-nav__group { color: var(--accent); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.chevron { width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: .25rem; transition: transform .15s ease; }
.site-nav__group[aria-expanded="true"] .chevron { transform: rotate(225deg) translateY(-1px); }
.site-nav__sub { padding-left: 1rem; }
.site-nav__sub a { font-weight: 500; }
.js .site-nav__group[aria-expanded="false"] + .site-nav__sub { display: none; }
.site-nav__item--cta { margin-top: .5rem; }
.btn--small { display: inline-flex; justify-content: center; font-size: 1rem; padding: .55rem 1.3rem; min-height: 44px; box-shadow: 0 3px 0 var(--accent-deep); }
.site-nav .btn--small { width: auto; color: var(--primary); background: var(--accent); font-weight: 800; border-radius: 999px; }
.site-nav .btn--small:hover { color: var(--primary); background: var(--accent); }

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .site-nav, .js .site-header:not(.is-open) .site-nav { display: block; flex-basis: auto; }
  .site-nav__list { flex-direction: row; align-items: center; gap: .15rem; padding: 0; }
  .site-nav a, .site-nav__group { width: auto; padding: .5rem .75rem; }
  .site-nav__item--group { position: relative; }
  .site-nav__sub {
    position: absolute; top: calc(100% + .35rem); left: 0; min-width: 15rem; padding: .4rem; display: none;
    background: #fff; border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .22);
  }
  .site-nav__sub::before { content: ""; position: absolute; left: 0; right: 0; top: -.5rem; height: .5rem; } /* ponte per l'hover */
  .site-nav__item--group:hover > .site-nav__sub, .site-nav__item--group:focus-within > .site-nav__sub,
  .js .site-nav__group[aria-expanded="true"] + .site-nav__sub { display: block; }
  .site-nav__sub a { color: var(--primary); width: 100%; }
  .site-nav__sub a:hover { color: var(--secondary); background: var(--background-2); }
  .site-nav__sub a[aria-current="page"] { color: var(--secondary); }
  .site-nav__item--cta { margin: 0 0 0 .6rem; }
}

/* ---------- Percorso (breadcrumb) ---------- */
.breadcrumb { margin-bottom: 1.25rem; font-size: .95rem; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; color: var(--muted); }
.breadcrumb li + li::before { content: "\203A"; margin-right: .35rem; }
.breadcrumb a { font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden; color: var(--on-dark);
  min-height: calc(100vh - 3.75rem); min-height: calc(100svh - 3.75rem); display: grid; place-items: center; text-align: center;
  padding: 2.5rem 1.25rem 7.5rem;
  background:
    radial-gradient(circle at 50% 26%, var(--accent-glow) 0, transparent 42%),
    linear-gradient(170deg, var(--primary) 0%, var(--primary-mid) 60%, var(--secondary) 120%);
}
.hero::before { /* raggi di sole */
  content: ""; position: absolute; z-index: -1; left: 50%; top: 26%; width: 190vmax; height: 190vmax;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, var(--accent-rays) 0 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 28%); mask-image: radial-gradient(circle, #000 0, transparent 28%);
  animation: spin 160s linear infinite;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.hero__inner { max-width: 44rem; display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.hero__logo {
  width: clamp(160px, 42vw, 300px); height: auto; aspect-ratio: 1; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 6px rgba(255, 255, 255, .9), 0 18px 50px rgba(0, 0, 0, .35);
}
.hero h1 { margin: .4rem 0 0; font-size: clamp(1.9rem, 6.2vw, 3.4rem); line-height: 1.1; letter-spacing: -.01em; text-wrap: balance; }
.hero__sub { margin: 0; font-size: 1.05rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.hero__manifesto { max-width: 36rem; font-size: clamp(1.02rem, 2.6vw, 1.2rem); }
.hero__manifesto p { margin: 0; }
.hero__manifesto a { color: var(--accent); }
/* Il "filo" del logo: fascia ondulata azzurra larga quanto la pagina. */
.wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(60px, 10vw, 130px); display: block; }
.wave__filo { fill: var(--filo); }
.wave__filo-light { fill: var(--filo-light); }
.wave__page { fill: var(--background); }

.btn {
  display: inline-block; font: inherit; font-weight: 800; font-size: 1.1rem; cursor: pointer; text-decoration: none;
  padding: .95rem 2rem; min-height: 48px; border: 3px solid transparent; border-radius: 999px;
  background: var(--accent); color: var(--primary); box-shadow: 0 6px 0 var(--accent-deep), 0 12px 24px rgba(0, 0, 0, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 0 var(--accent-deep), 0 16px 28px rgba(0, 0, 0, .25); }
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--accent-deep); }
.btn--primary { background: var(--secondary); color: var(--on-dark); box-shadow: 0 5px 0 var(--primary); }
.btn--primary:hover { color: var(--on-dark); box-shadow: 0 7px 0 var(--primary); }
.btn--line { background: transparent; color: var(--primary); border-color: var(--primary); box-shadow: none; }
.btn--line:hover { color: var(--primary); background: var(--background-2); box-shadow: none; transform: none; }
.hero .btn { margin-top: .6rem; }

/* ---------- Form ---------- */
.signup { padding: 2rem 1.25rem 4rem; }
.signup__card {
  max-width: 40rem; margin: 0 auto; background: #fff; border: 3px solid var(--primary); border-radius: var(--radius);
  padding: 1.5rem 1.25rem 1.75rem; box-shadow: 8px 8px 0 var(--filo-light);
}
.signup h2 { margin: 0 0 .25rem; color: var(--primary); font-size: clamp(1.5rem, 5vw, 2.1rem); line-height: 1.15; }
.signup__intro { margin: 0 0 1.25rem; color: var(--muted); }
.field { margin: 0 0 1.1rem; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 700; margin-bottom: .3rem; color: var(--primary); padding: 0; }
.req { color: var(--error); }
.help { display: block; font-size: .92rem; color: var(--muted); margin: .1rem 0 .4rem; }
.field input[type=text], .field input[type=email], .field input[type=number], .field input[type=date], .field select, .field textarea {
  width: 100%; font: inherit; color: var(--text); background: #fff; padding: .7rem .8rem; min-height: 48px;
  border: 2px solid #6b7a90; border-radius: 10px;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--secondary); outline: 3px solid var(--focus-ring); outline-offset: 0; }
.choices { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.choice { display: flex; gap: .65rem; align-items: flex-start; font-weight: 500; padding: .35rem 0; }
.choice input { width: 1.4rem; height: 1.4rem; margin: .12rem 0 0; flex: none; accent-color: var(--secondary); }
.choice label { font-weight: 500; }
.field--consent { background: var(--background-2); border-radius: 10px; padding: .75rem .9rem; }
.errors { margin: .35rem 0 0; padding: 0; list-style: none; color: var(--error); font-weight: 700; font-size: .95rem; }
.errors li::before { content: "\26A0\FE0E  "; }
.alert { border-left: 6px solid var(--error); background: #fdecee; color: var(--error); padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1.2rem; font-weight: 700; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.thanks { text-align: center; }
.thanks h2 { color: var(--primary); }
.thanks .tick { font-size: 3rem; color: var(--secondary); line-height: 1; }
.page-simple { max-width: 40rem; margin: 0 auto; padding: 3rem 1.25rem 4rem; }
.page-simple h1 { color: var(--primary); line-height: 1.15; }

/* ---------- Pagine legali ---------- */
.legal { max-width: 46rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.legal__updated { margin-top: -.5rem; color: var(--muted); font-size: .95rem; }
.legal h3 { color: var(--primary); }
.legal p:empty { display: none; }
.badge { display: inline-block; vertical-align: middle; margin-left: .4rem; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--background-2); color: var(--primary); }
.badge--consent { background: color-mix(in srgb, var(--accent) 35%, #fff); }
.table-wrap { overflow-x: auto; margin: .5rem 0 1.5rem; border: 2px solid var(--background-2); border-radius: 10px; background: #fff; }
.cookie-list table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.cookie-list th, .cookie-list td { text-align: left; vertical-align: top; padding: .6rem .75rem; border-bottom: 1px solid var(--background-2); }
.cookie-list thead th { background: var(--background-2); color: var(--primary); }
.cookie-list tbody tr:last-child > * { border-bottom: 0; }
.page-cta { margin: 3rem 0 1.5rem; padding: 1.5rem; border-radius: var(--radius); background: var(--primary); color: var(--on-dark); text-align: center; }
.legal .page-cta h2 { margin: 0 0 .4rem; color: var(--on-dark); }
.page-cta p { margin: 0 0 1rem; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.pager a { display: block; padding: .9rem 1rem; border: 2px solid var(--primary); border-radius: 10px; background: #fff; text-decoration: none; font-weight: 700; color: var(--primary); }
.pager a:hover { background: var(--background-2); }
.pager span { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); }
.pager__prev span::before { content: "\2190  "; }
.pager__next { grid-column: 2; text-align: right; }
.pager__next span::after { content: "  \2192"; }
.legal h1 { color: var(--primary); line-height: 1.15; }
.legal h2 { color: var(--primary-mid); margin-top: 2rem; }
.hero__link { color: var(--on-dark); font-weight: 700; text-underline-offset: 4px; }
.hero__link:hover { color: var(--accent); }
.manifesto__sub { margin: -.5rem 0 .5rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--secondary); }
.manifesto__lead { font-size: 1.15rem; color: var(--muted); }
.principles { list-style: none; counter-reset: p; margin: 2rem 0; padding: 0; display: grid; gap: 1rem; }
.principles li { counter-increment: p; position: relative; background: #fff; border: 2px solid var(--primary); border-radius: var(--radius); padding: 1rem 1.1rem 1rem 3.4rem; }
.principles li::before { content: counter(p); position: absolute; left: 1rem; top: 1rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--accent); color: var(--primary); font-weight: 800; display: grid; place-items: center; }
.principles h2 { margin: 0 0 .3rem; font-size: 1.2rem; line-height: 1.25; }
.principles p { margin: 0; }
.principles p + p, .manifesto__text p { margin: .6rem 0 0; }
.manifesto__quote { margin: 2rem 0; padding: .5rem 0 .5rem 1rem; border-left: 5px solid var(--accent); font-size: 1.2rem; font-style: italic; color: var(--primary); }
.manifesto__actions { display: flex; flex-wrap: wrap; gap: 1rem; }
.legal code { background: var(--background-2); padding: .05rem .3rem; border-radius: 4px; }

/* ---------- Blocco "Schede di persone": schede una accanto all'altra ---------- */
.members__group { margin: 2rem 0; }
.member-cards { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); }
.member-card { display: flex; flex-direction: column; background: #fff; border: 2px solid var(--primary); border-radius: var(--radius); padding: 1rem; box-shadow: 5px 5px 0 var(--filo-light); }
.member-card__photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: calc(var(--radius) - 4px); margin-bottom: .8rem; background: var(--background-2); }
.member-card__photo--empty { display: grid; place-items: center; font-size: 3.5rem; font-weight: 800; color: var(--primary); }
.legal .member-card__name { margin: 0; font-size: 1.15rem; line-height: 1.25; color: var(--primary); }
.member-card__role { margin: .15rem 0 0; font-weight: 700; color: var(--secondary); }
.member-card__bio { margin: .6rem 0 0; font-size: .97rem; }
.member-card__link { margin-top: auto; padding-top: .8rem; font-weight: 700; }

/* ---------- Footer ---------- */
.footer { background: var(--primary); color: var(--on-dark); font-size: .97rem; }
.footer__inner { max-width: 72rem; margin: 0 auto; padding: 2.5rem 1.25rem 1.5rem; display: grid; gap: 2rem; grid-template-columns: 1fr; }
.footer h2 { margin: 0 0 .6rem; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer__col li { margin: 0 0 .15rem; }
.footer a, .footer button { color: var(--on-dark); background: none; border: 0; font: inherit; text-decoration: none; cursor: pointer; padding: .3rem 0; display: inline-block; text-align: left; }
.footer a:hover, .footer button:hover { color: var(--accent); text-decoration: underline; }
.footer a[aria-current="page"] { color: var(--accent); }
.footer__col a { overflow-wrap: anywhere; }
.footer .footer__logo { display: inline-flex; align-items: center; gap: .7rem; font-weight: 800; font-size: 1.15rem; }
.footer__logo img { width: 56px; height: 56px; border-radius: 50%; background: #fff; }
.footer__tagline { margin: .6rem 0 1rem; color: color-mix(in srgb, var(--on-dark) 82%, var(--primary)); }
.footer__social { display: flex; flex-wrap: wrap; gap: .5rem; }
.footer .footer__social a { padding: .35rem .85rem; border: 2px solid rgba(255, 255, 255, .45); border-radius: 999px; font-weight: 700; font-size: .9rem; }
.footer .footer__social a:hover { border-color: var(--accent); text-decoration: none; }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, .18); }
.footer__org { max-width: 72rem; margin: 0 auto; padding: 1rem 1.25rem 1.25rem; font-style: normal; font-size: .88rem; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; color: color-mix(in srgb, var(--on-dark) 82%, var(--primary)); }
@media (min-width: 720px) {
  .footer__inner { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .footer__inner { grid-template-columns: 1.4fr 1fr 1.2fr 1fr; }
}

/* ---------- Banner cookie ---------- */
.cookie {
  position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; background: var(--background); color: var(--text);
  border-top: 4px solid var(--filo); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); padding: 1rem 1.25rem; max-height: 90vh; overflow: auto;
}
.cookie[hidden] { display: none; }
.cookie__inner { max-width: 60rem; margin: 0 auto; }
.cookie h2 { margin: 0 0 .3rem; font-size: 1.15rem; color: var(--primary); }
.cookie p { margin: 0 0 .8rem; font-size: .97rem; }
.cookie__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.cookie__actions .btn { font-size: 1rem; padding: .7rem 1.2rem; box-shadow: none; flex: 1 1 9rem; text-align: center; }
.cookie__actions .btn--primary { background: var(--secondary); color: var(--on-dark); }
.cookie__actions .btn--reject { background: var(--secondary); color: var(--on-dark); }
.cookie__prefs { margin: .8rem 0; display: grid; gap: .5rem; }
.cookie__prefs[hidden] { display: none; }
.cookie__prefs label { font-weight: 700; }
.cookie__prefs .help { margin-left: 2.05rem; }

@media (min-width: 720px) {
  .signup__card { padding: 2.25rem 2.5rem 2.5rem; }
  .cookie__actions .btn { flex: 0 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero::before { animation: none; }
  .btn, .chevron { transition: none; }
}

/* Blocco "Pagamento" (payments/templates/payments/payment_block.html) */
.payment-block { margin: 2rem 0; }
.payment-block h2 { margin-top: 0; }
.payment-block__test { background: #fff4d6; border-left: 6px solid var(--accent); padding: .6rem .9rem; border-radius: 8px; }
.payment-block__secure { margin-top: .8rem; }

/* Sezione della quota in fondo al modulo di iscrizione (profiling/_form_fields.html, payments.signup) */
.pay-section { margin: 1.6rem 0 1.2rem; padding: 1.1rem 1.2rem .4rem; border: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.pay-section__title { margin: 0 0 .4rem; color: var(--primary); font-size: 1.2rem; }
.pay-section__intro p { margin: 0 0 .8rem; }
.pay-section__test { background: #fff4d6; border-left: 6px solid var(--accent); padding: .5rem .8rem; border-radius: 8px; color: #3b2a00; }
.pay-section__secure { display: block; margin: 0 0 .8rem; }
.pay-section__clear { margin: -.4rem 0 .8rem; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; }
.link-button:hover, .link-button:focus-visible { color: var(--accent-deep); }
