:root {
  /* Palette Movimento Laudato Si' (colori del logo/globo) */
  --verde: #08ad72;
  --verde-scuro: #05784f;
  --blu: #00aef6;
  --blu-scuro: #0071a8;
  --inchiostro: #1d1d1b;
  --bg: #f7f6f1;
  --testo: #262622;
  --bordo: #e4e2d7;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--testo);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--verde-scuro); }

.topbar {
  background: #fff;
  color: var(--inchiostro);
  padding: 0.55rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--verde);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}
.brand { color: var(--inchiostro); text-decoration: none; font-weight: 600; display: flex; align-items: center; gap: 0.7rem; }
.brand-logo { height: 42px; width: auto; display: block; }
.brand-name { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.5px; color: var(--verde-scuro); }
.brand-name em { font-style: normal; font-weight: 400; color: var(--inchiostro); }
.mainnav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; }
.mainnav a { color: var(--inchiostro); text-decoration: none; font-weight: 500; }
.mainnav a:hover { color: var(--verde-scuro); text-decoration: underline; }
.logout-form { display: inline; }
.logout-form button, .mainnav button {
  background: var(--verde); color: #fff; border: 1px solid var(--verde);
  border-radius: 6px; padding: 0.25rem 0.6rem; cursor: pointer;
}
.logout-form button:hover, .mainnav button:hover { background: var(--verde-scuro); border-color: var(--verde-scuro); }

@media (max-width: 520px) {
  .brand-logo { height: 34px; }
  .brand-name { font-size: 0.95rem; }
}

