/**
 * Contrast Fixes - Accessibility v9.1
 * Système de contraste automatique intelligent
 * - Fond clair (blanc/gris) = Texte noir/gris foncé
 * - Fond sombre (vert/bleu/jaune foncé) = Texte blanc
 *
 * @package Forever_BE_Premium
 * @version 9.1.0
 */

/* ==========================================================================
   CARDS WITH WHITE/LIGHT BACKGROUND - DARK TEXT (DEFAULT)
   ========================================================================== */

/* Cards avec fond blanc/clair - Texte sombre par défaut */
.card,
.product-card,
.benefit-card,
.testimonial-card,
.blog-card {
    background: #ffffff;
    color: #1f2937; /* Gris très foncé */
}

/* Titres sur fond blanc */
.card .card-title,
.product-card .product-card__title,
.benefit-card h3,
.testimonial-card h3,
.blog-card .blog-card__title {
    color: #1f2937 !important; /* Noir/gris très foncé */
}

/* Descriptions sur fond blanc */
.card .card-description,
.product-card .product-card__description,
.benefit-card p,
.testimonial-card p,
.blog-card .blog-card__excerpt {
    color: #4b5563 !important; /* Gris moyen */
}

/* Prix sur fond blanc */
.product-card .product-card__price {
    color: #006241 !important; /* Vert brand */
}

/* ==========================================================================
   CARDS WITH DARK BACKGROUNDS - WHITE TEXT
   ========================================================================== */

/* Product Cards avec fond VERT FONCÉ */
.product-card.bg-brand-green,
.product-card.bg-green-600,
.product-card.bg-green-700,
.product-card.bg-green-800,
.product-card.bg-green-900,
.benefit-card.bg-brand-green,
.benefit-card.bg-green-600,
.benefit-card.bg-green-700,
.benefit-card.bg-green-800,
.card.bg-brand-green,
.card.bg-green-600,
.card.bg-green-700,
.card.bg-green-800 {
    color: #ffffff !important;
    background-color: #006241 !important;
}

/* Product Cards avec fond BLEU FONCÉ */
.product-card.bg-blue-600,
.product-card.bg-blue-700,
.product-card.bg-blue-800,
.product-card.bg-blue-900,
.benefit-card.bg-blue-600,
.benefit-card.bg-blue-700,
.benefit-card.bg-blue-800,
.card.bg-blue-600,
.card.bg-blue-700,
.card.bg-blue-800 {
    color: #ffffff !important;
}

/* Product Cards avec fond JAUNE/GOLD FONCÉ */
.product-card.bg-yellow-600,
.product-card.bg-yellow-700,
.product-card.bg-yellow-800,
.benefit-card.bg-yellow-600,
.benefit-card.bg-yellow-700,
.card.bg-yellow-600,
.card.bg-yellow-700 {
    color: #1f2937 !important; /* Jaune foncé = texte noir pour contraste */
}

/* Tous les enfants des cards à fond sombre = texte blanc */
.product-card.bg-brand-green *,
.product-card.bg-green-600 *,
.product-card.bg-green-700 *,
.product-card.bg-green-800 *,
.product-card.bg-blue-600 *,
.product-card.bg-blue-700 *,
.product-card.bg-blue-800 *,
.benefit-card.bg-brand-green *,
.benefit-card.bg-green-600 *,
.benefit-card.bg-green-700 *,
.benefit-card.bg-blue-600 *,
.benefit-card.bg-blue-700 *,
.card.bg-brand-green *,
.card.bg-green-600 *,
.card.bg-green-700 *,
.card.bg-green-800 *,
.card.bg-blue-600 *,
.card.bg-blue-700 * {
    color: inherit;
}

/* ==========================================================================
   TITRES - CONTRAST RULES
   ========================================================================== */

/* Titres sur fond VERT/BLEU FONCÉ = Blanc */
.product-card.bg-brand-green .product-card__title,
.product-card.bg-green-600 .product-card__title,
.product-card.bg-green-700 .product-card__title,
.product-card.bg-green-800 .product-card__title,
.product-card.bg-blue-600 .product-card__title,
.product-card.bg-blue-700 .product-card__title,
.product-card.bg-blue-800 .product-card__title,
.benefit-card.bg-brand-green h3,
.benefit-card.bg-green-600 h3,
.benefit-card.bg-green-700 h3,
.benefit-card.bg-blue-600 h3,
.benefit-card.bg-blue-700 h3,
.card.bg-brand-green .card-title,
.card.bg-green-600 .card-title,
.card.bg-green-700 .card-title,
.card.bg-blue-600 .card-title,
.card.bg-blue-700 .card-title {
    color: #ffffff !important;
    font-weight: 700;
}

