/* ============================================================
   MINDUS — THÈME + BARRE DU HAUT DES PAGES PUBLIQUES
   Généré à partir de index.html : les pages publiques ont EXACTEMENT la même barre,
   le même sélecteur de langue, le même bouton flottant et le même mode clair.
   Doit être chargé APRÈS le <style> de la page.
   ============================================================ */

/* variables communes (sombre) — faible priorité : une page qui les définit garde les siennes */
:where(:root) {
  --mf-ink: #050706; --mf-surface: #0a0e0c; --mf-surface-raised: #101512;
  --mf-line: rgba(202, 222, 211, 0.16); --mf-line-strong: rgba(202, 222, 211, 0.28);
  --mf-paper: #dce9e1; --mf-mint: #a9cbb9; --mf-muted: #8d9992; --mf-radius: 3px;
}
/* variables du mode clair (identiques à index) */
html[data-theme="light"] {
  --bg-dark: #f4f7f3; --bg-card: #ffffff; --bg-card-hover: #f0f4f0; --bg-light-section: #e9eee9;
  --text-primary: #0f1a14; --text-secondary: #4b5b51; --text-muted: #6b7a71;
  --border-color: rgba(15, 32, 22, .14);
  --mf-ink: #f4f7f3; --mf-surface: #eef2ed; --mf-surface-raised: #ffffff;
  --mf-line: rgba(15, 32, 22, .14); --mf-line-strong: rgba(15, 32, 22, .28);
  --mf-paper: #0f1a14; --mf-mint: #2b6a4c; --mf-muted: #5a6a60;
  color-scheme: light;
}
html[data-theme="light"] body { background-color: var(--bg-dark); color: var(--text-primary); }
html[data-theme="light"] ::selection { background: rgba(43, 106, 76, .22); color: #0f1a14; }
html[data-theme="light"] a:focus-visible, html[data-theme="light"] button:focus-visible { outline-color: #2979FF; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c3cdc5; }

/* ---------- Barre du haut (copie fidèle d'index) ---------- */
nav#mainNav { position: relative; z-index: 1; }
nav#mainNav { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; transition: background 0.3s ease, backdrop-filter 0.3s ease; }
nav#mainNav.scrolled { background: rgba(10, 10, 10, 0.75); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.nav-link { color: #a1a1a1; transition: color 0.2s ease; font-weight: 500; font-size: 14px; position: relative; padding: 6px 0; }
.nav-link:hover { color: #ffffff; }
.nav-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 1px; background: #ffffff; transition: width 0.3s ease; }
.nav-link:hover::after { width: 100%; }
.nav-contact-link { color: #10b981 !important; font-weight: 600 !important; }
.nav-contact-link:hover { color: #34d399 !important; }
.mega-menu-wrapper { position: relative; }
.mega-menu { position: fixed; top: 56px; left: 50%; transform: translateX(-50%) translateY(-8px); width: min(720px, 90vw); background: rgba(17, 17, 17, 0.98); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 20px; padding: 24px; box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.7); opacity: 0; visibility: hidden; transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s; z-index: 60; pointer-events: none; }
.mega-menu.open { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.mega-menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mega-menu-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 12px; transition: all 0.2s ease; cursor: pointer; text-decoration: none; color: inherit; }
.mega-menu-item:hover { background: rgba(255, 255, 255, 0.04); }
.mega-menu-item .menu-icon { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #ffffff; }
.mega-menu-item .menu-title { font-weight: 600; font-size: 14px; color: #ffffff; margin-bottom: 2px; }
.mega-menu-item .menu-desc { font-size: 12px; color: #888; line-height: 1.4; }
#mainNav .btn-primary, #mobile-menu .btn-primary { background: #ffffff; color: #000000; border: none; transition: all 0.3s ease; font-weight: 600; }
#mainNav .btn-primary:hover, #mobile-menu .btn-primary:hover { background: #e5e5e5; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1); }
#mainNav .btn-outline, #mobile-menu .btn-outline { background: transparent; border: 1px solid rgba(255, 255, 255, 0.15); color: #ffffff; transition: all 0.3s ease; font-weight: 500; }
#mainNav .btn-outline:hover, #mobile-menu .btn-outline:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.3); transform: translateY(-2px); }
#mobile-menu { background: rgba(17, 17, 17, 0.98) !important; backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.08) !important; }
#mobile-menu a { color: #a1a1a1 !important; }
#mobile-menu a:hover { background: rgba(255, 255, 255, 0.05) !important; color: #ffffff !important; }
@media (max-width: 768px) {
  .mega-menu-grid { grid-template-columns: 1fr; }
}
nav#mainNav { background: rgba(5, 7, 6, .88) !important; border-bottom: 1px solid var(--mf-line) !important; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
nav#mainNav.scrolled { box-shadow: 0 12px 35px rgba(0,0,0,.28); }
.nav-link { font-family: 'Roboto Mono', monospace; font-size: 11px; letter-spacing: .045em; text-transform: uppercase; }
#mainNav .btn-primary, #mobile-menu .btn-primary, #mainNav .btn-outline, #mobile-menu .btn-outline { border-radius: var(--mf-radius) !important; transition: transform .22s ease, background .22s ease, border-color .22s ease, color .22s ease !important; font-weight: 600; min-height: 44px; }
#mainNav .btn-primary, #mobile-menu .btn-primary { background: #dce9e1 !important; color: #08100b !important; border: 1px solid #dce9e1 !important; box-shadow: none !important; }
#mainNav .btn-primary:hover, #mobile-menu .btn-primary:hover { background: #b9d3c4 !important; border-color: #b9d3c4 !important; transform: translateY(-2px); }
#mainNav .btn-outline, #mobile-menu .btn-outline { background: rgba(255,255,255,.015) !important; border: 1px solid var(--mf-line-strong) !important; color: #e6eee9 !important; }
#mainNav .btn-outline:hover, #mobile-menu .btn-outline:hover { background: rgba(173,211,190,.08) !important; border-color: var(--mf-mint) !important; transform: translateY(-2px); }
.lang-switch { position: relative; display: inline-flex; flex-shrink: 0; }
.lang-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; color: #e6eee9; background: transparent; border: 1px solid transparent; border-radius: var(--mf-radius, 3px); cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease; }
.lang-btn:hover, .lang-btn[aria-expanded="true"] { background: rgba(173, 211, 190, .08); border-color: var(--mf-line-strong, rgba(202, 222, 211, .28)); color: var(--mf-mint, #a9cbb9); }
.lang-card { position: absolute; top: calc(100% + 10px); right: 0; z-index: 70; width: 232px; max-width: calc(100vw - 24px); max-height: 288px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(202, 222, 211, .28) transparent; padding: 6px; text-align: left; background: var(--mf-surface-raised, #101512); border: 1px solid var(--mf-line-strong, rgba(202, 222, 211, .28)); border-radius: var(--mf-radius, 3px); box-shadow: 0 18px 42px rgba(0, 0, 0, .45); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .16s ease, transform .16s ease, visibility .16s; }
.lang-switch.open .lang-card { opacity: 1; visibility: visible; transform: none; }
.lang-switch[data-dir="up"] .lang-card { top: auto; bottom: calc(100% + 10px); transform: translateY(4px); }
.lang-switch[data-dir="up"].open .lang-card { transform: none; }
@media (min-width: 768px) {
  .lang-switch[data-dir="up"] .lang-card { left: 0; right: auto; }
}
.lang-option { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.2; text-align: left; color: #cbd8d0; background: transparent; border: 0; border-radius: var(--mf-radius, 3px); cursor: pointer; transition: background .15s ease, color .15s ease; }
.lang-option:hover { background: rgba(173, 211, 190, .08); color: #ffffff; }
.lang-option:focus-visible { outline: 2px solid var(--mf-mint, #a9cbb9); outline-offset: -2px; }
.lang-option[aria-selected="true"] { color: var(--mf-mint, #a9cbb9); }
.lang-check { width: 14px; height: 14px; flex-shrink: 0; opacity: 0; }
.lang-option[aria-selected="true"] .lang-check { opacity: 1; }
.lang-status { position: sticky; top: 0; margin: 0 0 4px; padding: 8px 12px; font-size: 12px; line-height: 1.4; color: #f3b4b4; background: var(--mf-surface-raised, #101512); border-bottom: 1px solid var(--mf-line, rgba(202, 222, 211, .16)); }
.lang-status[hidden] { display: none; }
.lang-switch.is-busy .lang-option { opacity: .5; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .lang-card, .lang-btn, .lang-option { transition: none; }
}
html[data-theme="light"] nav#mainNav { background: rgba(244, 247, 243, .88) !important; }
html[data-theme="light"] nav#mainNav.scrolled { box-shadow: 0 10px 30px rgba(15, 32, 22, .08); }
html[data-theme="light"] .nav-link { color: #4b5b51; }
html[data-theme="light"] .nav-link:hover { color: #0f1a14; }
html[data-theme="light"] .nav-link::after { background: #0f1a14; }
html[data-theme="light"] .nav-contact-link { color: #047857 !important; }
html[data-theme="light"] .nav-contact-link:hover { color: #059669 !important; }
html[data-theme="light"] .mega-menu { background: rgba(255, 255, 255, .98); border-color: rgba(15, 32, 22, .12); box-shadow: 0 25px 60px -15px rgba(15, 32, 22, .28); }
html[data-theme="light"] .mega-menu-item:hover { background: rgba(15, 32, 22, .05); }
html[data-theme="light"] .mega-menu-item .menu-icon { background: rgba(15, 32, 22, .05); border-color: rgba(15, 32, 22, .10); color: #0f1a14; }
html[data-theme="light"] .mega-menu-item .menu-title { color: #0f1a14; }
html[data-theme="light"] .mega-menu-item .menu-desc { color: #5a6a60; }
html[data-theme="light"] #mobile-menu { background: rgba(255, 255, 255, .98) !important; border: 1px solid rgba(15, 32, 22, .12) !important; }
html[data-theme="light"] #mobile-menu a { color: #3d4d43 !important; }
html[data-theme="light"] #mobile-menu a:hover { background: rgba(15, 32, 22, .05) !important; color: #0f1a14 !important; }
html[data-theme="light"] #mobile-menu a.btn-primary { color: #f4f7f3 !important; }
html[data-theme="light"] #mobile-menu a.text-emerald-400 { color: #047857 !important; }
html[data-theme="light"] #mainNav .btn-primary, html[data-theme="light"] #mobile-menu .btn-primary { background: #0f1a14 !important; color: #f4f7f3 !important; border-color: #0f1a14 !important; }
html[data-theme="light"] #mainNav .btn-primary:hover, html[data-theme="light"] #mobile-menu .btn-primary:hover { background: #26382d !important; border-color: #26382d !important; }
html[data-theme="light"] #mainNav .btn-outline, html[data-theme="light"] #mobile-menu .btn-outline { background: rgba(15, 32, 22, .02) !important; border-color: var(--mf-line-strong) !important; color: #0f1a14 !important; }
html[data-theme="light"] #mainNav .btn-outline:hover, html[data-theme="light"] #mobile-menu .btn-outline:hover { background: rgba(15, 32, 22, .06) !important; border-color: #0f1a14 !important; }
html[data-theme="light"] .lang-btn { color: #1f2d25; }
html[data-theme="light"] .lang-btn:hover, html[data-theme="light"] .lang-btn[aria-expanded="true"] { background: rgba(43, 106, 76, .08); color: var(--mf-mint); }
html[data-theme="light"] .lang-card { background: #ffffff; box-shadow: 0 18px 42px rgba(15, 32, 22, .18); scrollbar-color: rgba(15, 32, 22, .28) transparent; }
html[data-theme="light"] .lang-option { color: #2d3d33; }
html[data-theme="light"] .lang-option:hover { background: rgba(43, 106, 76, .08); color: #0f1a14; }
html[data-theme="light"] .lang-status { color: #b42318; background: #ffffff; }

/* texte de la barre en mode clair (classes Tailwind utilisées dans la barre) */
html[data-theme="light"] :is(#mainNav, #mobile-menu) .text-white { color: #0f1a14 !important; }
html[data-theme="light"] :is(#mainNav, #mobile-menu) .text-gray-300,
html[data-theme="light"] :is(#mainNav, #mobile-menu) .text-gray-400 { color: #4b5b51 !important; }
html[data-theme="light"] #mobile-menu a.btn-primary, html[data-theme="light"] #mobile-menu a.btn-primary * { color: #f4f7f3 !important; }
html[data-theme="light"] #mobile-menu-btn { color: #0f1a14 !important; }

/* ---------- Bouton flottant + transition (copie fidèle d'index) ---------- */
.mf-theme-fab {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(var(--mf-fab-offset, 0px) + 16px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  width: 48px; height: 48px; padding: 0; margin: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(202, 222, 211, .30);
  background: rgba(16, 21, 18, .9);
  color: #e6eee9;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-transform: translateZ(0); transform: translateZ(0);
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease, scale .15s ease;
}
.mf-theme-fab:active { scale: .93; }
@media (hover: hover) { .mf-theme-fab:hover { scale: 1.07; border-color: rgba(202, 222, 211, .55); } }
.mf-theme-fab:focus-visible { outline: 2px solid #2979FF; outline-offset: 3px; }
.mf-theme-fab svg { width: 22px; height: 22px; display: block; pointer-events: none; }
.mf-theme-fab .ic-moon { display: none; }
html[data-theme="light"] .mf-theme-fab {
  background: rgba(255, 255, 255, .94);
  color: #0f1a14;
  border-color: rgba(15, 32, 22, .22);
  box-shadow: 0 8px 24px rgba(15, 32, 22, .18);
}
html[data-theme="light"] .mf-theme-fab .ic-sun { display: none; }
html[data-theme="light"] .mf-theme-fab .ic-moon { display: block; }
html.mf-theme-anim, html.mf-theme-anim *, html.mf-theme-anim *::before, html.mf-theme-anim *::after {
  transition: background-color .28s ease, color .28s ease, border-color .28s ease, fill .28s ease, stroke .28s ease, box-shadow .28s ease !important;
}
@media (prefers-reduced-motion: reduce) {
  .mf-theme-fab { transition: none; }
  html.mf-theme-anim, html.mf-theme-anim *, html.mf-theme-anim *::before, html.mf-theme-anim *::after { transition: none !important; }
}

/* Texte blanc conservé sur les fonds colorés (boutons d'accent, badges, avatars dégradés) */
html[data-theme="light"] :is(
  [class~="bg-red-500"], [class~="bg-red-600"], [class~="bg-red-700"],
  [class~="bg-green-500"], [class~="bg-green-600"], [class~="bg-green-700"],
  [class~="bg-emerald-500"], [class~="bg-emerald-600"], [class~="bg-emerald-700"],
  [class~="bg-blue-500"], [class~="bg-blue-600"], [class~="bg-blue-700"],
  [class~="bg-indigo-500"], [class~="bg-indigo-600"], [class~="bg-purple-500"], [class~="bg-purple-600"],
  [class~="bg-violet-500"], [class~="bg-violet-600"], [class~="bg-pink-500"], [class~="bg-pink-600"],
  [class~="bg-orange-500"], [class~="bg-orange-600"], [class~="bg-amber-500"], [class~="bg-amber-600"],
  [class~="bg-teal-500"], [class~="bg-teal-600"], [class~="bg-cyan-500"], [class~="bg-cyan-600"],
  [class~="bg-sky-500"], [class~="bg-sky-600"], [class~="bg-rose-500"], [class~="bg-rose-600"],
  [class*="bg-gradient-to"], [class*="from-blue-"], [class*="from-indigo-"], [class*="from-purple-"],
  [class*="from-emerald-"], [class*="from-green-"], [class*="from-red-"], [class*="from-orange-"], [class*="from-pink-"]
) :is(.text-white, [class~="text-white"]),
html[data-theme="light"] :is(
  [class~="bg-red-500"], [class~="bg-red-600"], [class~="bg-green-500"], [class~="bg-green-600"],
  [class~="bg-emerald-500"], [class~="bg-emerald-600"], [class~="bg-blue-500"], [class~="bg-blue-600"],
  [class~="bg-indigo-500"], [class~="bg-indigo-600"], [class~="bg-purple-500"], [class~="bg-purple-600"],
  [class~="bg-orange-500"], [class~="bg-orange-600"], [class~="bg-amber-500"], [class~="bg-pink-500"],
  [class*="bg-gradient-to"]
):is(.text-white, [class~="text-white"]) { color: #ffffff !important; }


/* ============================================================
   MF-FIX — corrections transverses des pages publiques
   (chargé en dernier sur chaque page publique → gagne sur les styles de page)
   ============================================================ */

/* 1) Titres dégradés en mode clair.
      Les règles de page écrivaient « background: linear-gradient(...) » : le raccourci remettait
      background-clip à sa valeur par défaut, le texte devenait transparent et on voyait un BLOC plein.
      On force ici le dégradé ET le découpage sur le texte, pour la classe commune et pour les
      <span> dégradés écrits en style inline. */
html[data-theme="light"] .text-gradient-modern,
html[data-theme="light"] [style*="background-clip"] {
  background-color: transparent !important;
  background-image: linear-gradient(135deg, #0f1a14 0%, #849388 100%) !important;
  -webkit-background-clip: text !important;
          background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

/* 2) Boutons .btn-primary placés dans un bloc .legal-text :
      la règle « .legal-text a » imposait la couleur du lien (blanc en sombre, noir en clair)
      → texte identique au fond du bouton, donc illisible. (La barre du haut a ses propres règles #mainNav.) */
a.btn-primary, .legal-text a.btn-primary { color: #000000 !important; }
html[data-theme="light"] a.btn-primary,
html[data-theme="light"] .legal-text a.btn-primary { color: #f4f7f3 !important; }
