/* === STILE GENERALE === */
body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: #f0f8ff;
  color: #222;
}

header {
  background-color: #003366;
  color: white;
  padding: 20px;
  text-align: center;
  position: relative;
}

.logo {
  max-width: 140px;
  display: block;
  margin: 10px auto;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

section {
  margin-bottom: 40px;
  padding: 20px;
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

h2 {
  color: #003366;
  margin-bottom: 15px;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.cta-button {
  display: inline-block;
  margin-top: 15px;
  background-color: #0055a5;
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1em;
}

.cta-button:hover {
  background-color: #0074d9;
}

footer {
  background-color: #f4f4f4;
  padding: 20px;
  text-align: center;
  font-size: 0.9em;
  border-top: 2px solid #ccc;
}

/* === PULSANTE "TORNA SU" === */
#scrollTopBtn {
  display: none;
  position: fixed;
  bottom: 40px;
  right: 20px;
  z-index: 99;
  font-size: 18px;
  border: none;
  outline: none;
  background-color: #0055a5;
  color: white;
  cursor: pointer;
  padding: 10px 15px;
  border-radius: 8px;
}

#scrollTopBtn:hover {
  background-color: #0074d9;
}

/* === MEDIA QUERIES === */
@media (max-width: 768px) {
  main {
    padding: 10px;
  }

  .cta-button {
    width: 100%;
    text-align: center;
  }
}

/* === AGRIMOTUS BOX === */
.project-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 25px;
  margin: 30px 0;
  border-left: 4px solid #2ecc71;
}

.project-header h2 {
  color: #27ae60;
  margin-bottom: 5px;
}

.project-status {
  font-size: 0.8em;
  background: #eafaf1;
  padding: 3px 8px;
  border-radius: 4px;
  color: #27ae60;
}

.project-subtitle {
  font-weight: 600;
  color: #2c3e50;
}

.project-lead {
  font-style: italic;
  color: #7f8c8d;
  margin-bottom: 20px;
}

.project-details h3 {
  color: #16a085;
  margin-top: 20px;
}

.solution-diagram {
  display: flex;
  align-items: center;
  margin: 20px 0;
  flex-wrap: wrap;
  position: relative;
}

.solution-node {
  background: white;
  border: 1px solid #ddd;
  padding: 12px 20px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin: 10px;
  min-width: 120px;
}

.solution-node.highlight {
  background: #eafaf1;
  border-color: #27ae60;
  font-weight: 600;
}

.solution-arrow {
  font-size: 1.5em;
  color: #7f8c8d;
  margin: 0 5px;
}

.solution-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.satellite-data {
  position: absolute;
  top: -25px;
  right: 30%;
  background: #e1f5fe;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #0288d1;
}

.project-contact {
  margin-top: 25px;
  text-align: center;
  padding-top: 15px;
  border-top: 1px dashed #ddd;
}