/* ==========================================================================
   DESCRIPTIONS - CONTRAST RULES
   ========================================================================== */

/* Descriptions sur fond VERT/BLEU FONCÉ = Blanc transparent 90% */
.product-card.bg-brand-green .product-card__description,
.product-card.bg-green-600 .product-card__description,
.product-card.bg-green-700 .product-card__description,
.product-card.bg-green-800 .product-card__description,
.product-card.bg-blue-600 .product-card__description,
.product-card.bg-blue-700 .product-card__description,
.benefit-card.bg-brand-green p,
.benefit-card.bg-green-600 p,
.benefit-card.bg-green-700 p,
.benefit-card.bg-blue-600 p,
.benefit-card.bg-blue-700 p,
.card.bg-brand-green .card-description,
.card.bg-green-600 .card-description,
.card.bg-green-700 .card-description,
.card.bg-blue-600 .card-description,
.card.bg-blue-700 .card-description {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ==========================================================================
   PRIX - CONTRAST RULES
   ========================================================================== */

/* Prix sur fond VERT/BLEU FONCÉ = Gold pour visibilité */
.product-card.bg-brand-green .product-card__price,
.product-card.bg-green-600 .product-card__price,
.product-card.bg-green-700 .product-card__price,
.product-card.bg-green-800 .product-card__price,
.product-card.bg-blue-600 .product-card__price,
.product-card.bg-blue-700 .product-card__price,
.product-card.bg-blue-800 .product-card__price {
    color: #fbbf24 !important; /* Gold pour contraste maximal */
    font-weight: 700;
}

/* ==========================================================================
   BUTTONS - CONTRAST RULES
   ========================================================================== */

/* Boutons sur fond BLANC = Vert avec texte blanc */
.product-card .btn,
.product-card .product-card__button,
.benefit-card .btn,
.card .card-button {
    background: #006241 !important;
    color: #ffffff !important;
    border: 2px solid #006241 !important;
}

.product-card .btn:hover,
.product-card .product-card__button:hover,
.benefit-card .btn:hover,
.card .card-button:hover {
    background: #004830 !important;
    color: #ffffff !important;
    border-color: #004830 !important;
}

/* Boutons sur fond VERT/BLEU FONCÉ = Blanc avec texte vert (inversé) */
.product-card.bg-brand-green .btn,
.product-card.bg-brand-green .product-card__button,
.product-card.bg-green-600 .btn,
.product-card.bg-green-700 .btn,
.product-card.bg-blue-600 .btn,
.product-card.bg-blue-700 .btn,
.benefit-card.bg-brand-green .btn,
.benefit-card.bg-green-600 .btn,
.benefit-card.bg-blue-600 .btn,
.card.bg-brand-green .card-button,
.card.bg-green-600 .card-button,
.card.bg-blue-600 .card-button {
    background: #ffffff !important;
    color: #006241 !important;
    border: 2px solid #ffffff !important;
}

.product-card.bg-brand-green .btn:hover,
.product-card.bg-brand-green .product-card__button:hover,
.product-card.bg-green-600 .btn:hover,
.product-card.bg-green-700 .btn:hover,
.product-card.bg-blue-600 .btn:hover,
.benefit-card.bg-brand-green .btn:hover,
.benefit-card.bg-green-600 .btn:hover,
.card.bg-brand-green .card-button:hover,
.card.bg-green-600 .card-button:hover {
    background: #fbbf24 !important;
    color: #1a1a1a !important;
    border-color: #fbbf24 !important;
}

/* ==========================================================================
   SIDEBAR FILTERS - TEXT CONTRAST
   ========================================================================== */

/* Active filter avec fond vert */
.sidebar-filter-link.active {
    background: linear-gradient(135deg, #2D7A3E 0%, #22543d 100%) !important;
    color: #ffffff !important;
}

.sidebar-filter-link.active * {
    color: #ffffff !important;
}

.sidebar-filter-link.active .sidebar-filter-count {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   SECTIONS WITH DARK GREEN BACKGROUND
   ========================================================================== */

/* Hero sections vertes */
.hero-section.bg-brand-green,
.hero-section.bg-green-800,
section.bg-brand-green,
section.bg-green-800 {
    color: #ffffff !important;
}

.hero-section.bg-brand-green h1,
.hero-section.bg-brand-green h2,
.hero-section.bg-brand-green h3,
.hero-section.bg-brand-green h4,
.hero-section.bg-brand-green h5,
.hero-section.bg-brand-green h6,
section.bg-brand-green h1,
section.bg-brand-green h2,
section.bg-brand-green h3,
section.bg-brand-green h4,
section.bg-brand-green h5,
section.bg-brand-green h6 {
    color: #ffffff !important;
}

.hero-section.bg-brand-green p,
.hero-section.bg-brand-green span,
.hero-section.bg-brand-green li,
section.bg-brand-green p,
section.bg-brand-green span,
section.bg-brand-green li {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* ==========================================================================
   TAILWIND UTILITY CLASSES - TEXT WHITE ON DARK BG
   ========================================================================== */

/* Forcer texte blanc sur fond vert Tailwind */
.bg-green-600,
.bg-green-700,
.bg-green-800,
.bg-green-900 {
    color: #ffffff !important;
}

.bg-green-600 *,
.bg-green-700 *,
.bg-green-800 *,
.bg-green-900 * {
    color: inherit;
}

/* Headings sur fond vert foncé */
.bg-green-600 h1,
.bg-green-600 h2,
.bg-green-600 h3,
.bg-green-700 h1,
.bg-green-700 h2,
.bg-green-700 h3,
.bg-green-800 h1,
.bg-green-800 h2,
.bg-green-800 h3,
.bg-green-900 h1,
.bg-green-900 h2,
.bg-green-900 h3 {
    color: #ffffff !important;
}

/* ==========================================================================
   BUTTONS - ACCESSIBLE CONTRAST
   ========================================================================== */

/* Boutons verts - texte blanc */
.btn-primary,
.btn-brand-green,
.bg-brand-green .btn,
button.bg-brand-green,
a.bg-brand-green {
    background: #006241 !important;
    color: #ffffff !important;
    border-color: #006241 !important;
}

.btn-primary:hover,
.btn-brand-green:hover {
    background: #004830 !important;
    color: #ffffff !important;
}

/* ==========================================================================
   TESTIMONIALS & REVIEWS - DARK BG
   ========================================================================== */

.testimonial-card.bg-brand-green,
.review-card.bg-brand-green {
    color: #ffffff !important;
}

.testimonial-card.bg-brand-green p,
.testimonial-card.bg-brand-green .testimonial-content,
.review-card.bg-brand-green p {
    color: rgba(255, 255, 255, 0.95) !important;
}

.testimonial-card.bg-brand-green .testimonial-author,
.review-card.bg-brand-green .author {
    color: #fbbf24 !important;
}

/* ==========================================================================
   ACCESSIBILITY - WCAG AA COMPLIANCE
   ========================================================================== */

/* Minimum contrast ratio 4.5:1 pour texte normal */
/* Minimum contrast ratio 3:1 pour texte large (18px+) */

/* Ensure links are visible on dark backgrounds */
.bg-brand-green a:not(.btn),
.bg-green-800 a:not(.btn),
section.bg-brand-green a:not(.btn) {
    color: #fbbf24 !important;
    text-decoration: underline;
}

.bg-brand-green a:not(.btn):hover,
.bg-green-800 a:not(.btn):hover {
    color: #ffffff !important;
}

/* Focus states - Always visible */
.bg-brand-green *:focus-visible,
.bg-green-800 *:focus-visible {
    outline: 2px solid #fbbf24 !important;
    outline-offset: 2px;
}

/* ==========================================================================
   COMPREHENSIVE GREEN BACKGROUND TEXT FIX v9.2
   Ensures ALL text on green backgrounds is WHITE/VISIBLE
   ========================================================================== */

/* ALL elements with inline green gradient backgrounds */
[style*="linear-gradient"][style*="#1e5a3e"],
[style*="linear-gradient"][style*="#006241"],
[style*="linear-gradient"][style*="#2d8659"],
[style*="linear-gradient"][style*="#2D7A3E"],
[style*="linear-gradient"][style*="#2d7a3e"],
[style*="linear-gradient"][style*="#004d33"],
[style*="background"][style*="#1e5a3e"],
[style*="background"][style*="#006241"],
[style*="background"][style*="#2d7a3e"],
[style*="background-color"][style*="#1e5a3e"],
[style*="background-color"][style*="#006241"] {
    color: #ffffff !important;
}

[style*="linear-gradient"][style*="#1e5a3e"] *,
[style*="linear-gradient"][style*="#006241"] *,
[style*="linear-gradient"][style*="#2d8659"] *,
[style*="linear-gradient"][style*="#2D7A3E"] *,
[style*="linear-gradient"][style*="#2d7a3e"] *,
[style*="linear-gradient"][style*="#004d33"] * {
    color: inherit;
}

/* Headings on green backgrounds - always white */
[style*="linear-gradient"][style*="#1e5a3e"] h1,
[style*="linear-gradient"][style*="#1e5a3e"] h2,
[style*="linear-gradient"][style*="#1e5a3e"] h3,
[style*="linear-gradient"][style*="#1e5a3e"] h4,
[style*="linear-gradient"][style*="#006241"] h1,
[style*="linear-gradient"][style*="#006241"] h2,
[style*="linear-gradient"][style*="#006241"] h3,
[style*="linear-gradient"][style*="#006241"] h4,
[style*="linear-gradient"][style*="#2d8659"] h1,
[style*="linear-gradient"][style*="#2d8659"] h2,
[style*="linear-gradient"][style*="#2d8659"] h3,
[style*="linear-gradient"][style*="#2d8659"] h4 {
    color: #ffffff !important;
}

/* Paragraphs on green backgrounds - white with slight transparency */
[style*="linear-gradient"][style*="#1e5a3e"] p,
[style*="linear-gradient"][style*="#006241"] p,
[style*="linear-gradient"][style*="#2d8659"] p,
[style*="linear-gradient"][style*="#2d7a3e"] p {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Spans and small text on green backgrounds */
[style*="linear-gradient"][style*="#1e5a3e"] span,
[style*="linear-gradient"][style*="#006241"] span,
[style*="linear-gradient"][style*="#2d8659"] span,
[style*="linear-gradient"][style*="#2d7a3e"] span {
    color: #ffffff !important;
}

/* Hero sections - ALL pages */
.livraison-hero,
.legal-hero,
.mentions-hero,
.faq-hero,
.contact-hero,
.affiliation-hero,
.affiliation-hero-premium,
.privacy-hero,
.about-hero,
.avis-hero {
    color: #ffffff !important;
}

.livraison-hero *,
.legal-hero *,
.mentions-hero *,
.faq-hero *,
.contact-hero *,
.affiliation-hero *,
.affiliation-hero-premium *,
.privacy-hero *,
.about-hero * {
    color: inherit;
}

.livraison-hero h1,
.livraison-hero h2,
.legal-hero h1,
.legal-hero h2,
.mentions-hero h1,
.mentions-hero h2,
.faq-hero h1,
.faq-hero h2,
.contact-hero h1,
.contact-hero h2,
.affiliation-hero h1,
.affiliation-hero h2,
.affiliation-hero-premium h1,
.affiliation-hero-premium h2,
.privacy-hero h1,
.privacy-hero h2 {
    color: #ffffff !important;
}

.livraison-hero p,
.legal-hero p,
.mentions-hero p,
.faq-hero p,
.contact-hero p,
.affiliation-hero p,
.affiliation-hero-premium p,
.privacy-hero p {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* CTA sections with green backgrounds */
.cgv-cta-section,
.support-section,
.contact-cta,
.final-cta-section,
.newsletter-section,
.fbe-blog-newsletter,
[class*="cta-section"] {
    color: #ffffff !important;
}

.cgv-cta-section h1, .cgv-cta-section h2, .cgv-cta-section h3,
.support-section h1, .support-section h2, .support-section h3,
.contact-cta h1, .contact-cta h2, .contact-cta h3,
.final-cta-section h1, .final-cta-section h2, .final-cta-section h3,
.newsletter-section h1, .newsletter-section h2, .newsletter-section h3,
.fbe-blog-newsletter h1, .fbe-blog-newsletter h2, .fbe-blog-newsletter h3 {
    color: #ffffff !important;
}

.cgv-cta-section p, .support-section p, .contact-cta p,
.final-cta-section p, .newsletter-section p, .fbe-blog-newsletter p {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Cards with green backgrounds */
.card.bg-brand-green,
.card.bg-green-700,
.card.bg-green-800,
.feature-card.bg-brand-green,
.benefit-card.bg-brand-green,
.step-card.bg-brand-green,
[class*="card"][style*="#1e5a3e"],
[class*="card"][style*="#006241"],
[class*="card"][style*="#2d8659"] {
    color: #ffffff !important;
}

.card.bg-brand-green h1, .card.bg-brand-green h2, .card.bg-brand-green h3, .card.bg-brand-green h4,
.feature-card.bg-brand-green h3,
.benefit-card.bg-brand-green h3,
.step-card.bg-brand-green h3 {
    color: #ffffff !important;
}

.card.bg-brand-green p,
.feature-card.bg-brand-green p,
.benefit-card.bg-brand-green p,
.step-card.bg-brand-green p {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Trust badges on hero sections */
.trust-badge,
.hero-badge,
.hero-trust-badge,
[class*="badge-premium"],
[class*="hero-badge"],
.livraison-hero__badge,
.mentions-hero-badge {
    color: #ffffff !important;
}

.trust-badge span,
.hero-badge span,
.hero-trust-badge span,
.livraison-hero__badge span,
.mentions-hero-badge span {
    color: #ffffff !important;
}

/* Highlight boxes on green backgrounds */
.guarantee-highlight,
.highlight-box--brand,
.highlight-box.bg-brand-green {
    color: #ffffff !important;
}

.guarantee-highlight h3,
.guarantee-highlight__title {
    color: #ffffff !important;
}

.guarantee-highlight p,
.guarantee-highlight__desc {
    color: rgba(255, 255, 255, 0.9) !important;
}

.guarantee-highlight__features li {
    color: #ffffff !important;
}

/* Stats on green backgrounds - use gold accent */
.faq-hero-stat-value,
.stats-value,
[class*="stat-number"],
[class*="stat-value"] {
    color: #fbbf24 !important;
}

/* Links on green backgrounds - yellow/gold for visibility */
/* IMPORTANT: Exclude dropdown menus which have their own styling */
[style*="linear-gradient"][style*="#1e5a3e"] > a:not(.btn):not(.cta-btn),
[style*="linear-gradient"][style*="#006241"] > a:not(.btn):not(.cta-btn),
.livraison-hero a:not(.btn):not(.cta-btn),
.legal-hero a:not(.btn):not(.cta-btn),
.support-section a:not(.btn):not(.cta-btn) {
    color: #fbbf24 !important;
    text-decoration: underline;
}

/* Exclude dropdown menus from gold link color - FORCE dark text */
[style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-wrapper a,
[style*="linear-gradient"][style*="#1e5a3e"] .dropdown-wrapper a,
[style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-blog a,
[style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-type-blog a,
[style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-blog a.menu-link,
[style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-blog a.mega-menu-header,
[style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-type-blog a.menu-link,
[style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-type-blog a.mega-menu-header {
    color: #374151 !important;
    text-decoration: none !important;
}

/* Dark mode - dropdown menus light text */
html.dark [style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-wrapper a,
html.dark [style*="linear-gradient"][style*="#1e5a3e"] .dropdown-wrapper a,
html.dark [style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-blog a,
html.dark [style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-type-blog a,
html.dark [style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-blog a.menu-link,
html.dark [style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-blog a.mega-menu-header,
html.dark [style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-type-blog a.menu-link,
html.dark [style*="linear-gradient"][style*="#1e5a3e"] .mega-menu-type-blog a.mega-menu-header {
    color: #94a3b8 !important;
}

[style*="linear-gradient"][style*="#1e5a3e"] > a:not(.btn):not(.cta-btn):hover,
[style*="linear-gradient"][style*="#006241"] > a:not(.btn):not(.cta-btn):hover {
    color: #ffffff !important;
}

/* Buttons on green backgrounds - keep white */
[style*="linear-gradient"][style*="#1e5a3e"] .btn,
[style*="linear-gradient"][style*="#006241"] .btn,
.support-section .btn,
.final-cta-section .btn {
    color: #ffffff !important;
}

/* Form inputs on green backgrounds */
[style*="linear-gradient"][style*="#1e5a3e"] input,
[style*="linear-gradient"][style*="#006241"] input,
.support-section input,
.newsletter-section input {
    color: #1f2937 !important;
    background: #ffffff !important;
}

[style*="linear-gradient"][style*="#1e5a3e"] input::placeholder,
[style*="linear-gradient"][style*="#006241"] input::placeholder {
    color: #6b7280 !important;
}

/* Icons on green backgrounds */
[style*="linear-gradient"][style*="#1e5a3e"] svg,
[style*="linear-gradient"][style*="#006241"] svg,
.livraison-hero svg,
.legal-hero svg,
.support-section svg {
    fill: #ffffff;
    stroke: #ffffff;
}

/* List items on green backgrounds */
[style*="linear-gradient"][style*="#1e5a3e"] li,
[style*="linear-gradient"][style*="#006241"] li,
.support-section li,
.guarantee-highlight li {
    color: #ffffff !important;
}

/* Special: Timeline dots - gold on dark mode, green on light */
.timeline__dot {
    background: #006241;
    border-color: #006241;
}

/* Special: Section numbers - gold accent */
.section-number {
    background: #fbbf24 !important;
    color: #1e5a3e !important;
}
