/* =================================================== */
/* Reset e impostazioni di base                      */
/* =================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

/* Accessibilità focus */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid #007BFF;
  outline-offset: 2px;
}

/* =================================================== */
/* Classi generali                                    */
/* =================================================== */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 0;
}

.btn-primary {
  display: inline-block;
  background-color: #007BFF;
  color: #fff;
  padding: 12px 20px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s, transform 0.3s;
  font-size: 0.9rem;
}

.btn-primary:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}

/* =================================================== */
/* Hero con video di background                      */
/* =================================================== */
#hero {
  position: relative;
  height: auto;
  min-height: 100vh;
  color: #fff;
  overflow: hidden;
  background-color: #ffffff;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-background video {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
}

/* Barra superiore (logo, nome, menu) */
.header-top {
  background-color: rgba(0, 0, 0, 0.3);/*background-color: rgba(0, 0, 0, 0.7);*/
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 10px 0;
}

/* IMPORTANTE: display: flex */
.header-top-content {
  display: flex;                /* Aggiunto per forzare l'allineamento orizzontale */
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  margin: 20px auto;
  padding: 10px 20px;
  max-width: 1400px;
}

.branding {
  width: auto;
  padding: 0;
  /*flex: 0 0 auto;*/
  
  margin-right: auto;
}

.branding img {
  height: 60px;
  width: 90px;
  margin-right: 15px;
  z-index: 5;
  flex-wrap: wrap;
}
.branding a{
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex-wrap: wrap;
}
.branding a:focus{
  outline: none;
}

.branding .project-name {
  font-size: 1.3rem;
  /*max-width: auto;*/
  flex: 1;
  z-index: 5;     
  /*overflow: hidden;*/
  /*text-overflow: ellipsis;*/ /* Troncamento con i tre puntini se lo spazio non basta */
}
.branding .project-name:hover{
  color: #007BFF; /* Colore di accento al passaggio del mouse */
  transform: translateY(-2px);
}
.mobile-background {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('background-static.png'); /* Assicurati che il percorso sia corretto */
  background-size: cover;
  background-position: center;
  filter: brightness(0.7);
  z-index: 0;
}
/* Menu di navigazione (versione mobile - default) */
.main-nav {
  display: none;
  width: 100%;
  padding-left: 10px;
  padding-right: 10px;
  position: relative;
}

/* La lista del menu deve essere nascosta di default su mobile */
#menu-list {
  list-style: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0;
  margin: 0;
}

/* Quando è attiva, la lista viene mostrata */
#menu-list.active {
  display: flex;
}

.main-nav ul li {
  width: 100%;
  text-align: center;
  list-style: none;
  margin-bottom: 10px;
}

.main-nav ul li a {
  text-decoration: none;
  color: #fff;
  font-size: 1.1rem;
  padding: 8px 12px;
  display: block;
  border-radius: 4px;
  min-width: 100px;
}
.main-nav ul li a {
  outline: none;
}

/* Stile pulsante toggle */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 40px;
  height: 30px;
  background: none;
  border: none;
  margin-left: auto;
  cursor: pointer;
  position: relative;
  z-index: 1001;
}

/* Stile delle linee dell'hamburger */
.menu-toggle span, .menu-toggle .hamburger-line {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #f0f0f0;
  transition: all 0.3s ease;
}

/* Trasformazione del pulsante quando è attivo */
.menu-toggle.active span:first-child, .menu-toggle.active .hamburger-line:first-child {
  transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2), .menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:last-child, .menu-toggle.active .hamburger-line:last-child {
  transform: rotate(-45deg) translate(6px, -6px);
}
.hero-content {
  position: relative;
  z-index:0;
  text-align: center;
  padding: 200px 20px 40px;
  margin-top: 80px;
}

.hero-content h1 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.hero-content p {
  font-size: 1rem;
  margin-bottom: 30px;
}




/* Citazione in corsivo */
.messaggio-differenziante blockquote {
  font-style: italic;
  padding: 20px;
  padding-bottom: 0px;
  margin-bottom: 0px;
  margin: 30px 0;
  /*background-color: rgba(0, 123, 255, 0.05);*/
}

/* Correzione 2: Quando il menu è attivo, deve essere mostrato */
.main-nav.active {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  padding-top: 60px;
  height: 100vh;
  overflow-y: auto;
}

/* =================================================== */
/* Sezione "Cosa Facciamo"                           */
/* =================================================== */
#cosa-facciamo {
  background-color: #f5f5f5;
  padding: 40px 0;
  text-align: center;
  padding-bottom: 0;
}

#cosa-facciamo h2 {
  margin-bottom: 20px;
  font-size: 1.8rem;
}

