/* ==========================================================================
   Toasts globais (SweetAlert2)
   --------------------------------------------------------------------------
   Estilos base + fundo por tipo de mensagem. O fundo é aplicado pela classe
   `prontus-toast--success|error|warning|info|question`; em navegadores que
   suportam seletores avançados há também um fallback pelo ícone renderizado.
   As variantes do tema escuro ficam em dark-mode.css.
   ========================================================================== */

/* Z-INDEX 200000: deve ficar SEMPRE à frente de todos os modais do sistema,
   incluindo PEP (workspace 9999, modais clínicos 10020/10030, assinatura 99999). */
.swal2-container.swal2-top,
.swal2-container.swal2-top-end,
.swal2-container.swal2-top-start {
    z-index: 200000 !important;
    padding-top: 14px !important;
}

/* --- base --- */
.swal2-popup.prontus-toast {
    border-radius: 16px !important;
    background: rgba(255, 255, 255, .94) !important;
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    border: 1px solid rgba(226, 232, 240, .9) !important;
    box-shadow: 0 16px 44px -12px rgba(15, 23, 42, .22), 0 2px 10px -2px rgba(15, 23, 42, .08) !important;
    padding: 11px 12px 13px !important;
    min-width: 300px;
    max-width: min(380px, calc(100vw - 32px));
    overflow: hidden;
}
.swal2-popup.prontus-toast .swal2-title.prontus-toast-title {
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    letter-spacing: -.01em;
    line-height: 1.45 !important;
    margin: 0 !important;
    padding: 1px 26px 0 0 !important;
    text-align: left !important;
}
.swal2-popup.prontus-toast.swal2-toast {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0 !important;
}
.swal2-popup.prontus-toast .swal2-icon {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    margin: 0 10px 0 0 !important;
    border-width: 2px !important;
}
.swal2-popup.prontus-toast .swal2-icon .swal2-icon-content {
    font-size: 16px !important;
    font-weight: 900 !important;
}
.swal2-popup.prontus-toast .swal2-icon.swal2-success {
    border-color: rgba(16, 185, 129, .35) !important;
    color: #059669 !important;
    background: #ecfdf5 !important;
}
.swal2-popup.prontus-toast .swal2-icon.swal2-error {
    border-color: rgba(244, 63, 94, .3) !important;
    color: #e11d48 !important;
    background: #fff1f2 !important;
}
.swal2-popup.prontus-toast .swal2-icon.swal2-warning {
    border-color: rgba(245, 158, 11, .35) !important;
    color: #d97706 !important;
    background: #fffbeb !important;
}
.swal2-popup.prontus-toast .swal2-icon.swal2-info {
    border-color: rgba(14, 165, 233, .35) !important;
    color: #0284c7 !important;
    background: #f0f9ff !important;
}
.swal2-popup.prontus-toast .swal2-icon.swal2-question {
    border-color: rgba(99, 102, 241, .35) !important;
    color: #4f46e5 !important;
    background: #eef2ff !important;
}
.swal2-popup.prontus-toast .swal2-timer-progress-bar {
    height: 3px !important;
    border-radius: 99px !important;
}
.swal2-popup.prontus-toast .swal2-close {
    width: 22px !important;
    height: 22px !important;
    font-size: 14px !important;
    color: #94a3b8 !important;
    border-radius: 8px !important;
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    box-shadow: none !important;
}
.swal2-popup.prontus-toast .swal2-close:hover {
    color: #475569 !important;
    background: #f1f5f9 !important;
}
.swal2-popup.prontus-toast-in {
    animation: prontusToastIn .32s cubic-bezier(.21, 1.02, .73, 1) both !important;
}
.swal2-popup.prontus-toast-out {
    animation: prontusToastOut .22s ease-in both !important;
}
@keyframes prontusToastIn {
    from { opacity: 0; transform: translateX(24px) scale(.97); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes prontusToastOut {
    to { opacity: 0; transform: translateX(16px) scale(.98); }
}

/* Conteúdo HTML opcional (ex.: link para abrir termo quando o pop-up é bloqueado) */
.swal2-popup.prontus-toast .swal2-html-container {
    margin: 0 !important;
    padding: 1px 26px 0 0 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.45 !important;
    color: #0f172a !important;
    text-align: left !important;
}
.swal2-popup.prontus-toast .swal2-html-container a {
    color: #0369a1 !important;
    font-weight: 800 !important;
    text-decoration: underline !important;
}

/* --- tipos (classe aplicada pelo JS) --- */
.swal2-popup.prontus-toast.prontus-toast--success {
    background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 55%, #f8fffc 100%) !important;
    border-color: rgba(16, 185, 129, .38) !important;
    box-shadow: 0 16px 44px -14px rgba(5, 150, 105, .38), 0 2px 10px -2px rgba(5, 150, 105, .14) !important;
}
.swal2-popup.prontus-toast.prontus-toast--success .swal2-title.prontus-toast-title {
    color: #065f46 !important;
}
.swal2-popup.prontus-toast.prontus-toast--success .swal2-close:hover {
    background: #d1fae5 !important;
    color: #065f46 !important;
}

.swal2-popup.prontus-toast.prontus-toast--error {
    background: linear-gradient(135deg, #ffe4e6 0%, #fff1f2 55%, #fff8f8 100%) !important;
    border-color: rgba(244, 63, 94, .36) !important;
    box-shadow: 0 16px 44px -14px rgba(225, 29, 72, .36), 0 2px 10px -2px rgba(225, 29, 72, .14) !important;
}
.swal2-popup.prontus-toast.prontus-toast--error .swal2-title.prontus-toast-title {
    color: #9f1239 !important;
}
.swal2-popup.prontus-toast.prontus-toast--error .swal2-close:hover {
    background: #ffe4e6 !important;
    color: #9f1239 !important;
}

.swal2-popup.prontus-toast.prontus-toast--warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 55%, #fffdf7 100%) !important;
    border-color: rgba(245, 158, 11, .4) !important;
    box-shadow: 0 16px 44px -14px rgba(217, 119, 6, .36), 0 2px 10px -2px rgba(217, 119, 6, .14) !important;
}
.swal2-popup.prontus-toast.prontus-toast--warning .swal2-title.prontus-toast-title {
    color: #92400e !important;
}
.swal2-popup.prontus-toast.prontus-toast--warning .swal2-close:hover {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.swal2-popup.prontus-toast.prontus-toast--info {
    background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 55%, #f8fdff 100%) !important;
    border-color: rgba(14, 165, 233, .36) !important;
    box-shadow: 0 16px 44px -14px rgba(2, 132, 199, .34), 0 2px 10px -2px rgba(2, 132, 199, .12) !important;
}
.swal2-popup.prontus-toast.prontus-toast--info .swal2-title.prontus-toast-title {
    color: #075985 !important;
}
.swal2-popup.prontus-toast.prontus-toast--info .swal2-close:hover {
    background: #e0f2fe !important;
    color: #075985 !important;
}

.swal2-popup.prontus-toast.prontus-toast--question {
    background: linear-gradient(135deg, #e0e7ff 0%, #eef2ff 55%, #f8f9ff 100%) !important;
    border-color: rgba(99, 102, 241, .36) !important;
    box-shadow: 0 16px 44px -14px rgba(79, 70, 229, .34), 0 2px 10px -2px rgba(79, 70, 229, .12) !important;
}
.swal2-popup.prontus-toast.prontus-toast--question .swal2-title.prontus-toast-title {
    color: #3730a3 !important;
}
.swal2-popup.prontus-toast.prontus-toast--question .swal2-close:hover {
    background: #e0e7ff !important;
    color: #3730a3 !important;
}

/* --- fallback por ícone (apenas navegadores com suporte) --- */
@supports selector(:has(*)) {
    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-success) {
        background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 55%, #f8fffc 100%) !important;
        border-color: rgba(16, 185, 129, .38) !important;
        box-shadow: 0 16px 44px -14px rgba(5, 150, 105, .38), 0 2px 10px -2px rgba(5, 150, 105, .14) !important;
    }
    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-success) .swal2-title.prontus-toast-title {
        color: #065f46 !important;
    }
    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-success) .swal2-close:hover {
        background: #d1fae5 !important;
        color: #065f46 !important;
    }

    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-error) {
        background: linear-gradient(135deg, #ffe4e6 0%, #fff1f2 55%, #fff8f8 100%) !important;
        border-color: rgba(244, 63, 94, .36) !important;
        box-shadow: 0 16px 44px -14px rgba(225, 29, 72, .36), 0 2px 10px -2px rgba(225, 29, 72, .14) !important;
    }
    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-error) .swal2-title.prontus-toast-title {
        color: #9f1239 !important;
    }
    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-error) .swal2-close:hover {
        background: #ffe4e6 !important;
        color: #9f1239 !important;
    }

    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-warning) {
        background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 55%, #fffdf7 100%) !important;
        border-color: rgba(245, 158, 11, .4) !important;
        box-shadow: 0 16px 44px -14px rgba(217, 119, 6, .36), 0 2px 10px -2px rgba(217, 119, 6, .14) !important;
    }
    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-warning) .swal2-title.prontus-toast-title {
        color: #92400e !important;
    }
    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-warning) .swal2-close:hover {
        background: #fef3c7 !important;
        color: #92400e !important;
    }

    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-info) {
        background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 55%, #f8fdff 100%) !important;
        border-color: rgba(14, 165, 233, .36) !important;
        box-shadow: 0 16px 44px -14px rgba(2, 132, 199, .34), 0 2px 10px -2px rgba(2, 132, 199, .12) !important;
    }
    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-info) .swal2-title.prontus-toast-title {
        color: #075985 !important;
    }
    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-info) .swal2-close:hover {
        background: #e0f2fe !important;
        color: #075985 !important;
    }

    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-question) {
        background: linear-gradient(135deg, #e0e7ff 0%, #eef2ff 55%, #f8f9ff 100%) !important;
        border-color: rgba(99, 102, 241, .36) !important;
        box-shadow: 0 16px 44px -14px rgba(79, 70, 229, .34), 0 2px 10px -2px rgba(79, 70, 229, .12) !important;
    }
    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-question) .swal2-title.prontus-toast-title {
        color: #3730a3 !important;
    }
    .swal2-popup.prontus-toast:has(.swal2-icon.swal2-question) .swal2-close:hover {
        background: #e0e7ff !important;
        color: #3730a3 !important;
    }
}
