/* ═══ Le bouton « Signaler » et son point ═══════════════════════════════════════════════
 * Demande de Thomas du 05/09/2026 : « un bouton présent sur la plateforme qui permet,
 * lorsqu'on appuie, de mettre un point quelque part et d'expliquer brièvement ce qui ne
 * fonctionne pas et ce qui devrait fonctionner ».
 *
 * LES HAUTEURS D'EMPILEMENT, ET POURQUOI CELLES-LÀ. Le thème pose ses propres couches
 * (ui/theme-hud.css) : le voile de sécurité monte à 9500, la palette et la visite guidée à
 * 9000, la barre de mise à jour à 2500, le message éclair à 2000, l'assistant à 60-61. Le
 * bouton se pose à 1900 : au-dessus de tout ce qui vit dans la page, SOUS le message éclair
 * (sinon il masquerait la confirmation qu'il vient de provoquer) et très en dessous des
 * fenêtres modales — une modale ouverte doit rester seule à l'écran, c'est sa raison d'être.
 * Le voile de visée, lui, monte à 2400 : il doit couvrir la barre de mise à jour, sinon un
 * clic destiné à poser un point tomberait dessus.
 * ═══════════════════════════════════════════════════════════════════════════════════════ */

#betaBouton {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1900;
  display: none;               /* JS l'affiche seulement si le serveur dit « bêta » */
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid rgba(255, 90, 60, .35);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #D6431F;
  font: 600 13.5px/1 inherit;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 30px -12px rgba(21, 24, 28, .35);
  transition: transform .15s cubic-bezier(.34, 1.4, .64, 1), box-shadow .15s;
}
#betaBouton:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px -14px rgba(255, 90, 60, .5);
}
#betaBouton .pt {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #FF5A3C;
  flex: none;
}
/* Sur fond sombre du thème, la pastille blanche jurerait : on la fait suivre l'ambiance. */
body[data-hud="ardoise"] #betaBouton,
body[data-hud="encre"] #betaBouton {
  background: rgba(28, 31, 36, .9);
  color: #FF8A70;
  border-color: rgba(255, 90, 60, .45);
}

/* Sous 680 px, le bouton flotte au-dessus d'un écran qui n'a plus de colonne libre à sa
   droite : il recouvrait la dernière ligne visible du texte (ticket 1639, 20/09/2026).
   C'est donc le CONTENU qui garde une bande vide sous lui, de la hauteur du bouton : le
   texte s'arrête au-dessus, jamais dessous. Réduire le bouton à sa pastille ne suffisait
   pas — il restait posé sur la colonne de texte, en plus haut d'un cran — et effaçait le
   mot « Signaler » que le guide bêta demande de chercher (retours-beta.js) : une consigne
   qui désigne un libellé absent de l'écran ne se suit pas. Le libellé reste donc écrit.
   La bande n'existe que si le bouton est là : hors programme bêta, rien ne change. */
@media (max-width: 680px) {
  body:has(#betaBouton) #view {
    padding-bottom: 64px;
  }
  /* Le guide bêta pose « Comment signaler ? » juste au-dessus du bouton : la bande
     grandit d'autant, sinon c'est lui qui recouvre la dernière ligne. */
  body:has(#betaGuideAide) #view {
    padding-bottom: 108px;
  }
}

/* ── Le voile de visée : le curseur devient une cible, un clic pose le point ───────────── */
#betaVoile {
  position: fixed;
  inset: 0;
  z-index: 2400;
  cursor: crosshair;
  background: rgba(21, 24, 28, .12);
}
#betaVoile .aide {
  position: fixed;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(21, 24, 28, .88);
  color: #fff;
  font-size: 13.5px;
  text-align: center;
  pointer-events: none;
}

/* ── Le point posé ────────────────────────────────────────────────────────────────────── */
#betaPoint {
  position: fixed;
  z-index: 2401;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: #FF5A3C;
  box-shadow: 0 0 0 4px rgba(255, 90, 60, .28);
  pointer-events: none;
  animation: betaPuls 1.6s ease-in-out infinite;
}
@keyframes betaPuls {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 90, 60, .28); }
  50%      { box-shadow: 0 0 0 11px rgba(255, 90, 60, .12); }
}
@media (prefers-reduced-motion: reduce) {
  #betaPoint { animation: none; }
  #betaBouton { transition: none; }
}

/* ── La fiche qui s'ouvre à côté du point ─────────────────────────────────────────────── */
#betaFiche {
  position: fixed;
  z-index: 2402;
  width: min(370px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 16px 17px 17px;
  border-radius: 16px;
  border: 1px solid rgba(21, 24, 28, .12);
  background: #fff;
  color: #15181C;
  box-shadow: 0 30px 70px -26px rgba(21, 24, 28, .5);
  font-size: 14px;
}
#betaFiche h3 {
  margin: 0 0 3px;
  font-size: 16px;
}
#betaFiche .sst {
  margin: 0 0 12px;
  color: #5B6675;
  font-size: 12.5px;
}
#betaFiche label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin: 11px 0 4px;
}
#betaFiche textarea {
  width: 100%;
  min-height: 68px;
  padding: 9px 10px;
  border: 1px solid #E3E0DA;
  border-radius: 10px;
  font: inherit;
  color: inherit;
  resize: vertical;
}
#betaFiche textarea:focus {
  outline: 2px solid #FF5A3C;
  outline-offset: 1px;
  border-color: #FF5A3C;
}
#betaFiche .actes {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
}
#betaFiche .bt {
  border: 0;
  border-radius: 9px;
  padding: 9px 15px;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  background: #FF5A3C;
  color: #fff;
}
#betaFiche .bt:hover { background: #D6431F; }
#betaFiche .bt.g {
  background: transparent;
  color: #5B6675;
  border: 1px solid #E3E0DA;
}
#betaFiche .bt[disabled] { opacity: .6; cursor: default; }
#betaFiche .lien {
  margin-left: auto;
  background: none;
  border: 0;
  padding: 0;
  color: #0E8F82;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
#betaFiche .err {
  margin-top: 9px;
  color: #D6431F;
  font-size: 12.5px;
  min-height: 1em;
}
#betaFiche .liste {
  margin-top: 4px;
  max-height: 46vh;
  overflow: auto;
}
#betaFiche .item {
  border-top: 1px solid #EFEDE9;
  padding: 11px 0;
}
#betaFiche .item:first-child { border-top: 0; }
#betaFiche .item .quand {
  color: #5B6675;
  font-size: 12px;
}
#betaFiche .item .rep {
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #E3F8F6;
  font-size: 13px;
}
#betaFiche .etq {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: #F1EFEB;
  color: #5B6675;
}
#betaFiche .etq.n { background: #FFEAE6; color: #D6431F; }
#betaFiche .etq.c { background: #E3F8F6; color: #0E8F82; }
