/* ==================================================================
   Bouton d'aide flottant et son panneau.
   Un seul point d'entrée plutôt qu'une pile de bulles : le thème pose
   déjà un bouton « haut de page » au même endroit, et 3CX en ajoute
   un troisième. Tout tient ici, le bouton du thème remonte.
   ================================================================== */

.vc-aide {
    position: fixed;
    right: max(20px, env(safe-area-inset-right, 0px));
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    /* 3CX pose son conteneur en z-index 99999, même quand il n'affiche
       rien : à 9998 le lanceur se faisait voler ses clics. On passe
       au-dessus, en restant sous le menu du thème (999999). */
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
}

/* --- le bouton --- */
.vc-aide__bouton {
    position: relative;   /* ancre la pastille d'état */
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 10px 20px 10px 10px;
    border: 0;
    border-radius: 999px;
    background: #0E59F2;
    color: #fff;
    font: 600 14.5px/1.2 inherit;
    cursor: pointer;
    box-shadow: 0 10px 30px -8px rgba(14, 89, 242, .6);
    transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.vc-aide__bouton:hover { background: #0B48C4; transform: translateY(-2px); }
.vc-aide__bouton:focus-visible { outline: 3px solid #25D8EE; outline-offset: 3px; }

.vc-aide__avatar {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; flex: none;
    border-radius: 50%;
    background: #fff;
    color: #0E59F2;
}
.vc-aide__avatar svg { width: 22px; height: 22px; }

/* une pastille discrète attire l'œil sans clignoter */
.vc-aide__point {
    position: absolute;
    top: 8px; left: 34px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #4ADE80;
    box-shadow: 0 0 0 2px #0E59F2;
    animation: vc-aide-pulse 2.6s ease-in-out infinite;
}
@keyframes vc-aide-pulse {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%      { transform: scale(1.35); opacity: .72; }
}

/* --- le panneau --- */
.vc-aide__panneau {
    width: min(330px, calc(100vw - 40px));
    background: #fff;
    border: 1px solid #E4E9F2;
    border-radius: 18px;
    box-shadow: 0 26px 60px -18px rgba(6, 19, 39, .42);
    overflow: hidden;
    transform-origin: bottom right;
    transition: opacity .2s ease, transform .2s ease;
}
.vc-aide__panneau[hidden] { display: none; }
.vc-aide:not(.is-ouvert) .vc-aide__panneau {
    opacity: 0; transform: translateY(8px) scale(.97); pointer-events: none;
}
.vc-aide.is-ouvert .vc-aide__panneau { opacity: 1; transform: none; }

.vc-aide__entete {
    display: flex; align-items: center; gap: 13px;
    padding: 18px 20px;
    background: #061327;
    color: #fff;
}
.vc-aide__entete .vc-aide__avatar { background: rgba(37, 216, 238, .16); color: #25D8EE; }
.vc-aide__titre { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.vc-aide__sous  { display: block; font-size: 12.5px; line-height: 1.5; color: #AEBBD0; }

.vc-aide__fermer {
    margin-left: auto; width: 30px; height: 30px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 8px;
    background: rgba(255, 255, 255, .08); color: #AEBBD0;
    cursor: pointer; transition: background-color .18s ease, color .18s ease;
}
.vc-aide__fermer:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.vc-aide__fermer:focus-visible { outline: 2px solid #25D8EE; outline-offset: 2px; }
.vc-aide__fermer svg { width: 15px; height: 15px; }

.vc-aide__liste { padding: 10px; display: grid; gap: 2px; }

.vc-aide__voie {
    display: grid;
    grid-template-columns: 38px 1fr;
    grid-template-areas: "icone nom" "icone detail";
    align-items: center;
    gap: 0 13px;
    padding: 11px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: none; border: 0; width: 100%; text-align: left;
    font: inherit; cursor: pointer;
    transition: background-color .16s ease;
}
.vc-aide__voie:hover { background: #F2F6FC; }
.vc-aide__voie:focus-visible { outline: 2px solid #0E59F2; outline-offset: -2px; }

.vc-aide__icone {
    grid-area: icone;
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: #F2F6FC; color: #0E59F2;
}
.vc-aide__icone svg { width: 19px; height: 19px; }
.vc-aide__voie--whatsapp .vc-aide__icone { background: rgba(37, 211, 102, .12); color: #1FA855; }

.vc-aide__nom    { grid-area: nom;    font-size: 14.5px; font-weight: 600; color: #061327; line-height: 1.35; }
.vc-aide__detail { grid-area: detail; font-size: 12.5px; color: #5A6B84; line-height: 1.45; }

.vc-aide__pied {
    padding: 12px 20px 16px;
    border-top: 1px solid #EDF1F7;
    font-size: 12px; line-height: 1.5; color: #7A8697;
}

/* Le bouton « haut de page » du thème occupe le même coin : on le remonte. */
#back-top.to-top { bottom: 96px; }
@media (max-width: 700px) {
    #back-top.to-top { bottom: 88px; }
    .vc-aide__bouton span.vc-aide__texte { display: none; }
    .vc-aide__bouton { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .vc-aide__point { animation: none; }
    .vc-aide__panneau, .vc-aide__bouton { transition: none; }
    .vc-aide__bouton:hover { transform: none; }
}

/* La bulle 3CX est déplacée au milieu du bord droit par le script : elle ne
   croise plus le lanceur d'aide ni le bouton « haut de page », qui restent
   donc où ils sont. */

/* Le bandeau de consentement, lui, barre tout le bas de l'écran et
   recouvrait ces deux boutons. Sa hauteur réelle est publiée par le script
   de consentement : les boutons montent d'autant, à n'importe quelle
   largeur. Quand le bandeau disparaît, la variable retombe à zéro et tout
   reprend sa place. */
.vc-bandeau-visible .vc-aide {
    bottom: calc(var(--vc-bandeau-hauteur, 0px) + 20px + env(safe-area-inset-bottom, 0px));
}
.vc-bandeau-visible #back-top.to-top {
    bottom: calc(var(--vc-bandeau-hauteur, 0px) + 96px);
}
@media (max-width: 700px) {
    .vc-bandeau-visible #back-top.to-top {
        bottom: calc(var(--vc-bandeau-hauteur, 0px) + 88px);
    }
}