.container { max-width: 1080px; margin: 1.5rem auto; padding: 0 1.2rem; }
.footer { text-align: center; color: #6b7363; font-size: 0.85rem; padding: 2rem 1rem; }

.messages { list-style: none; padding: 0; margin: 1rem auto; max-width: 1080px; }
.msg { padding: 0.6rem 1rem; border-radius: 6px; margin: 0.3rem 1.2rem; }
.msg.success { background: #e3f2e4; border: 1px solid var(--verde); }
.msg.error { background: #fdecea; border: 1px solid #c62828; }

.filtri {
  display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end;
  background: #fff; border: 1px solid var(--bordo); border-radius: 8px; padding: 0.9rem; margin-bottom: 1rem;
}
.filtri label { display: flex; flex-direction: column; font-size: 0.8rem; font-weight: 600; gap: 0.2rem; }
.filtri select, .filtri input { padding: 0.35rem 0.4rem; border: 1px solid var(--bordo); border-radius: 5px; }
.filtri button, .btn {
  background: var(--verde); color: #fff; border: 0; border-radius: 6px;
  padding: 0.45rem 0.9rem; cursor: pointer; text-decoration: none; display: inline-block;
}

#calendar { background: #fff; border: 1px solid var(--bordo); border-radius: 8px; padding: 1rem; }

.event-list { list-style: none; padding: 0; }
.event-item {
  display: flex; gap: 1rem; background: #fff; border: 1px solid var(--bordo);
  border-left: 5px solid var(--c, var(--blu)); border-radius: 8px; padding: 0.8rem 1rem; margin-bottom: 0.6rem;
}
.event-date { text-align: center; min-width: 70px; }
.event-date .d { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1; }
.event-date .m { display: block; text-transform: uppercase; font-size: 0.7rem; color: #6b7363; }
.event-date .t { display: block; font-size: 0.8rem; margin-top: 0.2rem; }
.event-title { font-weight: 600; font-size: 1.05rem; text-decoration: none; }
.event-meta { margin: 0.2rem 0; color: #57604c; font-size: 0.9rem; }
.badge {
  display: inline-block; background: #e3f2e4; color: var(--verde-scuro);
  border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.75rem; margin-right: 0.3rem;
}
.badge.warn { background: #fff3e0; color: #e65100; }

.evento-dettaglio {
  background: #fff; border: 1px solid var(--bordo); border-top: 6px solid var(--c, var(--blu));
  border-radius: 8px; padding: 1.5rem;
}
.evento-layout.con-manifesto { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: 1.2rem; align-items: start; }
.manifesto { background: #fff; border: 1px solid var(--bordo); border-radius: 8px; padding: 1rem; position: sticky; top: 1rem; }
.manifesto h2 { margin: 0 0 0.6rem; font-size: 1rem; color: #57604c; }
.manifesto img { display: block; width: 100%; height: auto; border: 1px solid var(--bordo); border-radius: 6px; }
.manifesto iframe { display: block; width: 100%; height: 480px; border: 1px solid var(--bordo); border-radius: 6px; }
@media (max-width: 820px) {
  .evento-layout.con-manifesto { grid-template-columns: 1fr; }
  .manifesto { position: static; }
}
.scheda { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin-top: 1rem; }
.scheda dt { font-weight: 700; color: #57604c; }
.scheda dd { margin: 0; }

.tabella, .form-evento { width: 100%; border-collapse: collapse; background: #fff; }
.tabella th, .tabella td { border: 1px solid var(--bordo); padding: 0.5rem 0.7rem; text-align: left; }
.azioni { display: flex; gap: 0.6rem; align-items: center; }
.link-danger { background: none; border: 0; color: #c62828; cursor: pointer; text-decoration: underline; }

.form-evento p { display: flex; flex-direction: column; margin: 0.6rem 0; max-width: 640px; }
.form-evento label { font-weight: 600; }
.form-evento input, .form-evento select, .form-evento textarea {
  padding: 0.4rem; border: 1px solid var(--bordo); border-radius: 5px; font: inherit;
}
.form-evento button { background: var(--verde); color: #fff; border: 0; border-radius: 6px; padding: 0.5rem 1.2rem; cursor: pointer; }

.auth-box { max-width: 420px; margin: 2rem auto; background: #fff; border: 1px solid var(--bordo); border-radius: 8px; padding: 1.5rem; }
.auth-box input { width: 100%; padding: 0.45rem; border: 1px solid var(--bordo); border-radius: 5px; }
.auth-box button { margin-top: 0.6rem; background: var(--verde); color: #fff; border: 0; border-radius: 6px; padding: 0.5rem 1.2rem; cursor: pointer; }

.riepilogo { margin-top: 1rem; }
.pill {
  display: inline-block; background: #fff; border: 1px solid var(--bordo);
  border-radius: 999px; padding: 0.2rem 0.7rem; margin: 0.2rem; font-size: 0.85rem;
}
.hint, .conteggio { color: #6b7363; font-size: 0.9rem; }

.legenda { font-size: 0.85rem; color: #6b7363; margin: 0 0 0.8rem; display: flex; align-items: center; flex-wrap: wrap; }
.legenda .pallino {
  display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 50%; margin-left: 0.8rem; margin-right: 0.3rem;
}
.legenda .pallino:first-child { margin-left: 0; }

.credenziali-box {
  background: #e8f5e9; border: 1px solid #a5d6a7; border-radius: 8px;
  padding: 0.8rem 1rem; margin: 1rem 0;
}
.credenziali-box code {
  font-size: 1.1rem; background: #fff; padding: 0.1rem 0.4rem; border-radius: 4px; border: 1px solid var(--bordo);
}

/* Foto e materiali degli eventi */
.materiali, .galleria { margin-top: 1.5rem; }
.materiali h2, .galleria h2 { font-size: 1.1rem; color: #57604c; margin-bottom: 0.5rem; }
.materiali ul { margin: 0; padding-left: 1.2rem; }
.foto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.6rem; }
.foto-grid a, .foto-grid figure { margin: 0; display: block; }
.foto-grid img {
  width: 100%; height: 150px; object-fit: cover; border-radius: 6px; border: 1px solid var(--bordo); display: block;
}
.foto-grid span, .foto-grid figcaption { font-size: 0.8rem; color: #6b7363; display: block; margin-top: 0.2rem; }
.media-sez { border-top: 1px solid var(--bordo); margin-top: 1.5rem; padding-top: 1rem; }
.media-sez h2 { font-size: 1.1rem; }
.media-lista { list-style: none; padding: 0; }
.media-lista li { display: flex; gap: 0.8rem; align-items: center; padding: 0.3rem 0; }
.media-lista form { display: inline; }

/* FullCalendar: pulsanti nei colori del Movimento */
.fc .fc-button-primary {
  background: var(--verde); border-color: var(--verde);
}
.fc .fc-button-primary:hover { background: var(--verde-scuro); border-color: var(--verde-scuro); }
.fc .fc-button-primary:disabled { background: var(--verde); border-color: var(--verde); opacity: .55; }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--verde-scuro); border-color: var(--verde-scuro);
}
.fc .fc-button-primary:focus,
.fc .fc-button-primary:not(:disabled):active:focus { box-shadow: 0 0 0 0.2rem rgba(8, 173, 114, .35); }
.fc .fc-toolbar-title { color: var(--inchiostro); }
.fc-theme-standard .fc-scrollgrid,
.fc-theme-standard td, .fc-theme-standard th { border-color: var(--bordo); }
.fc .fc-daygrid-day.fc-day-today { background: rgba(0, 174, 246, .10); }
