/* FabriSiteGPRS — modo escuro unificado (carregar por último entre as folhas do site).
   Regra: em html[data-theme="dark"] não há fundos brancos (#fff / #ffffff / cinzas muito claros como superfície). */

html[data-theme="dark"] {
  color-scheme: dark;
  --fs-d-canvas: #0f172a;
  --fs-d-surface: #1e293b;
  --fs-d-elevated: #334155;
  --fs-d-ink: #f1f5f9;
  --fs-d-muted: #94a3b8;
  --fs-d-line: rgba(148, 163, 184, 0.28);
  --fs-d-accent: #2dd4bf;
}

/* Base: corpo (exceto páginas jurídicas com fundo próprio em legal-pages.css) */
html[data-theme="dark"] body:not(.fs-legal-page) {
  background-color: var(--fs-d-canvas) !important;
  color: var(--fs-d-ink);
}

/*
  landing-modern.css define :root --fs-text (#0f172a). Sem override, no escuro títulos (.fs-steps h3),
  FAQ summary e .fs-section__head h2 continuam escuros sobre cartões escuros.
*/
html[data-theme="dark"] body.fs-landing {
  --fs-text: var(--fs-d-ink) !important;
}

/* ========== Landing (ff-landing) — cartões, secções, FAQ, passos ========== */
html[data-theme="dark"] body.fs-landing.ff-landing:not(.fs-auth-page) {
  --fs-surface: var(--fs-d-surface) !important;
  --fs-canvas: var(--fs-d-canvas) !important;
  --fs-ink: var(--fs-d-ink) !important;
  --fs-muted: var(--fs-d-muted) !important;
  --fs-border: var(--fs-d-line) !important;
}

/* Secção planos: fundo explícito (evita resíduo claro do landing-fleet / WebView) */
html[data-theme="dark"] .ff-landing .pricing {
  background: var(--fs-d-canvas) !important;
}

html[data-theme="dark"] .ff-landing .features {
  background: transparent !important;
}

/*
  Bloco pós-main (Como funciona, Escopo, FAQ): landing-seo.css define .fs-landing-extra { background: #f8fafc }
  sem tema — no escuro isso forçava faixa branca.
*/
html[data-theme="dark"] .fs-landing-extra {
  background: var(--fs-d-canvas) !important;
  border-top-color: var(--fs-d-line) !important;
}

html[data-theme="dark"] .fs-landing-extra .fs-eyebrow {
  color: var(--fs-d-accent) !important;
}

html[data-theme="dark"] .fs-landing-extra .fs-section__lead {
  color: var(--fs-d-muted) !important;
}

