/* ==========================================================================
   Message flash partagé (voir templates/fragments/toast.html)
   Les variables --glass-* sont définies par home.css ; les valeurs de repli
   permettent de l'utiliser aussi sur les pages qui ne les déclarent pas.
   ========================================================================== */

.toast {
    position: fixed;
    z-index: 40;
    top: max(1.5rem, env(safe-area-inset-top));
    left: 50%;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    max-width: calc(100vw - 2.5rem);
    padding: 0.75rem 0.9rem 0.75rem 1.1rem;
    background: var(--glass-bg, rgba(255, 255, 255, 0.92));
    backdrop-filter: var(--glass-blur, blur(18px));
    -webkit-backdrop-filter: var(--glass-blur, blur(18px));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.55));
    box-shadow: var(--shadow-md, 0 10px 30px rgba(15, 28, 18, 0.14));
    border-radius: 999px;
    transform: translate(-50%, 0);
    animation: toast-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.toast.is-hidden {
    opacity: 0;
    transform: translate(-50%, -12px);
}

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, -16px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    flex: none;
    border-radius: 50%;
    background: var(--color-primary, #2f5233);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.toast-error .toast-icon {
    background: #b3402a;
}

.toast-text {
    font-size: 0.88rem;
    color: var(--color-primary-dark, #1d3520);
}

.toast-error .toast-text {
    color: #7a2a1a;
}

.toast-close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted, #5d6a5f);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s ease, color 0.15s ease;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-primary-dark, #1d3520);
}

@media (max-width: 480px) {
    .toast-text {
        font-size: 0.8rem;
    }
}
