/* ==========================================================
   ACG HOME — Corrections UI/UX Premium 2026
   Phases 2→10 : Stabilisation · Hero · Carrousel · Responsive
   ========================================================== */

/* ==========================================================
   BARRE STATS — Chevauchement stable sur le hero
   ========================================================== */
.acg-stats-bar {
  padding: 0;
  margin-top: -50px;
  position: relative;
  z-index: 5;
  contain: layout style;
}


/* ==========================================================
   PHASE 10 — BANDEAU SUPERIEUR COORDONNEES
   ========================================================== */
.acg-topbar {
  background: #072a31;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 0;
  height: 40px;
  display: flex;
  align-items: center;
  z-index: 1100;
  position: relative;
  width: 100%;
}

.acg-topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1320px;
}

.acg-topbar-contacts {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.acg-topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(180,220,218,0.9);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.acg-topbar-link i { font-size: 13px; color: #54d5cc; }
.acg-topbar-link:hover { color: #fff; }

.acg-topbar-location {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(180,220,218,0.75);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.acg-topbar-location i { font-size: 12px; color: #54d5cc; }

@media (max-width: 767px) {
  .acg-topbar { height: auto; padding: 7px 0; }
  .acg-topbar .container { flex-direction: column; gap: 6px; align-items: flex-start; }
  .acg-topbar-contacts { gap: 12px; flex-wrap: wrap; }
  .acg-topbar-location { display: none; }
  .acg-topbar-link { font-size: 11px; }
}
@media (max-width: 480px) {
  .acg-topbar-contacts { gap: 8px; }
}


/* ==========================================================
   NAVBAR FIXE — Correction critique
   La topbar n'est plus dans le layout → navbar à top: 0
   ========================================================== */

/* Réinitialisation : supprime le décalage topbar obsolète */
.navbar-custom {
  top: 0 !important;
  z-index: 1050 !important;
  transition: box-shadow 0.3s ease, background 0.3s ease !important;
}

/* Effet subtil au scroll — appliqué via JS (classe .scrolled) */
.navbar-custom.scrolled {
  box-shadow: 0 4px 24px rgba(8, 57, 66, 0.13) !important;
}

/* scroll-padding-top = hauteur du navbar fixe (~72px) */
html {
  scroll-padding-top: 80px !important;
}

/* Topbar cachée sur mobile */
@media (max-width: 767px) {
  .acg-topbar { display: none; }
}


/* ==========================================================
   PHASE 2 — STABILISATION (ancres, scroll indicator)
   ========================================================== */
.acg-anchor {
  position: absolute !important;
  top: -120px !important;
  visibility: hidden;
  pointer-events: none;
  height: 0 !important;
  display: block;
}

@keyframes scrollBounceFixed {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(5px); }
}
.hero-scroll-indicator { animation-name: scrollBounceFixed !important; will-change: transform; }


/* ==========================================================
   PHASES 3 + 4 — HERO : GRILLE CSS RESPONSIVE
   ========================================================== */

/*
   CORRECTION DÉFINITIVE DU DÉCALAGE HORIZONTAL :

   CAUSE RACINE IDENTIFIÉE (audit navigateur 2026-10-21) :
   .acg-hero-deco-circle est un cercle absolu de 900px
   positionné à right:-280px, ce qui le projette à 1729px
   pour un viewport de 1448px → débordement de 281px.
   bodyScrollWidth=1729 > clientWidth=1448.

   CORRECTION :
   `overflow: clip` (et non `overflow: hidden`) sur .acg-hero.
   - `clip` coupe les enfants débordants comme `hidden`.
   - MAIS `clip` NE crée PAS de contexte de scroll BFC.
   - Il n'y a donc AUCUNE scrollbar horizontale.
   - Il n'y a AUCUN décalage du contenu.
   - Les textes et boutons sont pleinement visibles (pas coupés).

   Fallback : les navigateurs anciens sans `clip` reçoivent
   `overflow: hidden` via la propriété suivante — acceptable
   car le problème n'apparaît que sur les navigateurs modernes.
*/
.acg-hero {
  position: relative;
  overflow: clip;           /* Coupe les décos sans scroll context */
  overflow: hidden;         /* Fallback navigateurs < Chrome 90     */
  contain: layout style;    /* ← ANTI-RÉGRESSION : confine TOUS les enfants   */
                            /*   y compris les éléments à z-index négatif.     */
                            /*   Empêche tout débordement futur hors du hero.  */
  background: #092d35;
  color: #fff;
  /* padding-top = hauteur navbar (~72px) + marge visuelle (40px) */
  padding: 112px 0 48px;
  min-height: 720px;
  isolation: isolate;
  width: 100%;
  max-width: 100%;
}

/* Cercle décoratif — CONFINÉ dans .acg-hero par overflow:clip */
/* Ne pas modifier right/top/width : l'effet visuel est voulu.  */
/* C'est le clip parent qui empêche le débordement.             */
.acg-hero-deco-circle {
  position: absolute;
  right: -280px;
  top: -420px;
  width: 900px;
  height: 900px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  /* box-shadow confiné dans le parent — pas de débordement */
  box-shadow:
    0 0 0 130px rgba(255,255,255,0.018),
    0 0 0 260px rgba(255,255,255,0.012);
}

.acg-hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.18;
  pointer-events: none;
  background-image:
    linear-gradient(#80b9b31b 1px, transparent 1px),
    linear-gradient(90deg, #80b9b31b 1px, transparent 1px);
  background-size: 66px 66px;
  mask-image: linear-gradient(90deg, #000, transparent 85%);
}

/* Conteneur central — Phase 3 spec */
.acg-hero-inner {
  max-width: 1280px;
  width: 100%;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 64px);
  position: relative;
  z-index: 1;
}

/* Grille 2 colonnes — Phase 3 spec */
.acg-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 4vw, 72px);
  align-items: center;
}
.acg-hero-row > * { min-width: 0; }

/* Zone texte */
.acg-hero-copy { min-width: 0; }

/* Eyebrow */
.acg-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.21em;
  font-weight: 750;
  color: #a6e0db;
  margin-bottom: 28px;
  text-transform: uppercase;
}
.acg-eyebrow-dot {
  height: 7px;
  width: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #e1b97e;
  box-shadow: 0 0 0 5px rgba(225,185,126,0.18);
}

/* Titre principal — Phase 4 spec */
.acg-hero h1 {
  font-size: clamp(2.2rem, 3.5vw, 4rem) !important;
  line-height: 1.1 !important;
  letter-spacing: -0.03em !important;
  font-weight: 800 !important;
  color: #fff !important;
  max-width: 100% !important;
  margin-bottom: 22px;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.acg-hero h1 em {
  font-style: normal;
  color: #8cddd3 !important;
}

/* Paragraphe */
.acg-hero-desc,
.acg-hero-copy > p {
  font-size: clamp(0.97rem, 1.2vw, 1.08rem) !important;
  max-width: 100% !important;
  color: #c3d7d8;
  margin-bottom: 30px;
  line-height: 1.85;
  text-align: left;
  overflow-wrap: break-word;
}

/* Boutons CTA */
.acg-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.acg-btn {
  padding: 15px 22px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 740;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.acg-btn:hover { transform: translateY(-2px); }

.acg-btn-primary { background: #fff; color: #083840; }
.acg-btn-primary:hover { background: #dbf4f0; color: #083840; }

.acg-btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.32);
  color: #fff;
}
.acg-btn-ghost:hover { border-color: #fff; color: #fff; }

/* Trust line */
.acg-trustline {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: 0.045em;
  color: #afd0ce;
}
.acg-trustline-icon { color: #a4e3cc; font-size: 17px; }
.acg-trustline-sep  { color: #689397; padding: 0 2px; }

/* Zone media */
.acg-hero-media {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Barre bas du hero */
.acg-hero-bottom {
  border-top: 1px solid rgba(255,255,255,0.14);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 52px;
  padding-top: 20px;
  color: #9dbfc0;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.18em;
}
.acg-hero-bottom a {
  color: #c0ddd9;
  font-size: 10px;
  white-space: nowrap;
  text-decoration: none;
}
.acg-hero-bottom a i { margin-left: 8px; }

/* Responsive */
@media (max-width: 991px) {
  .acg-hero { padding: 110px 0 32px; min-height: 0; }
  .acg-hero-row { grid-template-columns: 1fr; gap: 36px; }
  .acg-hero-media { justify-content: center; }
  .acg-hero-bottom { margin-top: 36px; }
}
@media (max-width: 767px) {
  .acg-hero { padding: 96px 0 28px; }
}
@media (max-width: 480px) {
  .acg-hero-actions { flex-direction: column; align-items: stretch; }
  .acg-btn { width: 100% !important; justify-content: space-between; }
}


/* ==========================================================
   PHASE 5 — CARROUSEL PHOTOGRAPHIQUE DANS LE CADRE DROIT
   Confine dans .acg-hero-visual — 0 impact sur le scroll page
   ========================================================== */

.acg-hero-visual {
  height: 490px;
  width: 100%;
  max-width: 465px;
  position: relative;
  overflow: hidden;
  border-radius: 160px 12px 12px 12px;
  background: #254a50;
  box-shadow: 0 32px 75px rgba(0,29,37,0.65);
  flex-shrink: 0;
  outline: none;
}
.acg-hero-visual:focus-visible {
  outline: 3px solid #8cddd3;
  outline-offset: 4px;
}

@media (max-width: 991px) {
  .acg-hero-visual {
    height: 370px;
    max-width: 480px;
    border-radius: 90px 12px 12px 12px;
  }
}
@media (max-width: 575px) {
  .acg-hero-visual {
    height: 295px;
    border-radius: 70px 12px 12px 12px;
  }
}

.acg-carousel {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Slides : opacite uniquement — AUCUN transform qui deplace la page */
.acg-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  pointer-events: none;
}
.acg-slide.is-active {
  opacity: 1;
  z-index: 2;
  pointer-events: auto;
}

.acg-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg,
    rgba(4,25,32,0.92) 0%,
    rgba(4,25,32,0.35) 55%,
    transparent 100%
  );
  z-index: 1;
}

.acg-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.acg-slide-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 22px 26px 20px;
}
.acg-slide-service {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  font-weight: 750;
  color: #8cddd3;
  text-transform: uppercase;
  margin-bottom: 5px;
  font-family: Inter, Arial, sans-serif;
}
.acg-slide-title {
  font-size: clamp(15px, 1.3vw, 18px);
  font-weight: 750;
  color: #fff;
  line-height: 1.25;
  margin: 0 0 10px;
  letter-spacing: -0.025em;
  font-family: Inter, Arial, sans-serif;
}
.acg-slide-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 650;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  transition: color 0.2s, gap 0.2s;
  font-family: Inter, Arial, sans-serif;
}
.acg-slide-link:hover { color: #8cddd3; gap: 11px; }

.acg-visual-line {
  position: absolute;
  inset: 13px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 148px 6px 6px 6px;
  pointer-events: none;
  z-index: 10;
}

/* Boutons prev / next */
.acg-carousel-prev,
.acg-carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 50%;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}
.acg-carousel-prev { left: 14px; }
.acg-carousel-next { right: 14px; }

.acg-hero-visual:hover .acg-carousel-prev,
.acg-hero-visual:hover .acg-carousel-next,
.acg-hero-visual:focus-within .acg-carousel-prev,
.acg-hero-visual:focus-within .acg-carousel-next { opacity: 1; }

.acg-carousel-prev:hover,
.acg-carousel-next:hover { background: rgba(255,255,255,0.28); }

.acg-carousel-prev:focus-visible,
.acg-carousel-next:focus-visible {
  outline: 3px solid #8cddd3;
  outline-offset: 2px;
  opacity: 1;
}

/* Dots */
.acg-carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 5px;
  align-items: center;
}
.acg-dot {
  width: 6px;
  height: 6px;
  background: rgba(255,255,255,0.32);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: width 0.3s, background 0.3s, border-radius 0.3s;
}
.acg-dot.is-active { width: 20px; border-radius: 4px; background: #8cddd3; }
.acg-dot:focus-visible { outline: 2px solid #8cddd3; outline-offset: 2px; }


/* ==========================================================
   PHASE 9 — MENUS DEROULANTS PREMIUM
   ========================================================== */
.acg-nav-links .dropdown-menu {
  padding: 10px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(0,113,121,0.12) !important;
  box-shadow: 0 28px 65px rgba(0,40,55,0.14) !important;
  animation: acgDropIn 0.16s ease-out;
}
@keyframes acgDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.acg-nav-links .dropdown-item {
  border-radius: 9px !important;
  padding: 11px 14px !important;
  font-size: 13px !important;
  font-weight: 550 !important;
  color: #112b32 !important;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.acg-nav-links .dropdown-item.active,
.acg-nav-links .dropdown-item:hover {
  background: linear-gradient(135deg, #eaf7f5, #d5f0ec) !important;
  color: #007e89 !important;
  transform: translateX(3px);
}
body.dark-mode .acg-nav-links .dropdown-item { color: #f1f9f8 !important; }
body.dark-mode .acg-nav-links .dropdown-item:hover {
  background: rgba(84,213,204,0.1) !important;
  color: #54d5cc !important;
}


/* ==========================================================
   CORRECTIONS OVERFLOW GLOBAL
   ========================================================== */
/*
   NOTE : Ces règles sont un filet de sécurité complémentaire.
   La correction principale est overflow:clip sur .acg-hero.
   html/body:overflow-x:hidden est justifié ici car aucun
   contexte de scroll horizontal n'est intentionnel sur ce site.
*/
html {
  overflow-x: clip;   /* Moderne : pas de BFC forced layout  */
  overflow-x: hidden; /* Fallback */
}
body {
  overflow-x: clip;
  overflow-x: hidden; /* Fallback */
  max-width: 100%;
}


/* ==========================================================
   ACCESSIBILITE — prefers-reduced-motion
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  .acg-slide { transition: none !important; }
  .acg-carousel-progress { display: none !important; }
  .hero-scroll-indicator { animation: none !important; }
  .acg-btn:hover,
  .acg-carousel-prev:hover,
  .acg-carousel-next:hover { transform: none !important; }
}


/* ==========================================================
   PHASE 7 — BARRE DE PROGRESSION TEMPORELLE
   Fine ligne au bas du cadre, indique le délai avant la
   prochaine slide. Créée dynamiquement par acg-carousel.js.
   Confinée dans .acg-hero-visual — 0 impact sur le scroll.
   ========================================================== */
.acg-carousel-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #8cddd3, #54d5cc);
  z-index: 20;
  pointer-events: none;
  /* La transition est gérée par JS (startProgress / resetProgress) */
}


/* ==========================================================
   PHASE 8 — HEADER : alignement logo + bouton CTA premium
   ========================================================== */

/* Conteneur navbar — espacement intérieur cohérent */
.navbar-custom .acg-nav-shell {
  padding-top: 0;
  padding-bottom: 0;
}

/* Logo — proportions conservées, jamais collé au bord */
.acg-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 !important;
  text-decoration: none;
}

.acg-brand-mark {
  width: 48px !important;
  height: 48px !important;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.acg-brand-type {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}

.acg-brand-type strong {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0a2e38;
}

.acg-brand-type span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: #007e89;
  white-space: nowrap;
}

body.dark-mode .acg-brand-type strong { color: #f0fafa; }
body.dark-mode .acg-brand-type span   { color: #8cddd3; }

/* Liens nav */
.acg-nav-links .nav-link {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.6rem 0.9rem !important;
  white-space: nowrap;
}

/* Bouton CTA "Parlons de votre projet" */
.acg-nav-cta .nav-link-contact {
  padding: 10px 18px !important;
  background: #007e89;
  color: #fff !important;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.acg-nav-cta .nav-link-contact:hover {
  background: #009faf;
  transform: translateY(-1px);
}
body.dark-mode .acg-nav-cta .nav-link-contact {
  background: #54d5cc !important; /* !important nécessaire : écrase acg-premium.css #083942!important */
  color: #041921 !important;       /* Texte sombre sur fond turquoise clair — contraste WCAG AA        */
  border: none !important;
}

/* Dropdown menus — déjà en Phase 9 du CSS, confirmé ici */
.acg-nav-links .dropdown-menu {
  min-width: 220px;
  margin-top: 6px !important;
}

/* Active state — mode clair */
.acg-nav-links .nav-link.active {
  color: #007e89 !important;
  font-weight: 700;
}

/* Active state — mode sombre :
   Fond clair #ebf7f5 (acg-premium.css) remplacé par un fond teal semi-transparent
   cohérent avec la palette dark mode (#092d35 / #8cddd3)                        */
body.dark-mode .acg-nav-links .nav-link.active {
  color: #8cddd3 !important;
  background: rgba(84, 213, 204, 0.12) !important; /* teal translucide sur fond sombre */
  border-radius: 9px;
}

/* Mobile : espacements du menu déroulant */
@media (max-width: 991px) {
  .acg-brand-mark { width: 40px !important; height: 40px !important; }
  .acg-brand-type strong { font-size: 12px; }
  .acg-brand-type span   { font-size: 9.5px; }
  .acg-nav-cta .nav-link-contact {
    display: inline-flex;
    margin-top: 10px;
    width: fit-content;
  }
}
