/* ================================================================
   BERGEC — Feuille de style globale
   Bureau d'Études Renouvelé de Génie Civil
   Charte graphique extraite du logo officiel :
     - Rouge vif   : #CC1122 (texte BERGeC sur le logo)
     - Bleu marine : #1A3F7A (bannière du logo)
     - Gris route  : #8E9099 (asphalte du logo)
   ================================================================ */


/* ================================================================
   1. RÉINITIALISATION ET BASE
   ================================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  color: #2C3E50;
  background: #ffffff;
  overflow-x: hidden;
  line-height: 1.7;
}

img  { max-width: 100%; height: auto; display: block; }
a    { text-decoration: none; color: inherit; }
ul   { list-style: none; }


/* ================================================================
   2. VARIABLES DE COULEURS — CHARTE GRAPHIQUE LOGO
   ================================================================ */
:root {
  /* Couleurs primaires tirées du logo */
  --rouge:       #CC1122;   /* Rouge du texte BERGeC */
  --rouge-fonce: #9B0E1A;   /* Rouge foncé pour survol */
  --rouge-clair: #E8192A;   /* Rouge clair pour effets */

  /* Bleu marine de la bannière du logo */
  --bleu:        #1A3F7A;
  --bleu-fonce:  #0D2550;
  --bleu-clair:  #2A5499;

  /* Couleurs de support */
  --gris-route:  #8E9099;   /* Gris asphalte du logo */
  --sombre:      #0A1628;   /* Fond sombre principal */
  --texte:       #2C3E50;   /* Couleur texte général */
  --discret:     #6B7A99;   /* Texte secondaire */
  --bordure:     #E2E8F0;   /* Bordures légères */
  --fond-clair:  #F7F9FC;   /* Fond de section claire */
  --blanc:       #FFFFFF;

  /* Rayons de bordure */
  --rayon:       12px;
  --rayon-lg:    20px;

  /* Ombres */
  --ombre-sm:    0 4px 16px rgba(0, 0, 0, 0.08);
  --ombre-md:    0 8px 32px rgba(0, 0, 0, 0.12);
  --ombre-lg:    0 20px 60px rgba(0, 0, 0, 0.16);

  /* Transition globale */
  --transition:  all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Polices */
  --police-titre: 'Poppins', 'Segoe UI', sans-serif;
  --police-corps: 'Inter',   'Segoe UI', sans-serif;
}


/* ================================================================
   3. UTILITAIRES GÉNÉRAUX
   ================================================================ */

/* Conteneur centré */
.conteneur {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Sections */
.section { padding: 96px 0; }

/* Direction RTL (langue arabe) */
.rtl { direction: rtl; text-align: right; }


/* ================================================================
   4. BOUTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  border-radius: 8px;
  font-family: var(--police-titre);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

/* Effet de brillance au survol */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.btn:hover::after { transform: scaleX(1); }

/* Bouton rouge (principal) */
.btn-rouge {
  background: linear-gradient(135deg, var(--rouge), var(--rouge-fonce));
  color: var(--blanc);
  box-shadow: 0 4px 20px rgba(204, 17, 34, 0.35);
}
.btn-rouge:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(204, 17, 34, 0.48);
}

/* Bouton transparent (contour blanc) */
.btn-contour {
  background: transparent;
  color: var(--blanc);
  border: 2px solid rgba(255, 255, 255, 0.45);
}
.btn-contour:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--blanc);
  transform: translateY(-2px);
}

/* Bouton pleine largeur */
.btn-plein { width: 100%; justify-content: center; padding: 17px; font-size: 16px; }


/* ================================================================
   5. EN-TÊTES DE SECTIONS
   ================================================================ */
.en-tete-section {
  text-align: center;
  margin-bottom: 56px;
}

