html {
  scroll-behavior: smooth;
}
body {
  max-width: 1140px;
  margin: auto;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande",
    "Lucida Sans", Arial, sans-serif;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 136px;
  width: 100%;
}

a {
  text-decoration: none;
  color: black;
}

/* Style de base des liens */
.nav a {
  position: relative;
  color: black;
  text-decoration: none;
  font-weight: bold;
  padding: 5px 0;
}

/* Création de l'underline animée */
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px; /* épaisseur de la ligne */
  width: 0; /* commence à 0 */
  background-color: #4b63b2; /* couleur du soulignement */
  transition: width 0.3s ease; /* animation fluide */
}

/* Au survol : la ligne s’étend */
.nav a:hover::after,
.nav a:focus::after {
  width: 100%;
}

.nav {
  display: flex;
  gap: 20px;
}
.logo {
  width: 89px;
}

.accueil {
  height: 664px;
  background-color: #4374a2;
  text-align: center;
  padding-top: 60px;
  color: white;
}

.name {
  font-size: 48px;
  font-weight: bold;
}
.picture {
  margin-top: 44px;
  border-radius: 50%;
  width: 264px;
  -webkit-box-shadow: 5px 5px 20px 0px rgba(0, 0, 0, 0.6);
  box-shadow: 5px 5px 20px 0px rgba(0, 0, 0, 0.6);
}

.text1 {
  font-size: 24px;
  padding-top: 20px;
}

.text2 {
  font-size: 36px;
  padding-top: 31px;
}
.text3 {
  font-size: 24px;
  color: #b3b3b3;
  padding-top: 20px;
}

.services {
  width: 100%;
  min-height: 700px; /* hauteur de base sur grand écran */
  height: auto; /* s’adapte si le contenu dépasse */
  background-color: #e5e5e5;
}

.services_title {
  font-size: 60px;
  text-align: center;
  padding-top: 37px;
}

.services_box {
  height: 460px;
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 52px;
}

.box {
  background-color: white;
  width: 45%;
  border-radius: 30px; /* comme avant */
  text-align: center;
  display: flex;
  flex-direction: column;
  padding-top: 20px; /* comme avant */
  height: 100%;
  box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.7); /* comme avant */
  transition: transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
  will-change: transform, box-shadow;
  transform-origin: center center;
}

/* état hover / active */
.box:hover,
.box:active {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

/* état clavier (accessibilité) */
.box:focus,
.box:focus-within {
  outline: none;
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.box:focus-visible {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16), 0 0 0 4px rgba(75, 99, 178, 0.12);
  border-radius: 30px;
}

.box h1 {
  font-size: 30px;
  font-weight: 100;
  width: 100%; /* occupe toute la largeur dispo */
  max-width: 100%; /* empêche de dépasser */
  text-align: center; /* centre horizontalement */
  word-wrap: break-word; /* coupe si nécessaire */
  overflow-wrap: break-word;
  margin: 10px 0;
}

.box ul {
  margin: 10px 0;
  width: 100%; /* prend toute la largeur dispo */
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word; /* coupe si nécessaire */
  overflow-wrap: break-word;
}

.box h2 {
  font-size: 20px;
  font-weight: 100;
  padding: 10px 20px; /* petit padding équilibré */
  margin: 10px 0;
  width: 100%;
  max-width: 100%;
  text-align: center; /* centré comme h1 */
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.box li {
  text-align: left; /* lisibilité meilleure */
  margin-bottom: 6px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h1 {
  font-size: 30px;
  font-weight: 100;
  width: 520px;
}

h2 {
  font-size: 20px;
  font-weight: 100;
  padding-left: 20px;
  padding-right: 20px;
}

ul {
  padding-left: 87px;
}

li {
  text-align: start;
}

p {
  margin: 0px;
}

.contact {
  height: 300px;
  text-align: center;
  align-items: center;
  justify-content: center;
  display: flex;
  flex-direction: column;
}

.contacts_txt {
  font-size: 38px;
  font-weight: bold;
  padding-bottom: 40px;
}

.mail_num {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 18px;
  font-weight: bold;
}

.fa-envelope,
.fa-phone {
  padding-right: 10px;
}

footer {
  height: 40px;
  background-color: #333333;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer_txt {
  font-size: 10px;
  color: white;
}

#backToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background-color: #4b63b2;
  color: rgb(255, 255, 255);
  font-size: 20px;
  cursor: pointer;
  display: none; /* caché au début */
  align-items: center; /* centrer verticalement */
  justify-content: center; /* centrer horizontalement */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease;
  z-index: 9999;
  /* IMPORTANT : transforme le bouton en flex container */
  display: flex;
  text-align: center;
}

#backToTop:hover {
  background-color: #354b8a;
}

@media (max-width: 1064px) {
  body {
    max-width: 100%;
    padding: 0 20px;
  }

  header {
    flex-direction: column;
    height: auto;
    padding: 10px 0;
  }

  .nav {
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
  }

  .logo {
    width: 70px;
  }

  .accueil {
    height: auto;
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .name {
    font-size: 36px;
  }

  .text1 {
    font-size: 20px;
  }

  .text2 {
    font-size: 28px;
  }

  .text3 {
    font-size: 18px;
  }

  .picture {
    width: 200px;
    margin-top: 30px;
  }
  .services {
    min-height: auto; /* laisse s’adapter */
    padding-bottom: 40px; /* petit espace sous les boxes */
  }
  .services_box {
    flex-direction: column;
    gap: 20px;
    height: auto; /* pas de hauteur fixe */
  }
  .box {
    width: 100%;
    height: auto; /* s’adapte au contenu */
    min-height: 220px; /* si tu veux garder une certaine taille */
    z-index: 1;
  }

  .services_title {
    font-size: 40px;
    padding-top: 20px;
  }
  .contact {
    height: auto; /* laisse la hauteur s’adapter au contenu */
    padding: 40px 20px; /* espace suffisant */
    flex-direction: column;
    text-align: center;
    justify-content: center;
    align-items: center;
  }
}

@media (max-width: 612px) {
  header {
    padding: 5px 0;
  }

  body {
    margin-left: 0px;
    padding: 0px;
  }

  li {
    padding-left: 10px;
    padding-right: 10px;
  }
  .nav a {
    font-size: 16px;
    text-align: center;
  }

  .name {
    font-size: 28px;
  }

  .text1 {
    font-size: 18px;
  }

  .text2 {
    font-size: 22px;
  }

  .text3 {
    font-size: 16px;
    padding-top: 10px;
  }

  .picture {
    width: 150px;
    margin-top: 20px;
  }

  .services_title {
    font-size: 32px;
    padding-top: 15px;
  }

  .mail_num p {
    font-size: 16px;
  }

  footer {
    height: auto;
    padding: 10px 0;
  }

  .footer_txt {
    font-size: 12px;
  }
}
