/* ============================================================
   Leadsoon — thème sombre « agence »
   Chargé APRÈS app.css, uniquement quand body porte .theme-sombre.

   Le gros du travail passe par les variables : la feuille principale
   déclare --surface pour toutes ses cartes, donc il n'y a ici que
   les variables et les quelques teintes codées en dur (états,
   pastels indigo, dégradés).

   La page imprimable n'est jamais concernée : elle construit son
   propre <body class="mode-print"> sans classe de thème.
   ============================================================ */

body.theme-sombre{
  /* --- Textes --- */
  --ink:#f2f3ff;
  --ink-2:#c3c7e6;
  --muted:#8a90bd;
  --line-btn:#5b6288;

  /* --- Fonds et surfaces --- */
  --bg:#0a0b16;
  --bg-2:#12142a;
  --surface:#171a33;
  --surface-flou:rgba(10,11,22,.82);
  --line:#282d52;
  --line-2:#1e2240;

  /* --- Couleurs de marque : violet → magenta, la signature « agence » ---
     Deux violets, et c'est volontaire : le premier REMPLIT (boutons,
     pastilles) et doit porter du texte blanc, le second ÉCRIT sur le
     fond sombre. Un seul ton ne peut pas faire les deux : trop clair,
     le blanc dessus devient illisible ; trop foncé, il disparaît sur
     le fond. */
  --brand:#7c3aed;              /* fond de bouton — blanc dessus : 5,3:1 */
  --brand-2:#a78bfa;            /* texte d'accent sur fond sombre */
  --brand-soft:rgba(139,92,246,.16);
  --sky:#f472b6;
  --lien:#b39aff;               /* les liens s'éclaircissent, les boutons non */

  /* --- États : plus saturés pour tenir sur fond sombre --- */
  --ok:#34d399;
  --warn:#fbbf24;
  --bad:#f87171;

  /* Sur fond sombre le rapport s'inverse : ce sont les tons CLAIRS
     qui ecrivent. */
  --accent-txt:#a78bfa;
  --ok-txt:#34d399;
  --g1:#a78bfa; --g2:#f472b6;
  --d1:#8b5cf6; --d2:#c4b5fd; --d3:#f472b6; --d4:#fbcfe8;
  --crayon:#4ade80;

  /* Les ombres portées ne se voient pas sur du noir : on les remplace
     par une lueur colorée, discrète. */
  --shadow:0 1px 2px rgba(0,0,0,.5), 0 10px 30px -14px rgba(0,0,0,.8);
  --shadow-lg:0 30px 70px -30px rgba(139,92,246,.45), 0 10px 40px -20px rgba(0,0,0,.9);

  color-scheme:dark;
}

/* ---------- Halos du hero et des pages d'authentification ---------- */
body.theme-sombre .hero{
  background:
    radial-gradient(60rem 30rem at 80% -10%, rgba(139,92,246,.22) 0%, transparent 62%),
    radial-gradient(50rem 26rem at 5% 0%, rgba(244,114,182,.14) 0%, transparent 58%);
}
body.theme-sombre .auth{
  background:radial-gradient(50rem 30rem at 50% -10%, rgba(139,92,246,.25), transparent 62%);
}

