/* ============================================================
   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 */

/* === D854: architecture pages contrast fix === */
html body .node{background-color:#f0f4f8!important;border-color:#c5cbd5!important}
html body .node:hover{border-color:#6366f1!important;box-shadow:0 4px 12px rgba(99,102,241,0.15)!important}
html body .node.hub{background:linear-gradient(135deg,#e8e8f8,#f0f4f8)!important}
html body .node h4{color:#1B1B1B!important}
html body .node .d{color:#1B1B1B!important;font-size:10px!important;line-height:1.5!important}
html body .node .k{color:#1B1B1B!important;font-size:12px!important;font-weight:700!important}
html body .node .k.cy,html body .node .k.gr,html body .node .k.am{color:#1B1B1B!important}
html body .node .tags span,html body .node .tags div,html body .node .tags a{color:#1B1B1B!important;background:#e8ecf4!important;border:1px solid #c5cbd5!important}
html body .tier::before{background:#c5cbd5!important}
html body .grid>div{background-color:#f0f4f8!important;color:#1B1B1B!important;border:1px solid #c5cbd5!important}
html body .grid>div:hover{border-color:#6366f1!important}
html body section .node *,html body article .node *,html body .schema .node *,html body .tree .node *{color:#1B1B1B!important}
html body .node,html body .grid>div{--card:#f0f4f8!important;--dim:#1B1B1B!important;--cyan:#1B1B1B!important;--green:#1B1B1B!important;--amber:#1B1B1B!important}


/* ============================================================
   WEVIA CONTRAST GUARD — D-UXAUDIT 2026-07-10
   Verified-selector fixes from Playwright effective-bg audit.
   WCAG 2.1 AA (4.5:1 body / 3:1 large). Additive, class-scoped.
   Owner: Director UX pass. No _v2 file — appended to canonical guard.
   ============================================================ */

/* --- P1: .tag badges — indigo-on-indigo 1.75:1 (nos-solutions, actualites) --- */
/* Fix: dark purple text on pale purple fill -> ~12:1 */
span.tag,
.tag {
  color: #26215c !important;              /* purple-900 */
  background-color: #eeedfe !important;    /* purple-50 */
}
/* active nav pill same bug */
.nav-link.active,
.navlink.active,
a.active.tag,
.active.tag {
  color: #26215c !important;
  background-color: #eeedfe !important;
}

/* --- P2: .status-pill "We Recommend" — blue-on-blue 1:1 (technology-radar) --- */
.status-pill {
  color: #042c53 !important;               /* blue-900 */
  background-color: #e6f1fb !important;     /* blue-50 */
}

/* --- P3: Trust Center badge — green-on-green 1:1 --- */
.badge[style*="16"],
.trust .badge,
.badge.badge-trust {
  color: #04342c !important;               /* teal-900 */
  background-color: #e1f5ee !important;     /* teal-50 */
}

/* --- P4: use-cases category chips — text == bg color 1:1 --- */
/* These chips set color and background to the SAME hex. Force white text
   on the colored fill (fills are already saturated 600-level colors). */
.uc-tag, .case-tag, .sector-chip, .badge-sector,
[class*="chip"][style*="background"] {
  color: #ffffff !important;
}

/* --- P5: avatar initials — white on light gray 1.11:1 --- */
.avatar, .ceo-avatar, .author-avatar, .d492-ceo-avatar {
  color: #1e1b4b !important;               /* indigo-950 on light circle */
  background-color: #e0e7ff !important;     /* indigo-100 */
  font-weight: 600 !important;
}

/* --- P6: md-intro-badge — near-white on cream 1.06:1 --- */
.md-intro-badge {
  color: #26215c !important;
  background-color: #eeedfe !important;
}

/* --- P7: lang toggle buttons — white on cream 1.07:1 --- */
.weval-ml-btn, .lang-toggle, .btn-lang {
  color: #1e293b !important;
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}

/* --- P8: CTA buttons — white on indigo #6366f1 (4.47:1, just under) --- */
/* Darken the indigo fill to indigo-800 -> ~8:1 white text */
.service-button, .d497-cta, .d492-ceo-cta,
a.cta-primary, button.cta-primary,
.cta-btn-primary, .btn-primary-indigo {
  background-color: #312e81 !important;    /* indigo-900 */
  color: #ffffff !important;
}
/* audit / demo CTA anchors that were flagged white-on-white by parser:
   ensure the indigo fill is present and text white */
a[href*="audit"].btn,
a[href*="diagnostic"].btn {
  background-color: #312e81 !important;
  color: #ffffff !important;
}

/* --- P9: indigo link text on white (4.47:1 -> 7:1) --- */
.footer-nav-link, .contact-value, .d497-dept, .d492-ceo-role,
.p29-3d-count, a.link-indigo {
  color: #4338ca !important;               /* indigo-700, passes on white */
}

/* --- P10: .flag-tag FLAGSHIP eyebrow (4.04:1 -> 7:1) --- */
.flag-tag, .stag {
  color: #4338ca !important;               /* indigo-700 */
}

/* --- P11: suite count chips white-on-mid (3.1-3.7:1) --- */
/* Darken the chip backgrounds one step; text stays white */
.suite-cnt {
  color: #ffffff !important;
  font-weight: 600 !important;
}
.suite-cnt[style*="184"], .suite-cnt[style*="b88a2e"] { background-color:#8a5a00 !important; } /* amber darker */
.suite-cnt[style*="13, 148"], .suite-cnt[style*="0d9488"] { background-color:#0f5132 !important; } /* teal darker */
.suite-cnt[style*="220"], .suite-cnt[style*="dc3e3e"] { background-color:#991b1b !important; } /* red darker */

/* --- P12: muted grays just under threshold (author/office/subtitle) --- */
.author-context, .office-meta, .subtitle, .sd, .sub {
  color: #475569 !important;               /* slate-600, 7:1 on white */
}
.p29-3d-name, em.hero-em, .md-muted {
  color: #64748b !important;               /* slate-500, passes at 3:1 large */
}
/* office chips on gradient bg -> force readable */
.office {
  color: #f8fafc !important;
}

/* --- P13: Trust Center dark-bg headings reading dark (1.35:1) --- */
/* Page bg is #0a0a0c; these headings were dark slate. Force light. */
.trust h1, .trust h2, .trust-center h1, .trust-center h2,
body[data-page="trust"] h1, body[data-page="trust"] h2 {
  color: #f1f5f9 !important;
}

/* --- P14: category buttons on radar (3:1 -> 4.5:1) --- */
.cat-btn { color: #475569 !important; }
.cat-btn.active { color: #ffffff !important; }
.stats-val { color: #0f172a !important; }

/* --- P15: advisory footer links teal-on-dark (2.34:1) --- */
.advisory-footer a, footer .hover\:text-teal-400 {
  color: #5dcca5 !important;               /* teal-200 on dark */
}

/* ============================================================
   SPRINT3 A11Y — D-UXAUDIT 2026-07-11
   Touch targets >=44px (UI controls only; prose links WCAG-exempt),
   min font 12px on identified classes, skip-link focus styling.
   ============================================================ */

/* --- T1: nav & footer links — 44px hit area via padding --- */
.nav-link, .footer-nav-link, .lk, .contact-value,
a.hover\:text-teal-400, .text-gray-700 a, footer a {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 44px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

/* --- T2: demo-agents & CEO controls --- */
.d497-cta, .d497-filter-btn, .d492-ceo-cta, .et, .db,
.cat-btn, button.tag, .weval-ml-btn {
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* --- T3: carousel dots — keep visual size, expand hit area --- */
.carousel-3d-dot { position: relative !important; }
.carousel-3d-dot::before {
  content: '';
  position: absolute;
  inset: -16px;
}

/* --- T4: form selects --- */
select { min-height: 44px !important; }

/* --- F1: min 12px font on badge/meta classes (radar + demo + products + solutions) --- */
.tag, .suite-tag, .suite-cnt, .kpi-l, .flag-tag, .stag,
.status-pill, .card-stars-label, .card-lang, .card-license,
.replaces-badge, .d497-meta-item, .d497-dept, .gp,
.md-intro-badge, .badge {
  font-size: 12px !important;
  line-height: 1.4 !important;
}
/* demo-agents CTA text was <12 too */
.d497-cta { font-size: 13px !important; }

/* --- S1: skip-link visible & contrasted on focus --- */
a[href="#main"], a[href="#content"], .skip-link {
  position: absolute;
  left: -9999px;
}
a[href="#main"]:focus, a[href="#content"]:focus, .skip-link:focus {
  position: fixed !important;
  left: 12px !important;
  top: 12px !important;
  z-index: 99999 !important;
  background: #1e1b4b !important;
  color: #ffffff !important;
  padding: 12px 20px !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.3) !important;
}

/* --- SPRINT3-R2 2026-07-11: remaining identified selectors --- */
/* demo-agents: strong has own smaller rule, override explicitly */
.d497-meta-item strong, .d492-ceo-meta strong,
.dc-erp, .dc-m, .d492-ceo-role, .d492-ceo-meta,
.p29-3d-count, .p28-case-result-lbl,
.d453-scenario-btn .role, .d453-scenario-btn .ttl, .d453-scenario-btn .gain {
  font-size: 12px !important;
}
/* technology-radar legend */
.legend-count, .legend-title, .mono { font-size: 12px !important; }
/* service template footer link columns (44px hit area) */
.footer-links a {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 44px !important;
  padding: 8px 0 !important;
}
.logo { min-height: 44px !important; display: inline-flex !important; align-items: center !important; }

/* SPRINT3-R3: last identified classes (min-size bump, low-risk) */
.role, .ttl, .gain, .p36-partner-label { font-size: 12px !important; }

/* ============================================================
   D-REGRESSFIX 2026-07-11 — html body specificity beats late overrides
   Root cause: post-d979c CSS nuked button backgrounds on SPA pages;
   d812 (old protector) disabled by prior session. Charte d949 colors.
   ============================================================ */
html body .service-button, html body .wr-service-link,
html body .contact-button, html body .services-button {
  background-color: #6d28d9 !important;
  background-image: linear-gradient(135deg,#6d28d9,#7c3aed) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
html body .office, html body .office span { color: #f8fafc !important; }
html body nav .active, html body header .active,
html body .tag.active, html body .nav-link.active {
  color: #26215c !important;
  background-color: #eeedfe !important;
}

/* D-CAROUSEL-GHOST 2026-07-11: cartes 3D non-actives = texte fantome qui bave
   sur fond clair. On attenue fortement les cartes de profil (effet 3D garde),
   la carte .active reste pleine. */
html body .carousel-3d-card:not(.active) {
  opacity: 0.18 !important;
  filter: saturate(0.4) !important;
  transition: opacity .3s ease, filter .3s ease !important;
}
html body .carousel-3d-card:not(.active) .service-button,
html body .carousel-3d-card:not(.active) a,
html body .carousel-3d-card:not(.active) button {
  pointer-events: none !important;
}

/* D-LANGDOUBLON 2026-07-11 (Director): 2 boutons langue simultanes
   (#weval-lang-toggle "EN" + #weval-ml-btn multilingue). On garde le
   selecteur multilingue complet, on cache le toggle binaire doublon. */
html body #weval-lang-toggle { display: none !important; }

/* D-KILL-REVEAL 2026-07-11 (arbitrage council 5/6 SUPPRIMER, valide Directrice)
   .carousel-3d-* EXCLU volontairement (ordre Directrice: 3D garde). */
html body .wv-reveal, html body .weval-aos, html body [data-aos] {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}