/* Étiquette de catégorie */
.etiquette {
  display: inline-block;
  background: linear-gradient(135deg, var(--bleu), var(--bleu-clair));
  color: var(--blanc);
  padding: 5px 18px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* Étiquette claire (pour sections sombres) */
.etiquette-claire { background: rgba(255, 255, 255, 0.15); }

.titre-section {
  font-family: var(--police-titre);
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  color: var(--sombre);
  line-height: 1.2;
  margin-bottom: 12px;
}

/* Mot en couleur rouge dans les titres */
.titre-section span { color: var(--rouge); }

/* Version blanche (sections sombres) */
.titre-section.blanc { color: var(--blanc); }

.desc-section {
  font-size: 17px;
  color: var(--discret);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.8;
}

/* CTA centré sous une grille */
.cta-section { text-align: center; margin-top: 44px; }


/* ================================================================
   6. ANIMATIONS D'APPARITION AU DÉFILEMENT
   ================================================================ */

/* Classe de départ (invisible) */
.apparition {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
  transition-delay: var(--retard, 0s);
}

/* Classe ajoutée par JS quand l'élément est visible */
.apparition.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Animation CSS directe (hero) */
.anime-haut {
  opacity: 0;
  transform: translateY(30px);
  animation: monterFade 0.8s ease forwards;
  animation-delay: var(--delai, 0s);
}

@keyframes monterFade {
  to { opacity: 1; transform: translateY(0); }
}


/* ================================================================
   7. BARRE DE NAVIGATION
   ================================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: var(--transition);
}

/* Navbar au défilement */
.nav.defilée {
  background: rgba(10, 22, 40, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 10px 0;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.3);
}

.nav-interieur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Logo image */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo img {
  height: 56px;
  width: auto;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: white;
  object-fit: contain;
  padding: 2px;
}

.nav-logo-texte {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nav-logo-texte .nom {
  font-family: var(--police-titre);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}

.nav-logo-texte .nom .ber { color: var(--blanc); }
.nav-logo-texte .nom .gec { color: var(--rouge); }

.nav-logo-texte .slogan-nav {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Liens de navigation */
.nav-liens {
  display: flex;
  align-items: center;
  gap: 26px;
}

.lien-nav {
  font-family: var(--police-titre);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  transition: var(--transition);
  position: relative;
  padding-bottom: 4px;
}

/* Soulignement animé */
.lien-nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--rouge);
  transition: width 0.3s ease;
}

.lien-nav:hover,
.lien-nav.actif { color: var(--blanc); }

.lien-nav:hover::after,
.lien-nav.actif::after { width: 100%; }

/* Sélecteur de langue */
.selecteur-langue {
  display: flex;
  gap: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 4px;
}

.btn-langue {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--police-titre);
}

.btn-langue.actif,
.btn-langue:hover {
  background: var(--rouge);
  color: var(--blanc);
}

/* Bouton burger (mobile) */
.burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--blanc);
  border-radius: 2px;
  transition: var(--transition);
}

/* Animation burger ouvert */
.burger.ouvert span:nth-child(1) { transform: rotate(45deg) translate(5.5px, 5.5px); }
.burger.ouvert span:nth-child(2) { opacity: 0; }
.burger.ouvert span:nth-child(3) { transform: rotate(-45deg) translate(5.5px, -5.5px); }


/* ================================================================
   8. PIED DE PAGE (FOOTER)
   ================================================================ */
.pied-page {
  background: var(--sombre);
  color: var(--blanc);
}

.pied-principal { padding: 68px 0 44px; }

.pied-grille {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 44px;
}

/* Logo dans le footer */
.pied-logo {
  font-family: var(--police-titre);
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
}

.pied-logo img {
  height: 70px;
  width: auto;
  object-fit: contain;
  border-radius: 50%;
  background: white;
  padding: 4px;
  margin-bottom: 12px;
}

.pied-sous-titre {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 10px;
}

.pied-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.8;
  margin-bottom: 9px;
}

.pied-slogan {
  font-size: 13px;
  color: var(--rouge);
  font-style: italic;
}

/* Titres de colonnes footer */
.pied-grille h4 {
  font-family: var(--police-titre);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

/* Liens footer */
.pied-liens li { margin-bottom: 8px; }

.pied-liens a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  transition: var(--transition);
  display: inline-block;
}

.pied-liens a:hover { color: var(--blanc); padding-left: 5px; }

/* Contact footer */
.pied-contact-liste li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 11px;
}

