/* =====================================================================
   D507 v2 — CONTRAST SYSTEMIC FIX (Doctrine 6 STRIKE RULE)
   Loaded GLOBALLY via nginx sub_filter, AFTER weval-master-theme.css
   Targets: black-on-black + cream-on-cream recurrent patterns
   ===================================================================== */

/* === PATTERN 1: Hero sections avec dark gradients (.hero) === */
.hero[style*="linear-gradient"][style*="0f172a"] *,
.hero[style*="linear-gradient"][style*="1e1b4b"] *,
.hero[style*="linear-gradient"][style*="0a0d14"] *,
.hero[style*="linear-gradient"][style*="1e40af"] *,
section.hero[style*="linear-gradient"] h1,
section.hero[style*="linear-gradient"] h2,
section.hero[style*="linear-gradient"] h3 {
    color: #fff !important;
}
.hero[style*="linear-gradient"][style*="0f172a"] p,
.hero[style*="linear-gradient"][style*="1e1b4b"] p,
.hero[style*="linear-gradient"][style*="1e40af"] p {
    color: #cbd5e1 !important; /* WCAG AA on dark navy */
}

/* === PATTERN 2: Inline-style dark backgrounds → light text descendants === */
[style*="background:#0a0d14"] :not(button):not(input):not([style*="color"]),
[style*="background:#0e1219"] :not(button):not(input):not([style*="color"]),
[style*="background:#1a1f2d"] :not(button):not(input):not([style*="color"]),
[style*="background:#0f172a"] :not(button):not(input):not([style*="color"]),
[style*="background:#12131A"] :not(button):not(input):not([style*="color"]),
[style*="background:#1e1b4b"] :not(button):not(input):not([style*="color"]),
[style*="background:#3730a3"] :not(button):not(input):not([style*="color"]),
[style*="background-color:#0a0d14"] :not(button):not(input):not([style*="color"]),
[style*="background-color:#0f172a"] :not(button):not(input):not([style*="color"]) {
    color: #e2e8f0 !important;
}

/* === PATTERN 3: D490 stats strip (CONFIANCE) — demo-agents.html === */
[class*="d490-stats"] *,
[class*="d490-trust"] *,
[id*="d490-stats"] *,
[class*="trust-strip"] *,
[class*="confiance"] *,
[class*="results-strip"] *,
[class*="kpi-strip"] * {
    color: #fff !important;
}
[class*="d490-stats"] .kn,
[class*="d490-stats"] .kl,
[class*="d490-trust"] .kn,
[class*="d490-trust"] .kl,
[class*="confiance"] .kn,
[class*="confiance"] .kl {
    color: #fff !important;
}

/* === PATTERN 4: Cream/light theme — H1/H2/H3 sans color explicite === */
/* weval-master-theme force body color:#2a2520 sur cream → titres invisibles */
:root[data-theme="light"] h1:not([style*="color"]):not([class*="hero"]),
:root[data-theme="light"] h2:not([style*="color"]):not([class*="hero"]):not(.hero h2),
:root[data-theme="light"] h3:not([style*="color"]):not([class*="hero"]):not(.hero h3) {
    color: #1a1a1a !important;
}

/* Pages cream sans data-theme : body bg #faf*, #fff* → titres dark */
body[style*="background:#fff"] h1:not([style*="color"]),
body[style*="background:#fff"] h2:not([style*="color"]),
body[style*="background:#faf"] h1:not([style*="color"]),
body[style*="background:#faf"] h2:not([style*="color"]) {
    color: #1B1B1B !important;
}

/* === PATTERN 5: WEVIA-ERP-UNIFIED pattern — body bg cream + h2 inherit === */
/* La page utilise --bg + --text via :root data-theme, et les h2/.hero h2 sans color */
.hero h2[id="hero-title"],
.hero h2#hero-title,
[class*="hero"] h2:not([style*="color"]) {
    color: #1a1a1a !important;
}
:root[data-theme="dark"] [class*="hero"] h2:not([style*="color"]) {
    color: #fff !important;
}

