/* Toasts (Alertes/ToastNotification.razor), partagés par le desktop, le web mobile et l'application (lot 11, Q10) :
   carte claire à pastille, aux jetons des UI de la refonte (bordure, ombre des actions flottantes, couleurs de la charte). */
.toast-container {
    --toast-texte: #545b66;
    --toast-discret: #808891;
    --toast-bordure: #d9dde2;
    --toast-succes: #16a34a;
    --toast-succes-fond: #e6f4eb;
    --toast-info: #185a9d;
    --toast-info-fond: #e8f0f8;
    --toast-erreur: #c94a4a;
    --toast-erreur-fond: #fbeaea;
    position: fixed;
    bottom: 20px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 320px;
}
/* Au-dessus des actions flottantes de la Description (ActionsFlottantes, ADR 0143 : 44 px à 20 px du bas), sauf
   sous 1 100 px là où le bandeau collant les remplace. */
body:has(.flottants) .toast-container {
    bottom: 76px;
}
@media (max-width: 1100px) {
    body:has(.flottants--bandeau) .toast-container {
        bottom: 20px;
    }
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 8px 10px 10px;
    border: 1px solid var(--toast-bordure);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(36, 71, 110, 0.18), 0 1px 3px rgba(36, 71, 110, 0.12);
    color: var(--toast-texte);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    animation: toastIn 0.2s ease;
}
.toast-pastille {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}
.toast-pastille svg {
    width: 16px;
    height: 16px;
}
.toast--succes .toast-pastille { background: var(--toast-succes-fond); color: var(--toast-succes); }
.toast--info .toast-pastille { background: var(--toast-info-fond); color: var(--toast-info); }
.toast--erreur .toast-pastille { background: var(--toast-erreur-fond); color: var(--toast-erreur); }
/* Le texte s'aligne sur le centre de la pastille, sur une ligne comme sur plusieurs. */
.toast-corps {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    padding-top: 4px;
}
.toast-lien {
    padding: 0;
    border: none;
    background: none;
    color: var(--toast-info);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}
.toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--toast-discret);
    cursor: pointer;
}
.toast-close svg {
    width: 16px;
    height: 16px;
}
@media (hover: hover) {
    .toast-close:hover {
        background: #f3f4f6;
    }
}
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .toast { animation: none; }
}

/* Mobile : pleine largeur, au-dessus de la barre d'accueil de l'application (zone sûre), et de la barre d'actions de
   l'accueil (boutons ronds de 56 px à 16 px du bas) quand elle est là ; jetons mobiles (--m-*). */
@media (max-width: 767px) {
    .toast-container {
        --toast-texte: #545b66;
        --toast-discret: #808080;
        --toast-bordure: #e1e4e8;
        --toast-succes: #059669;
        --toast-succes-fond: #e3f4ee;
        left: 16px;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        width: auto;
    }
    body:has(.m-home-actions) .toast-container {
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    }
    .toast {
        gap: 12px;
        padding: 12px 6px 12px 12px;
        border-radius: 14px;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18), 0 1px 3px rgba(15, 23, 42, 0.1);
        font-size: 14px;
    }
    .toast-pastille {
        width: 32px;
        height: 32px;
    }
    .toast-pastille svg {
        width: 18px;
        height: 18px;
    }
    .toast-corps {
        gap: 0;
        padding-top: 5px;
    }
    .toast-lien {
        min-height: 40px;
    }
    /* Cible tactile de 44 px, sans grandir la carte. */
    .toast-close {
        width: 44px;
        height: 44px;
        margin: -6px 0;
    }
    .toast-close svg {
        width: 18px;
        height: 18px;
    }
}