#cosa-facciamo p {
  font-size: 1rem;
  margin-bottom: 20px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.messaggio-differenziante {
  margin-bottom: 0px;
  padding-bottom: 0px;  
}

.servizi-principali {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-bottom: 40px;
}

.servizio-item {
  background-color: #fff;
  padding: 25px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

.servizio-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  background-color: #e7e9eb;
}

.servizio-item h3 {
  color: #007BFF;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.servizio-item i {
  font-size: 1.8rem;
  margin-bottom: 12px;
  color: #007BFF;
  display: block;
}

.servizio-item p {
  font-size: 0.9rem;
  margin-bottom: 0;
  text-align: justify;
}
.servizi-p {
  text-align: center;
}

/* =================================================== */
/* Sezione "Come Funziona"                           */
/* =================================================== */
#come-funziona {
  padding-top: 0px;
  padding: 60px 0;
  background-color: #f5f5f5;
  padding-top: 0;
  padding-bottom: 0;
}

#come-funziona h2 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 1.8rem;
}

#come-funziona h3 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.1rem;
}

.processo-steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
  width: 100%;
  max-width: 350px;
}

.step-number {
  font-size: 1.8rem;
  font-weight: bold;
  color: #007BFF;
  margin-bottom: 15px;
  width: 50px;
  height: 50px;
  line-height: 50px;
  text-align: center;
}

.step h3 {
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.step p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 10px;
  text-align: justify;
}

.step::after {
  content: '';
  position: absolute;
  right: 50%;
  top: auto;
  bottom: -40px;
  width: 40px;
  height: 40px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23007BFF" opacity="0.6"><path d="M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: translateX(50%) rotate(90deg);
}

.step:last-child::after {
  display: none;
}

/* =================================================== */
/* Sezione "Chi Siamo"                               */
/* =================================================== */
#chi-siamo {
  background-color: #f0f0f0;
  padding: 60px 0;
  padding-top: 0;
  padding-bottom: 0;
}

.chi-siamo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.chi-siamo-img {
  text-align: center;
  padding: 20px;
}

.chi-siamo-img img {
  max-width: 100%;
  border-radius: 10px;
}

.chi-siamo-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  
}

.chi-siamo-text h2 {
  margin-bottom: 20px;
  font-size: 1.8rem;
  text-align: center;
}

.chi-siamo-text p {
  text-align: justify;
  font-size: 0.9rem;
}

/* =================================================== */
/* Sezione Portfolio                                 */
/* =================================================== */
#portfolio {
  padding: 60px 0;
  background-color: #fff;
  padding-top: 0;
  padding-bottom: 0;
}

#portfolio h2 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 1.8rem;
}

.portfolio-items {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 30px;
}

.portfolio-item {
  text-align: center;
  margin-bottom: 30px;
}

.portfolio-item img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.portfolio-item img:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.portfolio-item h3 {
  margin-top: 15px;
  font-size: 1.2rem;
  color: #333;
}

/* =================================================== */
/* Sezione Contatti                                  */
/* =================================================== */
#contatti {
  padding: 60px 0;
  background-color: #f0f0f0;
  text-align: center;
  padding-top: 0;
  padding-bottom: 0;
}

#contatti h2 {
  margin-bottom: 20px;
  font-size: 1.8rem;
}

#contatti h3 {
  margin-bottom: 20px;
  font-size: 1.2rem;
}

#contatti p {
  margin-bottom: 40px;
  font-size: 0.9rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-align: justify;
}

.contact-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  max-width: 500px;
  margin: 0 auto;
}

.contact-options .btn-primary {
  padding: 15px 30px;
  font-size: 1.1rem;
  width: 100%;
}

/* =================================================== */
/* Footer                                            */
/* =================================================== */
footer {
  background-color: #333;
  color: #fff;
  padding: 0;
}

footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
}

.footer-info p {
  margin: 5px 0;
  font-size: 0.9rem;
}

.footer-info a {
  color: #fff;
  text-decoration: underline;
}

/* Solo per desktop (sopra i 1200px) */
@media (min-width: 1200px) {
  .menu-toggle {
    display: none;
  }
  /* Menu di navigazione */
.main-nav {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  margin-left: 50px;
  padding-right: 10px;
  margin-top: 0px;
  flex: 1;
}

#menu-list {
  list-style: none;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  padding:1px;
  margin:1px;
  gap:10px;
  text-align: end;
  max-width: fit-content;
}

.main-nav ul li {
  display: flex;
  flex-direction:row;
  white-space: nowrap;
  padding:1px;
  margin:1px;
}

.main-nav ul li a {
  text-decoration: none;
  color: #fff;
  font-size: 1.1rem;
  transition: color 0.3s;
  padding:1px;
  margin:1px;
  text-align:center;
}

