/* /Components/Layout/ReconnectModal.razor.rz.scp.css */
/*
 * Modale de reconnexion — habillage.
 *
 * Les sélecteurs de visibilité sont ceux du gabarit Blazor : c'est lui qui pose la classe d'état
 * sur le <dialog>, et ces règles décident de ce qui apparaît. Ne pas les renommer.
 *
 * Le reste s'appuie sur les variables de Bootstrap (--bs-*) et sur --primary (thème de la
 * ferme) plutôt que sur des couleurs écrites en dur.
 */

.components-reconnect-first-attempt-visible[b-1nwjil4xy3],
.components-reconnect-repeated-attempt-visible[b-1nwjil4xy3],
.components-reconnect-failed-visible[b-1nwjil4xy3],
.components-pause-visible[b-1nwjil4xy3],
.components-resume-failed-visible[b-1nwjil4xy3],
.components-rejoining-animation[b-1nwjil4xy3] {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible[b-1nwjil4xy3],
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation[b-1nwjil4xy3],
#components-reconnect-modal.components-reconnect-paused .components-pause-visible[b-1nwjil4xy3],
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible[b-1nwjil4xy3],
#components-reconnect-modal.components-reconnect-retrying[b-1nwjil4xy3],
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible[b-1nwjil4xy3],
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation[b-1nwjil4xy3],
#components-reconnect-modal.components-reconnect-failed[b-1nwjil4xy3],
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible[b-1nwjil4xy3] {
    display: block;
}

#components-reconnect-modal[b-1nwjil4xy3] {
    /* Élargie par rapport au gabarit (20rem) : l'animation occupe 208 px, et le texte a besoin
       de lignes pleines plutôt que de quatre lignes hachées. */
    width: 26rem;
    max-width: calc(100vw - 2rem);
    margin: 18vh auto;
    padding: 2.5rem 2rem 2rem;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg, #fff);
    border: 0;
    border-radius: var(--bs-border-radius-lg, 0.5rem);
    box-shadow: var(--bs-box-shadow-lg, 0 3px 6px 2px rgba(0, 0, 0, 0.3));
    font-family: var(--font, var(--bs-body-font-family, inherit));
    opacity: 0;
    transition: display 0.5s allow-discrete, overlay 0.5s allow-discrete;
    animation: components-reconnect-modal-fadeOutOpacity-b-1nwjil4xy3 0.5s both;

    &[open] {
        animation: components-reconnect-modal-slideUp-b-1nwjil4xy3 1.5s cubic-bezier(.05, .89, .25, 1.02) 0.3s, components-reconnect-modal-fadeInOpacity-b-1nwjil4xy3 0.5s ease-in-out 0.3s;
        animation-fill-mode: both;
    }
}

#components-reconnect-modal[b-1nwjil4xy3]::backdrop {
    background-color: rgba(0, 0, 0, 0.4);
    animation: components-reconnect-modal-fadeInOpacity-b-1nwjil4xy3 0.5s ease-in-out;
    opacity: 1;
}

@keyframes components-reconnect-modal-slideUp-b-1nwjil4xy3 {
    0% {
        transform: translateY(30px) scale(0.95);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes components-reconnect-modal-fadeInOpacity-b-1nwjil4xy3 {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes components-reconnect-modal-fadeOutOpacity-b-1nwjil4xy3 {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.components-reconnect-container[b-1nwjil4xy3] {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

/* Emplacement de l'animation d'attente : le panier (PanierSpinner, styles dans
   wwwroot/css/panier-spinner.css). La classe est celle que le gabarit Blazor affiche et masque
   selon l'état de la reconnexion, son nom est donc conservé. */
.components-rejoining-animation[b-1nwjil4xy3] {
    line-height: 0;
}

/* Un bloc par état de la reconnexion : titre, explication, et parfois une action. */
.reconnect-bloc[b-1nwjil4xy3] {
    text-align: center;
}

.reconnect-titre[b-1nwjil4xy3] {
    margin: 0 0 0.375rem;
    color: var(--heading-color, var(--bs-body-color));
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
}

.reconnect-texte[b-1nwjil4xy3] {
    margin: 0;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.9375rem;
    line-height: 1.55;
}

/* Le décompte est la seule information qui bouge : il doit se repérer d'un coup d'œil sans
   crier plus fort que le titre. */
.reconnect-compteur[b-1nwjil4xy3] {
    display: inline-block;
    min-width: 1.75rem;
    color: var(--primary, #5b8c3e);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Bootstrap ne pose pas de marge au-dessus des boutons, or l'action a besoin de respirer. */
#components-reconnect-modal .btn[b-1nwjil4xy3] {
    margin-top: 1.25rem;
}

.reconnect-raccourci[b-1nwjil4xy3] {
    margin: 1rem 0 0;
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.8125rem;
}

    .reconnect-raccourci kbd[b-1nwjil4xy3] {
        padding: 0.15rem 0.45rem;
        color: var(--bs-body-color);
        background-color: rgba(var(--bs-body-color-rgb, 0, 0, 0), 0.06);
        border-radius: var(--bs-border-radius-sm, 0.25rem);
        font-family: var(--bs-font-monospace, monospace);
        font-size: 0.8125rem;
    }