/* Nuovo stile per la sezione di collegamento */
.featured-project {
  padding: 3rem 0;
  background: linear-gradient(135deg, #f1f8e9, #e8f5e9);
}

.project-card {
  display: flex;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: all 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.project-content {
  flex: 1;
  padding: 2.5rem;
}

.project-content h2 {
  color: #2e7d32;
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.project-content p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: #444;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  padding: 0.8rem 1.8rem;
  background: #2e7d32;
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.cta-button:hover {
  background: #1b5e20;
  transform: translateX(5px);
}

.cta-button i {
  margin-right: 8px;
  transition: all 0.3s ease;
}

.project-icon {
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
  .project-card {
    flex-direction: column;
  }
  
  .project-icon {
    width: 100%;
    height: 150px;
  }
}

/* SEZIONE SERVIZI OFFERTI */
.servizi-section {
  background-color: #f8f9fa;
  padding: 40px 0;
  margin-top: 30px;
  text-align: center;
}

.servizi-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.servizi-section h2 {
  color: #2c3e50;
  margin-bottom: 15px;
}

.servizi-section p {
  font-size: 1.1em;
  margin-bottom: 25px;
  line-height: 1.6;
}

.servizi-button {
  background-color: #3498db;
  color: white;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  display: inline-block;
  transition: background-color 0.3s;
}

.servizi-button:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
}

/* SEZIONE PATROCINI - PARTENARIATI HOMEPAGE */
.patrocini-section {
  background: linear-gradient(135deg, #2c3e50, #1a2530);
  padding: 50px 0;
  text-align: center;
  color: white;
}

.patrocini-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.patrocini-section h2 {
  font-size: 2rem;
  margin-bottom: 15px;
}

.patrocini-section p {
  font-size: 1.1em;
  margin-bottom: 25px;
  opacity: 0.9;
}

.patrocini-button {
  background-color: #27ae60;
  color: white;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  display: inline-block;
  transition: all 0.3s ease;
}

.patrocini-button:hover {
  background-color: #219653;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.copyright {
  text-align: center;
  padding-top: 20px;
  margin-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.2);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
}

.site-footer .copyright {
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Modifica stili esistenti */
.support-logos {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 50px;  /* Aumenta lo spazio tra gli elementi */
  margin-top: 30px;
}

.support-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.support-logo {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  padding: 15px;
  transition: transform 0.3s ease;
  margin-bottom: 15px; /* Spazio tra logo e testo */
}

.support-logo img {
  max-width: 100%;
  max-height: 100%;
}

.support-logo:hover {
  transform: scale(1.05);
}

.support-item p {
  font-weight: bold;
  color: #2c3e50;
  margin-top: 10px;
}

.support-item p {
  color: #2c3e50;
  font-size: 0.95rem;
  line-height: 1.6;
}

.section-light {
  background-color: #f9f9f9;
  padding: 60px 20px;
  font-family: 'Lato', sans-serif;
}

.section-title {
  font-size: 2.2em;
  color: #3c5a3c;
  text-align: center;
  margin-bottom: 10px;
}

.section-subtitle {
  text-align: center;
  font-size: 1.2em;
  color: #666;
  margin-bottom: 40px;
}

.borghi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
}

.borgo-card {
  background-color: #fff;
  border: 1px solid #ddd;
  padding: 25px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.btn-primary, .btn-secondary, .btn-contact {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 20px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
}

.btn-primary {
  background-color: #3c5a3c;
  color: #fff;
}

.btn-secondary {
  background-color: #e0e0e0;
  color: #333;
}

.btn-contact {
  background-color: #6c9c6c;
  color: #fff;
}

.update-note {
  font-style: italic;
  text-align: center;
  margin-top: 30px;
  color: #888;
}

.borghi-teaser {
  background-color: #f5f5f5;
  padding: 50px 20px;
  text-align: center;
  font-family: 'Lato', sans-serif;
}

.borghi-teaser h2 {
  color: #3c5a3c;
  font-size: 2em;
  margin-bottom: 10px;
}

.borghi-teaser p {
  font-size: 1.1em;
  color: #555;
  margin-bottom: 20px;
}

.borghi-links a {
  display: inline-block;
  margin: 10px;
  padding: 12px 20px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  color: #fff;
}

.btn-primary {
  background-color: #3c5a3c;
}

.btn-contact {
  background-color: #6c9c6c;
}

.borgo-content {
  margin: 0 auto;
  max-width: 800px;
}

.borgo-content .borgo-story {
  margin-bottom: 30px;
  padding: 20px;
  border-radius: 8px;
}
#val-di-merse .borgo-story {
  background: rgba(46, 125, 50, 0.05); /* verde tenue */
}
#parteolla .borgo-story {
  background: rgba(0, 96, 100, 0.05); /* blu tenue */
}

/* all’interno del tag <style> */
#val-di-merse .borgo-hero {
  background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://raw.githubusercontent.com/TizyM/movere-in-salus/main/Palazzetto (SI).jpg') center center;
  background-size: cover;
  padding: 100px 20px;
  color: white;
  text-align: center;
}

