/* ============================================================================================
   INTERRUPTEUR CLAIR / SOMBRE (composant commun MYDMC, 13.11.2026, demande de David à 23:35)
   « Clair ◯ Sombre » en haut à droite, partout à la même place : panels du noyau, panel agence et
   espace client de mydmc.ch, pages de connexion. Dessin repris de l'interrupteur « Visible par le
   client » de la fiche client (piste + bouton rond, pilule de 44 px), avec l'icône dans le bouton rond.

   Couleurs : jetons déjà définis par le noyau et par ec.css (--encre, --doux, --bord, --bord-2,
   --verre-2, --nuit, --accent / --ok). Rien à régler par site.
   Placement :
     .mydmc-theme-fixe   en haut à droite de la fenêtre (ordinateur, pages de connexion)
     dans une barre      (téléphone) : le bouton prend place à droite de la barre du haut, sans position fixe
   ============================================================================================ */
.mydmc-theme {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  min-height: 44px; padding: 4px 12px; margin: 0;
  border: 1px solid var(--bord, rgba(127,127,127,.35)); border-radius: 999px;
  background: var(--verre-2, rgba(127,127,127,.12));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: var(--encre, CanvasText); font: inherit; font-size: .875rem; line-height: 1.2; white-space: nowrap;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color .2s cubic-bezier(.22,1,.36,1), transform .12s cubic-bezier(.22,1,.36,1);
}
.mydmc-theme:hover { border-color: var(--bord-2, rgba(127,127,127,.6)); }
.mydmc-theme:active { transform: scale(.97); transition-duration: 0s; }
.mydmc-theme:focus-visible { outline: 2px solid var(--encre, CanvasText); outline-offset: 2px; }
.mydmc-theme-mot { color: var(--doux, GrayText); font-weight: 500; transition: color .2s cubic-bezier(.22,1,.36,1); }
html:not([data-theme="dark"]) .mydmc-theme .mydmc-theme-clair,
html[data-theme="dark"] .mydmc-theme .mydmc-theme-sombre { color: var(--encre, CanvasText); font-weight: 650; }
.mydmc-theme-piste {
  position: relative; flex: none; width: 42px; height: 24px; border-radius: 999px;
  border: 1px solid var(--bord-2, rgba(127,127,127,.6)); background: transparent;
  transition: background-color .2s cubic-bezier(.22,1,.36,1), border-color .2s cubic-bezier(.22,1,.36,1);
}
.mydmc-theme-rond {
  position: absolute; top: 1px; left: 1px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--encre, CanvasText); color: var(--nuit, Canvas);
  transition: transform .25s cubic-bezier(.65,0,.35,1);
}
.mydmc-theme-rond svg { width: 14px; height: 14px; display: block; }
html[data-theme="dark"] .mydmc-theme .mydmc-theme-piste {
  background: color-mix(in srgb, var(--accent, var(--ok, #3BB273)) 30%, transparent);
  border-color: color-mix(in srgb, var(--accent, var(--ok, #3BB273)) 70%, transparent);
}
html[data-theme="dark"] .mydmc-theme .mydmc-theme-rond { transform: translateX(18px); }
.mydmc-theme .ico-lune { display: none; }
html[data-theme="dark"] .mydmc-theme .ico-lune { display: block; }
html[data-theme="dark"] .mydmc-theme .ico-soleil { display: none; }

/* L'apparence suit data-theme sur <html> (posé avant le premier dessin) : juste même avant le script. */
/* Même place partout : en haut à droite. */
.mydmc-theme-fixe { position: fixed; top: max(12px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); z-index: 60; }

/* Petits téléphones : le libellé reste, seuls les espaces se resserrent. */
@media (max-width: 380px) {
  .mydmc-theme { gap: 6px; padding: 4px 10px; font-size: .875rem; }
  .mydmc-theme-piste { width: 38px; }
  html[data-theme="dark"] .mydmc-theme .mydmc-theme-rond { transform: translateX(14px); }
}
@media (prefers-reduced-motion: reduce) {
  .mydmc-theme, .mydmc-theme-rond, .mydmc-theme-piste, .mydmc-theme-mot { transition: none; }
  .mydmc-theme:active { transform: none; }
}
@media print { .mydmc-theme { display: none !important; } }

/* ── Place dans le panel du noyau (13.11.2026) ──────────────────────────────────────────────────────────────
   Ordinateur (≥ 900 px) : en haut à droite de la zone de travail, à côté du titre de l'écran (flottant à droite,
   il ne cache rien et ne pousse pas l'écran vers le bas). Téléphone : à droite de la barre du haut.
   Pages de connexion : en haut à droite de la fenêtre. */
html[data-design][data-theme] .mydmc-theme-ordi { position: static; float: right; margin: 0 0 8px 16px; }
html[data-design][data-theme] .mydmc-theme-barre { margin-left: auto; }
@media (max-width: 899px) { html[data-design][data-theme] :is(.mydmc-theme-ordi, .mydmc-theme-menu) { display: none; } }
@media (min-width: 900px) { html[data-design][data-theme] .mydmc-theme-barre { display: none; } }

/* ── Interrupteur dans la barre de gauche, SOUS le bouton menu ≡ (David, 14.11.2026 11:50) ─────────────────────
   Ordinateur (≥ 900 px) : ≡ puis l'interrupteur, l'un sous l'autre, centrés ; seulement la piste et l'icône lune / soleil
   (mêmes mesures que sur la carte de connexion), aucun texte « Clair / Sombre ». Barre repliée : même colonne, toujours
   visible. Téléphone : la barre de gauche est un tiroir, l'interrupteur reste dans la barre du haut (inchangé). */
@media (min-width: 900px) {
  html[data-design][data-theme] .menu-entete .marque-btns:has(> .mydmc-theme-menu) { display: flex; flex-direction: column; align-items: center; gap: 6px; }
  html[data-design][data-theme] .marque-btns > .mydmc-theme-menu {
    position: static; margin: 0; padding: 0 2px; gap: 0; min-width: 48px; min-height: 44px; justify-content: center;
    border-color: transparent; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  html[data-design][data-theme] .marque-btns > .mydmc-theme-menu:hover { border-color: transparent; }
  html[data-design][data-theme] .marque-btns > .mydmc-theme-menu .mydmc-theme-mot { display: none; }
  html[data-design][data-theme] .marque-btns > .mydmc-theme-menu .mydmc-theme-piste { width: 40px; height: 24px; }
  html[data-design][data-theme] .marque-btns > .mydmc-theme-menu .mydmc-theme-rond { width: 20px; height: 20px; }
  html[data-design][data-theme="dark"] .marque-btns > .mydmc-theme-menu .mydmc-theme-rond { transform: translateX(16px); }
}

/* ── Fond « Ruban » très discret sur TOUS les écrans du panel et de l'espace client (David, 14.11.2026 11:50) ──
   Les pages d'accès gardent leur ruban à elles (plus haut). Ici : le même dessin (fond-ruban-sombre.svg / -clair.svg),
   FIXE (aucune animation, §5.33), tout au fond : sous le fond pointillé de la page, sous les halos, sous les cartes et
   sous chaque texte (z-index -1 ; le fond uni du body passe sur <html>, qui a déjà la même couleur). Ne capte aucun clic.
   Il n'est pas imprimé. */
html[data-design][data-theme] body:has(.menu-lateral):not(:has(.login-wrap, .seul > .boite)) { background-color: transparent; }
html[data-design][data-theme] body:has(.menu-lateral):not(:has(.login-wrap, .seul > .boite))::before {
  content: ""; display: block; position: fixed; inset: 0; z-index: -1; pointer-events: none; filter: none;
  background: url("fond-ruban-sombre.svg") center / 100% 100% no-repeat; opacity: .5;
}
html[data-design][data-theme="light"] body:has(.menu-lateral):not(:has(.login-wrap, .seul > .boite))::before { background-image: url("fond-ruban-clair.svg"); opacity: .45; }

/* ── Signature « With ♡ by MYDMC » du panel (connexion, invitation) : logo et texte alignés (13.11.2026) ──────
   mydmc-blanc.svg porte « DMC » en haut (7,7 → 67 %) et « Crée ton ADN » dessous : seules les lettres restent,
   à la hauteur du texte, centrées sur la ligne (même réglage que le composant signature-mydmc.css des sites). */
html[data-design][data-theme] .signature-mydmc { display: inline-flex; align-items: center; gap: .45em; }
html[data-design][data-theme] .signature-mydmc > span { line-height: 1.5; }
html[data-design][data-theme] .signature-mydmc img[src*="mydmc-blanc"] {
  --h: 1em; display: block; flex: none; max-width: none;
  height: calc(var(--h) / .605); width: auto;
  margin: calc(var(--h) * -.1157) calc(var(--h) * -.17) calc(var(--h) * -.5372) calc(var(--h) * -.10);
  clip-path: inset(7% 0 32.5% 0);
}

/* Bande « With ♡ by MYDMC » en bas du menu (extensions/contact-mydmc.php, logo officiel) : même alignement.
   mydmc-officiel-blanc.svg : lettres de 8,2 à 71,2 % de la hauteur, ligne « mydmc.ch | Crée ton ADN » dessous. */
html[data-design][data-theme] .cm-bouton { align-items: center; }
html[data-design][data-theme] .cm-signature { line-height: 1.5; }
html[data-design][data-theme] .cm-logo {
  --h: 1.15em; flex: none; max-width: none;
  width: auto; height: calc(var(--h) / .64);
  margin: calc(var(--h) * -.1203) calc(var(--h) * -.16) calc(var(--h) * -.4422) calc(var(--h) * -.1445);
  clip-path: inset(7.7% 0 28.3% 0);
}

/* ============================================================================================
   PAGES D'ACCÈS MYDMC : décor « Ruban » + interrupteur dans la carte (David, 14.11.2026 00:10)
   Une seule connexion pour tous : panels du noyau (.login-wrap > .login-card), panel agence et espace
   client de mydmc.ch (.seul > .boite). La carte elle-même (440 px, champs de 48 px, bouton de 44 px)
   vient du gabarit commun acces-mydmc.css (noyau) et du bloc d'accès de ec.css (mydmc.ch).
   - Ouverture toujours en sombre ; le mode clair a le même ruban, en version claire.
   - Le ruban est FIXE (aucune boucle : règle de finition §5.33, seules les halos dérivent).
   - L'interrupteur « Clair ◯ Sombre » (icône + libellé) est dans la carte, en bas, centré.
   Fichiers à côté de cette feuille : fond-ruban-sombre.svg, fond-ruban-clair.svg.
   ============================================================================================ */
html[data-theme] body:has(.login-wrap, .seul > .boite)::before {
  content: ""; display: block; position: fixed; inset: 0; z-index: 1; pointer-events: none; filter: none; opacity: 1;   /* au-dessus des halos, sous la carte ; sans le flou de l’ancienne photo de fond (style.css) */
  background: url("fond-ruban-sombre.svg") center / 100% 100% no-repeat;
  -webkit-mask-image: radial-gradient(ellipse 64% 60% at 50% 50%, transparent 22%, rgba(0,0,0,.45) 52%, #000 84%);
          mask-image: radial-gradient(ellipse 64% 60% at 50% 50%, transparent 22%, rgba(0,0,0,.45) 52%, #000 84%);
}
html[data-theme="light"] body:has(.login-wrap, .seul > .boite)::before { background-image: url("fond-ruban-clair.svg"); }
html[data-theme="light"] body:has(.login-wrap, .seul > .boite) { background-color: #F0EDE9; }
body:has(.login-wrap, .seul > .boite) :is(.login-wrap, .seul) { position: relative; z-index: 2; }

/* Interrupteur : dans la carte, en bas, centré ; plus jamais seul dans le coin. */
:is(.login-card, .seul > .boite) > .mydmc-theme-carte { position: static; justify-self: center; align-self: center; margin: 4px auto 0; }
body:has(.login-card, .seul > .boite) .mydmc-theme-fixe { visibility: hidden; }   /* le temps que le script le range dans la carte */
@media (max-width: 600px) { html[data-design][data-modele="v15"][data-theme] body .login-wrap { padding-top: 24px; } }   /* plus de bouton fixe à éviter */
@media print { body::before { display: none !important; } }

/* ============================================================================================
   CARTE DE CONNEXION, VERSION FINALE DE DAVID (14.11.2026 10:04)
   - En haut (.acces-haut, construit par interrupteur-theme.js) : le logo au centre, l'interrupteur tout à droite,
     sur la même ligne ; interrupteur sans mots, seulement la piste verte et l'icône lune / soleil.
   - Titre et sous-titre centrés ; le formulaire reste aligné à gauche.
   - En bas (.acces-pied), après une fine ligne, UNE seule ligne : version à gauche, « With ♡ by DMC » à droite.
     Téléphone : même ligne, plus petite, jamais de retour à la ligne.
   - Logo DMC de la signature : lettres seules (mydmc-dmc.svg, sans « mydmc.ch | Crée ton ADN »), entières,
     à la hauteur des capitales du texte, même couleur que lui (masque).
   Sélecteurs précédés de « body » : ils passent devant acces-mydmc.css et ec.css (chargées après).
   ============================================================================================ */
html[data-design][data-theme] body .login-wrap .login-card > :is(h1, .sub, .acces-panel, .acces-note, .lien-oubli, .liens-secondaires) { text-align: center; justify-content: center; }
html[data-design][data-theme] body .login-wrap .login-card > .sub { margin-top: -8px; }
body .seul > .boite > :is(h1, div:has(> h1), .note, p) { text-align: center; }
body .seul > .boite > a.note { justify-self: center; }

body .acces-haut { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 8px; margin: 0; }
body .acces-haut > .acces-logo { grid-column: 2; justify-self: center; margin: 0; }
body .acces-haut > img.acces-logo { display: block; height: 48px; width: auto; max-width: min(200px, 100%); object-fit: contain; object-position: center; }
body .acces-haut > .mydmc-theme { grid-column: 3; justify-self: end; }

body .acces-pied {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--bord, rgba(127,127,127,.28));
  white-space: nowrap; font-size: 13px; line-height: 1.3; color: var(--pale, var(--doux, GrayText)); text-align: left;
}
body .acces-pied > .version-acces, body .acces-pied > .version { margin: 0; font-size: inherit !important; line-height: inherit !important; color: inherit !important; text-align: left; white-space: nowrap; }   /* !important : acces-mydmc.css et ec.css fixent 14 px aux versions ; ici la ligne entière a une seule taille */
body .acces-pied > .signature-mydmc {
  display: inline-flex; align-items: center; gap: .32em; margin: 0; padding: 0; border: 0;
  color: inherit; font-size: inherit; text-decoration: none; opacity: 1;
}
body .acces-pied > .signature-mydmc:is(:hover, :focus-visible) { color: var(--encre, CanvasText); }
body .acces-pied .sig-coeur { width: 1em; height: 1em; flex: none; display: block; }
body .acces-pied .sig-dmc {
  display: block; flex: none; height: .74em; aspect-ratio: 122.9 / 34; background: currentColor;
  -webkit-mask: url("mydmc-dmc.svg") center / contain no-repeat; mask: url("mydmc-dmc.svg") center / contain no-repeat;
}

body .acces-haut > .mydmc-theme {
  position: static; margin: 0; padding: 0 2px; gap: 0; min-width: 48px; min-height: 44px; justify-content: flex-end;
  border-color: transparent; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
}
body .acces-haut > .mydmc-theme:hover { border-color: transparent; }
body .acces-haut > .mydmc-theme .mydmc-theme-mot { display: none; }
body .acces-haut > .mydmc-theme .mydmc-theme-piste { width: 40px; height: 24px; }
body .acces-haut > .mydmc-theme .mydmc-theme-rond { width: 20px; height: 20px; }
html[data-theme="dark"] body .acces-haut > .mydmc-theme .mydmc-theme-rond { transform: translateX(16px); }
@media (max-width: 420px) {
  body .acces-pied { font-size: 11.5px; gap: 8px; }
  body .acces-haut > img.acces-logo { height: 42px; max-width: 170px; }
}
@media (max-width: 380px) { body .acces-pied { font-size: 11px; gap: 6px; } }
html[data-design="mydmc"][data-theme] body .acces-haut > img:not([data-design-logo]) { visibility: hidden; }   /* logo blanc d'origine caché tant que le script ne l'a pas remplacé : jamais de blanc sur blanc */

/* Retouche de David (14.11.2026 10:12) : la phrase « Espace réservé… » plus petite (13 px), plus discrète (gris clair),
   posée juste au-dessus de la fine ligne ; version et date à 12 px (11 px sur petit téléphone). */
body :is(.login-card, .seul > .boite) > :is(p, .acces-note):has(+ .acces-pied) {
  font-size: 13px !important; line-height: 1.45; color: var(--pale, GrayText) !important; opacity: .8; margin: 10px 0 -4px !important;
}
body .acces-pied > :is(.version-acces, .version) { font-size: 12px !important; }
@media (max-width: 380px) { body .acces-pied > :is(.version-acces, .version) { font-size: 11px !important; } }
/* Bas de carte : aucune marge venue du dessin du site (Treize, méthode B, met une marge aux paragraphes) — même ligne partout (14.11.2026 10:35). */
body .acces-pied > * { margin: 0 !important; align-self: center; }
/* Carte sans le gabarit v1.5 (Treize, méthode B) : pas d’espacement entre les blocs, on le donne au bas de carte (14.11.2026 10:50). */
html:not([data-modele]) body .login-card > .acces-pied { margin-top: 14px !important; }

/* Téléphone (David, 14.11.2026 11:50 « seulement l’interrupteur avec l’icône, sans texte ») : barre du haut, piste seule. */
.mydmc-theme-barre { padding: 0 4px; gap: 0; border-color: transparent; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; min-width: 48px; justify-content: center; }
.mydmc-theme-barre .mydmc-theme-mot { display: none; }
