/**
 * FastFide — Dark mode
 *
 * Surcharges appliquées quand <html data-theme="dark">.
 * Chargé APRÈS main.css / components.css / modern.css : à spécificité égale,
 * ces règles l'emportent grâce à l'ordre de cascade.
 *
 * La palette (tokens) est définie dans main.css ([data-theme="dark"]). Ce fichier
 * ne traite que les couleurs codées « en dur » dans les composants existants.
 */

/* =========================================================
   1. Surfaces principales (cartes, panneaux)
   ========================================================= */

[data-theme="dark"] .card,
[data-theme="dark"] .pricing-card,
[data-theme="dark"] .testimonial,
[data-theme="dark"] .feature-plan-compare__col,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .sector-card,
[data-theme="dark"] .price-card,
[data-theme="dark"] .testimonial-card,
[data-theme="dark"] .step-bubble,
[data-theme="dark"] .problem-card,
[data-theme="dark"] .comparatif-table-wrap,
[data-theme="dark"] .blog-featured__grid,
[data-theme="dark"] .cookie-banner {
    background: var(--surface-card);
    border-color: var(--surface-border);
    color: var(--text-body);
}

[data-theme="dark"] .blog-sidebar-card {
    background: var(--surface-soft);
    border-color: var(--surface-border);
}

/* Cartes problème / solution : garder la teinte rouge/vert mais assombrie */
[data-theme="dark"] .ff-modern .problem-card--bad {
    background: linear-gradient(145deg, rgba(220, 38, 38, 0.12) 0%, var(--surface-card) 55%);
    border-color: rgba(248, 113, 113, 0.22);
}

[data-theme="dark"] .ff-modern .problem-card--good {
    background: linear-gradient(145deg, rgba(13, 148, 136, 0.14) 0%, var(--surface-card) 55%);
    border-color: rgba(52, 211, 153, 0.22);
}

[data-theme="dark"] .ff-modern .problem-list li {
    background: var(--surface-soft);
    border-color: var(--surface-border);
    color: var(--text-body);
}

[data-theme="dark"] .ff-modern .problem-vs {
    background: var(--surface-soft);
    border-color: var(--surface-border);
    color: var(--text-muted);
}

[data-theme="dark"] .ff-modern .step-bubble__circle {
    background: var(--surface-soft);
}

/* =========================================================
   2. Titres et textes codés en dur (#1f2937, #334155, #4b4f5c…)
   ========================================================= */

[data-theme="dark"] .ff-modern .section-title,
[data-theme="dark"] .ff-modern .feature-card__title,
[data-theme="dark"] .ff-modern .sector-card__title,
[data-theme="dark"] .ff-modern .price-card__name,
[data-theme="dark"] .ff-modern .price-card__amount,
[data-theme="dark"] .ff-modern .testimonial-card__name,
[data-theme="dark"] .ff-modern .step-bubble__title,
[data-theme="dark"] .ff-modern .dash-stat__value,
[data-theme="dark"] .ff-modern .floating-notif__title {
    color: var(--text-strong);
}

[data-theme="dark"] .ff-modern .section-subtitle,
[data-theme="dark"] .ff-modern .feature-card__text,
[data-theme="dark"] .ff-modern .sector-card__text,
[data-theme="dark"] .ff-modern .price-card__period,
[data-theme="dark"] .ff-modern .price-card__clients,
[data-theme="dark"] .ff-modern .testimonial-card__role,
[data-theme="dark"] .ff-modern .step-bubble__text,
[data-theme="dark"] .ff-modern .logos-bar-modern__caption {
    color: var(--text-muted);
}

[data-theme="dark"] .ff-modern .testimonial-card__text {
    color: var(--text-body);
}

[data-theme="dark"] .ff-modern .testimonial-card__author {
    border-top-color: var(--surface-border);
}

/* Icônes de fonctionnalités : garder l'accent mint, ajuster le fond */
[data-theme="dark"] .ff-modern .feature-card__icon {
    background: linear-gradient(135deg, rgba(24, 203, 150, 0.2) 0%, rgba(13, 148, 136, 0.12) 100%);
    border-color: rgba(24, 203, 150, 0.32);
    color: #34d399;
}

/* =========================================================
   3. Boutons
   ========================================================= */

[data-theme="dark"] .btn--outline {
    color: #34d399;
    border-color: #34d399;
}

[data-theme="dark"] .btn--outline:hover {
    background-color: rgba(24, 203, 150, 0.12);
}

