/* ============================================
   FIE AMBASSADOR PLATFORM — STYLES
   Fondazione Italiana Endometriosi
   ============================================ */

/* --- RESET & VARIABLES --- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

/* --- FONT: Inter (variabile, hostata localmente) --- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-optical-sizing: auto;
  font-display: swap;
  src: url('../fonts/Inter.ttf') format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100 900;
  font-optical-sizing: auto;
  font-display: swap;
  src: url('../fonts/Inter-Italic.ttf') format('truetype');
}

:root {
  /* Colors — Brand FIE (coral / cream / mauve) */
  --white: #ffffff;
  --ivory: #fdf8f6;          /* bianco caldo (niente giallo) */
  --cream: #f1ecee;          /* grigio chiaro caldo (ex giallino) */
  --gray-100: #efe9e2;
  --gray-200: #ddd4cc;
  --gray-300: #bcb0a6;
  --gray-400: #8f857d;
  --gray-500: #6d635c;
  --gray-600: #4a423d;
  --dark: #3a2c2d;           /* testo: scuro caldo */
  --rose: #f3948f;           /* CORALLO — accento brand */
  --rose-light: #f8b6b2;
  --rose-pale: #fdeae8;      /* corallo tenue per badge/sfondi */
  --bordeaux: #a96b6c;       /* MAUVE/rosewood — colore primario scuro */
  --bordeaux-dark: #8c5658;  /* hover */
  --mauve: #c98f8c;
  --mauve-light: #ecd3d1;
  --green: #4a9a6e;
  --green-light: #e0f0e7;
  --amber: #d4a843;
  --amber-light: #faf0d6;
  --blue: #5a7fa8;
  --blue-light: #e0eaf3;

  /* Typography */
  --font-display: 'Inter', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 16px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-2xl: 48px;
  --sp-3xl: 64px;
  --sp-4xl: 96px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(30,28,26,0.06);
  --shadow-md: 0 4px 12px rgba(30,28,26,0.08);
  --shadow-lg: 0 8px 30px rgba(30,28,26,0.1);
  --shadow-xl: 0 16px 50px rgba(30,28,26,0.12);

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration: 0.3s;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body { overflow-x: hidden; max-width: 100%; }
body {
  font-family: var(--font-body);
  color: var(--dark);
  /* Bianco caldo con fade di rosa chiaro su 3 assi (trasparenza 30%) */
  background-color: #fff9f4;
  background-image:
    radial-gradient(120% 85% at 0% 0%,   rgba(248,182,178,0.30), transparent 60%),
    radial-gradient(120% 85% at 100% 0%, rgba(248,182,178,0.30), transparent 60%),
    radial-gradient(150% 90% at 50% 100%, rgba(248,182,178,0.30), transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img, svg, video, canvas { max-width: 100%; }
img { display: block; height: auto; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 1rem; }
ul, ol { list-style: none; }

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; line-height: 1.18; color: var(--dark); letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 800; letter-spacing: -0.025em; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--gray-400); }

p { color: var(--gray-500); line-height: 1.7; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-rose { color: var(--rose); }
.text-bordeaux { color: var(--bordeaux); }
.text-green { color: var(--green); }
.text-dark { color: var(--dark); }
.text-gray { color: var(--gray-400); }
.text-center { text-align: center; }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

/* --- LAYOUT --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--sp-lg); }
.container-sm { max-width: 680px; margin: 0 auto; padding: 0 var(--sp-lg); }
.container-md { max-width: 900px; margin: 0 auto; padding: 0 var(--sp-lg); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--sp-xs); }
.gap-sm { gap: var(--sp-sm); }
.gap-md { gap: var(--sp-md); }
.gap-lg { gap: var(--sp-lg); }
.gap-xl { gap: var(--sp-xl); }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.w-full { width: 100%; }

/* --- NAVBAR --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,249,247,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
  padding: var(--sp-md) 0;
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--bordeaux);
}
.navbar-brand .brand-icon {
  width: 40px;
  height: 40px;
  background: url('../img/logo-e.png') center / contain no-repeat;
  color: transparent;          /* nasconde la lettera "e" di fallback */
  font-size: 0;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  margin-left: auto;
}
.navbar-nav > a {
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--duration) var(--ease);
  position: relative;
  white-space: nowrap;
}
.navbar-nav > a:not(.btn) { color: var(--gray-500); }
.navbar-nav > a:not(.btn):hover,
.navbar-nav > a:not(.btn).active {
  color: var(--bordeaux);
}
.navbar-nav > a:not(.btn).active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--bordeaux);
  border-radius: 2px;
}
/* divisore tra link e bottoni CTA nella nav unificata */
.nav-divider { width: 1px; height: 22px; background: var(--gray-200); }
.nav-external::after { content: ' ↗'; font-size: 0.78em; opacity: 0.7; }
.navbar-cta {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin-left: var(--sp-md);
}
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-left: auto;
}
.mobile-toggle span {
  width: 22px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: var(--duration) var(--ease);
}

/* --- BUTTONS (premium, morbidi) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: 13px 30px;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--r-full);
  border: 1.5px solid transparent;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(122,45,63,0.06);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
  will-change: transform;
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn .btn-ic { font-size: 1.05em; line-height: 1; }
.btn-primary {
  background: linear-gradient(180deg, #b97e7f 0%, var(--bordeaux) 100%);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(169,107,108,0.34), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #b06d6e 0%, var(--bordeaux-dark) 100%);
  box-shadow: 0 16px 32px rgba(169,107,108,0.45), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-secondary {
  background: var(--white);
  color: var(--bordeaux);
  border-color: rgba(169,107,108,0.35);
  box-shadow: 0 6px 16px rgba(122,45,63,0.08);
}
.btn-secondary:hover {
  background: var(--rose-pale);
  border-color: var(--bordeaux);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(122,45,63,0.12);
}
.btn-rose {
  background: var(--rose);
  color: var(--dark);
  border-color: var(--rose);
}
.btn-rose:hover {
  background: #ec7c77;
  border-color: #ec7c77;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  background: transparent;
  color: var(--gray-500);
  border-color: var(--gray-200);
}
.btn-ghost:hover {
  border-color: var(--gray-400);
  color: var(--dark);
}
.btn-sm {
  padding: 8px 18px;
  font-size: 0.8rem;
}
.btn-lg {
  padding: 16px 36px;
  font-size: 1rem;
}
.btn-icon {
  padding: 10px;
  border-radius: var(--r-md);
}
.btn-block { width: 100%; }

/* --- CARDS --- */
.card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  box-shadow: 0 4px 18px rgba(122,45,63,0.06);
  border: 1px solid var(--gray-100);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(122,45,63,0.12);
  border-color: var(--rose-light);
}
.card-flat {
  box-shadow: none;
  background: var(--cream);
  border-color: transparent;
}
.card-bordered {
  box-shadow: none;
}

