/* ============================================================
   Voile d'attente a l'envoi du formulaire de reservation.

   L'extension de reservation pose, a l'envoi, la classe
   wpbc_booking_form_is_submitting sur #booking_form_div<N> et y ajoute le
   calque .wpbc_booking_form_submit_overlay. Cette feuille habille ce calque,
   sans rien intercepter. La sortie en fondu est portee par assets/voile.js,
   qui pose une copie du calque au moment ou l'extension le retire.

   Rien ne s'applique sans la classe jl-voile-on, posee sur body par
   includes/voile.php.

   Geometrie : le voile est fixe a l'ecran, sur la bande centrale en hauteur
   (tiers 3 et 4 sur 6, elargis de 2,5 % au-dessus et au-dessous, soit de
   30,833 % a 69,167 %), quel que soit le defilement, et prend la largeur du
   bloc de reservation, mesuree par le script dans --jl-voile-x et
   --jl-voile-l. Sur telephone le bloc est bien plus haut que l'ecran : un
   voile pose sur tout le bloc placerait l'anneau hors de vue.

   Poids : la regle de l'extension pese deux classes ; les notres en pesent
   au moins quatre.
   ========================================================== */

:is(html.jl-voile-on, body.jl-voile-on) {
    --jl-voile-or: #ffd60a;
    --jl-voile-or-doux: rgba(255, 214, 10, .28);
    --jl-voile-fond: rgba(22, 8, 34, .66);
}

/* Le calque, pendant l'envoi, et sa copie pendant la sortie. */
:is(html.jl-voile-on, body.jl-voile-on) .booking_form_div.wpbc_booking_form_is_submitting > .wpbc_booking_form_submit_overlay,
:is(html.jl-voile-on, body.jl-voile-on) .booking_form_div > .jl-voile-fantome {
    position: fixed;
    inset: auto;
    top: 30.833vh;
    top: 30.833dvh;
    left: var(--jl-voile-x, 16px);
    width: var(--jl-voile-l, calc(100vw - 32px));
    height: 38.333vh;
    height: 38.333dvh;
    min-height: 0;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 20px;
    background: var(--jl-voile-fond);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    backdrop-filter: blur(10px) saturate(1.3);
    box-shadow: inset 0 0 0 1px rgba(255, 214, 10, .38), 0 18px 44px rgba(10, 2, 18, .5);
    pointer-events: none;
    text-shadow: none;
    animation: jl-voile-halo 1.6s ease-in-out infinite;
}

/* Eclat lumineux qui traverse le verre, comme sur les pastilles. */
:is(html.jl-voile-on, body.jl-voile-on) .booking_form_div.wpbc_booking_form_is_submitting > .wpbc_booking_form_submit_overlay::before {
    content: "";
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: -60%;
    width: 34%;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .10) 30%, rgba(255, 244, 200, .42) 50%, rgba(255, 255, 255, .10) 70%, transparent 100%);
    transform: skewX(-14deg);
    animation: jl-voile-eclat .75s linear infinite;
}

:is(html.jl-voile-on, body.jl-voile-on) .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome) .wpbc_spins_loading_container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 0;
    padding: 24px 20px;
    border-radius: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    color: #fff;
    text-align: center;
}

/* Anneau or, pastille doree au centre. L'extension decale son enveloppe de
   50 % vers la droite et vers le bas : l'anneau mordait alors sur le libelle.
   Les decalages sont annules ici. Elle pose aussi sur l'anneau
   border-top-color: transparent en priorite explicite : seule cette
   propriete est reprise de la meme facon. */
:is(html.jl-voile-on, body.jl-voile-on) .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome) .wpbc_spins_loading_container .wpbc_booking_form_spin_loader,
:is(html.jl-voile-on, body.jl-voile-on) .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome) .wpbc_spins_loading_container .wpbc_spins_loader_wrapper {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 66px;
    height: 66px;
    margin: 0;
    padding: 0;
    transform: none;
}

:is(html.jl-voile-on, body.jl-voile-on) .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome) .wpbc_spins_loading_container .wpbc_spin_loader_one_new {
    position: absolute;
    inset: 0;
    display: block;
    width: auto;
    height: auto;
    margin: 0;
    box-sizing: border-box;
    border-width: 3px;
    border-style: solid;
    border-color: rgba(255, 214, 10, .28);
    border-top-color: #ffd60a !important;
    border-right-color: #ffd60a;
    border-radius: 50%;
    background: none;
    animation: jl-voile-anneau 1.1s linear infinite, jl-voile-pulse 1.6s ease-in-out infinite;
}

:is(html.jl-voile-on, body.jl-voile-on) .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome) .wpbc_spins_loading_container .wpbc_spins_loader_wrapper::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #fff3b0, #ffd60a 30%, #b8860b 55%, #ffd60a 80%, #fff3b0);
    box-shadow: 0 0 12px rgba(255, 214, 10, .65);
    animation: jl-voile-pastille 2.2s linear infinite;
}