[data-theme="dark"] .ff-modern .btn-ff-outline {
    color: #34d399;
    border-color: #34d399;
}

[data-theme="dark"] .ff-modern .btn-ff-outline:hover {
    background: rgba(24, 203, 150, 0.14);
    color: #6ee7b7;
    border-color: #6ee7b7;
}

/* =========================================================
   4. Formulaires
   ========================================================= */

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .faq-hero-search__input {
    background-color: var(--surface-soft);
    border-color: var(--surface-border);
    color: var(--text-strong);
}

[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder,
[data-theme="dark"] .faq-hero-search__input::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .form-group label {
    color: var(--text-body);
}

[data-theme="dark"] .form-success {
    background-color: rgba(24, 203, 150, 0.12);
    border-color: rgba(24, 203, 150, 0.35);
    color: #6ee7b7;
}

[data-theme="dark"] .form-success__title {
    color: #a7f3d0;
}

[data-theme="dark"] .form-error {
    background-color: rgba(220, 38, 38, 0.14);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fca5a5;
}

[data-theme="dark"] .contact-hero__title {
    color: var(--text-strong);
}

[data-theme="dark"] .contact-hero__subtitle {
    color: var(--text-body);
}

[data-theme="dark"] .contact-trust__item {
    background: rgba(24, 203, 150, 0.08);
    border-color: rgba(24, 203, 150, 0.22);
}

[data-theme="dark"] .contact-trust__label {
    color: var(--text-muted);
}

[data-theme="dark"] .contact-reason-chip {
    background: var(--surface-card);
    border-color: var(--surface-border);
    color: var(--text-body);
}

[data-theme="dark"] .contact-reason-chip:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

[data-theme="dark"] .contact-form-card,
[data-theme="dark"] .contact-success-card {
    background: var(--surface-card);
    border-color: var(--surface-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .contact-form-card__title,
[data-theme="dark"] .contact-success-card__title,
[data-theme="dark"] .contact-aside__title,
[data-theme="dark"] .contact-aside-block__title {
    color: var(--text-strong);
}

[data-theme="dark"] .contact-form-card__subtitle,
[data-theme="dark"] .contact-success-card__text,
[data-theme="dark"] .contact-aside-block__text {
    color: var(--text-body);
}

[data-theme="dark"] .contact-aside-block {
    background: rgba(24, 203, 150, 0.06);
    border-color: rgba(24, 203, 150, 0.15);
}

[data-theme="dark"] .contact-aside-block__icon {
    background: rgba(24, 203, 150, 0.15);
}

[data-theme="dark"] .form-group.is-invalid input,
[data-theme="dark"] .form-group.is-invalid select,
[data-theme="dark"] .form-group.is-invalid textarea {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15);
}

[data-theme="dark"] .form-field-error {
    color: #fca5a5;
}

[data-theme="dark"] .contact-form__mention a {
    color: #34d399;
}

/* =========================================================
   5. Tableaux (comparatifs, tarifs)
   ========================================================= */

[data-theme="dark"] .comparison-table,
[data-theme="dark"] .comparatif-table {
    background-color: var(--surface-card);
    color: var(--text-body);
}

[data-theme="dark"] .comparison-table thead th,
[data-theme="dark"] .comparatif-table thead th {
    background-color: var(--surface-soft);
    color: var(--text-strong);
    border-bottom-color: var(--surface-border);
}

[data-theme="dark"] .comparison-table tbody th,
[data-theme="dark"] .comparison-table tbody td,
[data-theme="dark"] .comparatif-table th,
[data-theme="dark"] .comparatif-table td {
    border-color: var(--surface-border);
    color: var(--text-body);
}

[data-theme="dark"] .comparison-table tbody th {
    background-color: var(--surface-card);
    color: var(--text-strong);
}

[data-theme="dark"] .comparison-table__plan--highlight,
[data-theme="dark"] .comparison-table__cell--highlight,
[data-theme="dark"] .comparatif-table__ff,
[data-theme="dark"] .comparatif-table__cell--ff {
    background-color: rgba(24, 203, 150, 0.12);
    color: var(--text-strong);
}

[data-theme="dark"] .ff-modern .comparison-table--ccm td {
    background: var(--surface-card);
    border-color: var(--surface-border);
    color: var(--text-body);
}

[data-theme="dark"] .ff-modern .comparison-table--ccm .comparison-table__cell--bad {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.12) 0%, var(--surface-card) 72%);
}

