/* Toast Components — "Híbrido clínico" style */

/* FOUC defense: hide Django-rendered messages until JS lifts them */
[data-toast-type] {
    display: none;
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100vw - 40px);
}

.toast {
    pointer-events: auto;
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    border-left-width: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.4;
    min-width: 260px;
    max-width: 360px;
    cursor: pointer;
    text-align: left;
    animation: toast-in 200ms ease-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.toast:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.toast.success { border-left-color: #10b981; }
.toast.error   { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }
.toast.info    { border-left-color: #3b82f6; }

.toast.hiding {
    animation: toast-out 200ms ease-in forwards;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
    padding: 0 2px;
    flex-shrink: 0;
    border-radius: 4px;
    transition: color 100ms ease;
}

.toast-close:hover {
    color: #374151;
}

.toast-close:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

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

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

@media (max-width: 768px) {
    .toast-container {
        right: 12px;
        left: 12px;
        bottom: 12px;
        max-width: none;
    }
    .toast {
        min-width: 0;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast.hiding {
        animation: none;
    }
}
