/* ─────────────────────────────────────────────────────────────────────────
   FISCUS — Dark mode + accessibilité inputs
   - Placeholders foncés et visibles en mode clair (#555) ET sombre (#cbd5e1)
   - Aucune surcharge cassante — uniquement des correctifs ciblés
   ───────────────────────────────────────────────────────────────────────── */

/* ── Placeholders visibles (mode clair) ─────────────────────────────────── */
.form-control::placeholder,
input::placeholder,
textarea::placeholder {
  color: #555 !important;
  opacity: 1 !important;
}
.form-control::-webkit-input-placeholder,
input::-webkit-input-placeholder { color: #555 !important; opacity: 1 !important; }
.form-control::-moz-placeholder,
input::-moz-placeholder { color: #555 !important; opacity: 1 !important; }
.form-control:-ms-input-placeholder,
input:-ms-input-placeholder { color: #555 !important; opacity: 1 !important; }

/* ── Texte saisi visible (mode clair) ───────────────────────────────────── */
.form-control,
input[type="email"],
input[type="password"],
input[type="text"],
textarea {
  color: #1e293b !important;
  background-color: #ffffff !important;
}

/* ── Auto-fill Chrome/Edge : forcer texte foncé sur fond clair ──────────── */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: #1e293b !important;
  -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
  caret-color: #1e293b !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* ── Mode sombre : placeholders clairs lisibles ─────────────────────────── */
@media (prefers-color-scheme: dark) {
  .form-control::placeholder,
  input::placeholder,
  textarea::placeholder {
    color: #cbd5e1 !important;
    opacity: 1 !important;
  }
  .form-control,
  input[type="email"],
  input[type="password"],
  input[type="text"],
  textarea {
    color: #f1f5f9 !important;
    background-color: #1e293b !important;
    border-color: #334155 !important;
  }
  input:-webkit-autofill,
  input:-webkit-autofill:hover,
  input:-webkit-autofill:focus,
  input:-webkit-autofill:active {
    -webkit-text-fill-color: #f1f5f9 !important;
    -webkit-box-shadow: 0 0 0 30px #1e293b inset !important;
    caret-color: #f1f5f9 !important;
  }
}

/* ── Classe explicite [data-theme="dark"] pour toggle manuel ────────────── */
[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #cbd5e1 !important;
  opacity: 1 !important;
}
[data-theme="dark"] .form-control,
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="text"],
[data-theme="dark"] textarea {
  color: #f1f5f9 !important;
  background-color: #1e293b !important;
  border-color: #334155 !important;
}
[data-theme="dark"] input:-webkit-autofill {
  -webkit-text-fill-color: #f1f5f9 !important;
  -webkit-box-shadow: 0 0 0 30px #1e293b inset !important;
}

/* ── Focus visible pour accessibilité ───────────────────────────────────── */
.form-control:focus,
input:focus {
  outline: 2px solid rgba(79, 110, 247, 0.45) !important;
  outline-offset: 1px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Correctifs de lisibilité mode sombre — bandeaux de diagnostic (OUI/NON/
   INCONNU) et cartes tarifaires. Ces blocs gardaient un fond clair fixe
   (jaune/rouge/vert pâle ou blanc) alors que le TEXTE suivait les variables
   globales --p-text / --gray-700 devenues quasi blanches en mode sombre →
   texte illisible. On fixe ici fond ET texte pour un contraste AA garanti.
   ───────────────────────────────────────────────────────────────────────── */

/* Bandeaux diagnostic OUI / NON / INCONNU (module Facturation électronique) */
[data-theme="dark"] .einv-answer-oui {
  background: rgba(239,68,68,0.16) !important;
}
[data-theme="dark"] .einv-answer-non {
  background: rgba(34,197,94,0.16) !important;
}
[data-theme="dark"] .einv-answer-inconnu {
  background: rgba(245,158,11,0.18) !important;
}
[data-theme="dark"] .einv-answer-badge {
  background: rgba(255,255,255,0.10) !important;
  color: #f1f5f9 !important;
}
[data-theme="dark"] .einv-answer-headline { color: #f1f5f9 !important; }
[data-theme="dark"] .einv-answer-just     { color: #cbd5e1 !important; }
[data-theme="dark"] .einv-missing {
  background: rgba(245,158,11,0.10) !important;
  border-color: rgba(245,158,11,0.35) !important;
  color: #e5e7eb !important;
}
[data-theme="dark"] .einv-honesty {
  background: rgba(99,102,241,0.14) !important;
  border-color: rgba(99,102,241,0.35) !important;
  color: #c7d2fe !important;
}
[data-theme="dark"] .einv-ref { color: #cbd5e1 !important; }
[data-theme="dark"] .einv-ref-tag { background: rgba(99,102,241,0.25) !important; color: #c7d2fe !important; }
[data-theme="dark"] .einv-provider-banner {
  background: rgba(99,102,241,0.14) !important;
  border-color: rgba(99,102,241,0.35) !important;
  color: #c7d2fe !important;
}
[data-theme="dark"] .einv-step { border-bottom-color: #1f2a44 !important; }
[data-theme="dark"] .einv-step-label { color: #f1f5f9 !important; }
[data-theme="dark"] .einv-step-desc  { color: #cbd5e1 !important; }
[data-theme="dark"] .einv-step-reason{ color: #9ca3af !important; }
[data-theme="dark"] .einv-check-label{ color: #f1f5f9 !important; }
[data-theme="dark"] .einv-check-msg  { color: #cbd5e1 !important; }
[data-theme="dark"] .einv-notice     { color: #9ca3af !important; border-top-color: #374151 !important; }

/* Cartes tarifaires (page Abonnements) — fond des cartes toujours clair,
   on force donc explicitement un texte sombre lisible en mode sombre. */
[data-theme="dark"] .pricing-card {
  background: #ffffff !important;
  border-color: #374151 !important;
}
[data-theme="dark"] .pricing-feature {
  color: #1e293b !important;
}
[data-theme="dark"] .pricing-period {
  color: #1e293b !important;
  opacity: 0.75 !important;
}
[data-theme="dark"] .pricing-name {
  color: #1e293b !important;
}
