/* ==========================================================
   ALPHASALUBRE : feuille de style commune
   Mobile d'abord, accessible, thème clair et sombre
   ========================================================== */

/* 1. Variables */
:root {
  --bleu: #012060;
  --bleu-fonce: #001445;
  --vert: #006600;
  --accent: #e10505;
  --fond: #ffffff;
  --fond-doux: #f3f7f9;
  --texte: #1d2b33;
  --texte-doux: #5b6b75;
  --bordure: #dfe7ec;
  --rayon: 12px;
  --ombre: 0 4px 16px rgba(1, 32, 96, 0.08);
  --police: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f1b21;
    --fond-doux: #16262e;
    --texte: #e8f0f3;
    --texte-doux: #a9bac3;
    --bordure: #2a3d47;
    --ombre: none;
    /* Bleu et vert éclaircis pour rester lisibles sur fond sombre */
    --bleu: #8fb8ff;
    --vert: #6fcf8e;
  }
  .etapes li::before { color: #0f1b21; background: var(--bleu); }
  .logo img { background: #ffffff; border-radius: 8px; padding: 2px 6px; }
}

/* 2. Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--police);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--texte);
  background: var(--fond);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--bleu); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--bleu); color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; }
.conteneur { width: min(1100px, 92%); margin-inline: auto; }
section { padding: 3.5rem 0; }
.fond-doux { background: var(--fond-doux); }
h1, h2, h3 { line-height: 1.25; color: var(--bleu); }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 1rem; }
h3 { font-size: 1.15rem; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }

/* 3. En-tête et navigation */
.entete {
  position: sticky; top: 0; z-index: 50;
  background: var(--fond);
  border-bottom: 1px solid var(--bordure);
  padding-top: env(safe-area-inset-top, 0px);
}
.entete-ligne {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px;
}
.logo { font-weight: 800; font-size: 1.2rem; color: var(--bleu); text-decoration: none; }
.menu { display: none; list-style: none; margin: 0; padding: 0; gap: 1.25rem; }
.menu a { color: var(--texte); text-decoration: none; font-weight: 500; }
.menu a[aria-current="page"] { color: var(--bleu); border-bottom: 2px solid var(--accent); }
.menu-bouton {
  background: none; border: 1px solid var(--bordure); border-radius: 8px;
  padding: .5rem .7rem; font-size: 1rem; color: var(--texte); cursor: pointer;
}
.actions-entete { display: flex; align-items: center; gap: .5rem; }
.menu-mobile { display: none; list-style: none; padding: 0 0 1rem; margin: 0; }
.menu-mobile.ouvert { display: block; }
.menu-mobile a { display: block; padding: .75rem 0; color: var(--texte); text-decoration: none; border-top: 1px solid var(--bordure); }

@media (min-width: 900px) {
  .menu { display: flex; }
  .menu-bouton { display: none; }
  .menu-mobile { display: none !important; }
}

/* 4. Boutons */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.4rem; border-radius: 999px; border: 2px solid transparent;
  font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  min-height: 48px; transition: transform .15s ease, background .15s ease;
}
.bouton:hover { transform: translateY(-1px); }
.bouton-principal { background: var(--accent); color: #ffffff; }
.bouton-secondaire { background: transparent; color: var(--bleu); border-color: var(--bleu); }
.bouton-petit { min-height: 40px; padding: .5rem 1rem; font-size: .9rem; }
.groupe-boutons { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* 5. Accueil : bandeau */
.hero {
  background: linear-gradient(135deg, var(--bleu) 0%, var(--vert) 100%);
  color: #fff; padding: 4.5rem 0 4rem;
}
.hero h1, .hero h2 { color: #fff; }
.hero p { font-size: 1.1rem; max-width: 60ch; opacity: .95; }
.hero .bouton-secondaire { color: #fff; border-color: #fff; }

/* 6. Indicateurs */
.chiffres { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.chiffre { background: var(--fond); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 1.25rem; text-align: center; }
.chiffre strong { display: block; font-size: 2rem; color: var(--bleu); }
@media (min-width: 800px) { .chiffres { grid-template-columns: repeat(4, 1fr); } }

/* 7. Cartes et grilles */
.grille { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grille.deux { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grille.trois { grid-template-columns: repeat(3, 1fr); } .grille.quatre { grid-template-columns: repeat(4, 1fr); } }
.carte {
  background: var(--fond); border: 1px solid var(--bordure); border-radius: var(--rayon);
  padding: 1.5rem; box-shadow: var(--ombre); display: flex; flex-direction: column;
}
.carte p:last-child { margin-bottom: 0; }
.carte a.lien-carte { margin-top: auto; padding-top: .75rem; font-weight: 600; text-decoration: none; }
.icone { font-size: 1.8rem; margin-bottom: .5rem; }

/* 8. Fil d'Ariane et titres de page */
.entete-page { background: var(--fond-doux); padding: 2.5rem 0; }
.fil { font-size: .9rem; color: var(--texte-doux); margin-bottom: .5rem; }
.fil a { color: var(--texte-doux); }

/* 9. Listes de contrôle et étapes */
.coches { list-style: none; padding: 0; margin: 0; }
.coches li { padding-left: 1.75rem; position: relative; margin-bottom: .6rem; }
.coches li::before { content: "✓"; position: absolute; left: 0; color: var(--vert); font-weight: 700; }
.etapes { counter-reset: etape; list-style: none; padding: 0; }
.etapes li { counter-increment: etape; padding: 1rem 1rem 1rem 3.5rem; position: relative; border-left: 3px solid var(--bleu); margin-bottom: .75rem; background: var(--fond); border-radius: 0 var(--rayon) var(--rayon) 0; }
.etapes li::before { content: counter(etape); position: absolute; left: 1rem; top: 1rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--bleu); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: .9rem; }

/* 10. Foire aux questions (balises details) */
.faq details { border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 1rem 1.25rem; margin-bottom: .75rem; background: var(--fond); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--bleu); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: .75rem 0 0; color: var(--texte-doux); }

/* 11. Formulaires */
.formulaire { display: grid; gap: 1rem; }
.champ { display: grid; gap: .35rem; }
.champ label { font-weight: 600; }
.champ input, .champ select, .champ textarea {
  font: inherit; padding: .75rem; border-radius: 8px; border: 1px solid var(--bordure);
  background: var(--fond); color: var(--texte); width: 100%;
}
.champ textarea { min-height: 120px; resize: vertical; }
.champ-ligne { display: grid; gap: 1rem; }
@media (min-width: 640px) { .champ-ligne { grid-template-columns: 1fr 1fr; } }
.message-ok { display: none; padding: 1rem; border-radius: var(--rayon); background: #e6f4ec; color: #1d5c39; }
.message-ok.visible { display: block; }

/* 12. Boutique */
.boutique-couches { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 900px) { .boutique-couches { grid-template-columns: 240px 1fr; } }
.filtres { display: flex; flex-wrap: wrap; gap: .5rem; }
.filtres button {
  border: 1px solid var(--bordure); background: var(--fond); color: var(--texte);
  border-radius: 999px; padding: .4rem .9rem; cursor: pointer; font: inherit;
}
.filtres button[aria-pressed="true"] { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.produit { display: flex; flex-direction: column; }
.produit img { border-radius: 8px; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: .75rem; background: var(--fond-doux); }
.prix { font-weight: 700; font-size: 1.15rem; color: var(--bleu); margin: .25rem 0 .75rem; }
.badge-phyto { display: inline-block; font-size: .8rem; background: #fff3d6; color: #6b4a00; border-radius: 6px; padding: .2rem .5rem; margin-bottom: .5rem; }
.panier-compteur {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; border-radius: 50%; border: 1px solid var(--bordure);
  background: var(--fond); color: var(--texte); text-decoration: none;
}
.panier-compteur span {
  position: absolute; top: -4px; right: -4px; background: var(--accent); color: #ffffff;
  border-radius: 999px; font-size: .75rem; font-weight: 700; padding: 0 .4rem;
}
.panier-lignes { list-style: none; padding: 0; margin: 0; }
.panier-lignes li { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--bordure); }
.panier-total { font-size: 1.2rem; font-weight: 700; margin: 1rem 0; }
.alerte { background: #fff3d6; color: #6b4a00; padding: .9rem 1rem; border-radius: var(--rayon); margin-bottom: 1rem; }

/* 13. Bandeau cookies et bouton WhatsApp */
.cookies {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--fond); border-top: 1px solid var(--bordure); box-shadow: var(--ombre);
  padding: 1rem; padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  display: none; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.cookies.visible { display: flex; }
.whatsapp {
  position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 55;
  background: #25d366; color: #fff; border-radius: 999px; padding: .75rem 1.1rem;
  text-decoration: none; font-weight: 700; box-shadow: var(--ombre);
}

/* 14. Pied de page */
.pied { background: var(--bleu-fonce); color: #d9e6ec; padding: 3rem 0 6rem; font-size: .95rem; }
.pied a { color: #fff; }
.pied-grille { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 800px) { .pied-grille { grid-template-columns: 2fr 1fr 1fr; } }
.pied ul { list-style: none; padding: 0; margin: 0; }
.pied li { margin-bottom: .5rem; }

/* 15. Mentions et textes longs */
.texte-long { max-width: 75ch; }
.texte-long h2 { margin-top: 2rem; }
.mention { font-size: .9rem; color: var(--texte-doux); }

/* 16. Réduction des animations */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* 17. Utilitaires d'accessibilité */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.fs-titre { font-size: 1.1rem; margin-bottom: .75rem; }

/* 18. Photos */
.carte > img { border-radius: 8px; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; margin-bottom: 1rem; }
.hero-photo {
  background-image: linear-gradient(135deg, rgba(1, 32, 96, 0.92) 0%, rgba(0, 102, 0, 0.85) 100%), url("../images/secteur-tertiaire.jpg");
  background-size: cover; background-position: center;
}

/* 19. Illustrations de rubriques */
.illustration { width: 100%; max-width: 800px; height: auto; margin: 0 auto 2rem; border-radius: var(--rayon); display: block; }

/* 20. Logo officiel */
.logo { flex-shrink: 0; }
.logo img { height: 40px; width: auto; min-width: 200px; max-width: none; display: block; }

/* 21. Pas de retour à la ligne dans le menu et les boutons */
.menu a, .bouton, .menu-mobile a { white-space: nowrap; }
@media (min-width: 900px) and (max-width: 1100px) { .menu { gap: .9rem; } .menu a { font-size: .95rem; } }
@media (max-width: 899px) { .logo img { height: 36px; min-width: 0; } .actions-entete > .bouton { display: none; } }

/* 22. Lisibilité : textes légèrement plus grands, descriptions des services renforcées */
body { font-size: 1.0625rem; line-height: 1.7; }
.carte p { font-size: 1.05rem; line-height: 1.65; }
.carte h3 { font-size: 1.25rem; }
.coches li, .etapes li, .texte-long p { font-size: 1.05rem; }
.mention { font-size: .95rem; }

/* 23. Bandeau de certifications défilant */
.bandeau-certif { background: var(--fond); border-bottom: 1px solid var(--bordure); overflow: hidden; padding: 1.25rem 0; }
.bandeau-certif-piste { display: flex; width: max-content; animation: defile-certif 36s linear infinite; }
.bandeau-certif-groupe { display: flex; align-items: center; gap: 3rem; padding-right: 3rem; }
.bandeau-certif-groupe a { display: block; flex-shrink: 0; }
.bandeau-certif-groupe img { height: 84px; width: auto; display: block; }
.bandeau-certif:hover .bandeau-certif-piste { animation-play-state: paused; }
.bandeau-certif a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
@keyframes defile-certif { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .bandeau-certif-piste { animation: none; width: 100%; justify-content: center; flex-wrap: wrap; }
  .bandeau-certif-groupe[aria-hidden="true"] { display: none; }
  .bandeau-certif-groupe { flex-wrap: wrap; justify-content: center; }
}

/* 24. Illustrations alignées sur le bord gauche des titres et des textes */
.illustration { width: 100%; max-width: none; margin: 0 0 2rem; }

/* 25. Carte thème avec image de fond */
.carte-fond { background-image: linear-gradient(rgba(1,32,96,.78), rgba(1,32,96,.88)), url("../images/formation-hygiene-alimentaire.jpg"); background-size: cover; background-position: center; border-color: transparent; }
.carte-fond h3, .carte-fond p, .carte-fond h3 a { color: #ffffff; }

/* 26. Thèmes de formation avec image de fond */
.carte-fond.fond-dechets { background-image: linear-gradient(rgba(1,32,96,.78), rgba(1,32,96,.88)), url("../images/formation-theme-dechets.jpg"); background-size: cover; background-position: center; }
.carte-fond.fond-hygiene-nettoyage { background-image: linear-gradient(rgba(1,32,96,.78), rgba(1,32,96,.88)), url("../images/formation-theme-hygiene-nettoyage.jpg"); background-size: cover; background-position: center; }
.carte-fond.fond-nuisibles { background-image: linear-gradient(rgba(1,32,96,.78), rgba(1,32,96,.88)), url("../images/formation-theme-nuisibles.jpg"); background-size: cover; background-position: center; }
.carte-fond.fond-produits-chimiques { background-image: linear-gradient(rgba(1,32,96,.78), rgba(1,32,96,.88)), url("../images/formation-theme-produits-chimiques.jpg"); background-size: cover; background-position: center; }
.carte-fond h3 a { color: #ffffff; }

/* 27. Nouveau logo : icône + nom écrit en deux couleurs */
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; flex-shrink: 0; }
.logo img { height: 52px; width: auto; min-width: 0; max-width: none; display: block; background: none; padding: 0; border-radius: 0; }
.logo-texte { font-weight: 900; font-size: 1.55rem; letter-spacing: .04em; line-height: 1; white-space: nowrap; }
.l-alpha { color: var(--bleu); }
.l-salubre { color: var(--vert); }
.pied-logo { margin-bottom: .75rem; }
.pied-logo img { height: 56px; }
.pied .l-alpha { color: #ffffff; }
.pied .l-salubre { color: #7fd69a; }
@media (prefers-color-scheme: dark) { .logo img { background: none; padding: 0; } }
@media (max-width: 899px) { .logo img { height: 42px; } .logo-texte { font-size: 1.2rem; } }

/* 28. Ajustement de l'en-tête sur ordinateur */
@media (min-width: 900px) { .logo-texte { font-size: 1.3rem; } .logo img { height: 46px; } .logo { gap: .5rem; } }
@media (min-width: 900px) and (max-width: 1280px) { .menu { gap: .75rem; } .menu a { font-size: .92rem; } }
@media (min-width: 900px) and (max-width: 1280px) { .logo-texte { font-size: 1.1rem; } .logo img { height: 40px; } .actions-entete .bouton { font-size: .85rem; padding: .6rem .9rem; } .menu a { white-space: nowrap; } }
@media (min-width: 900px) and (max-width: 1280px) { .menu { gap: .6rem; } .menu a { font-size: .88rem; } }
@media (min-width: 900px) and (max-width: 1180px) { .actions-entete > .bouton { display: none; } }
@media (min-width: 900px) and (max-width: 1000px) { .logo-texte { font-size: 1rem; } .menu a { font-size: .82rem; } .menu { gap: .5rem; } }
@media (min-width: 900px) and (max-width: 1119px) { .menu { display: none !important; } .menu-bouton { display: inline-block !important; } .menu-mobile.ouvert { display: block !important; } }

/* 29. Nom de la société en grand dans l'en-tête */
@media (min-width: 1120px) { .logo-texte { font-size: 2.2rem; letter-spacing: .03em; } .logo img { height: 66px; } .logo { gap: .7rem; } }
@media (min-width: 900px) and (max-width: 1119px) { .logo-texte { font-size: 1.7rem; } .logo img { height: 54px; } }
@media (max-width: 899px) { .logo-texte { font-size: 1.35rem; } .logo img { height: 44px; } }
@media (max-width: 420px) { .logo-texte { font-size: 1.2rem; } .logo img { height: 40px; } }
@media (max-width: 380px) { .logo-texte { font-size: 1.05rem; } .logo img { height: 36px; } }

/* 30. Bande de confiance, icônes de services, harmonisation des photos */
.bande-confiance { background: #e9f6ee; border-bottom: 1px solid var(--bordure); padding: .9rem 0; }
.bande-liste { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; justify-content: center; font-weight: 600; color: #0b3d1f; font-size: .98rem; text-align: center; }
.icone { color: var(--bleu); margin-bottom: .75rem; }
.icone svg { display: block; }
.carte > img, .illustration { filter: saturate(.92) contrast(1.03) brightness(1.02); }
@media (prefers-color-scheme: dark) { .bande-confiance { background: #14301f; color: #bfeccd; } .bande-liste { color: #bfeccd; } }

.page-app { padding: 0; }

/* 31. Icônes devant les coordonnées */
.contact-ligne { display: flex; align-items: flex-start; gap: .65rem; padding-left: 0; }
.contact-ligne::before { content: none; }
.contact-ligne svg { flex-shrink: 0; color: var(--bleu); margin-top: .25rem; }

/* 32. Coordonnées : pas de coche, texte bien aligné */
.coches li.contact-ligne { padding-left: 0; }
.coches li.contact-ligne::before { content: none; }
.contact-texte { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* 33. Fiches produits de la boutique */
.produit-galerie { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.produit-galerie img { width: 100%; height: auto; border-radius: 8px; aspect-ratio: 4 / 3; object-fit: cover; }
.badge-categorie { align-self: flex-start; font-size: .8rem; font-weight: 700; background: #e9f6ee; color: #0b3d1f; border-radius: 6px; padding: .2rem .55rem; margin-bottom: .5rem; }
.stock { font-weight: 600; color: #0b3d1f; margin: 0 0 .5rem; }
.stock-rupture { color: #b00020; }
@media (prefers-color-scheme: dark) { .badge-categorie { background: #14301f; color: #bfeccd; } .stock { color: #bfeccd; } .stock-rupture { color: #ff8a8a; } }

/* 34. Galerie produit : grande photo puis vignettes */
.produit-galerie img:first-child { width: 100%; }
.produit-galerie img:not(:first-child) { width: calc(33.333% - .35rem); aspect-ratio: 1 / 1; }
