/*
 * VISIONNEUSE VIDÉO (09/11/2026) — public/js/visionneuse-video.js. Repose sur la base `.visio` d'app.css (fond,
 * barre, boutons de 44 px), chargée au back-office comme dans l'espace client. Mobile d'abord : la vidéo prend toute
 * la place sous la barre, sans marge au téléphone ; le message d'échec garde un bouton de 50 px au doigt.
 */
.visio-video[open] { display: flex; flex-direction: column; }
.visio-video-corps {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 12px max(12px, env(safe-area-inset-bottom));
}
/* Taille propre de la vidéo, réduite pour tenir : les commandes natives restent collées à l'image (portrait ou
   paysage). Fond noir pendant le chargement, liseré cyan du « vaisseau ». */
.visio-video-lecteur {
  display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; min-width: min(100%, 320px);
  border-radius: 6px; background: #000; outline: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(53, 208, 242, .16);
}
.visio-video-lecteur:focus-visible { box-shadow: 0 10px 40px rgba(0, 0, 0, .5), 0 0 0 2px var(--accent, #35d0f2); }
.visio-video-echec .visio-video-lecteur { display: none; }

.visio-video-attente {
  position: absolute; inset: 0; margin: 0; pointer-events: none;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: #9fb0c8; font-size: 13px;
}
.visio-video-attente-ico {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(53, 208, 242, .25); border-top-color: var(--accent, #35d0f2);
  animation: visioVideoTourne .9s linear infinite;
}
@keyframes visioVideoTourne { to { transform: rotate(360deg); } }

/* Lecture impossible : panneau de verre, la tuile « ▶ » barrée de rouge, puis Télécharger. */
.visio-video-refus {
  display: grid; justify-items: center; gap: 10px; width: min(100%, 440px); box-sizing: border-box;
  padding: 26px 22px 24px; text-align: center;
  border-radius: 14px; border: 1px solid rgba(53, 208, 242, .28);
  background: linear-gradient(180deg, rgba(19, 27, 43, .94), rgba(14, 20, 32, .94));
  box-shadow: 0 0 0 1px rgba(53, 208, 242, .08), 0 18px 50px rgba(0, 0, 0, .55);
}
.visio-video-refus-ico {
  position: relative; width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; padding-left: 4px; box-sizing: border-box;
  font-size: 22px; line-height: 1; color: #0b1324;
  background: linear-gradient(135deg, var(--accent, #35d0f2), var(--accent-2, #7c6cf6)); opacity: .55;
}
.visio-video-refus-ico::after {
  content: ''; position: absolute; left: 6px; right: 6px; top: 50%; height: 3px; margin-top: -1.5px;
  border-radius: 2px; background: var(--danger, #fb5f7a); transform: rotate(-35deg);
}
.visio-video-refus-titre { margin: 4px 0 0; font: 600 15px var(--font-brand, inherit); letter-spacing: .02em; color: #e8eef7; }
.visio-video-refus-detail { margin: 0; font-size: 13px; line-height: 1.45; color: #9fb0c8; }
.visio-video-telecharger { min-height: 50px; padding: 0 24px; margin-top: 6px; display: inline-flex; align-items: center; justify-content: center; }

/* Le son passe mais pas l'image : bandeau sous la vidéo, la lecture continue. */
.visio-video-avis {
  position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 24px); box-sizing: border-box; margin: 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px;
  padding: 8px 14px; border-radius: 10px; font-size: 12.5px; color: #e8eef7;
  background: rgba(8, 11, 19, .9); border: 1px solid rgba(251, 191, 36, .45);
}
.visio-video-avis-tele { display: inline-flex; align-items: center; min-height: 36px; color: var(--accent, #35d0f2); font-weight: 600; }

.visio-video-refus[hidden], .visio-video-attente[hidden], .visio-video-avis[hidden] { display: none; }

@media (max-width: 599px) {
  .visio-video-corps { padding: 0 0 env(safe-area-inset-bottom); }
  .visio-video-lecteur { border-radius: 0; min-width: 100%; }
  .visio-video-refus { margin: 0 16px; }
}
@media (pointer: coarse) { .visio-video-avis-tele { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .visio-video-attente-ico { animation: none; } }

/* ==========================================================================================================
   DA « VISEUR » AU BACK-OFFICE (10/11/2026, Franck : « On supprime completement le theme SF et Espace du Delmak BO »).
   Cette feuille est PARTAGÉE avec l'espace client, qui ne doit pas bouger : les règles ci-dessus restent telles
   quelles, et le BO les reprend ici, bornées par :where(body:not(.espace)) (même poids, chargées après). Sans
   lueur, ni dégradé, ni arrondi ; la fenêtre reste sombre (#201e1d), le filet d'accent de 2 px en tête.
   ========================================================================================================== */
:where(body:not(.espace)) .visio-video-lecteur { border-radius: 0; box-shadow: var(--esp-shadow-xl); }
:where(body:not(.espace)) .visio-video-lecteur:focus-visible { box-shadow: 0 0 0 2px var(--esp-accent); }
:where(body:not(.espace)) .visio-video-attente { color: rgba(255, 255, 255, .78); }
/* Attente : un carré d'accent fixe à côté du texte (pas de tourniquet qui tourne). */
:where(body:not(.espace)) .visio-video-attente-ico { width: 8px; height: 8px; border: 0; border-radius: 0; background: var(--esp-accent); animation: none; }
:where(body:not(.espace)) .visio-video-refus {
  border-radius: 0; border: 0; border-top: 2px solid var(--esp-accent);
  background: #201e1d; box-shadow: var(--esp-shadow-xl);
}
:where(body:not(.espace)) .visio-video-refus-ico {
  border-radius: 0; opacity: 1; color: #fff;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .3);
}
:where(body:not(.espace)) .visio-video-refus-ico::after { border-radius: 0; background: var(--esp-accent); }
:where(body:not(.espace)) .visio-video-refus-titre { font: 800 13px var(--esp-font); letter-spacing: .16em; text-transform: uppercase; color: #fff; }
:where(body:not(.espace)) .visio-video-refus-detail { color: rgba(255, 255, 255, .78); }
:where(body:not(.espace)) .visio-video-avis {
  border-radius: 0; border: 0; border-top: 2px solid var(--esp-accent);
  background: #201e1d; color: #fff;
}
:where(body:not(.espace)) .visio-video-avis-tele { min-height: 44px; color: var(--esp-accent-on-dark); }
