/* ============================================================
   WEVIA CONTRAST GUARD v2 — extension pour patterns extrêmes
   Date: 02 mai 2026
   Ajouts vs v1 (FAQ déjà couvert):
   - kpi-pill cyan-on-cyan (contact.html)
   - nav-link slate-on-indigo (header global)
   - h4 sans classe (Nos bureaux white-on-white)
   - a.d472-skip-link (a11y)
   - patterns badge/chip avec same-color bug
   ============================================================ */

:root {
  --wcg-text-on-dark: #f1f5f9;
  --wcg-text-on-dark-muted: #cbd5e1;
  --wcg-text-on-light: #0f172a;
  --wcg-text-on-light-muted: #475569;
}

/* ZONE FAQ wr-faq-* (v1 conservé) */
.wr-faq-q { color: var(--wcg-text-on-dark) !important; background: #0f172a !important; font-weight: 600; }
.wr-faq-q:hover { color: #ffffff !important; }
.wr-faq-q span { color: inherit !important; }
.wr-faq-arrow { color: #6366f1 !important; }
.wr-faq-a, .wr-faq-a *, .wr-faq-a p { color: var(--wcg-text-on-dark-muted) !important; }
.wr-faq-a a { color: #818cf8 !important; }
.wr-faq-title { color: var(--wcg-text-on-dark) !important; }

/* ZONE FAQ d491-* */
.d491-faq-q, .d491-faq-q span { color: var(--wcg-text-on-dark) !important; }
.d491-faq-a, .d491-faq-a * { color: var(--wcg-text-on-dark-muted) !important; }
.d491-faq-title { color: var(--wcg-text-on-dark) !important; }

/* ZONE Modal wr-modal */
.wr-modal, .wr-modal h2, .wr-modal label { color: var(--wcg-text-on-dark) !important; }
.wr-modal p { color: var(--wcg-text-on-dark-muted) !important; }
.wr-modal input, .wr-modal select, .wr-modal textarea { color: var(--wcg-text-on-dark) !important; background: #1e293b !important; }
.wr-modal input::placeholder, .wr-modal textarea::placeholder { color: #64748b !important; }

/* ZONE Cases */
.wr-cases-section, .wr-cases-title, .wr-case-card h3 { color: var(--wcg-text-on-dark) !important; }
.wr-case-card p, .wr-case-card { color: var(--wcg-text-on-dark-muted) !important; }
.wr-case-card { background: #0f172a !important; }

/* ZONE theme-light button override fix */
body.theme-light .wr-faq-q,
body.theme-light .wr-cta-btn,
body.theme-light .wr-form-submit,
body.theme-light .wr-modal button,
body.theme-light .wr-faq-section button,
body.theme-light .wr-cases-section button,
body.theme-light .d491-faq-q,
body.theme-light [class^="wr-"] button:not(.wr-cta-close):not(.wr-modal-close) {
  color: var(--wcg-text-on-dark) !important;
}
body.theme-light .wr-cta-secondary { color: #a5b4fc !important; }

/* ============================================================
   v2 ADDITIONS — Patterns extrêmes que le runtime ne peut pas atteindre
   ============================================================ */

/* PATTERN 1: kpi-pill cyan-on-cyan (page contact.html — bug visible) */
.kpi-pill {
  color: #0f172a !important;
  font-weight: 600;
}
/* Variante avec bg explicite cyan/teal */
.kpi-pill[style*="background"], 
span.kpi-pill {
  color: #0f172a !important;
}

/* PATTERN 2: nav-link sur background indigo (header global) */
button.nav-link,
a.nav-link {
  color: #f1f5f9 !important;
}
button.nav-link:hover,
a.nav-link:hover {
  color: #ffffff !important;
}

/* PATTERN 3: h4 "Nos bureaux" white-on-white dans containers transparents */
h4:not([class]):not([id]) {
  color: var(--wcg-text-on-dark) !important;
}
/* h4 avec emoji 🌍 + texte simple = candidat fix */
h4 { color: var(--wcg-text-on-dark, #f1f5f9); }

/* PATTERN 4: skip-link a11y (apparaît en focus, doit être contrasté) */
a.d472-skip-link,
.skip-link {
  color: #ffffff !important;
  background: #0f172a !important;
  text-decoration: underline;
}
a.d472-skip-link:focus,
.skip-link:focus {
  outline: 3px solid #fbbf24 !important;
  outline-offset: 2px;
}

/* PATTERN 5: badges/chips/tags avec texte invisible (heuristique générique) */
.badge, .chip, .tag, .pill, .label-pill, .stat-pill,
[class*="-badge"], [class*="-chip"], [class*="-tag"], [class*="-pill"] {
  /* Si le bg est défini, force un text contrasté de base */
  font-weight: 600;
}
/* Si la couleur de fond est cyan/teal (pattern récurrent) */
.kpi-pill[style*="cyan"],
.kpi-pill[style*="22d3ee"],
[class*="-pill"][style*="cyan"],
[style*="background:#22d3ee"],
[style*="background: #22d3ee"],
[style*="background-color:#22d3ee"] {
  color: #0f172a !important;
}

/* PATTERN 6: Service-source slate-on-dark */
span.service-source { color: var(--wcg-text-on-dark-muted) !important; }

/* PATTERN 7: Hero h2 excellence-main-title sur cream */
h2.excellence-main-title { color: var(--wcg-text-on-light) !important; }

/* PATTERN 8: services-button et services-title */
button.services-button,
h4.services-title,
a.services-link { color: var(--wcg-text-on-light) !important; }

/* PATTERN 9: wr-service-link sur backgrounds clairs */
a.wr-service-link { color: var(--wcg-text-on-light) !important; font-weight: 600; }

/* PATTERN 10: Login labels (page wevia-master.html / admin.html) */
label[for*="user"], label[for*="pass"], label[for*="login"],
form label { color: var(--wcg-text-on-dark) !important; }

/* ============================================================
   ZONE generic dark-on-dark / light-on-light via inline style
   ============================================================ */
[style*="background:#0"] *:not([style*="color"]):not(.wr-cta-btn),
[style*="background: #0"] *:not([style*="color"]):not(.wr-cta-btn),
[style*="background:rgba(0,0,0"] *:not([style*="color"]),
[style*="background:rgba(15,23,42"] *:not([style*="color"]),
[style*="background:#1"] *:not([style*="color"]) {
  color: #cbd5e1;
}
[style*="background:#0"] h1, [style*="background:#0"] h2,
[style*="background:#0"] h3, [style*="background:#0"] h4,
[style*="background: #0"] h1, [style*="background: #0"] h2,
[style*="background: #0"] h3, [style*="background: #0"] h4,
[style*="background:#1"] h1, [style*="background:#1"] h2,
[style*="background:#1"] h3, [style*="background:#1"] h4 {
  color: #f1f5f9;
}

/* Light-on-light inverse */
[style*="background:#fff"] *:not([style*="color"]):not([class*="btn-primary"]):not([class*="cta-primary"]),
[style*="background: #fff"] *:not([style*="color"]):not([class*="btn-primary"]):not([class*="cta-primary"]),
[style*="background:#FFF"] *:not([style*="color"]):not([class*="btn-primary"]) {
  color: #0f172a;
}

/* ZONE A11Y focus visible */
.wr-faq-q:focus-visible,
.d491-faq-q:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* FIN — WEVIA CONTRAST GUARD v2 */
