/* --- Styles Globaux --- */
body {
  margin: 0;
  font-family: "Open Sans", sans-serif;
  background: antiquewhite;
  color: #1e1e1e;
  position: relative; /* Nécessaire pour le z-index de ::before */
  min-height: 100vh;
}

body::before {
  content: "";
  background-image: url("fond.png");
  background-size: cover;
  background-position: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.2;
  z-index: -1;
}

/* --- Formunaire --- */
#formdownload, .download-allowed {
  border: 1px solid #000000;
  border-radius: 5px;
  background-color: #f2f2f2;
  padding: 10px;
  text-indent: 0 !important;
  font-size: 12px;
  margin-left: 50px;
  width: 40%;
}
#formdownload input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 5px;
  margin: 4px 0;
  display: inline-block;
  border: 1px solid #ced4da;
  border-radius: 4px;
  box-sizing: border-box;
}
#formdownload input[type="submit"],
button[type="submit"] {
  width: 100%;
  background-color: #5e5c83; /* #4CAF50; */
  color: white;
  padding: 10px;
  margin: 8px 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
#formdownload input[type="submit"],
button[type="submit"]:hover {
  background-color: #45a049;
}
#formdownload .error_input{
  background-color: #f0c0c0;
}
.download-allowed {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px !important;
}
.success-result{
  color: #227a35;
}


/* --- Header --- */
.banner {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Navigation : Styles par défaut (Mobile First) --- */
nav {
  background-color: rgb(94, 92, 131);
  display: flex;
  justify-content: flex-end; /* Aligne le bouton hamburger à droite */
  align-items: center;
  padding: 5px 10px;
  border-top: 5px solid black;
  border-bottom: 5px solid black;
  position: relative; /* Contexte de positionnement pour le menu déroulant */
}

/* --- Menu Hamburger (visible sur mobile uniquement) --- */
#menu-toggle {
  display: block; /* Visible par défaut sur mobile */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001; /* Pour être au-dessus du menu */
}

#menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 5px 0;
  transition: all 0.3s ease-in-out;
}

/* Animation du bouton en croix */
#menu-toggle.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#menu-toggle.open span:nth-child(2) {
  opacity: 0;
}
#menu-toggle.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* --- Liens de navigation (cachés par défaut sur mobile, apparaissent au clic) --- */
.nav-links {
  display: none; /* Caché par défaut */
  flex-direction: column;
  width: 100%;
  background-color: rgb(94, 92, 131);
  position: absolute;
  top: 100%; /* Se positionne juste en dessous de la barre nav */
  left: 0;
  z-index: 1000;
  border-top: 1px solid black;
}

/* Classe ajoutée par JavaScript pour afficher le menu */
.nav-links.active {
  display: flex;
}

.nav-links a {
  color: white;
  text-decoration: none;
  padding: 1em;
  display: block;
  text-align: center;
  font-size: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-links a:last-child {
  border-bottom: none;
}

.nav-links a:hover {
  background-color: #6e6e6e;
}

.nav-links a.active {
  border: 1px solid black;
  background-color: rgba(0, 0, 0, 0.1);
}

/* --- Contenu Principal --- */
main {
  max-width: 1000px;
  margin: 2em auto;
  background: white;
  padding: 1em; /* Moins de padding sur mobile */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  font-size: 18px; /* Taille de police légèrement réduite pour mobile */
  text-indent: 2em;
}

.my-image {
  width: 80%; /* Image plus grande sur mobile */
  height: auto;
  padding: 5px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.noindent {
  text-indent: 0em;
}

.emphasis {
  color: rgb(89, 63, 168);
}

/* --- Typographie --- */
h1 {
  color: rgb(186, 194, 198);
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 20px;
  color: black;
}

ul {
  padding-left: 1.2em;
}

/* --- Media Query pour écrans plus larges (Tablettes et Ordinateurs > 768px) --- */
@media (min-width: 768px) {
  /* On cache le bouton hamburger */
  #menu-toggle {
    display: none;
  }

  /* On rétablit la barre de navigation horizontale */
  nav {
    justify-content: center;
    padding: 10px;
    max-height: 40px;
  }

  /* On affiche les liens et on annule les styles mobiles */
  .nav-links {
    display: flex !important; /* Forcer l'affichage */
    flex-direction: row;
    position: static;
    width: auto;
    background-color: transparent;
    border-top: none;
  }

  .nav-links a {
    padding: 0.3em 1.2em;
    border: none;
    font-size: 20px;
  }

  .nav-links a.active {
    border: 1px solid black;
    background-color: transparent; /* Annuler le fond grisé */
  }

  .nav-links a:hover {
    background-color: #6e6e6e;
  }

  /* Ajustements pour le contenu principal */
  main {
    padding: 2em;
    font-size: 20px;
  }

  .my-image {
    width: 60%; /* On revient à la taille initiale */
  }

  h2 {
    font-size: 25px;
  }

  h3 {
    font-size: 22px;
  }
}
