:root {
  --color-primary: #003d99;
  --color-accent: #ffc700;
  --color-dark: #0b1f3a;
  --color-text: #374151;
  --color-bg-alt: #f3f4f6;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--color-text);
  line-height: 1.6;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  z-index: 10;
}

.header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 64px;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
  text-decoration: none;
}

.logo-img {
  height: 44px;
  width: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 61, 153, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 61, 153, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-header {
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
  background: var(--color-accent);
  color: var(--color-dark);
  box-shadow: 0 4px 14px rgba(255, 199, 0, 0.4);
}

.btn-header:hover {
  box-shadow: 0 6px 18px rgba(255, 199, 0, 0.5);
}

.nav a {
  margin-left: 1.5rem;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
}

.nav a:hover {
  color: var(--color-primary);
}

/* Carosello */
.carousel {
  position: relative;
  height: 70vh;
  min-height: 420px;
  overflow: hidden;
  background: var(--color-dark);
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

.carousel-overlay h1 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.carousel-overlay p {
  font-size: 1.125rem;
  opacity: 0.9;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
}

.carousel-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
}

.carousel-prev {
  left: 1rem;
}

.carousel-next {
  right: 1rem;
}

.carousel-dots {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 2;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
}

.carousel-dot.active {
  background: #fff;
}

.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
}

.section p + p {
  margin-top: 1rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.card h3,
.card p {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.card h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--color-dark);
}

.card p {
  padding-bottom: 1.5rem;
}

.timeline {
  position: relative;
  margin-top: 2.5rem;
  padding-left: 2rem;
  border-left: 3px solid var(--color-primary);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.4rem;
  top: 0.35rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--color-primary);
}

.timeline-year {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.timeline-content h3 {
  color: var(--color-dark);
  margin-bottom: 0.4rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 58, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  background: #fff;
  border-radius: 10px;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text);
}

.form-volontario {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1.5rem;
}

.form-volontario label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-dark);
  margin-top: 0.6rem;
}

.form-volontario input,
.form-volontario textarea {
  padding: 0.6rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font: inherit;
}

.form-volontario input:focus,
.form-volontario textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.campo-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-volontario-submit {
  margin-top: 1rem;
  border: none;
  cursor: pointer;
}

.form-volontario-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-volontario-esito {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.form-volontario-esito.successo {
  color: #15803d;
}

.form-volontario-esito.errore {
  color: #b91c1c;
}

.footer {
  background: var(--color-dark);
  color: #9ca3af;
  text-align: center;
  padding: 1.5rem 0;
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .header .container {
    flex-direction: column;
    height: auto;
    padding: 1rem 1.5rem;
  }

  .nav a {
    margin: 0 0.75rem;
  }

  .btn-header {
    margin-top: 1rem;
  }

  .carousel-overlay h1 {
    font-size: 1.75rem;
  }
}