/* === PATTERN 6: Badges sur cream theme — texte dark === */
:root[data-theme="light"] .badge:not([style*="color"]):not([class*="badge-dark"]) {
    color: inherit;
}

/* === PATTERN 7: Lone <span class="kl"> labels en gray sur dark === */
:root[data-theme="dark"] .kl,
[style*="background:#0a"] .kl,
[style*="background:#0f"] .kl,
[style*="background:#1e"] .kl {
    color: #cbd5e1 !important;
}

/* === PATTERN 8: Conic-gradient orbs (mascots) === */
.d479-wevia-orb .d479-wevia-icon {
    color: #fff;
}

/* === DEV ONLY (commentable en prod) === */
/* Marqueur visuel des combinaisons impossibles */
/*
[style*="color:#fff"][style*="background:#fff"],
[style*="color:#000"][style*="background:#000"] {
    outline: 2px dashed #ef4444 !important;
}
*/

/* === D700 UNIVERSAL CONTRAST GUARD APPENDED 9mai2026 17:12 === */
/**
 * D700 UNIVERSAL CONTRAST GUARD - 9mai 2026 17:10
 * Doctrine 6 SYSTEMIQUE - patch tous les patterns clair-sur-clair / dark-sur-dark
 * 
 * Couvre 13 patterns identifies recurrents:
 * 1. text-gradient + transparent fill sur bg clair
 * 2. .speech .bubble .tooltip white-on-white
 * 3. .badge .pill .chip same-color
 * 4. .hero-title gradient cream/white invisible  
 * 5. Header brand "logo" texte
 * 6. KPI values
 * 7. Status pills
 * 8. Buttons disabled etat
 * 9. Form labels
 * 10. Modal/dialog text
 * 11. Card titles/descriptions
 * 12. Toast notifications
 * 13. Dark mode override conflicts
 * 
 * Strategy: Cascade !important avec specificity normale (eviter override total)
 * Approche fallback solid color + contraste WCAG AAA
 */

