/**
 * Toasts do sistema (toastr) — visual moderno global.
 *
 * Par com as opções em common.js (closeButton, progressBar, timeOut maior).
 * Ícones em Font Awesome 5 (font local do vendor.css) via ::before — o PNG
 * base64 padrão do toastr é desligado com background-image:none.
 * A "barra regressiva" é o .toast-progress nativo do toastr (100% → 0),
 * só estilizada aqui.
 */

#toast-container > div {
    opacity: 1;
    background-image: none !important; /* desliga o ícone PNG nativo */
    border-radius: 12px;
    padding: 16px 42px 16px 62px;
    min-width: 320px;
    max-width: 420px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.18);
    animation: toast-slide-in 0.45s cubic-bezier(0.21, 1.02, 0.55, 1.01) both;
    overflow: hidden;
}

#toast-container > div:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 3px 8px rgba(0, 0, 0, 0.3);
}

/* ===== Cores por tipo (gradientes) ===== */
#toast-container > .toast-success {
    background: linear-gradient(135deg, #1b7742 0%, #2eb262 100%) !important;
}
#toast-container > .toast-error {
    background: linear-gradient(135deg, #a61b1b 0%, #e04040 100%) !important;
}
#toast-container > .toast-warning {
    background: linear-gradient(135deg, #b06d00 0%, #e79c1c 100%) !important;
}
#toast-container > .toast-info {
    background: linear-gradient(135deg, #145a8a 0%, #2f8fd0 100%) !important;
}

/* ===== Ícone (Font Awesome 5 solid) com animação de entrada ===== */
#toast-container > div::before {
    font-family: 'Font Awesome 5 Free', 'Font Awesome\ 5 Free', FontAwesome;
    font-weight: 900;
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 26px;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    animation: toast-icon-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}
#toast-container > .toast-success::before { content: '\f058'; } /* check-circle */
#toast-container > .toast-error::before   { content: '\f057'; } /* times-circle */
#toast-container > .toast-warning::before { content: '\f071'; } /* exclamation-triangle */
#toast-container > .toast-info::before    { content: '\f05a'; } /* info-circle */

/* ===== Texto ===== */
#toast-container .toast-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
}
#toast-container .toast-message {
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
}

/* ===== Botão fechar (X no canto superior direito) ===== */
#toast-container .toast-close-button {
    position: absolute;
    top: 6px;
    right: 8px;
    float: none;
    width: 22px;
    height: 22px;
    line-height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 15px;
    font-weight: 400;
    text-align: center;
    text-shadow: none;
    opacity: 0.85;
    padding: 0;
    transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
#toast-container .toast-close-button:hover,
#toast-container .toast-close-button:focus {
    background: rgba(255, 255, 255, 0.35);
    opacity: 1;
    transform: scale(1.12);
    color: #fff;
}

/* ===== Barra regressiva (progress inversa nativa do toastr) ===== */
#toast-container + * .toast-progress, /* especificidade defensiva */
.toast-progress {
    height: 4px;
    opacity: 0.95;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.65));
    border-radius: 0 2px 2px 0;
}

/* ===== Animações ===== */
@keyframes toast-slide-in {
    from {
        transform: translateX(110%);
        opacity: 0;
    }
    60% {
        transform: translateX(-6px);
        opacity: 1;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-icon-pop {
    from {
        transform: translateY(-50%) scale(0);
        opacity: 0;
    }
    70% {
        transform: translateY(-50%) scale(1.25);
        opacity: 1;
    }
    to {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

/* Acessibilidade: respeita usuários com redução de movimento */
@media (prefers-reduced-motion: reduce) {
    #toast-container > div,
    #toast-container > div::before {
        animation: none;
    }
}

/* Telas pequenas: toast ocupa a largura com margem */
@media (max-width: 480px) {
    #toast-container > div {
        min-width: 0;
        width: calc(100vw - 24px);
    }
}