/* --- KPI CARDS --- */
.kpi-card {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  border: 1px solid var(--gray-100);
  transition: all var(--duration) var(--ease);
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--rose-light);
}
.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: var(--sp-sm);
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1;
}
.kpi-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: var(--sp-sm);
  padding: 3px 10px;
  border-radius: var(--r-full);
}
.kpi-change.up { color: var(--green); background: var(--green-light); }
.kpi-change.down { color: #c44; background: #fde8e8; }

/* --- PROGRESS BAR --- */
.progress-wrap {
  width: 100%;
}
.progress-bar {
  width: 100%;
  height: 10px;
  background: var(--gray-100);
  border-radius: var(--r-full);
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--bordeaux));
  border-radius: var(--r-full);
  transition: width 1s var(--ease);
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  border-radius: var(--r-full);
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--sp-sm);
  font-size: 0.85rem;
}

/* --- FORMS --- */
.form-group {
  margin-bottom: var(--sp-lg);
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: var(--sp-sm);
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--r-md);
  font-size: 1rem;
  color: var(--dark);
  background: var(--white);
  transition: all var(--duration) var(--ease);
  outline: none;
}
.form-input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px var(--rose-pale);
}
.form-input::placeholder { color: var(--gray-300); }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
}

/* --- TOGGLE --- */
.toggle-group {
  display: flex;
  background: var(--cream);
  border-radius: var(--r-full);
  padding: 4px;
  border: 1px solid var(--gray-100);
  overflow: hidden;            /* la pill attiva non esce mai dal contenitore */
}
.toggle-btn {
  flex: 1;
  padding: 10px 20px;
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-400);
  text-align: center;
  transition: all var(--duration) var(--ease);
}
.toggle-btn.active {
  background: var(--white);
  color: var(--bordeaux);
  box-shadow: var(--shadow-sm);
}

/* --- CHECKBOX --- */
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-500);
}
.checkbox-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--bordeaux);
  cursor: pointer;
}

/* --- BADGE --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-rose { background: var(--rose-pale); color: var(--bordeaux); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }
.badge-gold {
  background: linear-gradient(135deg, #f5e6c8, #e8d5a8);
  color: #8a6d3b;
}

/* --- TABLE --- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-100);
  background: var(--white);
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  background: var(--cream);
  border-bottom: 1px solid var(--gray-100);
}
.table td {
  padding: 14px 18px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-600);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--ivory); }

/* --- AVATAR --- */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-light), var(--mauve-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--bordeaux);
  flex-shrink: 0;
}
.avatar-lg {
  width: 80px;
  height: 80px;
  font-size: 1.8rem;
}
.avatar-xl {
  width: 120px;
  height: 120px;
  font-size: 2.8rem;
}
.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

/* --- QR CODE MOCK --- */
.qr-mock {
  width: 160px;
  height: 160px;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--r-md);
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 2px;
  padding: 12px;
  position: relative;
}
.qr-mock .qr-cell {
  border-radius: 2px;
}
.qr-mock .qr-cell.filled {
  background: var(--dark);
}
.qr-mock .qr-cell.empty {
  background: var(--white);
}
.qr-mock::after {
  content: 'FIE';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--bordeaux);
  background: var(--white);
  padding: 2px 6px;
  border-radius: 3px;
}

/* --- TOAST --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}
.toast {
  padding: 14px 24px;
  background: var(--dark);
  color: var(--white);
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.4s var(--ease);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.toast.success { background: var(--green); }
.toast.error { background: #c44; }
.toast.fade-out { animation: toastOut 0.3s var(--ease) forwards; }

@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(10px); }
}

/* --- MODAL --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,28,26,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--ease);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--sp-2xl);
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  transition: transform var(--duration) var(--ease);
}
.modal-overlay.active .modal {
  transform: translateY(0);
}

/* --- SECTIONS --- */
.section {
  padding: var(--sp-4xl) 0;
}
.section-sm {
  padding: var(--sp-2xl) 0;
}
.section-header {
  text-align: center;
  margin-bottom: var(--sp-2xl);
}
.section-header p {
  max-width: 600px;
  margin: var(--sp-md) auto 0;
}

/* --- HERO --- */
.hero {
  padding: var(--sp-4xl) 0 var(--sp-3xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, var(--rose-pale) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, var(--mauve-light) 0%, transparent 40%);
  opacity: 0.4;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin-bottom: var(--sp-lg); }
.hero p {
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto var(--sp-xl);
}
.hero-ctas {
  display: flex;
  gap: var(--sp-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- FOOTER --- */
.footer {
  background: var(--dark);
  color: var(--gray-300);
  padding: var(--sp-3xl) 0 var(--sp-xl);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-2xl);
  margin-bottom: var(--sp-2xl);
}
.footer h4 {
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-md);
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--white);
  margin-bottom: var(--sp-md);
}
.footer p { color: var(--gray-300); font-size: 0.9rem; }
.footer ul li { margin-bottom: var(--sp-sm); }
.footer ul a {
  font-size: 0.9rem;
  color: var(--gray-300);
  transition: color var(--duration);
}
.footer ul a:hover { color: var(--rose-light); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--sp-lg);
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

/* --- DASHBOARD LAYOUT --- */
.dash-layout {
  display: flex;
  min-height: 100vh;
}
.dash-sidebar {
  width: 260px;
  background: var(--white);
  border-right: 1px solid var(--gray-100);
  padding: var(--sp-lg);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}
.dash-sidebar .brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--bordeaux);
  padding-bottom: var(--sp-lg);
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: var(--sp-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.dash-sidebar .brand .brand-icon {
  width: 36px;
  height: 36px;
  background: url('../img/logo-e.png') center / contain no-repeat;
  color: transparent;
  font-size: 0;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 2px;
  transition: all var(--duration) var(--ease);
}
.sidebar-nav a:hover {
  background: var(--cream);
  color: var(--dark);
}
.sidebar-nav a.active {
  background: var(--rose-pale);
  color: var(--bordeaux);
  font-weight: 600;
}
.sidebar-nav .nav-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-style: normal;
  flex-shrink: 0;
}
.sidebar-nav .nav-icon svg { width: 18px; height: 18px; }
.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-300);
  padding: var(--sp-md) 14px var(--sp-sm);
}
.dash-main {
  flex: 1;
  padding: var(--sp-xl) var(--sp-2xl);
  min-width: 0;
  /* sfondo triassiale rosa chiaro (come il resto della piattaforma) */
  background-color: #fff9f4;
  background-image:
    radial-gradient(120% 85% at 0% 0%,   rgba(248,182,178,0.30), transparent 60%),
    radial-gradient(120% 85% at 100% 0%, rgba(248,182,178,0.30), transparent 60%),
    radial-gradient(150% 90% at 50% 100%, rgba(248,182,178,0.30), transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-xl);
}
.dash-header h1 {
  font-size: 1.8rem;
}

/* --- CHART (pure CSS/SVG) --- */
.chart-container {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  border: 1px solid var(--gray-100);
}
.chart-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: var(--sp-lg);
}
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding-top: var(--sp-md);
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.bar {
  width: 100%;
  max-width: 40px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--rose), var(--bordeaux));
  transition: height 0.8s var(--ease);
  min-height: 4px;
  position: relative;
}
.bar:hover {
  opacity: 0.85;
}
.bar-label {
  font-size: 0.65rem;
  color: var(--gray-400);
  font-weight: 500;
}
.bar-value {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-600);
}