.pied-contact-liste i { color: var(--rouge); margin-top: 3px; flex-shrink: 0; }
.pied-contact-liste a { color: rgba(255, 255, 255, 0.6); transition: var(--transition); }
.pied-contact-liste a:hover { color: var(--blanc); }

/* Bande basse du footer */
.pied-bas {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 20px 0;
  text-align: center;
}

.pied-bas p { font-size: 13px; color: rgba(255, 255, 255, 0.3); }


/* ================================================================
   9. BOUTONS FLOTTANTS (WhatsApp + Retour haut)
   ================================================================ */

/* Bouton retour en haut */
.retour-haut {
  position: fixed;
  bottom: 24px;
  right: 88px;
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--bleu), var(--bleu-clair));
  color: var(--blanc);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: var(--transition);
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.retour-haut.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.retour-haut:hover {
  background: linear-gradient(135deg, var(--rouge-fonce), var(--rouge));
  transform: translateY(-3px);
}

/* Bouton WhatsApp flottant */
.whatsapp-flottant {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: #25D366;
  color: var(--blanc);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  z-index: 998;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-flottant:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.55);
  color: var(--blanc);
}


/* ================================================================
   10. FORMULAIRE DE CONTACT (partagé)
   ================================================================ */
.champ-form { margin-bottom: 16px; }

.champ-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--texte);
  margin-bottom: 6px;
  font-family: var(--police-titre);
}

.champ-form input,
.champ-form select,
.champ-form textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--bordure);
  border-radius: 8px;
  font-family: var(--police-corps);
  font-size: 14px;
  color: var(--texte);
  background: var(--fond-clair);
  transition: var(--transition);
  outline: none;
}

.champ-form input:focus,
.champ-form select:focus,
.champ-form textarea:focus {
  border-color: var(--bleu);
  background: var(--blanc);
  box-shadow: 0 0 0 3px rgba(26, 63, 122, 0.1);
}

.champ-form textarea { resize: vertical; min-height: 120px; }

.champ-form select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7A99' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

.rangee-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }


/* ================================================================
   11. FAQ ACCORDÉON (partagé)
   ================================================================ */
.boite-faq {
  background: var(--blanc);
  border-radius: var(--rayon);
  padding: 22px;
  border: 1px solid var(--bordure);
}

.boite-faq h3 {
  font-family: var(--police-titre);
  font-size: 15px;
  font-weight: 700;
  color: var(--sombre);
  margin-bottom: 14px;
}

.faq-element { border-bottom: 1px solid var(--bordure); }
.faq-element:last-child { border-bottom: none; }

.faq-question {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  text-align: left;
  font-family: var(--police-titre);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--texte);
  cursor: pointer;
  transition: var(--transition);
}

.faq-question:hover { color: var(--bleu); }
.faq-question i { flex-shrink: 0; font-size: 11px; color: var(--discret); transition: transform 0.3s ease; }
.faq-element.ouvert .faq-question i { transform: rotate(180deg); color: var(--rouge); }

.faq-reponse { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.faq-element.ouvert .faq-reponse { max-height: 200px; }
.faq-reponse p { padding-bottom: 13px; font-size: 13.5px; color: var(--discret); line-height: 1.7; }


/* ================================================================
   12. RESPONSIVE — TABLETTE (≤ 1024px)
   ================================================================ */
@media (max-width: 1024px) {
  .pied-grille { grid-template-columns: 1fr 1fr; gap: 32px; }
  .rangee-form { grid-template-columns: 1fr; }
}

/* ================================================================
   13. RESPONSIVE — MOBILE (≤ 768px)
   ================================================================ */
@media (max-width: 768px) {
  .section { padding: 68px 0; }

  /* Menu mobile en panneau latéral */
  .nav-liens {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 280px;
    background: var(--sombre);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 40px;
    gap: 22px;
    transition: right 0.4s ease;
    z-index: 1000;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.5);
  }

  .nav-liens.ouvert { right: 0; }
  .lien-nav { font-size: 18px; }
  .burger { display: flex; }

  .pied-grille { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 480px) {
  .btn { padding: 12px 22px; font-size: 14px; }
}