/* Libelle : le texte est remplace par le script ; a defaut, celui de
   l'extension reste, avec le meme habillage. */
:is(html.jl-voile-on, body.jl-voile-on) .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome) .wpbc_spins_loading_container span {
    display: block;
    max-width: 26ch;
    margin: 0;
    padding: 0;
    color: #fff;
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: .01em;
    text-shadow: 0 1px 2px rgba(38, 0, 56, .6);
}

/* Sortie : l'anneau se contracte en eclat dore, le verre s'efface. */
:is(html.jl-voile-on, body.jl-voile-on) .booking_form_div > .jl-voile-fantome {
    animation: jl-voile-effacement .55s ease-in .25s forwards;
}

:is(html.jl-voile-on, body.jl-voile-on) .booking_form_div > .jl-voile-fantome .wpbc_spins_loading_container .wpbc_spin_loader_one_new {
    animation: jl-voile-contraction .35s ease-in forwards;
}

:is(html.jl-voile-on, body.jl-voile-on) .booking_form_div > .jl-voile-fantome .wpbc_spins_loading_container .wpbc_spins_loader_wrapper::after {
    animation: jl-voile-eclat-final .45s ease-out forwards;
}

:is(html.jl-voile-on, body.jl-voile-on) .booking_form_div > .jl-voile-fantome .wpbc_spins_loading_container span {
    animation: jl-voile-effacement .3s ease-in forwards;
}

/* Un passage toutes les 0,75 s : 0,52 s de traversee, 0,23 s de repos. */
@keyframes jl-voile-eclat {
    0%   { left: -60%; }
    70%  { left: 126%; }
    100% { left: 126%; }
}

@keyframes jl-voile-halo {
    0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 214, 10, .30), 0 18px 44px rgba(10, 2, 18, .5); }
    50%      { box-shadow: inset 0 0 0 1px rgba(255, 214, 10, .70), inset 0 0 26px rgba(255, 214, 10, .16), 0 18px 44px rgba(10, 2, 18, .5); }
}

@keyframes jl-voile-anneau {
    to { transform: rotate(360deg); }
}

@keyframes jl-voile-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 214, 10, 0); }
    50%      { box-shadow: 0 0 18px 2px rgba(255, 214, 10, .45); }
}

@keyframes jl-voile-pastille {
    to { transform: rotate(360deg); }
}

@keyframes jl-voile-contraction {
    to { transform: scale(.25); opacity: 0; }
}

@keyframes jl-voile-eclat-final {
    0%   { transform: scale(1); box-shadow: 0 0 12px rgba(255, 214, 10, .65); opacity: 1; }
    60%  { transform: scale(2.6); box-shadow: 0 0 40px 14px rgba(255, 214, 10, .7); opacity: 1; }
    100% { transform: scale(3.2); box-shadow: 0 0 60px 24px rgba(255, 214, 10, 0); opacity: 0; }
}

@keyframes jl-voile-effacement {
    to { opacity: 0; }
}

/* Mouvement reduit : voile immobile, sortie en fondu court. Le reglage de
   l'appareil s'applique, sauf si l'outil de test force les animations
   (classe jl-voile--force). jl-voile--sobre force au contraire le mode
   reduit sur un appareil qui ne le demande pas. */
@media (prefers-reduced-motion: reduce) {
    html:not(.jl-voile--force) .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome),
    html:not(.jl-voile--force) .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome)::before,
    html:not(.jl-voile--force) .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome) *,
    html:not(.jl-voile--force) .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome) *::after {
        animation: none !important;
    }
    html:not(.jl-voile--force) .booking_form_div > .jl-voile-fantome {
        animation: jl-voile-effacement .18s linear forwards !important;
    }
}

html.jl-voile--sobre .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome),
html.jl-voile--sobre .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome)::before,
html.jl-voile--sobre .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome) *,
html.jl-voile--sobre .booking_form_div > :is(.wpbc_booking_form_submit_overlay, .jl-voile-fantome) *::after {
    animation: none !important;
}

html.jl-voile--sobre .booking_form_div > .jl-voile-fantome {
    animation: jl-voile-effacement .18s linear forwards !important;
}

/* Outil de test, ?jl_voile=demo : panneau en bas a gauche. Aucun envoi. */
.jl-voile-banc {
    position: fixed;
    left: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 2147483000;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: calc(100vw - 20px);
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 14px;
    background: rgba(22, 8, 34, .92);
    box-shadow: 0 10px 28px rgba(10, 2, 18, .45);
    font: 600 13px/1.3 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.jl-voile-banc button {
    margin: 0;
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 9px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font: inherit;
    cursor: pointer;
    text-shadow: none;
    box-shadow: none;
}

.jl-voile-banc button[aria-pressed="true"] {
    border-color: #ffd60a;
    color: #ffd60a;
}

.jl-voile-banc__etat {
    flex-basis: 100%;
    color: #ffd60a;
    font-size: 12px;
    font-weight: 500;
}