/* Line chart SVG */
.line-chart-svg {
  width: 100%;
  height: 200px;
}

/* --- LEADERBOARD --- */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-100);
  margin-bottom: var(--sp-sm);
  transition: all var(--duration) var(--ease);
}
.leaderboard-row:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--rose-light);
}
.leaderboard-rank {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-300);
  width: 40px;
  text-align: center;
}
.leaderboard-row:nth-child(1) .leaderboard-rank { color: #d4a843; }
.leaderboard-row:nth-child(2) .leaderboard-rank { color: #a0a0a0; }
.leaderboard-row:nth-child(3) .leaderboard-rank { color: #cd7f32; }
.leaderboard-info { flex: 1; min-width: 0; }
.leaderboard-name { font-weight: 600; color: var(--dark); }
.leaderboard-meta { font-size: 0.8rem; color: var(--gray-400); }
.leaderboard-stats {
  text-align: right;
}
.leaderboard-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--bordeaux);
}
.leaderboard-donors {
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* --- DOWNLOAD CARD --- */
.download-card {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) var(--sp-lg);
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-100);
  transition: all var(--duration) var(--ease);
  cursor: pointer;
}
.download-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--rose-light);
}
.download-icon {
  width: 48px;
  height: 48px;
  background: var(--rose-pale);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--bordeaux);
  flex-shrink: 0;
}
.download-info { flex: 1; }
.download-name { font-weight: 600; font-size: 0.9rem; color: var(--dark); }
.download-meta { font-size: 0.75rem; color: var(--gray-400); }

/* --- CHIP / STAT --- */
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--cream);
  border-radius: var(--r-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
}

/* --- FAQ --- */
.faq-item {
  border-bottom: 1px solid var(--gray-100);
  padding: var(--sp-lg) 0;
}
.faq-question {
  font-weight: 600;
  font-size: 1rem;
  color: var(--dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-md);
}
.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--gray-300);
  transition: transform var(--duration) var(--ease);
  flex-shrink: 0;
}
.faq-item.open .faq-question::after {
  transform: rotate(45deg);
  color: var(--rose);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease), padding 0.3s var(--ease);
}
.faq-item.open .faq-answer {
  max-height: 300px;
  padding-top: var(--sp-md);
}
.faq-answer p {
  font-size: 0.9rem;
  line-height: 1.7;
}
/* Guide pratiche: contenuto più lungo delle FAQ → serve più spazio in apertura */
.faq-item.guide-item.open .faq-answer { max-height: 2400px; }
.faq-item.guide-item .faq-answer p { margin: 0 0 var(--sp-sm); }
.faq-item.guide-item .faq-answer p:last-child { margin-bottom: 0; }

/* Script pronti: elementi a fisarmonica con testo + pulsante Copia */
.faq-item.script-item.open .faq-answer { max-height: 700px; }
.script-text {
  font-size: 0.9rem; line-height: 1.7; color: var(--gray);
  background: var(--cream); border-left: 3px solid var(--rose);
  border-radius: var(--r-sm); padding: var(--sp-md); margin: 0 0 var(--sp-sm);
  white-space: pre-line;
}
.script-copy { display: inline-flex; align-items: center; gap: 6px; }

/* --- DONATION AMOUNTS --- */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-sm);
}
.amount-btn {
  padding: 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--r-md);
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gray-600);
  background: var(--white);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.amount-btn:hover {
  border-color: var(--rose);
  color: var(--bordeaux);
}
.amount-btn.active {
  border-color: var(--bordeaux);
  background: var(--rose-pale);
  color: var(--bordeaux);
}

/* --- PAYMENT MOCK --- */
.payment-methods {
  display: flex;
  gap: var(--sp-sm);
}
.payment-method {
  flex: 1;
  padding: 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--r-md);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}
.payment-method:hover { border-color: var(--gray-400); }
.payment-method.active {
  border-color: var(--bordeaux);
  background: var(--rose-pale);
  color: var(--bordeaux);
}

/* --- DONATION SUMMARY --- */
.donation-summary {
  /* grigio chiaro con fade triassiale (rosa scuro) al 30% */
  background-color: #f1ecee;
  background-image:
    radial-gradient(110% 90% at 0% 0%,   rgba(169,107,108,0.30), transparent 60%),
    radial-gradient(110% 90% at 100% 0%, rgba(169,107,108,0.30), transparent 60%),
    radial-gradient(130% 95% at 50% 100%, rgba(169,107,108,0.30), transparent 60%);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: var(--sp-sm) 0;
  font-size: 0.9rem;
  color: var(--gray-500);
}
.summary-row.total {
  border-top: 2px solid var(--gray-200);
  margin-top: var(--sp-sm);
  padding-top: var(--sp-md);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--dark);
}

/* --- COPY LINK --- */
.copy-link-wrap {
  display: flex;
  gap: var(--sp-sm);
  align-items: center;
}
.copy-link-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--cream);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  font-size: 0.85rem;
  color: var(--gray-600);
  font-family: monospace;
}
.copy-link-btn {
  padding: 10px 18px;
  background: var(--bordeaux);
  color: var(--white);
  border-radius: var(--r-md);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--duration) var(--ease);
}
.copy-link-btn:hover {
  background: var(--bordeaux-dark);
}

/* --- CHALLENGE CARD --- */
.challenge-card {
  background: linear-gradient(135deg, var(--rose-pale) 0%, var(--mauve-light) 100%);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  border: 1px solid var(--rose-light);
}
.challenge-card h4 { color: var(--bordeaux); margin-bottom: var(--sp-sm); }

/* --- FUNNEL --- */
.funnel-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: var(--sp-md) 0;
}
.funnel-label {
  width: 120px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-500);
  text-align: right;
  flex-shrink: 0;
}
.funnel-track {
  flex: 1;
  height: 32px;
  background: var(--gray-100);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.funnel-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--bordeaux));
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white);
  transition: width 1s var(--ease);
}

/* --- ANIMATIONS --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up {
  animation: fadeUp 0.6s var(--ease) both;
}
.fade-up-1 { animation-delay: 0.1s; }
.fade-up-2 { animation-delay: 0.2s; }
.fade-up-3 { animation-delay: 0.3s; }
.fade-up-4 { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* --- PAGE SPECIFIC: Thank You --- */
.thankyou-hero {
  text-align: center;
  padding: var(--sp-4xl) 0;
}
.thankyou-icon {
  width: 80px;
  height: 80px;
  background: var(--green-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-xl);
  font-size: 2.5rem;
}
.impact-box {
  background: var(--cream);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  text-align: center;
  border: 1px solid var(--gray-100);
}