.main-nav ul li a:hover {
  color: #007BFF; /* Colore di accento al passaggio del mouse */
  transform: translateY(-2px);
}
  
  /* Container e spaziature */
  .container {
    width: 100%;
    padding: 40px 0;
  }

  /* Header e navigazione */
  .header-top {
    padding: 20px;
  }
  .hero-background video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
  }
  .branding{
    flex: 0 0 auto;
  }
  .branding .project-name {
    flex: 0;
    font-size: 1.3rem;
    max-width: auto;
    white-space: nowrap;     /* Impedisce il "va a capo" */
   /* overflow: hidden;
    text-overflow: ellipsis;*/ /* Troncamento con i tre puntini se lo spazio non basta */
  }
  .branding .project-name:hover{
    color: #007BFF; /* Colore di accento al passaggio del mouse */
    transform: translateY(-2px);
  }
  .header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Riduciamo il padding interno del container per non spostare troppo in basso il contenuto */
    width: 100%;
    max-width: 2500px;
    margin: 20px auto;
    padding: 10px 20px;
  }
  .mobile-background {
    display: none;
  } 
  #hero {
    height: 100vh;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    top: 40%;
    left: 0;
    right: 0;
    width: auto;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content p {
    font-size: 2rem;
  }
  .btn-primary {
    justify-content: center;
    font-size: 1.1rem;
    white-space: nowrap;
  }
  /* Servizi */
  .servizi-principali {
    flex-direction: row;
    gap: 40px;
  }

  .servizio-item {
    flex: 1;
    min-height: 280px;
    padding: 35px 25px;
  }

  .servizio-item h3 {
    font-size: 1.4rem;
    white-space: nowrap;
  }

  .servizio-item i {
    font-size: 2rem;
  }

  .servizio-item p {
    font-size: 1rem;
    text-align: justify;
  }

  /* Processo steps */
  .processo-steps {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
  }

  .step {
    display: flex;
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 20px;
    text-align: center;
    gap: 15px;
  }
  .step-number{
    font-size: 2.2rem;
    font-weight: bold;
    color: #007BFF;
    margin-bottom: 15px;
    width: 60px;
    height: 60px;
    line-height: 60px;
    text-align: center;
  }
  .step p {
    text-align: justify;
  }

  .step::after {
    right: -40px;
    bottom: auto;
    top: 30px;
    
    transform: none;
  }
  /*Portfolio*/
  .portfolio-items{
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
  }

  /* Chi siamo */
  .chi-siamo-container {
    flex-direction: row;
    align-items: flex-start;
  }

  .chi-siamo-img {
    flex: 1;
  }

  .chi-siamo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    order:2;
    margin: 10px;
  }

  .chi-siamo-text h2 {
    font-size: 2rem;
    text-align:end;
  }

  .chi-siamo-text p {
    font-size: 1rem;
    text-align: justify;
  }

  /* Contatti */
  #contatti {
    padding: 80px 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  #contatti h2 {
    font-size: 2rem;
  }

  #contatti p {
    font-size: 1.1rem;
    margin-bottom: 50px;
    text-align: justify;
  }

 
  /* Footer */
  footer .container {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    padding-left: 1px;
  }
  .footer-info {
    display: flex;
    flex-direction: row;
    justify-content: center;
  }
}
/* =================================================== */
/* Stili Mobile per dispositivi sotto 500px          */
/* =================================================== */
@media (max-width: 500px) {
  /* Nascondi il video e mostra la foto statica */
  /*.desktop-video {
    display: none;
  }
  /*.mobile-background {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('background-static.png'); /* Assicurati che il percorso sia corretto 
    background-size: cover;
    background-position: center;
    filter: brightness(0.7);
  }*/
  
  /* Improved branding for very small screens */
  /*.branding {
     width: 100%;
  }*/
  
  /*branding img {
    height: 40px;
    width: 60px;
    margin-right: 8px;
    flex-shrink: 0;
  }*/
  
  .branding .project-name {
    font-size: 1.1rem;
    margin-right: 5px;
  }
  
 

  /* Header top content adjustments */
  /*.header-top-content {
    position: relative;
    padding: 15px 10px;
  }*/
  .hero-content{
    margin-top: 20px;
  }
  .hero-content h1{
    font-size: 1.1rem;
  }
  #hero {
    min-height: 80vh;
  }
  .chi-siamo-text p{
    text-align: justify;
  }
  
}

/* Extra adjustments for very small screens */
/*@media (max-width: 400px) {
  .branding {
    width: 75%;
  }
  
  .branding .project-name {
    font-size: 1rem;
  }
}*/

/* Ottimizzazioni globali */
/*html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

section, header, footer {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* Previeni scrolling del body quando il menu mobile è aperto */
/*body.menu-open {
  overflow: hidden;
}*/