/* ═══════════════════════════════════════════════════════
   Patto Digitale di Comunità – Ben.Gio APS
   Allineato al sito ufficiale bengio.org
   Font: Fraunces (display) + Hanken Grotesk (body)
   Bootstrap 5.3 + custom tokens
═══════════════════════════════════════════════════════ */

/* ── Design tokens (allineati al sito ufficiale) ──────────── */
:root {
  --navy:       #0F172A;
  --navy-mid:   #1E3A8A;
  --blue:       #2563EB;
  --blue-light: #EFF6FF;
  --green:      #15803D;
  --amber:      #D97706;
  --violet:     #7C3AED;
  --bg:         #F8F9FA;
  --bg-tint:    #F1F5F9;
  --text:       #1E293B;
  --text-muted: #64748B;
  --border:     #E2E8F0;
  --radius:     .75rem;
  --radius-lg:  1.25rem;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.12);
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  line-height: 1.18;
  color: var(--navy);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 300; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.65rem); }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--navy-mid); }

em { font-style: italic; color: var(--blue); }

strong { font-weight: 600; }

/* ── Eyebrow label ────────────────────────────────────────── */
.eyebrow {
  display: block;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: .6rem;
}
.eyebrow-light { color: rgba(255,255,255,.6); }

/* ── NAVBAR ───────────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  height: 68px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(229,231,235,.7);
  transition: box-shadow .2s;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: .01em;
}
.nav-brand img { height: 36px; width: auto; }

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: .25rem;
}
.nav-links a {
  display: block;
  padding: 6px 14px;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: .85rem;
  font-weight: 500;
  color: #6B7280;
  border-radius: 8px;
  letter-spacing: .01em;
  transition: background .18s, color .18s;
}
.nav-links a:hover { background: #F1F5F9; color: #1C1C2E; }
.nav-links a.active { background: #EFF6FF; color: #2563EB; font-weight: 600; }

/* Patto: pill verde (identico all'index) */
.nav-links .nav-patto a {
  color: #15803D;
  background: #DCFCE7;
  font-weight: 600;
  border-radius: 999px;
  padding: 6px 16px;
}
.nav-links .nav-patto a:hover,
.nav-links .nav-patto a.active {
  background: #bbf7d0;
  color: #14532d;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Mobile nav */
@media (max-width: 767px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(14px);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    gap: .15rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .65rem 1rem; border-radius: .5rem; }
}

/* ── HERO ─────────────────────────────────────────────────── */
.patto-hero {
  position: relative;
  min-height: min(680px, 90vh);
  display: flex;
  align-items: center;
  padding-top: 64px;
  background: var(--navy);
  overflow: hidden;
}

.hero-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(37,99,235,.20) 0, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(21,128,61,.14) 0, transparent 35%),
    radial-gradient(circle at 60% 80%, rgba(37,99,235,.10) 0, transparent 30%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 4rem 1.25rem;
  max-width: 760px;
}

.hero-eyebrow {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 1rem;
}

.patto-hero h1 {
  color: #fff;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 300;
  line-height: 1.08;
  margin-bottom: 1.25rem;
}

.patto-hero h1 em {
  font-style: italic;
  color: #93c5fd;
}

.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,.8);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  padding: .75rem 1.6rem;
  background: var(--blue);
  color: #fff;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: .925rem;
  font-weight: 600;
  border-radius: .5rem;
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.btn-primary:hover {
  background: #1d4ed8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,.4);
}

.btn-ghost {
  display: inline-block;
  padding: .75rem 1.6rem;
  color: rgba(255,255,255,.85);
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: .925rem;
  font-weight: 600;
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: .5rem;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  text-decoration: none;
}
.btn-ghost:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.6);
  color: #fff;
}

.btn-lg-custom {
  padding: .9rem 2.2rem;
  font-size: 1rem;
}