/* --- LOGIN --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rose);
  padding: var(--sp-lg);
}
.login-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xl);
  width: 100%;
  max-width: 420px;
}
.login-brand {
  color: #fff;
  font-size: 1.4rem;
  gap: var(--sp-sm);
}
.login-brand .brand-icon {
  width: 48px;
  height: 48px;
  filter: brightness(0) invert(1);   /* logo bianco */
}
.login-card {
  background: var(--white);
  border-radius: var(--r-xl);
  padding: var(--sp-2xl) var(--sp-2xl);
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-card h2 { margin-bottom: var(--sp-xs); }
.login-card .subtitle { margin-bottom: var(--sp-xl); }
.login-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin: var(--sp-xl) 0;
  color: var(--gray-300);
  font-size: 0.8rem;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* --- MOBILE SIDEBAR --- */
.mobile-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  width: 50px;
  height: 50px;
  background: var(--bordeaux);
  color: var(--white);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: var(--shadow-lg);
}

/* backdrop scuro dietro la sidebar mobile aperta */
.dash-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,28,26,0.45);
  z-index: 140;
}
.dash-backdrop.show { display: block; }

/* =========================================================
   RESPONSIVE — breakpoint: 1024 (tablet) · 900 (nav) · 768 (mobile) · 560 (phone)
   ========================================================= */

/* ---- TABLET LANDSCAPE ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-xl); }
  .dash-sidebar { width: 224px; }
  .dash-main { padding: var(--sp-lg); min-width: 0; }
  .container, .container-sm, .container-md { padding: 0 var(--sp-lg); }
}

/* ---- COLLASSO MENU (tablet portrait e sotto) ---- */
@media (max-width: 900px) {
  .navbar-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    background: var(--white);
    padding: var(--sp-sm) var(--sp-md) var(--sp-md);
    border-bottom: 1px solid var(--gray-100);
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .navbar-nav.open { display: flex; }
  .navbar-nav > a {
    padding: 14px 8px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 1rem;
  }
  .navbar-nav > a.active::after { display: none; }
  .navbar-nav > a.btn,
  .navbar-nav .btn {
    width: 100%;
    margin-top: var(--sp-sm);
    border-bottom: none;
    min-height: 48px;
  }
  .nav-divider { display: none; }
  .mobile-toggle { display: flex; }
}

/* ---- MOBILE ---- */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .amount-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: var(--sp-2xl) 0; }
  .hero .flex { flex-wrap: wrap; gap: var(--sp-lg) !important; }
  .section, .section-sm { padding: var(--sp-2xl) 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: var(--sp-sm); text-align: center; }
  .payment-methods { flex-direction: column; }

  /* form comodi: niente zoom iOS, tap area ampia */
  .form-input, input, select, textarea { font-size: 16px; }
  .btn { min-height: 46px; }
  .btn-sm { min-height: 42px; padding: 10px 18px; }

  /* podio classifica: in colonna il 1° va in cima (l'ordine DOM è 2°,1°,3°
     per il layout desktop col vincitore al centro) */
  .podium > :nth-child(1) { order: 2; margin-top: 0 !important; } /* 2° posto */
  .podium > :nth-child(2) { order: 1; }                            /* 1° posto */
  .podium > :nth-child(3) { order: 3; margin-top: 0 !important; } /* 3° posto */

  /* tabelle scrollabili invece di sforare */
  .table-wrap, .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* permetti agli item di griglia/card di restringersi (così le tabelle scrollano dentro) */
  .grid > *, .card, .chart-container { min-width: 0; }

  /* Dashboard mobile: sidebar a scomparsa */
  .dash-layout { display: block; }
  .dash-sidebar {
    position: fixed;
    left: -288px;
    top: 0;
    z-index: 150;
    width: 270px;
    height: 100vh;
    transition: left var(--duration) var(--ease);
    box-shadow: var(--shadow-xl);
  }
  .dash-sidebar.open { left: 0; }
  .mobile-sidebar-toggle { display: flex; }
  .dash-main { padding: var(--sp-md) var(--sp-md) var(--sp-3xl); width: 100%; }
  .dash-header { flex-direction: column; align-items: flex-start; gap: var(--sp-md); }
  .dash-header > .flex { width: 100%; flex-wrap: wrap; }
  .dash-header .btn { flex: 1 1 auto; }
  .dash-header h1 { font-size: 1.5rem; }
  .kpi-value { font-size: 1.6rem; }

  .leaderboard-row { flex-wrap: wrap; gap: var(--sp-sm); }
  .funnel-bar { flex-direction: column; align-items: flex-start; }
  .funnel-label { width: auto; text-align: left; }

  .copy-link-wrap { flex-direction: column; }
  .copy-link-input { width: 100%; }

  /* griglie con colonne inline (es. 2fr 1fr) forzate a colonna su mobile */
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* i bottoni lunghi vanno a capo invece di sforare */
  .btn { white-space: normal; min-width: 0; padding-left: var(--sp-lg); padding-right: var(--sp-lg); }
}

/* ---- PHONE ---- */
@media (max-width: 560px) {
  .container, .container-sm, .container-md { padding: 0 var(--sp-md); }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { width: 100%; }
  .btn-lg { width: 100%; }
  .hero .flex.justify-center { justify-content: space-between; gap: var(--sp-md) !important; }
  .payment-methods { flex-direction: column; }
  /* la pill una tantum/mensile resta in riga su mobile (2 opzioni ci stanno) */
  .toggle-group { flex-direction: row; }
  .amount-grid { grid-template-columns: repeat(2, 1fr); }
  .card { padding: var(--sp-lg); }
  .section, .section-sm { padding: var(--sp-xl) 0; }
}

/* --- UTILITY --- */
.mt-xs { margin-top: var(--sp-xs); }
.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }
.mt-xl { margin-top: var(--sp-xl); }
.mt-2xl { margin-top: var(--sp-2xl); }
.mb-sm { margin-bottom: var(--sp-sm); }
.mb-md { margin-bottom: var(--sp-md); }
.mb-lg { margin-bottom: var(--sp-lg); }
.mb-xl { margin-bottom: var(--sp-xl); }
.mb-2xl { margin-bottom: var(--sp-2xl); }
.pt-md { padding-top: var(--sp-md); }
.pb-md { padding-bottom: var(--sp-md); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ============================================
   COMMUNITY — FORUM, TOPIC, PROFILE, PROPOSAL
   ============================================ */

/* Hero community variant */
.hero-community {
  background: linear-gradient(180deg, var(--ivory) 0%, var(--cream) 100%);
  padding: var(--sp-3xl) 0 var(--sp-2xl);
}
.hero-community h1 { max-width: 780px; }
.hero-community p { max-width: 640px; color: var(--gray-500); font-size: 1.05rem; }

/* Community stats strip */
.community-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-lg);
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  margin-top: var(--sp-2xl);
}
.community-stats > div { text-align: center; }
.community-stats strong { font-family: var(--font-display); font-size: 1.8rem; color: var(--bordeaux); display: block; }
.community-stats span { font-size: 0.78rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.06em; }

/* Layout community: main + sidebar */
.community-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--sp-2xl);
  align-items: start;
}
.community-side > section { margin-bottom: var(--sp-xl); }
.community-side h4 { margin-bottom: var(--sp-md); font-family: var(--font-display); font-size: 1.05rem; }

