/* Galaxy — thème « soleil » (clair) / « espace » (sombre), commun à tout le site.

   <html data-theme="sun|space"> est posé avant l'affichage (base.html) : choix
   mémorisé du visiteur, sinon le design natif de la page (vitrine sombre,
   espace client clair). Ce fichier, chargé après les autres, ne fait que
   basculer les pages dans le thème qui n'est pas le leur :
     - espace sur une page claire  → variables de site.css en sombre ;
     - soleil sur une page vitrine → variables de vitrine.css en clair.
   Les pages servies par HAProxy (maintenance, erreurs) ne sont pas concernées. */

html[data-theme="sun"] { color-scheme: light; }
html[data-theme="space"] { color-scheme: dark; }

/* ── Bouton (coin inférieur droit) ─────────────────────────────────────── */
.theme-toggle { position: fixed; right: 1rem; bottom: 1rem; z-index: 40; display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 50%; cursor: pointer;
  color: #5d6679; background: rgba(255, 255, 255, .8); border: 1px solid rgba(29, 36, 51, .12);
  box-shadow: 0 4px 14px rgba(16, 24, 40, .12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: .7; transition: opacity .2s, transform .2s, color .2s; }
.theme-toggle:hover, .theme-toggle:focus-visible { opacity: 1; transform: rotate(-12deg); background: rgba(255, 255, 255, .8); }
.theme-toggle:focus-visible { outline: 2px solid #3b4fd8; outline-offset: 3px; }
.theme-toggle svg { width: 1.2rem; height: 1.2rem; }
html[data-theme="space"] .theme-toggle { color: #f5c96a; background: rgba(15, 18, 41, .8); border-color: rgba(160, 170, 255, .2);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .45); }
html[data-theme="space"] .theme-toggle:hover { background: rgba(15, 18, 41, .8); }
/* Icône de la destination : le soleil en mode espace, la planète en mode soleil */
.theme-toggle .ico-sun, html[data-theme="space"] .theme-toggle .ico-space { display: none; }
html[data-theme="space"] .theme-toggle .ico-sun { display: block; }
@media print { .theme-toggle { display: none; } }

/* ── Espace : pages claires (espace client, comptes…) en sombre ────────── */
html[data-theme="space"] body:not(.lp) {
  --bg: #070918; --card: #0f1229; --text: #e6e8f5; --muted: #9aa1c2; --line: rgba(160, 170, 255, .16);
  --primary: #7d8aff; --primary-dark: #6372ff; --ok: #3ddc97; --ok-bg: rgba(61, 220, 151, .12);
  --err: #ff8a80; --err-bg: rgba(255, 90, 80, .13); --info-bg: rgba(109, 124, 255, .15);
  --warn-bg: rgba(245, 184, 74, .12); --warn: #ffd08a;
}
html[data-theme="space"] body:not(.lp) input:not([type=checkbox]):not([type=radio]),
html[data-theme="space"] body:not(.lp) select,
html[data-theme="space"] body:not(.lp) textarea { background: #0a0d20; color: var(--text); }
html[data-theme="space"] body:not(.lp) .mode-card:has(input:checked) { background: var(--info-bg); }
html[data-theme="space"] body:not(.lp) .slider { background: #39406a; }
html[data-theme="space"] body:not(.lp) .plan-card:hover { border-color: rgba(125, 138, 255, .5); }
html[data-theme="space"] body:not(.lp) .feat li.no .ico { color: #59607f; }
html[data-theme="space"] body:not(.lp) nav.menu a.btn { box-shadow: 0 2px 10px rgba(109, 124, 255, .3); }

/* ── Soleil : pages vitrine en clair ───────────────────────────────────── */
html[data-theme="sun"] body.lp {
  --lp-bg: #f6f7fb; --lp-bg2: #fff; --lp-text: #1d2433; --lp-dim: #5d6679; --lp-line: rgba(29, 36, 51, .12);
  --lp-glass: rgba(255, 255, 255, .72); --lp-indigo: #4f5cf0; --lp-cyan: #0a9fb3; --lp-violet: #8a4cf0; --lp-ok: #1f9d63;
  --lp-grad: linear-gradient(100deg, #0a9fb3, #4f5cf0 45%, #8a4cf0);
}
html[data-theme="sun"] body.lp a { color: #3b4fd8; }
html[data-theme="sun"] body.lp header.top { background: rgba(255, 255, 255, .78); }
html[data-theme="sun"] body.lp nav.menu a.btn { color: #fff; background: #3b4fd8; border-color: #3b4fd8; }
html[data-theme="sun"] body.lp .subnav a:hover { color: #3b4fd8; }
html[data-theme="sun"] body.lp .messages li { background: #fff; }
html[data-theme="sun"] body.lp .lp-btn-ghost { background: #fff; }
html[data-theme="sun"] body.lp .lp-btn-ghost:hover { background: #eef1ff; }
html[data-theme="sun"] body.lp .lp-btn-note { border-left-color: rgba(255, 255, 255, .5); }
html[data-theme="sun"] body.lp .lp-cell { background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
html[data-theme="sun"] body.lp .lp-cell-wide { background: radial-gradient(120% 140% at 0% 0%, rgba(79, 92, 240, .1), transparent 55%), #fff; }
html[data-theme="sun"] body.lp .lp-ico { color: #3b4fd8; background: #eef1ff; border-color: rgba(79, 92, 240, .2); }
html[data-theme="sun"] body.lp .lp-plan { background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .05); }
html[data-theme="sun"] body.lp .lp-plan.is-featured { background: linear-gradient(#fff, #fff) padding-box, var(--lp-grad) border-box;
  box-shadow: 0 18px 40px -24px rgba(79, 92, 240, .55); }
html[data-theme="sun"] body.lp .lp-plan-tag { color: #fff; }
html[data-theme="sun"] body.lp .lp-plan-go { color: #3b4fd8; }
html[data-theme="sun"] body.lp .lp-domain { background: radial-gradient(80% 120% at 50% 0%, rgba(10, 159, 179, .09), transparent 60%), #fff; }
html[data-theme="sun"] body.lp .lp-search { background: #fff; border-color: rgba(79, 92, 240, .3); box-shadow: 0 0 0 6px rgba(79, 92, 240, .06); }
html[data-theme="sun"] body.lp .lp-search input::placeholder { color: #9aa1b9; }
html[data-theme="sun"] body.lp .lp-tlds li { background: #fff; }
html[data-theme="sun"] body.lp .lp-steps li { background: #fff; }
html[data-theme="sun"] body.lp .lp-faq details { background: #fff; }
html[data-theme="sun"] body.lp .lp-final { background: radial-gradient(60% 120% at 50% 120%, rgba(138, 76, 240, .16), transparent 70%),
  radial-gradient(50% 90% at 50% -30%, rgba(10, 159, 179, .12), transparent 70%), #fff; border-color: rgba(79, 92, 240, .25); }
/* Accueil : schéma et ciel */
html[data-theme="sun"] body.lp .lp-node { background: #fff; }
html[data-theme="sun"] body.lp .lp-orbit { box-shadow: 0 30px 70px -40px rgba(79, 92, 240, .45); }
html[data-theme="sun"] body.lp .lp-stars { display: none; }
html[data-theme="sun"] body.lp .lp-aurora { opacity: .55; }
/* Pages produit */
html[data-theme="sun"] body.lp .vt-banner { color: #8a5a00; background: #fff6e0; border-color: rgba(138, 90, 0, .25); }
html[data-theme="sun"] body.lp .vt-banner strong { color: #6b4500; }
html[data-theme="sun"] body.lp .vt-billing { background: #fff; }
html[data-theme="sun"] body.lp .vt-billing input:checked + label { background: #eef1ff; color: #3b4fd8; }
html[data-theme="sun"] body.lp .vt-included, html[data-theme="sun"] body.lp .vt-list,
html[data-theme="sun"] body.lp .vt-table-wrap { background: #fff; }
html[data-theme="sun"] body.lp .vt-compare thead th { background: #f8f9ff; }
html[data-theme="sun"] body.lp .vt-compare thead th.is-featured { color: #3b4fd8; }
html[data-theme="sun"] body.lp .vt-compare tbody tr:hover { background: #fafbff; }
html[data-theme="sun"] body.lp .vt-no { color: #b9bfcc; }
html[data-theme="sun"] body.lp .vt-tech code { color: #2c3db3; background: #eef1ff; }
/* Page des noms de domaine */
html[data-theme="sun"] body.lp .vt-results > li.is-free { background: linear-gradient(90deg, rgba(31, 157, 99, .08), transparent 60%); }
html[data-theme="sun"] body.lp .vt-pill { background: #f3f4f8; }
html[data-theme="sun"] body.lp .vt-pill.is-ok { background: #e7f6ee; }
html[data-theme="sun"] body.lp .vt-pill.is-info { color: #3b4fd8; background: #eef1ff; }
html[data-theme="sun"] body.lp .vt-pill.is-err { color: #b42318; background: #fdecea; }
html[data-theme="sun"] body.lp .vt-suggest { background: #fff; }
html[data-theme="sun"] body.lp .vt-tools input, html[data-theme="sun"] body.lp .vt-tools select { background: #fff; }
html[data-theme="sun"] body.lp .vt-tld thead th { background: #f8f9ff; }
/* Pied de page */
html[data-theme="sun"] body.lp footer.ft { --ft-accent: #3b4fd8; background: radial-gradient(60% 80% at 50% 0%, rgba(79, 92, 240, .06), transparent 70%); }
html[data-theme="sun"] body.lp .ft-word { background-image: linear-gradient(180deg, rgba(79, 92, 240, .16), transparent 85%); }
html[data-theme="space"] body:not(.lp) .ft-word { background-image: linear-gradient(180deg, rgba(160, 170, 255, .2), transparent 85%); }
/* « Haut de page » (#top, sans élément de ce nom : haut du document) : défilement doux */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