:root {
  /* === D700 SAFE TEXT COLORS === */
  --d700-text-on-light: #1f2937;        /* WCAG AAA 12.6:1 sur cream/white */
  --d700-text-on-light-muted: #4b5563;   /* WCAG AAA 7.1:1 */
  --d700-text-on-light-soft: #6b7280;    /* WCAG AA 5.5:1 */
  --d700-text-on-dark: #f1f5f9;          /* WCAG AAA */
  --d700-text-on-dark-muted: #cbd5e1;    /* WCAG AA */
  --d700-violet-fallback: #6d28d9;       /* WEVAL violet AAA on cream */
  --d700-violet-light: #8b5cf6;
  --d700-success: #166534;                /* AAA on cream */
  --d700-amber: #92400e;                  /* AAA on cream */
  --d700-error: #991b1b;                  /* AAA on cream */
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 1: text-gradient + webkit-text-fill transparent (le pire)
   ═══════════════════════════════════════════════════════════════════ */
.text-gradient,
[class*="text-gradient"],
[style*="webkit-text-fill-color: transparent"]:not([style*="background"]),
[style*="-webkit-text-fill-color:transparent"]:not([style*="background"]) {
  color: var(--d700-violet-fallback) !important;
  /* Si gradient existe ET contient #fff/#fafa.. force violet WEVAL */
}

/* Si gradient explicit cream/white -> override violet */
[style*="linear-gradient"][style*="#f8fafc"],
[style*="linear-gradient"][style*="#fafbff"],
[style*="linear-gradient"][style*="#FAF8F5"],
[style*="linear-gradient"][style*="#ffffff"],
[style*="linear-gradient"][style*="rgb(255"],
[class*="text-gradient"] {
  background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 50%, #8b5cf6 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}

@supports not (-webkit-background-clip: text) {
  .text-gradient,
  [class*="text-gradient"] {
    color: var(--d700-violet-fallback) !important;
    background: none !important;
    -webkit-text-fill-color: var(--d700-violet-fallback) !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 2: Speech bubbles / tooltips / popovers white-on-white
   ═══════════════════════════════════════════════════════════════════ */
.speech,
.bubble,
.tooltip,
[class*="speech"],
[class*="bubble"],
[class*="popover"],
[role="tooltip"] {
  color: var(--d700-text-on-light) !important;
  /* Force minimum readable color */
}

.speech *,
.bubble *,
.tooltip *,
[class*="bubble"] *,
[role="tooltip"] * {
  color: inherit;
}

/* Speech with explicit white/cream background -> dark text */
.speech[style*="background"][style*="rgba(255"],
.speech[style*="background"][style*="#fff"],
.speech[style*="background"][style*="white"],
[class*="bubble"][style*="background"][style*="rgba(255"],
[class*="bubble"][style*="background"][style*="#fff"] {
  color: var(--d700-text-on-light) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 3: Hero titles invisible
   ═══════════════════════════════════════════════════════════════════ */
.hero-title,
.hero-title.text-gradient,
[class*="hero"] [class*="title"] {
  color: var(--d700-violet-fallback) !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  font-weight: 700 !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 4: Headers + brand + logo
   ═══════════════════════════════════════════════════════════════════ */
.app-header,
.app-header *:not([class*="brand-icon"]):not([class*="positive"]):not([class*="negative"]),
header.app-header *,
[class*="app-header"] [class*="brand"]:not([class*="brand-icon"]),
[class*="app-header"] h1,
[class*="app-header"] [class*="title"] {
  color: var(--d700-text-on-light) !important;
  overflow: visible !important;
  white-space: nowrap !important;
}

/* Header containers avoid text cutoff */
header, .header, .app-header, .top-header, [class*="navbar"] {
  overflow: visible !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 5: KPI / pills / chips
   ═══════════════════════════════════════════════════════════════════ */
[class*="kpi"]:not([style*="color"]),
[class*="pill"]:not([style*="color"]),
[class*="chip"]:not([style*="color"]),
[class*="stat-pill"],
[class*="stat-value"]:not([style*="color"]) {
  color: var(--d700-text-on-light) !important;
}

/* Status semantic colors (override generic) */
[class*="kpi-green"], [class*="status-ok"], [class*="status-success"],
[class*="positive"]:not([class*="negative"]) { 
  color: var(--d700-success) !important; 
}
[class*="kpi-amber"], [class*="status-warn"], [class*="status-pending"] { 
  color: var(--d700-amber) !important; 
}
[class*="kpi-red"], [class*="status-error"], [class*="negative"] { 
  color: var(--d700-error) !important; 
}
[class*="kpi-violet"], [class*="status-live"] { 
  color: var(--d700-violet-fallback) !important; 
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 6: Cards on cream/white background
   ═══════════════════════════════════════════════════════════════════ */
.card[style*="background:#fff"]:not([style*="color"]),
.card[style*="background: #fff"]:not([style*="color"]),
.card[style*="background:#fafa"]:not([style*="color"]),
[class*="card"][style*="background:#fff"] *:not([class*="text-"]):not([style*="color"]) {
  color: var(--d700-text-on-light);
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 7: Headings without explicit color
   ═══════════════════════════════════════════════════════════════════ */
body h1:not([style*="color"]):not([class*="text-"]):not([class*="hero"]):not(.pitch *):not(.pitch),
body h2:not([style*="color"]):not([class*="text-"]):not([class*="hero"]):not(.pitch *):not(.pitch),
body h3:not([style*="color"]):not([class*="text-"]):not([class*="hero"]):not(.pitch *):not(.pitch),
body h4:not([style*="color"]):not([class*="text-"]):not(.pitch *):not(.pitch) {
  color: var(--d700-text-on-light) !important;
}

/* D700-FIX: scope dark sections - text must be light */
body .pitch h1:not([style*="color"]),
body .pitch h2:not([style*="color"]),
body .pitch h3:not([style*="color"]),
body .pitch h4:not([style*="color"]),
body .pitch h5:not([style*="color"]),
body .pitch h6:not([style*="color"]),
body .pitch p:not([style*="color"]),
body .ct h1:not([style*="color"]),
body .ct h2:not([style*="color"]),
body .ct h3:not([style*="color"]),
body .ct h4:not([style*="color"]),
body .ct p:not([style*="color"]),
body section[style*="linear-gradient(135deg, #6366f1"] h1:not([style*="color"]),
body section[style*="linear-gradient(135deg, #6366f1"] h2:not([style*="color"]),
body section[style*="linear-gradient(135deg, #6366f1"] h3:not([style*="color"]),
body section[style*="linear-gradient(135deg, #6366f1"] h4:not([style*="color"]),
body section[style*="linear-gradient(135deg, #6366f1"] p:not([style*="color"]),
body section[style*="linear-gradient(135deg,#6366f1"] h1:not([style*="color"]),
body section[style*="linear-gradient(135deg,#6366f1"] h2:not([style*="color"]),
body section[style*="linear-gradient(135deg,#6366f1"] h3:not([style*="color"]),
body section[style*="linear-gradient(135deg,#6366f1"] h4:not([style*="color"]),
body section[style*="linear-gradient(135deg,#6366f1"] p:not([style*="color"]) {
  color: #fff !important;
}

/* Dans contexte dark explicite -> texte clair */
[data-theme="dark"] body h1:not([style*="color"]),
body.theme-night h1:not([style*="color"]),
body[style*="background:#0"] h1:not([style*="color"]) {
  color: var(--d700-text-on-dark) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 8: Modals / dialogs
   ═══════════════════════════════════════════════════════════════════ */
.modal:not([style*="background"]) *:not([class*="text-"]):not(button):not(input),
[role="dialog"] *:not([class*="text-"]):not(button):not(input),
[class*="modal"]:not([style*="background"]) > div *:not([class*="text-"]) {
  color: var(--d700-text-on-light);
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 9: Form labels + placeholders
   ═══════════════════════════════════════════════════════════════════ */
label:not([style*="color"]) {
  color: var(--d700-text-on-light) !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--d700-text-on-light-soft) !important;
  opacity: 1 !important;
}

input:not([style*="color"]),
textarea:not([style*="color"]),
select:not([style*="color"]) {
  color: var(--d700-text-on-light) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 10: Toast / notifications
   ═══════════════════════════════════════════════════════════════════ */
.toast:not([style*="color"]),
[class*="toast"]:not([style*="color"]),
[class*="notification"]:not([style*="color"]),
[class*="alert"]:not([style*="background:#0"]):not([class*="alert-dark"]) {
  color: var(--d700-text-on-light) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 11: Logout button (recurrent global)
   ═══════════════════════════════════════════════════════════════════ */
button[onclick*="logout"]:not([style*="color"]),
a[href*="logout"]:not([style*="color"]),
.logout:not([style*="color"]),
[class*="logout"]:not([style*="color"]) {
  color: var(--d700-text-on-light-muted) !important;
  background: transparent !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  padding: 6px 14px !important;
}

button[onclick*="logout"]:hover,
a[href*="logout"]:hover,
.logout:hover {
  color: var(--d700-violet-fallback) !important;
  border-color: var(--d700-violet-fallback) !important;
  background: rgba(124,58,237,0.05) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 12: Disabled buttons (a11y)
   ═══════════════════════════════════════════════════════════════════ */
button:disabled,
[disabled]:not([class*="text-"]) {
  color: var(--d700-text-on-light-soft) !important;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

/* ═══════════════════════════════════════════════════════════════════
   PATTERN 13: Force focus visible AAA
   ═══════════════════════════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--d700-violet-fallback) !important;
  outline-offset: 2px !important;
}

/* D702 v3 ULTRA SPECIFICITY 9mai 19:05 */

html body div.dc-erp,
html body div.dc-erp[class],
html body [class*="dc-erp"][class] {
  color: #1e293b !important;
  background-color: #eef2ff !important;
  font-weight: 700 !important;
}

html body div.dc-pain,
html body div.dc-pain[class],
html body [class*="dc-pain"][class] {
  color: #991b1b !important;
}

html body div.dc-m,
html body div.dc-m[class] {
  color: #475569 !important;
}

html body span.gp,
html body span.gp[class],
html body .gp[class] {
  color: #7f1d1d !important;
  background-color: #fee2e2 !important;
  font-weight: 700 !important;
}

/* D701-ULTIMATE 9mai 19:15 - Comprehensive widget dedup */

@media (min-width: 769px) {
  body #d483-live-widget {
    position: fixed !important;
    bottom: 96px !important;
    right: 24px !important;
    top: auto !important;
    z-index: 99950 !important;
  }
  body #d470-fab {
    position: fixed !important;
    bottom: 168px !important;
    right: 24px !important;
    top: auto !important;
    z-index: 99955 !important;
  }
  body #d466-sticky-cta-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 99940 !important;
  }
  /* D507 v9 10mai - REMOVED bad d701 floating-cta rule (broke layout)
     See d701-desktop-fix.css for correct version */
  body [class*="floating-cta"]:not([class*="bar"]):not(#d466-sticky-cta-bar) {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    padding-right: 100px !important;
    z-index: 99945 !important;
  }
}

@media (max-width: 768px) {
  body #d466-sticky-cta-bar {
    bottom: 0 !important;
    z-index: 99940 !important;
  }
}

/* =====================================================================
   D507 v3 - APPENDED 10mai2026 - ROOT CAUSE FIX (Strike Rule applied)
   Generic patterns to cover ALL future components without enumeration:
   - Gradient backgrounds without bg-color fallback
   - Sections with violet/purple/dark linear-gradients
   - Generic prefix matchers (p[0-9]+-*) for future component naming
   ===================================================================== */

/* === PATTERN: ANY element with linear-gradient inline OR class-based ===
   Rule: if has linear-gradient AND text is white/light, force bg-color fallback */

/* Sections with violet gradients (.pitch + future violet sections) */
.pitch,
.pitch-feature,
[class*="pitch"]:not(.pitch-btn),
section[class*="cta"]:not(.cta-light),
[class*="-violet"],
[class*="-purple"],
[style*="linear-gradient(135deg, #6366f1"],
[style*="linear-gradient(135deg,#6366f1"],
[style*="linear-gradient(135deg, rgb(99, 102, 241)"] {
    background-color: #6366f1 !important; /* Fallback for WCAG checkers */
}

.pitch * { color: #fff !important; }
.pitch h2, .pitch h3, .pitch h4 { color: #fff !important; font-weight: 800; }
.pitch p { color: rgba(255,255,255,0.95) !important; }
.pitch-feature {
    background-color: rgba(99,102,241,0.85) !important;
    border: 1px solid rgba(255,255,255,0.25);
}
.pitch-feature h4 { color: #fff !important; }
.pitch-feature p { color: rgba(255,255,255,0.92) !important; }

/* Hero CTAs with linear-gradient */
.hero-cta,
.p36-roi-cta,
.pitch-btn:not(.outlined),
a[class*="-cta"]:not([class*="outlined"]),
button[class*="-cta"]:not([class*="outlined"]) {
    background-color: #6366f1 !important;
    color: #fff !important;
}
.pitch-btn.outlined { 
    background-color: transparent !important; 
    color: #fff !important; 
    border: 2px solid rgba(255,255,255,0.6) !important; 
}

/* Generic: any text-white element with no bg-color fallback gets a safe parent bg */
[style*="color:#fff"]:not([style*="background"]):not(button):not(a),
[style*="color: #fff"]:not([style*="background"]):not(button):not(a),
[style*="color:white"]:not([style*="background"]):not(button):not(a) {
    /* Don't override - parents must provide bg */
}

/* === PATTERN: GENERIC PREFIX MATCHERS for future components === */
/* p2x / p3x / p4x prefix conventions (D-AUDIT batches) */
/* Default safe colors for any p2x-* p3x-* card with white parent */
[id^="p2"][id*="-"], [id^="p3"][id*="-"], [id^="p4"][id*="-"] {
    /* Containers OK */
}

/* Any descendants of dark sections must be light */
[style*="background:#0f172a"] *,
[style*="background:#0a0a14"] *,
[style*="background:#0a0d14"] *,
[style*="background:#1e1b4b"] *,
[style*="background:linear-gradient(135deg,#0f172a"] *,
[style*="background:linear-gradient(135deg, #0f172a"] *,
[style*="background: linear-gradient(135deg, #0f172a"] * {
    color: inherit;
}
.hero[style*="0f172a"] h1, .hero[style*="0f172a"] h2, 
.hero[style*="1e1b4b"] h1, .hero[style*="1e1b4b"] h2 {
    color: #fff !important;
}

/* === PATTERN: P28-P38 specific guards (current batch) === */
.p28-case-card { background: #fff !important; }
.p28-case-card * { color: inherit; }
.p28-case-logo { color: #1e293b !important; font-weight: 800; }
.p28-case-sector { color: #6366f1 !important; }
.p28-case-quote { color: #475569 !important; }
.p28-case-result-num { color: #047857 !important; }
.p28-case-result-lbl { color: #64748b !important; }

.p35-analyst-card { background: #fff !important; }
.p35-analyst-card-name { color: #1e293b !important; }
.p35-analyst-card-quote { color: #475569 !important; }
.p35-analyst-card-source { color: #94a3b8 !important; }

.p36-roi-result { color: #fff !important; background-color: #0f172a !important; }
.p36-roi-result * { color: inherit; }
.p36-roi-result-num { color: #fff !important; }
.p36-roi-result-sub { color: #c7d2fe !important; }
.p36-roi-result-label { color: #a78bfa !important; }
.p36-roi-bd-num { color: #fff !important; }
.p36-roi-bd-lbl { color: #94a3b8 !important; }

.p36-phase-card { background: #fff !important; }
.p36-phase-name { color: #1e293b !important; }
.p36-phase-duration { color: #6366f1 !important; }
.p36-phase-desc { color: #64748b !important; }

.p36-urgency-card { background: #fff !important; }
.p36-urgency-name { color: #1e293b !important; }
.p36-urgency-desc { color: #475569 !important; }
.p36-urgency-deadline { color: #dc2626 !important; }

/* Maturity public page guards */
.score-num { color: #047857 !important; }
.axis-card { background: #fff !important; }
.axis-name { color: #1e293b !important; }
.axis-pct { color: #10b981 !important; font-weight: 900; }
.axis-detail { color: #64748b !important; }
.compliance-card { background: #fff !important; }
.compliance-name { color: #1e293b !important; }
.compliance-desc { color: #475569 !important; }

/* === ANTI-WHITE-ON-WHITE GUARD === */
/* Force any white text to have a non-white background */
*[style*="color:#fff"] { background-color: inherit; }
*[style*="color: white"] { background-color: inherit; }

/* Final safety: detect if rendered with white-on-white at runtime via :where() */
@supports (color: color-mix(in srgb, white, black)) {
  /* Modern browsers - we trust JS guard */
}

/* === Dark mode fallback === */
body.p34-dark .axis-card,
body.p34-dark .compliance-card,
body.p34-dark .p28-case-card,
body.p34-dark .p35-analyst-card,
body.p34-dark .p36-phase-card,
body.p34-dark .p36-urgency-card { 
    background: #1e293b !important; 
    border-color: #334155 !important; 
}
body.p34-dark .axis-name,
body.p34-dark .compliance-name,
body.p34-dark .p28-case-logo,
body.p34-dark .p35-analyst-card-name,
body.p34-dark .p36-phase-name,
body.p34-dark .p36-urgency-name { color: #f1f5f9 !important; }
body.p34-dark .axis-detail,
body.p34-dark .compliance-desc,
body.p34-dark .p28-case-quote,
body.p34-dark .p35-analyst-card-quote,
body.p34-dark .p36-phase-desc,
body.p34-dark .p36-urgency-desc { color: #cbd5e1 !important; }

/* =====================================================================
   D507 v4 - 10mai2026 - REGRESSION FIX from v3
   v3 introduced bg=color on score-num. Fix:
   ===================================================================== */

/* Score num: vert on white BG, NOT vert on vert */
.score-num {
    color: #047857 !important;
    background: transparent !important;
    background-color: transparent !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: #047857 !important;
}

/* axis-pct must have darker green for AA */
.axis-pct {
    color: #047857 !important; /* darker green: 4.95:1 vs white */
    background: transparent !important;
}

/* Pitch text: force WHITE on violet, override any inherited dark text */
.pitch,
.pitch * {
    color: #fff !important;
}
.pitch h2, .pitch h3, .pitch h4 { 
    color: #fff !important; 
    -webkit-text-fill-color: #fff !important;
}
.pitch p, .pitch .pitch-feature p, .pitch-feature h4 { 
    color: #fff !important; 
    -webkit-text-fill-color: #fff !important;
}

/* Footer text on light bg: must be darker grey for AA */
.footer, .footer div {
    color: #475569 !important; /* 7.0:1 on white */
}

/* === Anti-regression: bg-color = color === */
.ca-tag {
    color: #1e293b !important;
    background: #eef2ff !important;
}
[class$="-tag"], 
[class*=" ca-tag"] {
    color: #1e293b !important;
    background-color: #eef2ff !important;
}

/* Score-num inner: even if container has gradient, ensure fg is forced */
.score-num,
.score-meta h2,
.axis-name {
    -webkit-text-fill-color: initial !important;
}
.score-num { -webkit-text-fill-color: #047857 !important; color: #047857 !important; }
.score-meta h2 { color: #047857 !important; }
.axis-name { color: #1e293b !important; }

/* Hero CTA on dark hero: white text + violet bg fallback */
.hero-cta { 
    color: #fff !important; 
    background-color: #6366f1 !important;
}

/* Pitch CTAs: white text + correct bg */
.pitch-btn:not(.outlined) { 
    color: #6366f1 !important; 
    background-color: #fff !important;
}
.pitch-btn.outlined { 
    color: #fff !important; 
    background-color: transparent !important; 
    border: 2px solid rgba(255,255,255,0.6) !important; 
}

/* Footer link */
.footer a { color: #6366f1 !important; }

/* =====================================================================
   D507 v5 - 10mai2026 - SPECIFICITY FIX
   weval-master-theme.css uses 'html body h2' (specificity 0,1,3)
   We must match or exceed to override (0,1,3) + !important
   ===================================================================== */

/* Pitch text - HIGH SPECIFICITY override */
html body .pitch,
html body .pitch * { color: #fff !important; }

html body .pitch h1,
html body .pitch h2,
html body .pitch h3,
html body .pitch h4,
html body .pitch h5,
html body .pitch h6 {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

html body .pitch p,
html body .pitch .pitch-feature p,
html body .pitch-feature h4 {
    color: #fff !important;
}

html body .pitch-btn:not(.outlined) { 
    color: #6366f1 !important; 
    background-color: #fff !important;
}
html body .pitch-btn.outlined { 
    color: #fff !important; 
    background-color: transparent !important;
}

html body .hero-cta,
html body a.hero-cta { 
    color: #fff !important; 
    background-color: #6366f1 !important;
}

/* Same approach for any other dark/violet sections we might add */
html body .ct,
html body .ct * { color: #fff !important; }
html body section[class*="cta"][class*="-violet"] *,
html body section[class*="cta"][class*="-purple"] * { color: #fff !important; }

/* Generic: any element inside section with linear-gradient violet/dark bg */
html body section[style*="linear-gradient"][style*="6366f1"] h1,
html body section[style*="linear-gradient"][style*="6366f1"] h2,
html body section[style*="linear-gradient"][style*="6366f1"] h3,
html body section[style*="linear-gradient"][style*="6366f1"] h4,
html body section[style*="linear-gradient"][style*="6366f1"] p {
    color: #fff !important;
}

/* WEVIA Score card on demo-agents (link to maturity) */
html body a.p35-analyst-card[style*="064e3b"] *,
html body a.p35-analyst-card[href*="maturity"] * {
    color: inherit !important;
}

/* Buttons with violet bg = white text */
html body button[style*="linear-gradient(135deg,#6366f1"],
html body button[style*="linear-gradient(135deg, #6366f1"],
html body a[style*="linear-gradient(135deg,#6366f1"],
html body a[style*="linear-gradient(135deg, #6366f1"] {
    color: #fff !important;
}

/* =====================================================================
   D700 P41 ROOT FIX - 10mai2026 Yacine D607
   Cause racine: D700 body h1:not([class*="hero"]) ne capte que la classe 
   directe du h1, pas son ascendant <header class="hero">. 
   Donc h1 sans classe -> piege par body h1:not(...) -> color #1f2937 sur fond dark.
   
   Fix: regles scope-style "dark section -> light text" avec specificite >= D700.
   Couvre TOUS futurs composants dark sans enumeration manuelle.
   ===================================================================== */

/* Hero/dark sections : force texte clair (specificite 0,2,4 = 24, mais !important gagne sur D700 !important) */
body header.hero h1,
body header.hero h2,
body header.hero h3,
body header.hero h4,
body header.hero p,
body section.hero h1,
body section.hero h2,
body section.hero h3,
body section.hero p,
body .hero h1,
body .hero h2,
body .hero h3,
body .hero h4,
body .hero-badge,
body [class*="hero-"]:not(.hero-cta) {
  color: #ffffff !important;
}

/* Hero badge: green pill - texte SOMBRE pour AAA */
body .hero-badge,
body header.hero .hero-badge,
body [class*="badge"][class*="hero"] {
  color: #064e3b !important;
  background: linear-gradient(135deg, #4ade80, #22c55e) !important;
  font-weight: 700 !important;
}

/* Hero CTA primary button - violet plus fonce pour AA strict (4.5+) */
body .hero-cta,
body header.hero .hero-cta,
body section.hero .hero-cta {
  color: #ffffff !important;
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  background-color: #4f46e5 !important;
  border: 2px solid #4f46e5 !important;
  font-weight: 600 !important;
}

/* Subtitle paragraph in hero - blanc cassé pour confort lecture */
body header.hero p,
body section.hero p,
body .hero p {
  color: #e2e8f0 !important;
}

/* Strong text in hero (le "100% Advanced" en gras) */
body header.hero strong,
body section.hero strong,
body .hero strong {
  color: #4ade80 !important;
}

/* Source line italic */
body header.hero em,
body section.hero em,
body .hero em {
  color: #94a3b8 !important;
}

/* =====================================================================
   D700 P41-v2 ROOT FIX VIA CSS VARIABLES - 10mai2026 D607
   Cascade-proof: au lieu de combattre specificite D700 = (0,5,2),
   on REDEFINIT la variable --d700-text-on-light dans le scope dark sections.
   var() resout au contexte le plus proche -> bulletproof.
   ===================================================================== */

/* Hero & dark sections: redefinir variable -> tout texte var(--d700-text-on-light) devient blanc */
header.hero,
section.hero,
.hero,
[data-bg="dark"],
[class*="dark-section"],
.pitch,
.ct {
  --d700-text-on-light: #ffffff;
  --weval-text: #ffffff;
}

/* Hero badge: green pill - texte SOMBRE (override la var pour ce composant interne) */
.hero-badge,
header.hero .hero-badge,
[class*="badge"][class*="hero"] {
  --d700-text-on-light: #064e3b;
  color: #064e3b !important;
  background: linear-gradient(135deg, #4ade80, #22c55e) !important;
  font-weight: 700 !important;
}

/* Hero CTA primary - violet bg + texte blanc */
.hero-cta,
header.hero .hero-cta,
section.hero .hero-cta {
  --d700-text-on-light: #ffffff;
  color: #ffffff !important;
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  background-color: #4f46e5 !important;
  border: 2px solid #4f46e5 !important;
  font-weight: 600 !important;
}

/* Subtitle paragraph dans hero - blanc cassé */
header.hero p,
section.hero p,
.hero p {
  --d700-text-on-light: #e2e8f0;
  color: #e2e8f0 !important;
}

/* Strong text dans hero (le "100% Advanced" en gras) */
header.hero strong,
section.hero strong,
.hero strong {
  --d700-text-on-light: #4ade80;
  color: #4ade80 !important;
}

/* Source line italic */
header.hero .hero-source,
section.hero .hero-source,
.hero .hero-source,
header.hero em,
.hero em {
  --d700-text-on-light: #94a3b8;
  color: #94a3b8 !important;
}