/* ---------- Boutons ---------- */
body.theme-sombre .btn:hover{border-color:#3b4173}
body.theme-sombre .btn-primary{box-shadow:0 6px 20px -8px rgba(139,92,246,.7)}
body.theme-sombre .btn-primary:hover{background:#7c4df0;border-color:#7c4df0}
body.theme-sombre .btn-danger{border-color:rgba(248,113,113,.35)}
body.theme-sombre .btn-danger:hover{background:rgba(248,113,113,.12);border-color:rgba(248,113,113,.6)}

/* ---------- Champs ---------- */
body.theme-sombre input,body.theme-sombre select,body.theme-sombre textarea{color:var(--ink)}
/* Mesuré le 21/08 : #6a7099 ne donnait que 3,84 de contraste sur le fond
   sombre — sous le seuil de lisibilité (4,5), et le texte le plus pâle de
   l'écran. #8f95bd monte à 6,3 : lisible, sans jamais se confondre avec le
   texte réellement saisi (15,6). */
body.theme-sombre input::placeholder,body.theme-sombre textarea::placeholder{color:#8f95bd}
body.theme-sombre input:disabled{background:var(--bg-2);color:var(--muted)}
body.theme-sombre .input-unit span{background:var(--bg-2);color:var(--muted)}

/* ---------- Messages et encarts d'état ---------- */
body.theme-sombre .flash{background:rgba(52,211,153,.12);border-color:rgba(52,211,153,.35);color:#6ee7b7}
body.theme-sombre .flash-err{background:rgba(248,113,113,.12);border-color:rgba(248,113,113,.35);color:#fca5a5}
body.theme-sombre .flash-info{background:rgba(96,165,250,.12);border-color:rgba(96,165,250,.35);color:#93c5fd}
body.theme-sombre .note{background:var(--bg-2);border-color:var(--line);color:var(--ink-2)}
body.theme-sombre .note-warn{background:rgba(251,191,36,.1);border-color:rgba(251,191,36,.35);color:#fcd34d}
body.theme-sombre .note-ok{background:rgba(52,211,153,.1);border-color:rgba(52,211,153,.35);color:#6ee7b7}
/* Le schéma de zone : rouges éclaircis, coche verte adoucie. */
body.theme-sombre .gc-exclu circle{fill:#f87171}
body.theme-sombre .gc-exclu line{stroke:#f87171}
body.theme-sombre .gc-exclu text{fill:#fca5a5}
body.theme-sombre .geo-carte-zone i{color:#34d399}

/* Le verdict de l'estimation garde ses fonds clairs d'app.css : illisible ici. */
body.theme-sombre .onb-verdict-ok{background:rgba(52,211,153,.1);border-color:rgba(52,211,153,.35);color:#6ee7b7}
body.theme-sombre .onb-verdict-attention{background:rgba(251,191,36,.1);border-color:rgba(251,191,36,.35);color:#fcd34d}
body.theme-sombre table.compare tr.ecart td{background:rgba(251,191,36,.08)}
body.theme-sombre .tag-off{background:rgba(248,113,113,.12);color:#fca5a5}

/* ---------- Pastels indigo devenus violets ---------- */
body.theme-sombre .btn-assist{background:var(--brand-soft);border-color:#4c3f8a;color:var(--brand-2)}
body.theme-sombre .btn-assist:hover{background:rgba(139,92,246,.26);border-color:var(--brand-2)}
body.theme-sombre .prop{border-color:#4c3f8a;color:var(--brand-2)}
body.theme-sombre .prop:hover{background:var(--brand-soft)}
body.theme-sombre .props-offre{border-top-color:#3a3268}
body.theme-sombre .lecture-bandeau{background:var(--brand-soft);border-bottom-color:#4c3f8a}
body.theme-sombre .lecture-bandeau span{color:var(--brand-2)}
body.theme-sombre .demo-box{background:var(--brand-soft);color:var(--brand-2)}
body.theme-sombre .why{border-left-color:#3a3268}
body.theme-sombre .apercu-media{background:linear-gradient(135deg,rgba(139,92,246,.28),rgba(244,114,182,.22));color:#e9d5ff}
body.theme-sombre .coche{background:rgba(52,211,153,.18);color:#6ee7b7}
body.theme-sombre .demo-bar i{background:#2c3157}

/* ---------- Le violet qui ÉCRIT, partout où la feuille claire
     utilisait --brand comme couleur de texte ---------- */
body.theme-sombre .demo-t,
body.theme-sombre .demo-res em,
body.theme-sombre .niveau-go,
body.theme-sombre .side-nav a.on,
body.theme-sombre .etapes a.done,
body.theme-sombre .etape-n,
body.theme-sombre .nav-links a:hover,
body.theme-sombre .nav-auth-mob,
body.theme-sombre .check li::before,
body.theme-sombre .bloc-why + h3,
body.theme-sombre .grand,
body.theme-sombre .eyebrow{color:#b39aff}
body.theme-sombre .demo-res em,
body.theme-sombre .etape-n{background:rgba(139,92,246,.2)}
body.theme-sombre .brand-name span{color:#b39aff}

/* ---------- Dégradés : sur fond noir, il faut partir plus clair ----------
   ⚠ Ne JAMAIS utiliser la propriété raccourcie `background` sur un texte
   en dégradé : elle réinitialise `background-clip`, le dégradé repeint
   toute la boîte et le texte — resté transparent — disparaît. On ne
   touche qu'à `background-image`, et on réaffirme le découpage. */
body.theme-sombre .bar i,
body.theme-sombre .progress i{background-image:linear-gradient(90deg,#a78bfa,#f472b6)}
body.theme-sombre .demo-res b{
  background-image:linear-gradient(135deg,#a78bfa,#f472b6);
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
body.theme-sombre .flux::before{background-image:linear-gradient(90deg,#a78bfa,#f472b6);opacity:.4}

/* ---------- Dégradés codés en dur dans la feuille principale ---------- */
body.theme-sombre .verdict-box{background:linear-gradient(135deg,#7c3aed,#db2777)}

/* ---------- Barres collantes ---------- */
body.theme-sombre .site-nav,body.theme-sombre .app-top{border-bottom-color:var(--line)}
body.theme-sombre .side{border-right-color:var(--line)}

/* Le fil du parcours et le contour des pastilles doivent suivre le fond. */
body.theme-sombre .flux-n{box-shadow:0 0 0 5px var(--bg)}
body.theme-sombre .section-alt .flux-n{box-shadow:0 0 0 5px var(--bg-2)}


/* Illustrations des vignettes : le violet plein s'éteint sur fond sombre
   (2,99:1). On reprend la teinte claire déjà utilisée pour le texte. */
body.theme-sombre .demo-illu{color:var(--lien)}
body.theme-sombre .feature-illu{color:var(--lien)}

/* Exemple concret : les pastilles et le trait de chronologie tiennent leurs
   couleurs de variables claires — seules les teintes en dur sont reprises. */
body.theme-sombre .ex-tag-vif{background:rgba(124,58,237,.16);border-color:rgba(124,58,237,.4);color:var(--lien)}
body.theme-sombre .ex-num{background:rgba(124,58,237,.16);border-color:rgba(124,58,237,.4);color:var(--lien)}
body.theme-sombre .ex-fin .ex-num{background:var(--brand);border-color:var(--brand);color:#fff}
body.theme-sombre .ex-fin b{color:var(--lien)}
body.theme-sombre .ex-suite li::before{background:linear-gradient(var(--lien),rgba(179,154,255,.12))}
body.theme-sombre .ex-coche{color:#6ee7b7}
body.theme-sombre .citation::before,body.theme-sombre .citation::after{color:var(--lien);opacity:.5}

/* Retour en haut : la carte claire et le violet plein disparaîtraient. */
body.theme-sombre .haut{background:var(--surface);border-color:var(--line);color:var(--lien)}
body.theme-sombre .haut:hover{background:rgba(124,58,237,.16);border-color:rgba(124,58,237,.45)}

/* ---------- Estimateur à deux panneaux ---------- */
body.theme-sombre .estim2-num{color:var(--lien)}
body.theme-sombre .estim2-fleche{color:var(--lien)}
body.theme-sombre .tuile:hover .tuile-in{background:rgba(124,58,237,.14);border-color:rgba(124,58,237,.45)}
body.theme-sombre .tuile input:checked + .tuile-in{background:rgba(124,58,237,.2);border-color:var(--brand)}
body.theme-sombre .tuile input:checked + .tuile-in .tuile-ico svg{color:var(--lien)}
body.theme-sombre .estim2-info-i{background:rgba(124,58,237,.18);color:var(--lien)}
body.theme-sombre .estim2-prix b{color:var(--lien)}
body.theme-sombre .estim2-crit i{color:#6ee7b7}

/* Bascule de thème : la carte claire et le violet plein disparaîtraient. */
body.theme-sombre .bascule-theme{background:var(--surface);border-color:var(--line);color:var(--ink-2)}
body.theme-sombre .bascule-theme:hover{color:var(--lien);background:rgba(124,58,237,.16);border-color:rgba(124,58,237,.45)}

/* ---------- Administration ----------
   Les cartes d'alerte gardaient leurs pastels clairs d'app.css pendant que
   le texte secondaire passait en gris clair : illisible. Même inversion
   que pour les notes et les flashs — fond teinté sombre, texte clair. */
body.theme-sombre .adm-a-err{background:rgba(248,113,113,.1);border-color:rgba(248,113,113,.38)}
body.theme-sombre .adm-a-err b{color:#fca5a5}
body.theme-sombre .adm-a-warn{background:rgba(251,191,36,.09);border-color:rgba(251,191,36,.35)}
body.theme-sombre .adm-a-warn b{color:#fcd34d}
body.theme-sombre .warn{color:#fbbf24}
/* Natures des sources de coûts : les tons foncés de la feuille claire
   s'éteignent sur fond sombre. */
body.theme-sombre .nat-vente{color:#34d399}
body.theme-sombre .nat-agence{color:#fbbf24}
body.theme-sombre .nat-media{color:#a5b4fc}
body.theme-sombre .nat-interne{color:#8a90bd}
