/* =========================================================================
   GALAXY THEME — Espace profond "Star Wars"
   Override la palette claire du site pour basculer en mode nuit.
   Chargé APRÈS /css/style.css pour gagner la cascade.
   ========================================================================= */

:root {
  /* Tokens galaxie (lus par /js/galaxy.js) */
  --c-primary:  #2e6bff;
  --c-primary-2: #5b9dff;
  --c-cyan:     #4dd2ff;
  --c-violet:   #6a4bff;
  --c-gold:     #ffe81f;
  --c-dark:     #020207;
  --c-deep:     #000000;
  --c-ink:      #e8edf6;
  --c-gray:     #9aa3b8;

  /* Override palette site : du clair vers le sombre */
  --bg: transparent;
  --bg-cream: rgba(255, 255, 255, 0.018);
  --bg-cta: rgba(46, 107, 255, 0.06);
  --bg-dark: rgba(0, 0, 0, 0.55);
  --bg-dark-2: rgba(0, 0, 0, 0.65);
  --text: #e8edf6;
  --text-muted: #9aa3b8;
  --text-light: rgba(255, 255, 255, 0.78);
  --primary: #5b9dff;
  --primary-dark: #2e6bff;
  --primary-light: #8fb8ff;
  --primary-glow: rgba(91, 157, 255, 0.22);
  --accent: #6a4bff;
  --accent-light: #9580f0;
  --white: rgba(15, 18, 32, 0.55);
  --card-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 50px rgba(0, 0, 0, 0.6);
  --card-shadow-hover: 0 0 0 1px rgba(91, 157, 255, 0.22), 0 28px 70px rgba(46, 107, 255, 0.22);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(91, 157, 255, 0.4);
}

/* Body : fond noir profond, texte clair, le canvas vit dessous */
html, body { background: var(--c-deep); color: var(--c-ink); }

/* Nouveau fond galaxie : conteneur fixé plein écran */
#spirit-galaxy {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  display: block;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 90% at 50% 30%, #0a1024 0%, #060a18 45%, #02030a 100%);
}
#spirit-galaxy canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#spirit-galaxy::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 90% 75% at 50% 45%, transparent 55%, rgba(0, 2, 8, .55) 100%);
}

