/* =========================================
   1. RÉINITIALISATION
========================================= */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  width: 100%;
  overflow-x: hidden;
}

/* Conteneur global pour forcer le footer en bas (Sticky Footer) */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
}


/* =========================================
   2. EN-TÊTE PRINCIPAL
========================================= */

.main-header {
  background-color: #1a5797;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1500px;
  min-height: 120px;
  margin: 0 auto;
  padding: 12px 24px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;

  position: relative;
}


/* =========================================
   3. IDENTITÉ VISUELLE : LOGO ET SLOGAN
========================================= */

.brand {
  display: flex;
  align-items: center;
  gap: 2px;

  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  display: block;
  width: auto;
  height: 100px;
  max-width: 100px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.brand-name {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: 1px;
}

.logo-tagline {
  color: #00d4e8;
  font-size: 1.20rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  letter-spacing: 0.1px;
}


/* =========================================
   4. MENU DE NAVIGATION : ORDINATEUR
========================================= */

.nav-menu ul {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 8px;
}

.nav-menu a {
  display: inline-block;
  position: relative;

  padding: 10px 12px;
  border-radius: 4px;

  text-decoration: none;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 500;

  opacity: 0.9;

  transition:
    background-color 0.2s ease,
    opacity 0.2s ease;
}

.nav-menu a:hover {
  opacity: 1;
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.12);
}

.nav-menu a.active {
  opacity: 1;
  color: #ffffff;
}

.nav-menu a::after {
  content: '';
  position: absolute;

  left: 12px;
  right: 12px;
  bottom: 5px;

  height: 2px;
  background-color: #ffffff;

  transform: scaleX(0);
  transform-origin: left;

  transition: transform 0.25s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  transform: scaleX(1);
}


/* =========================================
   5. SÉLECTEUR DE LANGUE
========================================= */

.language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 7px 12px;
  border-radius: 24px;

  background-color: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;

  border: none;
  background: transparent;
  cursor: pointer;

  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;

  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.lang-btn img {
  display: block;
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
}

.lang-btn:hover,
.lang-btn.active {
  opacity: 1;
}

.divider {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
}


/* =========================================
   6. BOUTON HAMBURGER
========================================= */

.menu-toggle {
  display: none;

  width: 44px;
  height: 44px;
  padding: 9px;

  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;

  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px auto;

  background-color: #f8f9fa; /*Test de Mohamed */
  border-radius: 2px;

  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.menu-toggle:focus-visible,
.nav-menu a:focus-visible,
.lang-btn:focus-visible {
  outline: 2px solid #00d4e8;
  outline-offset: 3px;
}


/* =========================================
   7. STYLE DU MENU DÉROULANT (DROPDOWN)
========================================= */

.nav-menu ul li.dropdown {
  position: relative;
}

.nav-menu ul li.dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #f8f9fa;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.1);
  list-style: none;
  padding: 10px 0;
  min-width: 320px; /* Élargi pour les textes en anglais */
  z-index: 1000;
  border-radius: 4px;
}

.nav-menu ul li.dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-menu li a {
  display: block;
  padding: 10px 15px;
  color: #333333 !important; /* Texte sombre et visible */
  white-space: normal;
  font-size: 14px;
  text-decoration: none;
}

.dropdown-menu li a::after {
  display: none !important; /* Supprime le soulignement animé sur les items du dropdown */
}

.dropdown-menu li a:hover {
  background-color: #f4f4f4;
  color: #0066cc !important;
}


/* =========================================
   8. TABLETTES ET PETITS ORDINATEURS
========================================= */