/* Forum cards in homepage preview */
.forum-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-md); }
.forum-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  transition: all var(--duration) var(--ease);
}
.forum-card:hover { border-color: var(--rose-light); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.forum-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-sm); margin-bottom: var(--sp-sm); }
.forum-card-head h3 { font-size: 1.1rem; }
.forum-card p { font-size: 0.875rem; min-height: 2.6em; margin-bottom: var(--sp-md); }
.forum-card-meta { display: flex; gap: var(--sp-md); font-size: 0.75rem; color: var(--gray-400); flex-wrap: wrap; }

/* Forum index rows */
.forum-list { display: flex; flex-direction: column; gap: var(--sp-sm); }
.forum-row {
  display: grid;
  grid-template-columns: 1fr 200px 200px;
  gap: var(--sp-lg);
  align-items: center;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  transition: all var(--duration) var(--ease);
}
.forum-row:hover { border-color: var(--rose-light); box-shadow: var(--shadow-sm); }
.forum-row-main h3 { font-size: 1.1rem; margin-bottom: 4px; display: flex; align-items: center; gap: var(--sp-sm); }
.forum-row-main p { font-size: 0.875rem; color: var(--gray-500); }
.forum-row-stats { display: flex; gap: var(--sp-md); justify-content: center; }
.forum-row-stats > div { text-align: center; }
.forum-row-stats strong { font-family: var(--font-display); font-size: 1.3rem; color: var(--bordeaux); display: block; }
.forum-row-stats span { font-size: 0.7rem; color: var(--gray-400); text-transform: uppercase; }
.forum-row-last { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; font-size: 0.85rem; }

/* Topic rows */
.topic-list { display: flex; flex-direction: column; gap: var(--sp-xs); }
.topic-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: var(--sp-md);
  align-items: center;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-md);
  padding: var(--sp-md) var(--sp-lg);
  transition: all var(--duration) var(--ease);
}
.topic-row:hover { border-color: var(--rose-light); background: var(--ivory); }
.topic-row-main { display: flex; flex-direction: column; gap: 4px; }
.topic-row-main h4 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; }
.topic-row-main .badge { align-self: flex-start; margin-bottom: 2px; }
.topic-row-sub { font-size: 0.78rem; color: var(--gray-400); }
.topic-row-meta { display: flex; flex-direction: column; gap: 2px; font-size: 0.78rem; color: var(--gray-400); text-align: right; }

/* Reply rows (sidebar) */
.reply-list { display: flex; flex-direction: column; gap: var(--sp-sm); }
.reply-row {
  display: flex;
  gap: var(--sp-sm);
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-md);
  padding: var(--sp-md);
  transition: all var(--duration) var(--ease);
}
.reply-row:hover { border-color: var(--rose-light); }
.reply-row-author { font-size: 0.85rem; font-weight: 600; }
.reply-row-snippet { font-size: 0.8rem; color: var(--gray-500); margin: 4px 0; }
.reply-row-on { font-size: 0.75rem; color: var(--gray-400); }

/* Topic detail */
.topic-header {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  margin-bottom: var(--sp-lg);
}
.topic-header h1 { font-size: clamp(1.6rem, 3vw, 2rem); margin-bottom: var(--sp-md); }
.topic-meta {
  display: flex;
  gap: var(--sp-lg);
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-100);
  padding-top: var(--sp-md);
  margin-top: var(--sp-md);
}
.topic-meta strong { color: var(--bordeaux); }

.post-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-md);
}
.post-card.post-nested { margin-left: var(--sp-2xl); border-left: 3px solid var(--rose-light); }
.post-head { display: flex; align-items: center; gap: var(--sp-sm); margin-bottom: var(--sp-md); }
.post-head strong { display: block; }
.post-head .badge { font-size: 0.65rem; }
.post-head > span:last-child { margin-left: auto; }
.post-body { color: var(--gray-600); line-height: 1.7; white-space: pre-line; }
.post-actions { margin-top: var(--sp-md); border-top: 1px solid var(--gray-100); padding-top: var(--sp-sm); }

/* Reply composer */
.reply-composer {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-top: var(--sp-lg);
}
.reply-composer h4 { margin-bottom: var(--sp-md); }
.reply-composer textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--sp-md);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  font-size: 0.95rem;
  resize: vertical;
}
.login-gate {
  background: var(--cream);
  border: 1px dashed var(--gray-200);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  text-align: center;
}

/* User profile */
.profile-header {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: var(--sp-2xl);
  margin-bottom: var(--sp-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-xl);
}
.profile-header h1 { margin-bottom: 4px; }
.profile-stats { display: flex; gap: var(--sp-xl); margin-top: var(--sp-md); font-size: 0.9rem; color: var(--gray-500); }
.profile-stats strong { color: var(--bordeaux); font-family: var(--font-display); font-size: 1.2rem; }
.profile-tabs {
  display: flex;
  gap: var(--sp-md);
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: var(--sp-lg);
}
.profile-tab {
  display: inline-block;
  padding: var(--sp-sm) var(--sp-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  transition: all var(--duration) var(--ease);
}
.profile-tab.active, .profile-tab:hover { color: var(--bordeaux); border-bottom-color: var(--bordeaux); }

/* Ambassador directory */
.amb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-lg); }
.amb-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  transition: all var(--duration) var(--ease);
}
.amb-card:hover { box-shadow: var(--shadow-md); border-color: var(--rose-light); }
.amb-card-head { display: flex; gap: var(--sp-md); align-items: center; }
.amb-card-head h3 { font-size: 1.1rem; }
.amb-card p { font-size: 0.875rem; color: var(--gray-500); flex: 1; }
.amb-card-stats { display: flex; gap: var(--sp-lg); font-size: 0.85rem; color: var(--gray-500); border-top: 1px solid var(--gray-100); padding-top: var(--sp-md); }
.amb-card-stats strong { color: var(--bordeaux); font-family: var(--font-display); font-size: 1.05rem; margin-right: 4px; }
.amb-card-actions { display: flex; gap: var(--sp-sm); }

.directory-filters {
  display: flex;
  gap: var(--sp-md);
  margin-bottom: var(--sp-xl);
  flex-wrap: wrap;
}
.directory-filters input, .directory-filters select {
  flex: 1;
  min-width: 200px;
  padding: var(--sp-sm) var(--sp-md);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-md);
  background: var(--white);
}

/* Proposal cards */
.proposal-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-md);
}
.proposal-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-md); margin-bottom: var(--sp-sm); }
.proposal-head h4 { font-size: 1rem; }
.proposal-meta { display: flex; flex-wrap: wrap; gap: var(--sp-sm); font-size: 0.8rem; color: var(--gray-500); margin-top: var(--sp-sm); }
.proposal-actions { display: flex; gap: var(--sp-sm); margin-top: var(--sp-md); border-top: 1px solid var(--gray-100); padding-top: var(--sp-md); }