/* Le contenu du body passe au-dessus du conteneur galaxie */
body > *:not(#spirit-galaxy):not(script):not(style):not(link) {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Header : glass sombre, traversable par le canvas
   ========================================================================== */
.site-header {
  background: rgba(2, 2, 7, 0.55) !important;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.site-header.scrolled {
  background: rgba(2, 2, 7, 0.85) !important;
}

/* Logo : on garde la couleur d'origine (bleu Spirit). Seul le texte passe en clair pour rester lisible. */
.logo-img, .header-logo img, .footer-logo img { filter: none; }
.logo-name, .header-logo .logo-name { color: var(--c-ink); }

/* Liens nav */
.header-nav a, .mobile-menu a { color: var(--c-ink); }
.header-nav a:hover, .mobile-menu a:hover, .header-nav a.active { color: var(--c-primary-2); }
.mobile-toggle span { background: var(--c-ink); }
.mobile-menu, .nav-overlay { background: rgba(2, 2, 7, 0.95); backdrop-filter: blur(20px); }

/* ==========================================================================
   Typo : titres clairs, sous-titres atténués
   ========================================================================== */
h1, h2, h3, h4, h5, h6,
.section-title, .hero h1, .hero h2 { color: var(--c-ink); }

p, li, .section-subtitle, .hero-subtitle { color: var(--text-light); }

.section-label, .eyebrow { color: var(--c-primary-2); }

a:not(.btn):not(.header-logo):not(.footer-logo) { color: var(--c-primary-2); }
a:not(.btn):not(.header-logo):not(.footer-logo):hover { color: var(--c-cyan); }

/* ==========================================================================
   Cartes : effet glass (verre dépoli) sur la galaxie
   ========================================================================== */
.card, .service-card, .profile-card, .pricing-card, .plan-card,
.feature-card, .stat-card, .testimonial-card, .faq-item,
.calc-card, .diag-calc .calc-card, .case-card {
  background: rgba(15, 18, 32, 0.55) !important;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  color: var(--c-ink);
}
.card:hover, .service-card:hover, .pricing-card:hover, .case-card:hover {
  border-color: rgba(91, 157, 255, 0.3) !important;
  box-shadow: 0 0 0 1px rgba(91, 157, 255, 0.18), 0 30px 70px rgba(46, 107, 255, 0.22);
}

/* Case-card : visual sombre + glow primary, lien "Voir le site" */
.case-visual {
  background: linear-gradient(135deg, rgba(46, 107, 255, 0.18), rgba(106, 75, 255, 0.22)) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.case-visual-mark { color: var(--c-ink) !important; }
.case-link a {
  display: inline-block;
  margin-top: 12px;
  font-weight: 600;
  color: var(--c-primary-2);
  text-decoration: none;
  border-bottom: 1px solid var(--c-primary-2);
  transition: color 0.2s, border-color 0.2s;
}
.case-link a:hover { color: var(--c-cyan); border-color: var(--c-cyan); }

/* Sections : bg cream → quasi transparent */
.section-cream, .section.section-cream { background: rgba(255, 255, 255, 0.015); }
.section-dark, .section.section-dark { background: rgba(0, 0, 0, 0.35); }

/* ==========================================================================
   Boutons : primary plus lumineux + glow bleu
   ========================================================================== */
.btn-primary {
  background: linear-gradient(135deg, #2e6bff 0%, #5b9dff 100%) !important;
  color: #fff !important;
  border: 0;
  box-shadow: 0 8px 28px rgba(46, 107, 255, 0.45);
}
.btn-primary:hover {
  box-shadow: 0 12px 38px rgba(46, 107, 255, 0.6), 0 0 0 1px rgba(91, 157, 255, 0.4);
  transform: translateY(-2px);
}
.btn-ghost, .btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--c-ink);
}
.btn-ghost:hover, .btn-outline:hover {
  border-color: rgba(91, 157, 255, 0.5);
  background: rgba(91, 157, 255, 0.08);
}
.btn-gold {
  background: var(--c-gold) !important;
  color: #1a1a1a !important;
  box-shadow: 0 6px 24px rgba(255, 232, 31, 0.25);
}

/* ==========================================================================
   Formulaires
   ========================================================================== */
input, textarea, select {
  background: rgba(0, 0, 0, 0.4) !important;
  color: var(--c-ink) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--c-primary-2) !important;
  box-shadow: 0 0 0 3px rgba(91, 157, 255, 0.18) !important;
  outline: 0;
}
input::placeholder, textarea::placeholder { color: rgba(232, 237, 246, 0.4); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer, footer.footer, .footer {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--c-ink);
}
.site-footer a, .footer a { color: rgba(232, 237, 246, 0.7); }
.site-footer a:hover, .footer a:hover { color: var(--c-primary-2); }

/* ==========================================================================
   Diagnostic / calc — ajustements glass spécifiques
   ========================================================================== */
.diag-calc .calc-label, .diag-recap-label { color: var(--c-primary-2) !important; }

/* Audit contraste 2026-06-12 : chip active en bleu plus saturé (passe 2.7→4.5:1) */
.diag-calc .chip.on { background: #2e6bff !important; border-color: #2e6bff !important; }

/* Audit contraste 2026-06-12 : rouge éclairci sur récap (passe 3.0→5.4:1) */
.diag-recap-amount b { color: #EF4444 !important; }

/* ==========================================================================
   Fix invisibilité 2026-06-12 — color: var(--white) devenait rgba(15,18,32,0.55)
   (verre dark) en mode galaxie → texte invisible sur fond noir.
   Données chiffrées → OR (#ffe81f, même que le bouton "Réserver un appel").
   Textes/headings → blanc ink. Décoratifs sur gradient → blanc plein.
   ========================================================================== */
.stat-item .stat-number,
.stats-band .stat-number,
.stat-number {
  color: #ffe81f !important;
}
.cta-band h2,
.footer-logo-link .logo-name,
.footer-col h4,
.blog-card-category {
  color: var(--c-ink) !important;
}
.testimonial-avatar,
.step-number,
.pricing-badge {
  color: #ffffff !important;
}
.diag-recap-card {
  background: rgba(15, 18, 32, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.diag-recap-values, .diag-recap-amount { color: var(--text-light); }
.diag-recap-amount { border-top-color: rgba(255, 255, 255, 0.08); }

/* Bloc rouge "perte" — éclaircir pour rester lisible */
.diag-compare-card.loss { background: rgba(185, 28, 28, 0.18); border-color: rgba(185, 28, 28, 0.4); }
.diag-compare-card.gain { background: rgba(4, 120, 87, 0.18); border-color: rgba(4, 120, 87, 0.4); }
.diag-compare-amount { color: var(--c-ink); }

/* ==========================================================================
   Stripe / blocs spéciaux : ne pas casser
   ========================================================================== */
.stripe-buy-button { filter: none; }

/* ==========================================================================
   AUTO-HIDE HEADER — le header glisse hors écran et revient au survol du sommet.
   Activé uniquement par <body class="auto-hide-header"> (= home desktop, via JS inline).
   Touch devices : non concernés (matchMedia hover:none).
   Pendant l'intro : opacity:0 de body.intro-running > * masque déjà le header,
   et body.header-hidden ajoute le translateY pour que la transition de fin d'intro
   ne fasse pas flasher le header brièvement.
   ========================================================================== */
body.auto-hide-header .site-header {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  will-change: transform, opacity;
}
body.auto-hide-header.header-hidden .site-header {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}
/* Hot-zone indicateur très discret au sommet (suggère où survoler) */
body.auto-hide-header.header-hidden::before {
  content: "";
  position: fixed;
  top: 0; left: 50%;
  width: 64px; height: 2px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(91, 157, 255, 0.45), transparent);
  border-radius: 0 0 3px 3px;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  animation: hotZoneHint 4s ease-in-out 1.5s 2;
}
@keyframes hotZoneHint {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.7; }
}

/* ==========================================================================
   HERO MINIMAL — home : 2 boutons centrés, plein viewport, max d'air.
   Le visiteur respire, la galaxie tient le visuel.
   ========================================================================== */
.hero.hero-minimal {
  min-height: calc(100vh - 88px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  border-bottom: 0;
  background: transparent;
}
.hero.hero-minimal::before { display: none; }
.hero.hero-minimal .hero-buttons {
  margin-bottom: 0;
  gap: 22px;
}
@media (max-width: 600px) {
  .hero.hero-minimal .hero-buttons {
    flex-direction: column;
    gap: 14px;
    width: 100%;
    padding: 0 20px;
  }
  .hero.hero-minimal .hero-buttons .btn { width: 100%; }
}

/* ==========================================================================
   INTRO d'ouverture (home uniquement, déclenchée par <body class="intro-running">)
   Contenu du site masqué pendant que le pégase galope, puis fade-in.
   Le canvas reste visible : c'est lui qui joue l'animation.
   ========================================================================== */
body.intro-running { overflow: hidden; }
body.intro-running > *:not(#spirit-galaxy):not(script):not(style):not(link) {
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
}
body.ready > *:not(#spirit-galaxy):not(script):not(style):not(link) {
  opacity: 1;
  transform: none;
  transition: opacity 1.1s ease, transform 1.1s ease;
}

/* Pas d'intro pour les utilisateurs qui demandent réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
  body.intro-running > *:not(#spirit-galaxy):not(script):not(style):not(link),
  body.intro-running { overflow: visible; }
  body.intro-running > *:not(#spirit-galaxy):not(script):not(style):not(link) {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

/* ==========================================================================
   Réduction de mouvement : enlever blur (coût GPU), garder transparence
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .card, .service-card, .pricing-card,
  .site-header, .mobile-menu, .site-footer {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* ==========================================================================
   SPIRIT STARS — composant planètes WebGL (home uniquement)
   Conteneur en pointer-events:none → seules les .star-cta capturent la souris.
   Z-index interne : layer-trails=1, layer-3d=2, star-cta calculé en JS (~10-30).
   ========================================================================== */
#spirit-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
#spirit-stars canvas.layer-trails,
#spirit-stars canvas.layer-3d {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
#spirit-stars canvas.layer-trails { z-index: 1; }
#spirit-stars canvas.layer-3d    { z-index: 2; }

.star-cta {
  position: absolute;
  top: 0; left: 0;
  width: var(--size, 64px);
  height: var(--size, 64px);
  border-radius: 50%;
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  will-change: transform;
}
.star-cta:focus-visible {
  box-shadow: 0 0 0 3px rgba(255,255,255,.7), 0 0 24px var(--glow-soft);
}
.star-cta .label {
  position: absolute;
  left: calc(var(--size, 64px) + 18px);
  top: 50%;
  transform: translateY(-50%) translateX(-14px);
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.13), rgba(255,255,255,.05));
  border: 1px solid var(--glow-soft);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(0,0,0,.35), 0 0 18px var(--glow-faint);
  opacity: 0;
  clip-path: inset(0 100% 0 0 round 999px);
  transition:
    clip-path .55s cubic-bezier(.22,1,.36,1),
    opacity   .35s ease,
    transform .55s cubic-bezier(.22,1,.36,1);
  pointer-events: none;
}
.star-cta .label .arrow {
  display: inline-block;
  transform: translateX(-6px); opacity: 0;
  transition: transform .45s cubic-bezier(.22,1,.36,1) .15s, opacity .3s ease .15s;
}
.star-cta.label-left .label {
  left: auto;
  right: calc(var(--size, 64px) + 18px);
  transform: translateY(-50%) translateX(14px);
  clip-path: inset(0 0 0 100% round 999px);
  flex-direction: row-reverse;
}
.star-cta.label-left .label .arrow { transform: translateX(6px) rotate(180deg); }
.star-cta:hover .label,
.star-cta:focus-visible .label {
  opacity: 1;
  clip-path: inset(0 0 0 0 round 999px);
  transform: translateY(-50%) translateX(0);
}
.star-cta:hover .label .arrow,
.star-cta:focus-visible .label .arrow { opacity: 1; transform: translateX(0); }
.star-cta.label-left:hover .label .arrow,
.star-cta.label-left:focus-visible .label .arrow { transform: translateX(0) rotate(180deg); }
.star-cta.star-blue { --glow-soft: rgba(59, 130, 246, .45); --glow-faint: rgba(37, 99, 235, .22); }
.star-cta.star-sun  { --glow-soft: rgba(251, 191, 36, .5); --glow-faint: rgba(245, 158, 11, .25); }
@media (max-width: 720px) {
  .star-cta .label { font-size: 13px; padding: 7px 14px; }
}