/* ── Sections ─────────────────────────────────────────────── */
.section {
  padding: 5rem 0;
}
.section-tinted { background: var(--bg-tint); }
.section-dark {
  background: var(--navy);
  color: rgba(255,255,255,.8);
}
.section-dark h2,
.section-dark h3,
.section-dark h4 { color: #fff; }

/* ── Lead text ────────────────────────────────────────────── */
.intro-lead {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--navy);
  line-height: 1.6;
}
.lead-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
}
.lead-text-light { color: rgba(255,255,255,.65); }

/* ── Callout card ─────────────────────────────────────────── */
.callout-card {
  background: var(--blue-light);
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
}
.callout-icon { font-size: 2.2rem; margin-bottom: .75rem; }
.callout-card h3 {
  font-size: 1.2rem;
  color: var(--navy-mid);
  margin-bottom: .6rem;
}
.callout-card p { font-size: .95rem; color: #374151; }

.callout-highlight {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(37,99,235,.12);
  border-left: 3px solid var(--blue);
  border-radius: 0 .5rem .5rem 0;
  font-size: .95rem;
  color: var(--navy);
  line-height: 1.55;
}

/* ── Principle cards ──────────────────────────────────────── */
.principle-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.principle-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.principle-icon { font-size: 2rem; margin-bottom: .75rem; }
.principle-card h4 { font-size: .95rem; margin-bottom: .4rem; color: var(--navy); }
.principle-card p { font-size: .88rem; color: var(--text-muted); margin: 0; }

/* ── Bootstrap Tabs override ──────────────────────────────── */
.patto-tabs {
  border-bottom: 2px solid var(--border);
  gap: .25rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.patto-tabs .nav-link {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: .6rem 1.2rem;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.patto-tabs .nav-link .tab-age {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  font-weight: 700;
}
.patto-tabs .nav-link:hover { color: var(--blue); }
.patto-tabs .nav-link.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  background: none;
}

.patto-tab-content {
  padding: 2rem 0 0;
}

/* ── Age panel ────────────────────────────────────────────── */
.age-panel-header {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.age-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #fff;
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 700;
}
.age-panel-header h3 { margin-bottom: .35rem; }
.age-panel-header p { font-size: .92rem; color: var(--text-muted); margin: 0; }

.panel-note {
  background: var(--blue-light);
  border-left: 3px solid var(--blue);
  border-radius: 0 .5rem .5rem 0;
  padding: .85rem 1rem;
  font-size: .88rem;
  color: var(--navy);
  line-height: 1.55;
}

/* ── Commitment list ──────────────────────────────────────── */
.commitment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.commitment-list li {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: .5rem;
  font-size: .93rem;
  line-height: 1.55;
}
.commitment-list li::before {
  content: '✓';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 800;
  margin-top: .05rem;
}
.commitment-list-sm li { padding: .6rem .9rem; font-size: .88rem; }

/* ── Sub-age block ────────────────────────────────────────── */
.sub-age-block {
  border-left: 3px solid var(--sub-accent, var(--amber));
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  background: #fff;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
}
.sub-age-label {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sub-accent, var(--amber));
  margin-bottom: .4rem;
}
.sub-age-block h5 { margin-bottom: .4rem; }
.sub-age-block p { font-size: .9rem; color: var(--text-muted); margin-bottom: .75rem; }

/* ── Rule cards ───────────────────────────────────────────── */
.rule-card {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.rule-card-green { border-top-color: var(--green); }
.rule-num {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rule-num-green { background: #dcfce7; color: var(--green); }
.rule-card h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.rule-card p { font-size: .92rem; color: var(--text-muted); margin-bottom: .75rem; }

.simple-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.simple-list li {
  display: flex;
  gap: .6rem;
  font-size: .9rem;
  line-height: 1.5;
  align-items: flex-start;
}
.simple-list li::before {
  content: '→';
  color: var(--blue);
  flex-shrink: 0;
  margin-top: .05rem;
}
.rule-card-green .simple-list li::before { color: var(--green); }

/* ── General attention cards ──────────────────────────────── */
.general-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.general-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.general-icon { font-size: 2rem; margin-bottom: .75rem; display: block; }
.general-card h5 { font-size: .95rem; margin-bottom: .4rem; color: var(--navy); }
.general-card p { font-size: .87rem; color: var(--text-muted); margin: 0; }

/* ── Community cards (dark section) ──────────────────────── */
.community-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: background var(--transition), transform var(--transition);
}
.community-card:hover {
  background: rgba(255,255,255,.1);
  transform: translateY(-2px);
}
.community-card-featured {
  background: rgba(37,99,235,.25);
  border-color: rgba(96,165,250,.4);
}
.community-icon { font-size: 2rem; display: block; margin-bottom: .75rem; }
.community-card h5 { color: #fff; font-size: .95rem; margin-bottom: .4rem; }
.community-card p { font-size: .87rem; color: rgba(255,255,255,.65); margin: 0; }
.community-card-featured h5 { color: #93c5fd; }
.community-card-featured p { color: rgba(255,255,255,.8); }

.community-note {
  font-size: .9rem;
  color: rgba(255,255,255,.55);
  font-style: italic;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

/* ── Quote block ──────────────────────────────────────────── */
.patto-quote {
  margin: 2.5rem auto 0;
  padding: 2rem 2.5rem;
  border-radius: var(--radius-lg);
  background: var(--blue-light);
  border-left: none;
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--navy-mid);
  line-height: 1.6;
  text-align: center;
  max-width: 560px;
}
.patto-quote strong {
  display: block;
  margin-top: .75rem;
  font-style: normal;
  color: var(--blue);
  font-size: 1rem;
  font-family: 'Hanken Grotesk', sans-serif;
}

/* ── Form ─────────────────────────────────────────────────── */
.patto-form .form-control,
.patto-form .form-select {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: .93rem;
  border: 1.5px solid var(--border);
  border-radius: .5rem;
  padding: .65rem .9rem;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.patto-form .form-control:focus,
.patto-form .form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  outline: none;
}
.patto-form .form-label {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: .35rem;
}
.required { color: #dc2626; }

.patto-form .form-check-input {
  width: 1.1em;
  height: 1.1em;
  border: 1.5px solid var(--border);
  border-radius: .25em;
}
.patto-form .form-check-input:checked {
  background-color: var(--blue);
  border-color: var(--blue);
}
.patto-form .form-check-label {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.link-inline { color: var(--blue); text-decoration: underline; }

.note-small {
  font-size: .8rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Success block ────────────────────────────────────────── */
.form-success-block {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
}
.form-success-block h3 { color: var(--green); }

/* ── Alert override ───────────────────────────────────────── */
.alert-danger {
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: .9rem;
  border-radius: var(--radius);
}

/* ── FOOTER (allineato al sito principale) ────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.45);
  text-align: center;
  padding: 2rem 1.25rem;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: .82rem;
  line-height: 1.8;
}
.site-footer a {
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color var(--transition);
}
.site-footer a:hover { color: rgba(255,255,255,.85); }

/* ── Reveal animation ─────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Utility overrides ────────────────────────────────────── */
.text-center { text-align: center; }
.mt-auto { margin-top: auto; }

/* ── Responsive fixes ─────────────────────────────────────── */
@media (max-width: 575px) {
  .section { padding: 3.5rem 0; }
  .hero-inner { padding: 3rem 1rem; }
  .patto-hero h1 { font-size: 2.2rem; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .rule-card { flex-direction: column; gap: .75rem; }
  .age-panel-header { flex-direction: column; gap: .75rem; }
  .patto-quote { padding: 1.5rem 1.25rem; font-size: 1rem; }
  .patto-tabs .nav-link { padding: .5rem .75rem; }
}