/* Activity card / row */
.activity-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  transition: all var(--duration) var(--ease);
}
.activity-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--rose-light); }
.activity-card h4 { font-size: 1rem; margin: var(--sp-sm) 0; }
.activity-card p { font-size: 0.85rem; }
.activity-cat { display: inline-block; background: var(--rose-pale); color: var(--bordeaux); font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 10px; border-radius: var(--r-full); }
.activity-meta { display: flex; gap: var(--sp-xs); font-size: 0.78rem; color: var(--gray-400); margin-top: var(--sp-sm); flex-wrap: wrap; }

.activity-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-md);
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-md);
  padding: var(--sp-md) var(--sp-lg);
  margin-bottom: var(--sp-sm);
}
.activity-row h4 { font-size: 0.95rem; margin: 4px 0; }
.activity-row p { font-size: 0.85rem; }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th { text-align: left; padding: var(--sp-sm) var(--sp-md); border-bottom: 2px solid var(--gray-100); font-weight: 600; color: var(--gray-500); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.06em; }
.data-table td { padding: var(--sp-md); border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tr:hover { background: var(--ivory); }

/* Form layout (proposal) */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-lg);
}
.form-grid .form-row.full { grid-column: 1 / -1; }
.form-section {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: var(--sp-2xl);
}

/* Sticky badge color */
.badge.badge-rose { background: var(--rose-pale); color: var(--bordeaux); }

/* Page header (community) */
.community-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  padding: var(--sp-2xl) 0 var(--sp-lg);
}
.community-header h1 { margin-bottom: var(--sp-sm); }
.community-header .crumbs { font-size: 0.85rem; color: var(--gray-400); margin-bottom: var(--sp-sm); }
.community-header .crumbs a:hover { color: var(--bordeaux); }

/* Section heading bar */
.bar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-lg);
  border-bottom: 1px solid var(--gray-100);
  padding-bottom: var(--sp-sm);
}
.bar-heading h2, .bar-heading h3 { font-size: 1.2rem; }
.bar-heading a { font-size: 0.85rem; color: var(--rose); }

/* Notice */
.notice {
  background: var(--blue-light);
  border: 1px solid var(--blue);
  color: var(--gray-600);
  border-radius: var(--r-lg);
  padding: var(--sp-md) var(--sp-lg);
  display: flex;
  gap: var(--sp-md);
  align-items: center;
  font-size: 0.9rem;
}
.notice strong { color: var(--blue); }

/* Responsive community */
@media (max-width: 1024px) {
  .community-layout { grid-template-columns: 1fr; }
  .forum-row { grid-template-columns: 1fr; }
  .forum-row-stats, .forum-row-last { align-items: flex-start; }
  .community-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .topic-row { grid-template-columns: 1fr; }
  .topic-row-meta { text-align: left; }
  .forum-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .profile-header { flex-direction: column; text-align: center; }
}

/* === AVVISO POPUP DISMISSIBILE (community home) === */
.info-popup {
  position: fixed;
  bottom: var(--sp-lg);
  right: var(--sp-lg);
  max-width: 360px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-left: 4px solid var(--bordeaux);
  border-radius: var(--r-lg);
  padding: var(--sp-lg) var(--sp-xl) var(--sp-lg) var(--sp-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  animation: popup-slide 0.4s var(--ease);
}
.info-popup h4 { margin-bottom: var(--sp-sm); font-size: 1rem; }
.info-popup.dismissed { display: none; }
.info-popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 1.4rem;
  color: var(--gray-400);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.info-popup-close:hover { color: var(--bordeaux); }
@keyframes popup-slide {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 720px) {
  .info-popup { left: var(--sp-md); right: var(--sp-md); bottom: var(--sp-md); max-width: none; }
}

/* === COMMUNITY FOOTER GRID === */
.community-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-2xl);
  padding: var(--sp-2xl) 0 var(--sp-xl);
  color: var(--gray-300);
}
.community-footer-grid h5 { margin-bottom: var(--sp-md); }
.community-footer-grid p { color: var(--gray-300); font-size: 0.85rem; }
.community-footer-grid .footer-links { display: flex; flex-direction: column; gap: var(--sp-sm); }
.community-footer-grid .footer-links a { font-size: 0.85rem; color: var(--gray-300); }
.community-footer-grid .footer-links a:hover { color: var(--white); }
@media (max-width: 1024px) {
  .community-footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-xl); }
}
@media (max-width: 480px) {
  .community-footer-grid { grid-template-columns: 1fr; }
}

/* === ACTIVITY AUTHOR (footer della card attività) === */
.activity-author { transition: all var(--duration) var(--ease); }
.activity-card:hover .activity-author .text-bordeaux { text-decoration: underline; }

/* === MAPPA ITALIA (homepage) === */
.italy-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--sp-2xl); align-items: center; }
.italy-map {
  width: 100%; max-width: 520px; margin: 0 auto;
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--r-xl); padding: var(--sp-lg); box-shadow: var(--shadow-md);
}
.italy-regions { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 22px rgba(122,45,63,0.16)); }
.italy-regions .region {
  fill: var(--rose-light);
  stroke: var(--white);
  stroke-width: 1.6;
  transition: fill 0.15s var(--ease);
  cursor: pointer;
}
.italy-regions .region:hover { fill: var(--rose); }
.italy-regions .region:focus { outline: none; fill: var(--rose); }
.italy-regions .region.selected { fill: var(--bordeaux); }
.italy-side { display: flex; flex-direction: column; gap: var(--sp-md); }
.italy-region-card {
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--r-lg); padding: var(--sp-lg); box-shadow: var(--shadow-sm);
}
.italy-region-card .eyebrow { color: var(--rose); }
.italy-region-card .italy-region-name { margin: 0.2rem 0 0.4rem; color: var(--bordeaux); }
.italy-region-cta { margin-top: var(--sp-md); }
.italy-stat { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--r-md); padding: var(--sp-md) var(--sp-lg); text-align: center; }
.italy-stat-num { display: block; font-size: 1.6rem; font-weight: 800; color: var(--bordeaux); letter-spacing: -0.02em; }
.italy-stat-lbl { font-size: 0.8rem; color: var(--gray-500); }
/* lista iniziative aperte (nel pannello mappa) */
.italy-open { display: flex; flex-direction: column; gap: var(--sp-sm); margin: var(--sp-md) 0; }
.open-init { padding: 8px 10px; border: 1px solid var(--gray-100); border-radius: var(--r-sm); background: var(--ivory); }
.open-init .badge { margin-bottom: 4px; }
.open-init strong { display: block; font-size: 0.9rem; }
/* domande di qualificazione nel form proposta */
.screening-head { margin-top: var(--sp-md); padding-top: var(--sp-lg); border-top: 1px dashed var(--gray-200); }
.screening-head h4 { color: var(--bordeaux); }
@media (max-width: 768px) {
  .italy-layout { grid-template-columns: 1fr; gap: var(--sp-xl); }
  .italy-map { max-width: 360px; }
}