[data-theme="dark"] .ff-modern .comparison-table--ccm .comparison-table__cell--good {
    background: linear-gradient(90deg, rgba(24, 203, 150, 0.12) 0%, var(--surface-card) 74%);
}

/* =========================================================
   6. FAQ accordion (Bootstrap)
   ========================================================= */

[data-theme="dark"] .ff-modern .faq-bs .accordion-item {
    background: var(--surface-card);
    border-color: var(--surface-border);
}

[data-theme="dark"] .ff-modern .faq-bs .accordion-button {
    background-color: var(--surface-card);
    color: var(--text-strong);
}

[data-theme="dark"] .ff-modern .faq-bs .accordion-button:not(.collapsed) {
    color: #34d399;
    background-color: rgba(24, 203, 150, 0.08);
}

[data-theme="dark"] .ff-modern .faq-bs .accordion-body {
    color: var(--text-muted);
}

/* Toggle de facturation (tarifs) */
[data-theme="dark"] .billing-toggle {
    background-color: var(--surface-soft);
    border-color: var(--surface-border);
}

[data-theme="dark"] .billing-toggle__input:checked + .billing-toggle__label {
    background-color: var(--surface-card);
    color: var(--text-strong);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* FAQ custom (design system) */
[data-theme="dark"] .faq__question {
    color: var(--text-strong);
}

[data-theme="dark"] .faq__item {
    border-bottom-color: var(--surface-border);
}

/* =========================================================
   7. Hero d'accueil (fond blanc → surface) + mockups
   ========================================================= */

[data-theme="dark"] .hero--split {
    background: transparent;
}

[data-theme="dark"] .ff-modern .hero-title-grad {
    background: linear-gradient(135deg, #34d399 0%, #18cb96 45%, #0d9488 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Mockups (dashboard, fonctionnalités) : passent en sombre comme le reste */
[data-theme="dark"] .hero-dash,
[data-theme="dark"] .ff-modern .dash-mockup,
[data-theme="dark"] .ff-modern .feature-mockup {
    background: var(--surface-card);
    border-color: var(--surface-border);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 30px 80px rgba(0, 0, 0, 0.55);
}

/* hero-dash : le corps utilise déjà des variables, on force le fond des sous-blocs */
[data-theme="dark"] .hero-dash__topbar {
    background: var(--surface-soft);
    border-bottom-color: var(--surface-border);
}

/* dash-mockup (variante) : sous-blocs codés en dur */
[data-theme="dark"] .ff-modern .dash-mockup__topbar {
    background: var(--surface-soft);
    border-bottom-color: var(--surface-border);
}

[data-theme="dark"] .ff-modern .dash-stat {
    background: var(--surface-soft);
    border-color: var(--surface-border);
}

[data-theme="dark"] .ff-modern .dash-stat__value,
[data-theme="dark"] .ff-modern .dash-client__name {
    color: var(--text-strong);
}

[data-theme="dark"] .ff-modern .dash-chart,
[data-theme="dark"] .ff-modern .dash-client {
    background: var(--surface-soft);
}

/* feature-mockup : lignes et cartes placeholder */
[data-theme="dark"] .ff-modern .feature-mockup__line {
    background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .ff-modern .feature-mockup__card {
    background: linear-gradient(135deg, #1e1e26, #26262e);
}

/* Toast / notification flottante du hero */
[data-theme="dark"] .hero-notif,
[data-theme="dark"] .ff-modern .floating-notif {
    background: var(--surface-card);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.07),
        0 12px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .hero-notif__text,
[data-theme="dark"] .ff-modern .floating-notif__title {
    color: var(--text-strong);
}

/* Feature mock : maquettes illustratives des pages fonctionnalités */
[data-theme="dark"] .ff-modern .fmock {
    background: var(--surface-card);
    border-color: var(--surface-border);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 24px 60px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .ff-modern .fmock__topbar {
    background: var(--surface-soft);
    border-bottom-color: var(--surface-border);
}

[data-theme="dark"] .ff-modern .fmock-toggle,
[data-theme="dark"] .ff-modern .fmock-stat,
[data-theme="dark"] .ff-modern .fmock-chart,
[data-theme="dark"] .ff-modern .fmock-row,
[data-theme="dark"] .ff-modern .fmock-option,
[data-theme="dark"] .ff-modern .fmock-progress,
[data-theme="dark"] .ff-modern .fmock-qr,
[data-theme="dark"] .ff-modern .fmock-field__input,
[data-theme="dark"] .ff-modern .fmock-badge {
    background: var(--surface-soft);
    border-color: var(--surface-border);
}

[data-theme="dark"] .ff-modern .fmock-toggle--on {
    background: rgba(24, 203, 150, 0.12);
    border-color: rgba(24, 203, 150, 0.35);
}

[data-theme="dark"] .ff-modern .fmock-toggle,
[data-theme="dark"] .ff-modern .fmock-stat__value,
[data-theme="dark"] .ff-modern .fmock-row__name,
[data-theme="dark"] .ff-modern .fmock-qr__name,
[data-theme="dark"] .ff-modern .fmock-seg__count,
[data-theme="dark"] .ff-modern .fmock-option {
    color: var(--text-strong);
}

[data-theme="dark"] .ff-modern .fmock-badge,
[data-theme="dark"] .ff-modern .fmock-seg__row,
[data-theme="dark"] .ff-modern .fmock-field__input {
    color: var(--text-body);
}

[data-theme="dark"] .ff-modern .fmock-option--active {
    background: rgba(24, 203, 150, 0.14);
    border-color: rgba(24, 203, 150, 0.45);
    color: #6ee7b7;
}

[data-theme="dark"] .ff-modern .fmock-switch {
    background: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .ff-modern .fmock-bar,
[data-theme="dark"] .ff-modern .fmock-seg__track {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .ff-modern .fmock-qr__code {
    background-color: #e5e7eb;
    border-color: #e5e7eb;
}

[data-theme="dark"] .ff-modern .fmock-option__icon {
    background: rgba(24, 203, 150, 0.18);
    color: #6ee7b7;
}

/* =========================================================
   8. Divers surfaces et accents
   ========================================================= */

[data-theme="dark"] .hero::before,
[data-theme="dark"] .ff-modern .page-hero::before {
    background: radial-gradient(ellipse at center top, rgba(24, 203, 150, 0.14) 0%, transparent 65%);
}

[data-theme="dark"] .hero__bg-blob {
    background: radial-gradient(circle at center, rgba(24, 203, 150, 0.12) 0%, transparent 68%);
}

[data-theme="dark"] .blog-featured__visual,
[data-theme="dark"] .card-article__img,
[data-theme="dark"] .blog-featured__grid {
    background-color: var(--surface-soft);
}

[data-theme="dark"] .card-article__img {
    background: var(--surface-soft);
}

/* Pages légales : bordures de titres */
[data-theme="dark"] .legal-page-content h2 {
    border-bottom-color: var(--surface-border);
}

/* Étapes « comment ça marche » : encarts détails */
[data-theme="dark"] .step__details li {
    background: var(--surface-soft);
    border-color: var(--surface-border);
    border-left-color: rgba(24, 203, 150, 0.5);
    color: var(--text-body);
}

/* Cartes secteurs (hover garde le gradient mint plein, texte blanc déjà géré) */
[data-theme="dark"] .ff-modern .sector-card__icon {
    background: linear-gradient(135deg, rgba(24, 203, 150, 0.22), rgba(24, 203, 150, 0.08));
    border-color: rgba(24, 203, 150, 0.32);
    color: #6ee7b7;
}

/* Badges secondaires */
[data-theme="dark"] .badge--primary {
    background-color: rgba(24, 203, 150, 0.16);
    color: #6ee7b7;
}

/* Séparateurs de tableaux / cartes internes */
[data-theme="dark"] .card__footer,
[data-theme="dark"] .testimonial__author {
    border-color: var(--surface-border);
}

/* Blog : méta et liens */
[data-theme="dark"] .blog-breadcrumb__list li:not(:last-child)::after {
    color: var(--surface-border);
}

/* Utilitaires de texte Bootstrap (couleurs fixes avec !important) */
[data-theme="dark"] .ff-modern .text-muted,
[data-theme="dark"] .ff-modern .text-body-secondary,
[data-theme="dark"] .ff-modern .text-secondary {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .ff-modern .text-dark,
[data-theme="dark"] .ff-modern .text-black,
[data-theme="dark"] .ff-modern .text-body {
    color: var(--text-strong) !important;
}

/* Sélection de texte alignée sur le SaaS (bg-primary/20) */
[data-theme="dark"] ::selection {
    background: rgba(24, 203, 150, 0.28);
}

/* =========================================================
   9. Surfaces qui utilisaient var(--color-dark) comme FOND
   (ce token est remappé en clair pour le texte en dark mode)
   ========================================================= */

[data-theme="dark"] .stats-bar {
    background: #050506;
    border-top: 1px solid var(--surface-border);
    border-bottom: 1px solid var(--surface-border);
}

[data-theme="dark"] .section--dark {
    background-color: #050506;
}

/* KPI mis en avant : mint plein et lisible (pas « fantôme ») */
[data-theme="dark"] .about-numbers__value {
    color: #34d399;
}

/* =========================================================
   10. Textes d'accent teal (#0d9488 / #129673 / #0f766e)
   → mint plus clair pour rester lisibles sur fond sombre
   ========================================================= */

[data-theme="dark"] .ff-modern .section-eyebrow,
[data-theme="dark"] .ff-modern .section-eyebrow-light,
[data-theme="dark"] .ff-modern .page-hero__eyebrow,
[data-theme="dark"] .ff-modern .hero-eyebrow-pill,
[data-theme="dark"] .ff-modern .feature-card__more,
[data-theme="dark"] .ff-modern .step-bubble__tag,
[data-theme="dark"] .ff-modern .price-card__highlight {
    color: #6ee7b7;
    background: rgba(24, 203, 150, 0.12);
    border-color: rgba(24, 203, 150, 0.28);
}

[data-theme="dark"] .eyebrow,
[data-theme="dark"] .card__more,
[data-theme="dark"] .card-article__more,
[data-theme="dark"] .legal-page-content__link,
[data-theme="dark"] .blog-sidebar-list__item a,
[data-theme="dark"] .blog-breadcrumb__list a,
[data-theme="dark"] .feature-plan-compare__label {
    color: #34d399;
}


/* =========================================================
   11. Polish UX — surfaces & accents dark
   ========================================================= */

[data-theme="dark"] .ff-modern .feature-card,
[data-theme="dark"] .ff-modern .sector-card,
[data-theme="dark"] .ff-modern .price-card,
[data-theme="dark"] .ff-modern .problem-card,
[data-theme="dark"] .ff-modern .accordion-item {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .ff-modern .dash-mockup {
    background: rgba(22, 22, 28, 0.88);
    border-color: rgba(255, 255, 255, 0.08);
    outline-color: rgba(24, 203, 150, 0.1);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 30px 80px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .ff-modern .nav.scrolled {
    border-bottom-color: rgba(24, 203, 150, 0.22);
}

[data-theme="dark"] .ff-modern .accordion-button:not(.collapsed) {
    background: rgba(24, 203, 150, 0.1);
    color: #6ee7b7;
}

[data-theme="dark"] .ff-modern .btn-ff-primary .bi-arrow-right,
[data-theme="dark"] .ff-modern .btn-ff-primary > span[aria-hidden="true"] {
    background: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .ff-modern .nav__dropdown {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 16px 40px rgba(0, 0, 0, 0.45);
}

/* Tarifs — cartes pricing */
[data-theme="dark"] .pricing-card {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .pricing-card--popular {
    background: linear-gradient(160deg, rgba(24, 203, 150, 0.12) 0%, var(--surface-card) 48%);
    border-color: rgba(24, 203, 150, 0.55);
}

[data-theme="dark"] .pricing-card__name,
[data-theme="dark"] .tarifs-price__amount,
[data-theme="dark"] .tarifs-price__amount--label,
[data-theme="dark"] .tarifs-price__value,
[data-theme="dark"] .tarifs-price__currency,
[data-theme="dark"] .pricing-card__currency {
    color: var(--text-strong);
}

[data-theme="dark"] .pricing-card--popular .pricing-card__name {
    color: #6ee7b7;
}

[data-theme="dark"] .pricing-card--popular .tarifs-price__value,
[data-theme="dark"] .pricing-card--popular .tarifs-price__currency,
[data-theme="dark"] .pricing-card--popular .tarifs-price__amount--label {
    background: linear-gradient(135deg, #34d399 0%, #18cb96 55%, #6ee7b7 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

[data-theme="dark"] .pricing-card__top {
    border-bottom-color: var(--surface-border);
}

[data-theme="dark"] .pricing-card__tagline,
[data-theme="dark"] .tarifs-price__period,
[data-theme="dark"] .pricing-card__period,
[data-theme="dark"] .pricing-card__clients {
    color: var(--text-muted);
}

[data-theme="dark"] .pricing-card__highlight {
    color: #6ee7b7;
}
