/* Import Google Font */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap");

/* ============================================= */
/*          RESET E STILI GLOBALI                */
/* ============================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #0d1117;
  color: #c9d1d9;
  line-height: 1.7;
  overflow-x: hidden;
}

body.sidenav-open {
  overflow: hidden;
}

a {
  color: #e31e25;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: white;
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
}

/* NUOVA CLASSE PER ACCESSIBILITÀ: nasconde il testo ma lo lascia leggibile agli screen reader */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============================================= */
/*          HEADER & HERO SECTION                */
/* ============================================= */
header.hero {
  background: url("https://images.unsplash.com/photo-1550751827-4bd374c3f58b")
    no-repeat center center/cover;
  height: 90vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

header.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.8),
    rgba(0, 0, 0, 0.5)
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  color: white;
  animation: fadeIn 1.5s ease-in-out;
  padding: 0 1rem;
}

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

/* REGOLA MODIFICATA: L'h1 ora contiene un'immagine, quindi non ha più bisogno di stili per il font */
.hero-content h1 {
  margin: 0;
  padding: 0;
  line-height: 1; /* Resetta l'altezza della riga */
}

/* NUOVA REGOLA: per dare stile al logo nella sezione hero */
.hero-logo {
  max-width: clamp(250px, 50vw, 500px); /* Larghezza responsive */
  height: auto;
  margin-bottom: 1rem; /* Spazio sotto il logo */
  filter: drop-shadow(
    0 4px 10px rgba(255, 255, 255, 0.5)
  ); /* Ombra simile al testo */
}

.hero-content p {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 300;
  margin-top: 1rem;
}

/* ============================================= */
/*                 NAVIGAZIONE                   */
/* ============================================= */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(10px);
  padding: 1rem;
  border-bottom: 1px solid #30363d;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  display: inline-block;
}
.logo {
  max-height: 40px;
  height: auto;
  display: block;
  filter: drop-shadow(
    0 4px 10px rgba(255, 255, 255, 0.5)
  ); /* Ombra simile al testo */
}

.desktop-menu {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin: 0;
}

.desktop-menu a {
  font-weight: 600;
  position: relative;
  padding: 0.5rem 0;
}

.desktop-menu a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #e31e25 0%, #ff4d4d 100%);
  transition: width 0.3s ease;
}

.desktop-menu a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
}

/* --- Sidenav e Overlay (Menu Mobile) --- */
.sidenav {
  height: 100%;
  width: 280px;
  position: fixed;
  z-index: 1500;
  top: 0;
  right: -280px;
  background-color: #161b22;
  overflow-x: hidden;
  padding-top: 60px;
  transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
}

.sidenav a {
  padding: 15px 20px 15px 32px;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 600;
  color: #c9d1d9;
  display: block;
  transition: 0.3s;
}

.sidenav a:hover {
  color: #e31e25;
}

.sidenav .close-btn {
  position: absolute;
  top: 10px;
  right: 25px;
  font-size: 36px;
}

#overlay {
  position: fixed;
  display: none;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1400;
  cursor: pointer;
}

/* ============================================= */
/*             STILI CONTENUTO GENERALE          */
/* ============================================= */
.content {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: auto;
}