/* === PAGINA EVENTO (QR) === */
.event-hero { text-align: center; margin-bottom: var(--sp-xl); }
.event-hero h1 { margin: var(--sp-xs) 0; }
.event-meta { color: var(--gray-500); font-size: 0.95rem; }
.event-actions { display: flex; flex-direction: column; gap: var(--sp-md); }
.event-action {
  display: flex; align-items: center; gap: var(--sp-md);
  width: 100%; text-align: left;
  background: var(--white); border: 1px solid var(--gray-100);
  border-radius: var(--r-lg); padding: var(--sp-lg);
  box-shadow: var(--shadow-sm); transition: all var(--duration) var(--ease); cursor: pointer;
}
.event-action:hover { border-color: var(--rose); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.event-action-icon { font-size: 1.8rem; width: 48px; height: 48px; display: grid; place-items: center; background: var(--rose-pale); border-radius: var(--r-md); flex-shrink: 0; }
.event-action strong { display: block; font-size: 1.05rem; color: var(--dark); }
.event-action small { color: var(--gray-500); font-size: 0.85rem; }
.event-view { margin-top: var(--sp-md); }
.ev-back { color: var(--gray-500); font-size: 0.85rem; font-weight: 600; margin-bottom: var(--sp-md); background: none; }
.ev-back:hover { color: var(--bordeaux); }
.consent-box { background: var(--rose-pale); border-radius: var(--r-md); padding: var(--sp-md); margin-top: var(--sp-md); align-items: flex-start; }
.consent-box span { font-size: 0.85rem; }
#survey-form .form-group, #storia-form .form-group { margin-bottom: var(--sp-md); }

/* === EVENTI & QR (dashboard) === */
.qr-box { background: var(--white); border: 1px solid var(--gray-100); border-radius: var(--r-md); padding: var(--sp-md); display: inline-block; }
.qr-box img, .qr-box canvas { display: block; width: 140px; height: 140px; }
.event-row { display: flex; gap: var(--sp-md); align-items: center; padding: var(--sp-md) 0; border-bottom: 1px solid var(--gray-100); flex-wrap: wrap; }
.event-row .qr-box img, .event-row .qr-box canvas { width: 96px; height: 96px; }
.qr-box img, .qr-box canvas { border-radius: 4px; }

/* === QR REALI (libreria client-side) === */
/* Quando un .qr-mock viene riempito da un QR reale, disattiva griglia/overlay demo */
.qr-mock.qr-real {
  display: block;
  grid-template-columns: none;
  grid-template-rows: none;
  gap: 0;
  padding: 6px;
}
.qr-mock.qr-real::after { content: none; }
.qr-mock.qr-real canvas, .qr-mock.qr-real img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  border-radius: 4px;
}

/* Card "Scansiona per donare" — profilo pubblico ambassador */
.qr-card {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  margin-top: var(--sp-xl);
  padding: var(--sp-lg);
  background: linear-gradient(135deg, var(--white), var(--rose-pale, #fdf2f4));
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.qr-frame {
  flex-shrink: 0;
  width: 136px;
  height: 136px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--r-md);
  box-shadow: 0 6px 18px rgba(122,45,63,0.10);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.qr-frame:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 12px 28px rgba(122,45,63,0.18); }
.qr-frame canvas, .qr-frame img { width: 100% !important; height: 100% !important; display: block; }
.qr-card-text strong { display: block; font-size: 1.05rem; margin-bottom: 4px; color: var(--bordeaux); }
.qr-card-text p { margin: 0; }
@media (max-width: 480px) {
  .qr-card { flex-direction: column; text-align: center; }
}

/* === PAGAMENTI (donation-page) === */
.pay-info-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  animation: payFade 0.35s var(--ease);
}
@keyframes payFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.pay-field {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  padding: var(--sp-sm) 0;
  border-bottom: 1px dashed var(--gray-100);
}
.pay-field:last-child { border-bottom: 0; }
.pay-field-label {
  flex: 0 0 100%;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  font-weight: 600;
}
.pay-field-value { font-weight: 600; color: var(--dark); }
.pay-field-value.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.02em; }
.pay-field .pay-copy { margin-left: auto; }
.pay-5x1000 { margin-top: var(--sp-xs); padding-top: var(--sp-md); border-top: 1px solid var(--gray-100); border-bottom: 0; }
.pay-redirect { display: flex; align-items: center; gap: var(--sp-md); }
.pay-redirect-icon { font-size: 1.8rem; line-height: 1; }
.pay-redirect p { margin: 0; }

/* === HERO: più aria + modulo statistiche corallo === */
.hero { padding: var(--sp-lg) 0 var(--sp-2xl); }
.hero p { margin-bottom: var(--sp-2xl); }
.hero-ctas { gap: var(--sp-lg); margin-top: var(--sp-xl); }

/* la "card" dell'hero: corallo solido #f3948f, testi bianchi */
.hero-card {
  background: var(--rose);
  border-radius: clamp(20px, 4vw, 36px);
  padding: clamp(2rem, 5vw, 4rem) clamp(1.4rem, 4vw, 3.4rem);
  box-shadow: 0 30px 70px rgba(243,148,143,0.40);
  color: #fff;
  text-align: center;
}
.hero-card h5 { color: rgba(255,255,255,0.85); }
.hero-card h1 { color: #fff; }
.hero-card p { color: rgba(255,255,255,0.92); margin-left: auto; margin-right: auto; }
.hero-card .btn-primary { background: #fff; color: var(--bordeaux); box-shadow: 0 10px 24px rgba(92,31,46,0.20); }
.hero-card .btn-primary:hover { background: #fff; color: var(--bordeaux-dark); box-shadow: 0 16px 34px rgba(92,31,46,0.28); }
.hero-card .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,0.65); box-shadow: none; }
.hero-card .btn-secondary:hover { background: rgba(255,255,255,0.15); border-color: #fff; }

/* statistiche: pannello chiaro traslucido dentro la card corallo */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 620px;
  margin: var(--sp-2xl) auto 0;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: var(--r-xl);
  padding: var(--sp-xl) var(--sp-lg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}
.hero-stat {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: var(--sp-xs) var(--sp-md);
  transition: transform 0.3s var(--ease);
}
.hero-stat:hover { transform: translateY(-3px); }
.hero-stat + .hero-stat { border-left: 1px solid rgba(255,255,255,0.45); }
.hero-stat-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.92);
  display: grid; place-items: center;
  color: var(--bordeaux);
  box-shadow: 0 6px 14px rgba(122,45,63,0.16);
  animation: floatY 3.4s var(--ease) infinite;
}
.hero-stat-icon svg { width: 26px; height: 26px; }
.benefit-ic svg { width: 40px; height: 40px; }
.benefit-ic { color: var(--bordeaux); margin-bottom: var(--sp-md); line-height: 0; }
.btn-ic svg { width: 1.15em; height: 1.15em; vertical-align: -0.18em; }
.hero-stat:nth-child(2) .hero-stat-icon { animation-delay: 0.5s; }
.hero-stat:nth-child(3) .hero-stat-icon { animation-delay: 1s; }
.hero-stat .kpi-value {
  font-size: clamp(1.7rem, 4.2vw, 2.4rem);
  font-weight: 800; letter-spacing: -0.02em; color: #fff; line-height: 1;
  text-shadow: 0 1px 3px rgba(92,31,46,0.25);
}
.hero-stat-label {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  color: rgba(255,255,255,0.88);
}
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (max-width: 560px) {
  .hero-stats { grid-template-columns: 1fr; gap: var(--sp-lg); padding: var(--sp-xl); }
  .hero-stat + .hero-stat { border-left: none; border-top: 1px solid rgba(255,255,255,0.45); padding-top: var(--sp-lg); }
}

