/**
 * Alertes « toast » (assets/js/toast.js) : bandeau qui descend du haut de
 * l'écran : rouge pour les erreurs, vert pour les succès des formulaires.
 */

.cb-toasts {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 100100; /* au-dessus des fenêtres (modales) du site */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(560px, calc(100% - 32px));
    transform: translateX(-50%);
    pointer-events: none;
}

.cb-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 14px 14px 18px;
    border-radius: 14px;
    background: #c62828;
    color: #fff;
    font-family: 'Montserrat', 'Gotham', sans-serif;
    font-size: 14.5px;
    line-height: 1.45;
    box-shadow: 0 12px 32px -10px rgba(120, 20, 20, 0.45);
    pointer-events: auto;
    animation: cb-toast-in 260ms ease-out both;
}

.cb-toast--success {
    background: #1d7a43;
    box-shadow: 0 12px 32px -10px rgba(20, 90, 50, 0.45);
}

.cb-toast.is-leaving {
    animation: cb-toast-out 200ms ease-in both;
}

.cb-toast__icon {
    flex: 0 0 auto;
    margin-top: 1px;
    font-size: 20px;
    line-height: 1;
}

.cb-toast__message {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.cb-toast__close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: -3px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.cb-toast__close:hover,
.cb-toast__close:focus-visible {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}

@keyframes cb-toast-in {
    from { opacity: 0; transform: translateY(-24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cb-toast-out {
    to { opacity: 0; transform: translateY(-16px); }
}

@media (prefers-reduced-motion: reduce) {
    .cb-toast,
    .cb-toast.is-leaving {
        animation-duration: 1ms;
    }
}
