/* --- STILI GLOBALI E VARIABILI --- */
:root {
  --color-primary: #3b7b8d; /* Un blu-grigio avio, professionale e calmo */
  --color-dark: #2c3e50; /* Un grigio scuro per testi e sfondi */
  --color-light: #f8f9fa; /* Un bianco sporco per sezioni alternate */
  --color-text: #34495e; /* Grigio per il testo principale */
  --color-white: #ffffff;
  --font-primary: "Poppins", sans-serif;
  --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.07);
  --shadow-strong: 0 6px 20px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text);
  background-color: var(--color-white);
  line-height: 1.7;
}

h1,
h2,
h3,
h4 {
  color: var(--color-dark);
  font-weight: 600;
  line-height: 1.3;
}

/* Dimensioni di base dei titoli */
h1 {
  font-size: 3rem;
}
h2 {
  font-size: 2.5rem;
}
h3 {
  font-size: 1.5rem;
}
h4 {
  font-size: 1.25rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-padding {
  padding: 100px 0;
}

.bg-light {
  background-color: var(--color-light);
}
.bg-dark {
  background-color: var(--color-dark);
  color: var(--color-white);
}

.section-title {
  text-align: center;
  margin-bottom: 60px;
}

.section-title h2 {
  margin-bottom: 15px;
}

.section-title p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  color: #777;
}

/* --- BOTTONI --- */
.btn,
.btn-outline {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
  border: 2px solid var(--color-primary);
}
.btn {
  background-color: var(--color-primary);
  color: var(--color-white);
}
.btn:hover {
  background-color: #316675;
  transform: translateY(-3px);
  box-shadow: var(--shadow-strong);
}
.btn-outline {
  background-color: var(--color-white);
  color: var(--color-primary);
  border: 2px solid #e0e0e0;
}
.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
  transform: translateY(-3px);
}

/* --- HEADER E NAVIGAZIONE --- */
.main-header {
  position: sticky;
  top: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
  box-shadow: var(--shadow-light);
  padding: 10px 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  height: 80px;
  transition: height 0.3s ease;
}

.main-nav a {
  color: var(--color-text);
  text-decoration: none;
  margin: 0 15px;
  font-weight: 500;
  padding-bottom: 5px;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* --- SEZIONE HERO --- */
#hero {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 70vh;
  min-height: 500px;
  color: var(--color-white);

  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url("./Assets/foto3.jpg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
}

#hero .hero-content {
  max-width: 800px;
}

#hero h1 {
  color: var(--color-white);
  margin-bottom: 15px;
}

#hero p {
  font-size: 1.25rem;
  font-weight: 300;
  margin-bottom: 30px;
}

/* --- SEZIONE CHI SONO --- */
#about .about-container {
  display: flex;
  align-items: center;
  gap: 80px;
}

#about .about-image img {
  width: 300px; /* Impostiamo una dimensione di base per desktop */
  max-width: 100vw; /* <-- QUESTA È LA SOLUZIONE FONDAMENTALE */
  height: auto; /* Mantiene le proporzioni originali */
  aspect-ratio: 1 / 1; /* Assicura che sia sempre un quadrato (e quindi un cerchio perfetto) */
  object-fit: cover;
  border-radius: 50%;
  box-shadow: var(--shadow-strong);
}

#about .about-text h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

#about .about-text p {
  margin-bottom: 30px;
}

/* --- SEZIONE SERVIZI --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
}

.service-card {
  background: var(--color-white);
  padding: 35px;
  border-radius: 10px;
  box-shadow: var(--shadow-light);
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-strong);
}

.service-card .price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 20px;
}

.service-card ul {
  list-style: none;
  margin: 20px 0;
  text-align: left;
  display: inline-block;
  flex-grow: 1;
}

.service-card ul li {
  margin-bottom: 10px;
  padding-left: 20px;
  position: relative;
}

.service-card ul li::before {
  content: "✓";
  color: var(--color-primary);
  position: absolute;
  left: 0;
  font-weight: bold;
}

.service-card .btn-outline {
  margin-top: auto;
}

/* --- SEZIONE ATTESTATI --- */
.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.certificate-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-strong);
  height: 350px;
}

.certificate-card .card-background {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.certificate-card:hover .card-background {
  transform: scale(1.1);
}

.certificate-card .card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: var(--color-white);
  transition: background 0.3s ease;
}

.certificate-card:hover .card-content {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
}

.certificate-card .card-content h3 {
  color: var(--color-white);
  margin-bottom: 5px;
}

/* --- FOOTER --- */
.footer-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  text-align: center;
}

#contact h4 {
  color: var(--color-white);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.contact-list {
  list-style: none;
}

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

#contact a:hover {
  color: var(--color-white);
}

.footer-bottom {
  text-align: center;
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid #4a6278;
  font-size: 0.9rem;
  color: #bdc3c7;
}

/* --- MEDIA QUERIES PER RESPONSIVE DESIGN --- */

/* Tablet (e schermi medi) */
@media (max-width: 992px) {
  h1 {
    font-size: 2.8rem;
  }
  h2 {
    font-size: 2.2rem;
  }

  .section-padding {
    padding: 80px 0;
  }

  .header-container {
    flex-direction: column;
    padding-bottom: 10px;
  }

  .main-nav {
    margin-top: 15px;
  }

  #about .about-container {
    flex-direction: column;
    text-align: center;
    gap: 50px;
  }

  #about .about-image img {
    width: 300px;
    height: 300px;
  }
}

/* Smartphone (e schermi piccoli) */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 2rem;
  }
  h3 {
    font-size: 1.4rem;
  }
  h4 {
    font-size: 1.15rem;
  }

  .section-padding {
    padding: 60px 0;
  }

  .logo {
    text-align: center;
  }

  .logo img {
    height: 70px;
  }
  .main-nav a {
    margin: 0 8px;
    font-size: 0.95rem;
  }

  #hero {
    display: none;
  }

  #hero h1 {
    font-size: 2.2rem;
  }

  #hero p {
    font-size: 1.1rem;
  }

  #about .about-image img {
    width: 250px;
    height: 250px;
  }

  .service-card {
    padding: 30px 25px;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
  }
}

/* Smartphone molto piccoli */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  #hero h1 {
    font-size: 2rem;
  }

  #hero p {
    font-size: 1rem;
  }

  .btn,
  .btn-outline {
    padding: 10px 25px;
    font-size: 0.9rem;
  }

  .header-container {
    padding: 0 10px 10px 10px;
  }

  .main-nav {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
  }

  .main-nav a {
    margin: 5px 8px;
  }

  .section-title p {
    font-size: 1rem;
  }
}