@media (min-width: 769px) and (max-width: 1200px) {

  .header-container {
    gap: 12px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .logo-img {
    height: 72px;
    max-width: 110px;
  }

  .brand {
    gap: 8px;
  }

  .brand-name {
    font-size: 1.3rem;
  }

  .logo-tagline {
    font-size: 1.05rem;
  }

  .nav-menu ul {
    gap: 2px;
  }

  .nav-menu a {
    font-size: 0.85rem;
    padding: 9px 7px;
  }

  .language-switcher {
    gap: 5px;
    padding: 6px 8px;
  }
}


/* =========================================
   9. VERSION MOBILE & ACCORDÉON
========================================= */

@media (max-width: 768px) {

  .header-container {
    min-height: 90px;
    padding: 12px 16px;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    gap: 8px;
  }

  .logo-img {
    height: 58px;
    max-width: 75px;
  }

  .brand-name {
    font-size: clamp(1.1rem, 4.5vw, 1.35rem);
    letter-spacing: 0.5px;
  }

  .logo-tagline {
    font-size: clamp(0.75rem, 2.5vw, 0.95rem);
    white-space: normal;
  }

  .menu-toggle {
    display: block;
    grid-column: 2;
    grid-row: 1;
  }

  .nav-menu {
    display: none;

    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;

    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);

    padding: 8px 16px 16px;

    max-height: calc(100vh - 90px);
    overflow-y: auto;
  }

  .nav-menu.open {
    display: block;
  }

  .nav-menu ul {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-menu li {
    border-bottom: 1px solid #e5e7eb;
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .nav-menu a {
    display: block;
    padding: 13px 12px;

    color: #1a5797;
    font-size: 1rem;
    opacity: 1;
  }

  .nav-menu a::after {
    display: none;
  }

  .nav-menu a:hover,
  .nav-menu a.active {
    color: #1a5797;
    background-color: #f0f5fa;
    border-radius: 4px;
  }

  /* Style du sous-menu (dropdown) intégré dans l'accordéon mobile */
  .nav-menu ul li.dropdown .dropdown-menu {
    position: static;
    box-shadow: none;
    background-color: #f8f9fa;
    padding: 0 0 0 15px;
    min-width: 100%;
    border-radius: 0;
    border-left: 3px solid #1a5797;
  }

  .nav-menu ul li.dropdown:not(.open) .dropdown-menu {
    display: none;
  }

  .nav-menu ul li.dropdown.open .dropdown-menu {
    display: block;
  }

  .dropdown-menu li a {
    padding: 10px 12px;
    font-size: 0.95rem;
    color: #1a5797 !important;
  }

  .language-switcher {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
  }
}


/* =========================================
   10. TRÈS PETITS TÉLÉPHONES
========================================= */

@media (max-width: 360px) {

  .header-container {
    padding-left: 10px;
    padding-right: 10px;
    gap: 8px;
  }

  .brand {
    gap: 6px;
  }

  .logo-img {
    height: 48px;
    max-width: 58px;
  }

  .brand-name {
    font-size: 1.1rem;
  }

  .logo-tagline {
    font-size: 9px;
  }

  .menu-toggle {
    width: 40px;
    height: 40px;
  }
}


/* =========================================
   11. PAGE LOGICIEL (STYLES GÉNÉRAUX)
========================================= */

.software-container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

.software-image {
  text-align: center;
  margin-bottom: 30px;
}

.software-image img {
  width: 100%;
  max-width: 900px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.software-content {
  color: #333;
  line-height: 1.7;
  font-size: 1rem;
  background-color: #f8f9fa; 

}

.software-content h1 {
  font-size: 1.8rem;
  color: #004b87;
  margin-bottom: 20px;
}

.software-content p {
  margin-bottom: 15px;
}

.software-content ul {
  margin: 15px 0 20px 25px;
}

.software-content li {
  margin-bottom: 8px;
}

.software-cta {
  font-size: 1.15rem;
  color: #004b87;
  margin-top: 30px;
  padding: 15px;
  background-color: #f4f7fa;
  border-left: 4px solid #004b87;
  border-radius: 4px;
}

/* Force le fond blanc pour les pages logicielles (français et anglais) */
body:has(.software-container) .main-content {
  background-color: #f8f9fa !important;
  padding: 40px 20px;
}


/* =========================================
   12. PIED DE PAGE (FOOTER)
========================================= */

.main-footer {
  background-color: rgb(34, 54, 84);
  color: #ffffff;
  padding: 50px 20px 20px;
  font-size: 0.95rem;
  text-align: center;
}

.footer-container {
  width: 95%;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center; 
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-col h3 {
  color: #00d4e8;
  font-size: 1.1rem;
  margin-bottom: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.footer-col p {
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 10px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul a {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.footer-col ul a:hover {
  opacity: 1;
  color: #00d4e8;
}

.footer-bottom {
  width: 95%;
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* =========================================
   13. MOUVEMENTS RÉDUITS
========================================= */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}