/* ============================================================
   Toast Notification System — CSS puro, reutilizável
   Inclua este arquivo + /assets/js/toast.js em qualquer página
   ============================================================ */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 48px);
}

/* ---- Item ---- */
.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);
    border-left: 4px solid #888;
    position: relative;
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 13.5px;
    line-height: 1.5;
    color: #333;
}

.toast-item.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-item.hiding {
    transform: translateX(120%);
    opacity: 0;
}

/* ---- Cores por tipo ---- */
.toast-item--success { border-left-color: #2e7d32; }
.toast-item--error   { border-left-color: #d32f2f; }
.toast-item--info    { border-left-color: #1565c0; }
.toast-item--warning { border-left-color: #e65100; }

/* ---- Ícone circular ---- */
.toast-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-top: 1px;
    font-style: normal;
}

.toast-item--success .toast-icon { background: #2e7d32; }
.toast-item--error   .toast-icon { background: #d32f2f; }
.toast-item--info    .toast-icon { background: #1565c0; }
.toast-item--warning .toast-icon { background: #e65100; }

/* ---- Mensagem ---- */
.toast-msg {
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

/* ---- Botão fechar ---- */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 20px;
    color: #aaa;
    cursor: pointer;
    padding: 0 0 0 8px;
    line-height: 1;
    transition: color .2s;
}
.toast-close:hover { color: #333; }

/* ---- Barra de progresso ---- */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    opacity: .6;
    animation: toastProgress linear forwards;
}

.toast-item--success .toast-progress { background: #2e7d32; }
.toast-item--error   .toast-progress { background: #d32f2f; }
.toast-item--info    .toast-progress { background: #1565c0; }
.toast-item--warning .toast-progress { background: #e65100; }

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        max-width: 100%;
        width: auto;
    }

    .toast-item {
        font-size: 13px;
        padding: 12px 14px;
        gap: 10px;
    }
}