section {
  margin-bottom: 5rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

h2 {
  font-size: clamp(2rem, 4vw, 2.5rem);
  margin-bottom: 2rem;
  text-align: center;
  position: relative;
  padding-bottom: 1rem;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, #e31e25 0%, #ff4d4d 100%);
}

.section-alt {
  background-color: #161b22;
  padding: 5rem 0;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
}

.section-alt > .content {
  padding-top: 0;
  padding-bottom: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.card {
  background: #161b22;
  padding: 2.5rem 2rem;
  border-radius: 8px;
  border: 1px solid #30363d;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  border-color: #e31e25;
}

.card h3 {
  color: white;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e31e25;
  display: inline-block;
}

.card p {
  color: #8b949e;
  flex-grow: 1;
}

/* ============================================= */
/*           SEZIONE CALL TO ACTION (CTA)        */
/* ============================================= */
.cta-section {
  text-align: center;
  padding: 5rem 2rem;
  background: linear-gradient(90deg, #e31e25 0%, #ff4d4d 100%);
  color: white;
}

.cta-section h2 {
  color: white;
}

.cta-section h2::after {
  background: white;
}

/* ============================================= */
/*                SEZIONE CONTATTI               */
/* ============================================= */
.contact-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  max-width: 1200px;
  margin: 3rem auto 0;
}

.contact-info,
#contact-form {
  flex: 1;
  min-width: 300px;
}

.contact-info h3 {
  color: white;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e31e25;
  display: inline-block;
}

.contact-info p {
  text-align: left;
  line-height: 1.8;
  color: #8b949e;
  font-size: 1rem;
}

.contact-info ul {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.contact-info li {
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* --- Stile del Form --- */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #8b949e;
}

#contact-form input,
#contact-form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background-color: #0d1117;
  border: 1px solid #30363d;
  border-radius: 5px;
  color: #c9d1d9;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#contact-form input:focus,
#contact-form textarea:focus {
  outline: none;
  border-color: #e31e25;
  box-shadow: 0 0 0 3px rgba(227, 30, 37, 0.2);
}

#contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* ============================================= */
/*                   PULSANTI                    */
/* ============================================= */
.btn {
  display: inline-block;
  padding: 0.8rem 2.5rem;
  margin-top: 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.btn-light {
  background-color: white;
  color: #e31e25;
}

.btn-light:hover {
  background-color: #f0f0f0;
  transform: scale(1.05);
  color: #b01015;
}

.btn-primary {
  background: linear-gradient(90deg, #e31e25 0%, #ff4d4d 100%);
  color: white;
  border: none;
  cursor: pointer;
  align-self: flex-start;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(227, 30, 37, 0.3);
}

/* ============================================= */
/*                     FOOTER                    */
/* ============================================= */
footer {
  text-align: center;
  padding: 2rem 1rem;
  background: #161b22;
  border-top: 1px solid #30363d;
  color: #8b949e;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-details {
  font-size: 0.85rem;
  color: #ccc;
  margin-top: 0.5rem;
  line-height: 1.6;
}

/* #################################################################### */
/* #                                                                  # */
/* #      MEDIA QUERIES PER LA RESPONSIVITÀ (DEVONO STARE ALLA FINE)    # */
/* #                                                                  # */
/* #################################################################### */

@media (max-width: 1024px) {
  .desktop-menu {
    gap: 1.5rem;
  }
  .content {
    padding: 3rem 1.5rem;
  }
}

/* --- BREAKPOINT PER TABLET E MENU MOBILE --- */
@media (max-width: 768px) {
  body {
    line-height: 1.6;
  }
  header.hero {
    height: 70vh;
  }
  .nav-container {
    justify-content: space-between;
  }
  .desktop-menu {
    display: none;
  }
  .menu-toggle {
    display: block;
  }
  .content {
    padding: 3rem 1rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .cta-section {
    padding: 4rem 1rem;
  }

  .contact-info {
    text-align: center;
  }
  .contact-info h3 {
    display: block;
    width: 80%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1rem;
  }
  .contact-info ul {
    text-align: left;
    display: inline-block;
  }
}

/* --- BREAKPOINT PER SMARTPHONE --- */
@media (max-width: 480px) {
  header.hero {
    height: 60vh;
  }
  .hero-content p {
    font-size: 1rem;
  }
  .card {
    padding: 1.5rem;
  }
  .btn {
    padding: 0.7rem 1.8rem;
    font-size: 0.9rem;
  }
  footer {
    font-size: 0.8rem;
  }
  .contact-container {
    gap: 2.5rem;
  }
  #contact-form {
    margin-top: 1rem;
  }
}