#parteolla .borgo-hero {
  background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://raw.githubusercontent.com/TizyM/movere-in-salus/main/Parteolla-borghi.jpg') center center;
  background-size: cover;
  padding: 100px 20px;
  color: white;
  text-align: center;
}

/* Add this to your existing CSS */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-container {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Apply to all sections */
header, .borgo-section, .certification-section, .footer {
    padding-left: 20px;
    padding-right: 20px;
}

/* === Layout Centrato e Bilanciato === */
body {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* === Header e Footer arrotondati === */
header {
  border-bottom-left-radius: 30px;
  border-bottom-right-radius: 30px;
}

.footer {
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
}

/* === Spaziature migliorate tra sezioni === */
section {
  margin-top: 60px;
  margin-bottom: 60px;
}

/* === Bordi arrotondati + transizioni === */
.borgo-container,
.step-card,
.contact-form,
.testimonial,
.activity-card,
.highlight-item,
.legal-info,
.nav-card {
  border-radius: 16px;
  transition: var(--transition);
}

/* === Effetti hover su elementi principali === */
.step-card:hover,
.nav-card:hover,
.activity-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

/* === Transizioni fluide su pulsanti === */
.submit-btn,
.lang-btn {
  transition: var(--transition);
}

/* === Sezione Certificazione: pulsanti più visibili === */
.certification-section .submit-btn {
  background-color: #ffffff;
  color: var(--dark);
  font-weight: bold;
  border: 2px solid var(--accent);
}

.certification-section .submit-btn:hover {
  background-color: var(--accent);
  color: white;
}

/* === Responsive: Ottimizzazione Mobile === */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  .borgo-title {
    font-size: 1.6rem;
  }

  .certification-steps {
    flex-direction: column;
    align-items: center;
  }

  .step-card {
    width: 90%;
  }

  .activity-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .language-switcher {
    top: 10px;
    right: 10px;
  }
}

/* Sezione patrimonio storico */
.heritage-section {
  margin-top: 40px;
  padding: 25px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  border: 2px dashed var(--accent);
  position: relative;
  overflow: hidden;
}

.heritage-section:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none" stroke="%23f57f17" stroke-width="2" stroke-dasharray="8,4" opacity="0.3"/></svg>');
  z-index: -1;
}

.heritage-section h3 {
  text-align: center;
  margin-bottom: 25px;
  color: var(--darker);
  font-size: 1.8rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 10px;
  display: inline-block;
}

.heritage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
}

.heritage-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.heritage-card:hover {
  transform: translateY(-5px);
}

.heritage-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.heritage-content {
  padding: 20px;
}

.heritage-content h4 {
  color: var(--secondary);
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.heritage-content p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 15px;
}

.heritage-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s ease;
}

.heritage-btn:hover {
  background: #e06c00;
}

.heritage-btn i {
  margin-left: 8px;
}
/* Nuovo stile sezione certificazione */
.certification-section {
  background: linear-gradient(135deg, var(--darker), var(--secondary));
  padding: 60px 20px;
  color: white;
}

.certification-container {
  max-width: 1200px;
  margin: 0 auto;
}

.certification-header {
  text-align: center;
  margin-bottom: 50px;
}

.certification-header h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--accent);
}

.certification-header p {
  font-size: 1.3rem;
  max-width: 700px;
  margin: 0 auto;
}

.certification-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin: 40px 0;
}

.step-card {
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.step-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.step-card::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.step-icon {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
}

.step-icon i {
  font-size: 2.5rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.step-number {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--accent);
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.step-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: white;
}

.certification-cta {
  background: linear-gradient(135deg, var(--accent), #e06c00);
  border-radius: 15px;
  padding: 40px;
  max-width: 900px;
  margin: 60px auto 0;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  border: 3px solid white;
}

.cta-content h3 {
  font-size: 2rem;
  margin-bottom: 15px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.cta-content p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 25px;
}

.cta-button {
  display: inline-block;
  background: white;
  color: var(--darker);
  padding: 15px 35px;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.cta-button:hover {
  background: var(--darker);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  .certification-steps {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .certification-cta {
    padding: 30px 20px;
  }
}