html[data-theme="dark"] .fs-landing-extra .fs-seo-prose,
html[data-theme="dark"] .fs-landing-extra .fs-seo-prose p {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .fs-landing-extra .fs-seo-prose strong {
  color: var(--fs-d-ink) !important;
}

html[data-theme="dark"] .ff-landing .features.features--surface {
  background: #0c1222 !important;
}

html[data-theme="dark"] .ff-landing .fs-premium-card,
html[data-theme="dark"] .ff-landing .pricing-card:not(.featured) {
  background: var(--fs-d-surface) !important;
  border-color: var(--fs-d-line) !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .ff-landing .fs-recursos-benefits .fs-recurso-card__title {
  color: var(--fs-d-ink) !important;
}

html[data-theme="dark"] .ff-landing .fs-recursos-benefits .fs-recurso-card__desc {
  color: var(--fs-d-muted) !important;
}

html[data-theme="dark"] .ff-landing .fs-recursos-disclaimer.fs-recursos-legalbox {
  background: linear-gradient(
    180deg,
    rgba(30, 58, 138, 0.35) 0%,
    rgba(30, 41, 59, 0.95) 100%
  ) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .ff-landing .fs-block-bloqueio__card {
  background: var(--fs-d-surface) !important;
  border-color: var(--fs-d-line) !important;
  color: #e2e8f0;
}

html[data-theme="dark"] .ff-landing .fs-block-bloqueio__card h3,
html[data-theme="dark"] .ff-landing .fs-block-bloqueio__card li {
  color: #e2e8f0;
}

html[data-theme="dark"] .ff-landing .fs-block-bloqueio__card--critical {
  background: rgba(127, 29, 29, 0.25) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
}

html[data-theme="dark"] body.fs-landing.ff-landing .fs-faq details {
  background: var(--fs-d-surface) !important;
  border-color: var(--fs-d-line) !important;
  color: #e2e8f0;
}

html[data-theme="dark"] body.fs-landing.ff-landing .fs-faq details summary {
  color: var(--fs-d-ink);
}

/* landing-seo.css usa #475569 fixo no corpo do accordion — ilegível no escuro */
html[data-theme="dark"] body.fs-landing.ff-landing .fs-faq details > div {
  color: var(--fs-d-muted) !important;
  border-top-color: var(--fs-d-line) !important;
}

html[data-theme="dark"] body.fs-landing.ff-landing .fs-faq details > div strong {
  color: var(--fs-d-ink) !important;
}

html[data-theme="dark"] body.fs-landing.ff-landing .fs-steps li {
  background: var(--fs-d-surface) !important;
  border-color: var(--fs-d-line) !important;
  color: #e2e8f0;
}

html[data-theme="dark"] body.fs-landing.ff-landing .fs-steps h3 {
  color: var(--fs-d-ink) !important;
}

html[data-theme="dark"] body.fs-landing.ff-landing .fs-steps p {
  color: var(--fs-d-muted) !important;
}

html[data-theme="dark"] body.fs-landing.ff-landing .fs-steps p strong {
  color: var(--fs-d-ink) !important;
}

html[data-theme="dark"] .ff-landing .fs-escopo-card {
  background: var(--fs-d-surface) !important;
  border-color: var(--fs-d-line) !important;
}

html[data-theme="dark"] .ff-landing .fs-escopo-card p,
html[data-theme="dark"] .ff-landing .fs-escopo-card ul {
  color: var(--fs-d-muted);
}

html[data-theme="dark"] .ff-landing .fs-escopo-card__title {
  color: var(--fs-d-ink) !important;
}

html[data-theme="dark"] .ff-landing .fs-escopo-card--sim .fs-escopo-card__ico {
  background: rgba(34, 197, 94, 0.22) !important;
  color: #4ade80 !important;
}

html[data-theme="dark"] .ff-landing .fs-escopo-card--nao .fs-escopo-card__ico {
  background: rgba(248, 113, 113, 0.18) !important;
  color: #fca5a5 !important;
}

html[data-theme="dark"] .ff-landing .section-header p,
html[data-theme="dark"] .ff-landing .fs-section__lead {
  color: var(--fs-d-muted) !important;
}

/* Hero / mock dashboard */
html[data-theme="dark"] .ff-landing .hero-visual {
  background: transparent !important;
}

html[data-theme="dark"] .ff-landing .dashboard-preview {
  background: linear-gradient(165deg, #0f172a 0%, #1e293b 100%) !important;
  border-color: rgba(232, 200, 74, 0.35) !important;
}

/* Home: cabeçalho escuro coerente com modo escuro (não forçar #121821 só do tema claro) */
html[data-theme="dark"] body.fs-landing.ff-landing.fs-home .fs-header {
  background: #0b1120 !important;
  border-bottom-color: var(--fs-d-line) !important;
}

html[data-theme="dark"] body.fs-landing.ff-landing.fs-home .fs-header__nav a {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] body.fs-landing.ff-landing.fs-home .fs-brand-site {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] body.fs-landing.ff-landing.fs-home .fs-header__link-entrar {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] body.fs-landing.ff-landing .fs-footer__quick a {
  color: #cbd5e1 !important;
}

/* Rodapé landing: mesmo azul-marinho do cartão em destaque + borda tracejada */
html[data-theme="dark"] body.fs-landing.ff-landing footer.fs-footer {
  background: linear-gradient(165deg, #020617 0%, #0f172a 52%, #111827 100%) !important;
  border-top: 2px dashed rgba(232, 200, 74, 0.4) !important;
  box-shadow: inset 0 1px 0 rgba(232, 200, 74, 0.08) !important;
}

/* PWA modal */
html[data-theme="dark"] .fs-pwa-modal__panel {
  background: var(--fs-d-surface) !important;
  border-color: var(--fs-d-line) !important;
}

/* ========== Auth (entrar / cadastrar) — reforço anti-branco ========== */
html[data-theme="dark"] body.fs-landing.fs-auth-page .fs-login-card,
html[data-theme="dark"] body.fs-landing.fs-auth-page .fs-login-panel--page {
  background: rgba(17, 36, 64, 0.92) !important;
}

html[data-theme="dark"] body.fs-landing.fs-auth-page .fs-form .wrap-input100:focus-within {
  background: rgba(15, 23, 42, 0.95) !important;
}

/* main.css / inputs herdados */
html[data-theme="dark"] .input100,
html[data-theme="dark"] .login100-form input,
html[data-theme="dark"] textarea.input100 {
  background: transparent !important;
  color: #e2e8f0 !important;
}

/* ========== legal-nova (termos, contato, …) ========== */
html[data-theme="dark"] .nova-topbar,
html[data-theme="dark"] .fs-header {
  background: rgba(15, 23, 42, 0.94) !important;
  border-bottom-color: var(--fs-d-line) !important;
  backdrop-filter: blur(12px);
}

html[data-theme="dark"] .nova-hero {
  background: linear-gradient(125deg, #1e293b 0%, #172033 100%) !important;
  border-color: var(--fs-d-line) !important;
}

html[data-theme="dark"] .nova-card {
  background: var(--fs-d-surface) !important;
  border-color: var(--fs-d-line) !important;
}

html[data-theme="dark"] .nova-eyebrow {
  color: var(--fs-d-accent) !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] .nova-lead {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .nova-lead {
  color: var(--fs-d-muted) !important;
}

html[data-theme="dark"] .nova-card h2,
html[data-theme="dark"] .nova-card h3,
html[data-theme="dark"] .nova-toc a {
  color: #e2e8f0;
}

html[data-theme="dark"] .nova-toc a:hover {
  color: var(--fs-d-accent);
}

html[data-theme="dark"] .nova-alert,
html[data-theme="dark"] .nova-note {
  background: rgba(30, 41, 59, 0.9) !important;
  border-color: var(--fs-d-line) !important;
  color: #cbd5e1;
}

html[data-theme="dark"] .nova-content h2 {
  color: #e2e8f0 !important;
  border-top-color: var(--fs-d-line) !important;
}

html[data-theme="dark"] .nova-content p,
html[data-theme="dark"] .nova-content li {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .nova-content a {
  color: var(--fs-d-accent) !important;
}

html[data-theme="dark"] .nova-sign {
  color: var(--fs-d-muted) !important;
  border-top-color: var(--fs-d-line) !important;
}

html[data-theme="dark"] .fs-header__nav a {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .fs-header__nav a:hover {
  color: var(--fs-d-accent) !important;
}

html[data-theme="dark"] .fs-header__logo-text,
html[data-theme="dark"] .fs-brand-site {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .fs-brand-gprs {
  color: var(--fs-d-accent) !important;
}

/* ========== Páginas jurídicas fs-legal-page (legal-pages.css) ========== */
html[data-theme="dark"] body.fs-legal-page .fs-legal-doc,
html[data-theme="dark"] body.fs-legal-page .fs-legal-doc.content {
  background: var(--fs-d-surface) !important;
  border-color: var(--fs-d-line) !important;
  color: #e2e8f0;
}

html[data-theme="dark"] body.fs-legal-page .fs-legal-doc h1,
html[data-theme="dark"] body.fs-legal-page .fs-legal-doc h2,
html[data-theme="dark"] body.fs-legal-page .fs-legal-doc h3 {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] body.fs-legal-page .fs-legal-doc p,
html[data-theme="dark"] body.fs-legal-page .fs-legal-doc li {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] body.fs-legal-page .fs-legal-back {
  background: var(--fs-d-surface) !important;
  border-color: var(--fs-d-line) !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] body.fs-legal-page .alert-box {
  background: rgba(30, 58, 138, 0.25) !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
  color: #cbd5e1;
}

/* ========== Utilitário: gradientes claros que viram texto legível ========== */
html[data-theme="dark"] .fs-gradient-heading {
  background: linear-gradient(100deg, #f8fafc 0%, #D4B84A 55%, #E8C84A 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}