/* === ANTI-FLASH IDRATAZIONE ===
   I blocchi marcati [data-live-region] (es. classifica, ambassador in evidenza)
   restano nascosti dal primo paint finché live.js non inserisce i dati reali,
   evitando il "lampo" dei dati demo. La rivelazione avviene rimuovendo la classe
   .fie-prehydrate dall'<html> (live.js dopo l'idratazione, oppure il failsafe JS
   in app.js dopo 2.5s, oppure subito se Supabase non è configurato). */
html.fie-prehydrate [data-live-region] { opacity: 0; }

/* === AMBASSADOR IN EVIDENZA (home) — soldi raccolti === */
.amb-raised { text-align: center; margin: var(--sp-md) 0 var(--sp-xs); }
.amb-raised strong { display: block; font-family: var(--font-display); font-size: 1.9rem; color: var(--bordeaux); line-height: 1.1; letter-spacing: -0.02em; }
.amb-raised span { font-size: 0.85rem; color: var(--gray-500); }

/* === SOCIAL / INSTAGRAM === */
.social-ig {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--rose-light, #d68a99);
  font-weight: 600; font-size: 0.9rem; text-decoration: none;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}
.social-ig:hover { color: var(--white); transform: translateY(-1px); }
.social-ig svg { width: 18px; height: 18px; flex-shrink: 0; }
/* variante prominente (footer ricco / pagine social) */
.social-ig.social-ig-lg {
  font-size: 0.95rem; padding: 9px 16px; border-radius: var(--r-full);
  border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.04);
}
.social-ig.social-ig-lg:hover { background: rgba(255,255,255,0.10); transform: translateY(-2px); }

/* === SCROLL REVEAL (animazioni d'ingresso al scroll) === */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-stat-icon { animation: none; }
}

/* ============================================================
   === EFFETTI & ANIMAZIONI (rifinitura grafica go-live) ======
   Tutto additivo e performante (solo transform/opacity).
   ============================================================ */
html { scroll-behavior: smooth; }

/* Accessibilità: anello di focus visibile e coerente col brand */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* --- Navbar: si compatta ed eleva allo scroll --- */
.navbar { transition: padding 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.navbar.scrolled {
  padding: calc(var(--sp-sm) + 2px) 0;
  background: rgba(250,249,247,0.96);
  box-shadow: 0 6px 24px rgba(30,28,26,0.07);
}
.navbar-brand .brand-icon { transition: transform 0.4s var(--ease); }
.navbar-brand:hover .brand-icon { transform: rotate(-6deg) scale(1.06); }

/* --- CTA principali: "sheen" luminoso che attraversa al hover --- */
.btn-primary, .btn-rose { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary::after, .btn-rose::after {
  content: "";
  position: absolute; top: 0; left: -120%;
  width: 70%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s var(--ease);
  z-index: -1;
}
.btn-primary:hover::after, .btn-rose:hover::after { left: 130%; }

/* --- Card: lift un filo più morbido e luminoso --- */
.card { will-change: transform; }
.card:hover { transform: translateY(-4px); }

/* --- Selezione importo / metodo pagamento: "pop" elastico --- */
@keyframes selectPop { 0% { transform: scale(1); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }
.amount-btn.active, .payment-method.active { animation: selectPop 0.32s var(--ease); }

/* --- QR: linea di scansione che scorre (richiama l'azione "inquadra") --- */
.qr-frame, .qr-mock.qr-real { position: relative; overflow: hidden; }
.qr-frame::after, .qr-mock.qr-real::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 36%;
  background: linear-gradient(180deg, rgba(194,105,122,0.0), rgba(194,105,122,0.28));
  border-bottom: 2px solid rgba(122,45,63,0.45);
  transform: translateY(-110%);
  animation: qrScan 2.6s var(--ease) infinite;
  pointer-events: none;
}
@keyframes qrScan {
  0% { transform: translateY(-110%); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(300%); opacity: 0; }
}

/* --- Badge oro (classifica #1): leggero luccichio --- */
.badge-gold { background-size: 200% 100%; animation: goldShine 3.5s linear infinite; }
@keyframes goldShine { to { background-position: 200% 0; } }

/* --- Avatar: morbido zoom al hover dove cliccabile --- */
a .avatar, .leaderboard-row .avatar { transition: transform 0.3s var(--ease); }
a:hover .avatar, .leaderboard-row:hover .avatar { transform: scale(1.05); }

/* --- Link testuali rosa con sottolineatura animata --- */
.text-rose { background-image: linear-gradient(currentColor, currentColor); background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size 0.3s var(--ease); }
.text-rose:hover { background-size: 100% 1px; }

/* Rispetta la preferenza "meno animazioni": spegne i nuovi effetti continui */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .qr-frame::after, .qr-mock.qr-real::after,
  .badge-gold, .amount-btn.active, .payment-method.active { animation: none; }
  .qr-frame::after, .qr-mock.qr-real::after { display: none; }
  .btn-primary::after, .btn-rose::after { transition: none; }
}

/* ============================================================
   === HEADER INVERTITA — sfondo corallo, testo e logo bianchi ===
   ============================================================ */
.navbar {
  background: var(--rose);
  border-bottom: 1px solid rgba(255,255,255,0.20);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.navbar.scrolled {
  background: var(--rose);
  box-shadow: 0 6px 22px rgba(122,45,63,0.22);
}
.navbar .navbar-brand { color: #fff; }
.navbar .navbar-brand .brand-icon { filter: brightness(0) invert(1); }  /* logo bianco */
.navbar-nav > a:not(.btn), .navbar .nav-external { color: rgba(255,255,255,0.92); }
.navbar-nav > a:not(.btn):hover,
.navbar-nav > a:not(.btn).active,
.navbar .nav-external:hover { color: #fff; }
.navbar-nav > a:not(.btn).active::after,
.navbar .nav-external::after { background: #fff; }
.navbar .nav-divider { background: rgba(255,255,255,0.30); }
.navbar .mobile-toggle span { background: #fff; }
/* CTA: "Login" ghost bianco, "Dona ora" pieno bianco con testo bordeaux */
.navbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.65); background: transparent; }
.navbar .btn-ghost:hover { color: #fff; background: rgba(255,255,255,0.16); border-color: #fff; }
.navbar .btn-primary { background: #fff; color: var(--bordeaux); box-shadow: none; }
.navbar .btn-primary:hover { background: var(--ivory); color: var(--bordeaux); transform: translateY(-1px); }
.navbar .btn-primary::after { display: none; }
/* menu mobile a tendina: stesso sfondo corallo */
@media (max-width: 900px) {
  .navbar .navbar-nav { background: var(--rose); }
}
