/* Shared light-green slide-in success toast */
.erx-success-toast-stack {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1000001;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(380px, calc(100vw - 2.5rem));
    pointer-events: none;
}

.erx-success-toast {
    pointer-events: auto;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(26, 107, 60, 0.14);
    overflow: hidden;
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    will-change: transform, opacity;
    transition:
        transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.5s ease;
}

.erx-success-toast__body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
}

.erx-success-toast.is-visible {
    transform: translateX(0);
    opacity: 1;
}

.erx-success-toast.is-leaving {
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
}

.erx-success-toast__icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #d1fae5;
    color: #15803d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.erx-success-toast__title {
    margin: 0;
    flex: 1;
    font-size: 0.92rem;
    font-weight: 700;
    color: #14532d;
    font-family: 'Inter', sans-serif;
    line-height: 1.3;
}

.erx-success-toast__close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #6b9080;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.erx-success-toast__close:hover {
    color: #14532d;
}

.erx-success-toast__timer {
    height: 3px;
    background: #dcfce7;
    overflow: hidden;
}

.erx-success-toast__timer-line {
    display: block;
    height: 100%;
    width: 100%;
    background: #86efac;
    transform-origin: left center;
    animation: erxSuccessToastTimer var(--erx-toast-duration, 3s) linear forwards;
}

@keyframes erxSuccessToastTimer {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.erx-success-toast.erx-toast--error {
    background: #fef2f2;
    border-color: #fecaca;
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.12);
}

.erx-success-toast.erx-toast--error .erx-success-toast__icon {
    background: #fee2e2;
    color: #dc2626;
}

.erx-success-toast.erx-toast--error .erx-success-toast__title {
    color: #991b1b;
}

.erx-success-toast.erx-toast--error .erx-success-toast__close {
    color: #b99191;
}

.erx-success-toast.erx-toast--error .erx-success-toast__close:hover {
    color: #991b1b;
}

.erx-success-toast.erx-toast--error .erx-success-toast__timer {
    background: #fee2e2;
}

.erx-success-toast.erx-toast--error .erx-success-toast__timer-line {
    background: #f87171;
}

@media (max-width: 575.98px) {
    .erx-success-toast-stack {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
    }
}

/* Legacy aliases used on consultation page */
.medicine-flash-toast-stack {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1000001;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(380px, calc(100vw - 2.5rem));
    pointer-events: none;
}

.medicine-flash-toast { pointer-events: auto; background: #ecfdf5; border: 1px solid #bbf7d0; border-radius: 14px; box-shadow: 0 12px 32px rgba(26, 107, 60, 0.14); overflow: hidden; transform: translateX(calc(100% + 2rem)); opacity: 0; will-change: transform, opacity; transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease; }
.medicine-flash-toast__body { display: flex; align-items: center; gap: 0.75rem; padding: 0.95rem 1rem; }
.medicine-flash-toast.is-visible { transform: translateX(0); opacity: 1; }
.medicine-flash-toast.is-leaving { transform: translateX(calc(100% + 2rem)); opacity: 0; }
.medicine-flash-toast__icon { flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%; background: #d1fae5; color: #15803d; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.medicine-flash-toast__title { margin: 0; flex: 1; font-size: 0.92rem; font-weight: 700; color: #14532d; font-family: 'Inter', sans-serif; line-height: 1.3; }
.medicine-flash-toast__close { flex-shrink: 0; border: none; background: transparent; color: #6b9080; font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0; transition: color 0.2s ease; }
.medicine-flash-toast__close:hover { color: #14532d; }
.medicine-flash-toast__timer { height: 3px; background: #dcfce7; overflow: hidden; }
.medicine-flash-toast__timer-line { display: block; height: 100%; width: 100%; background: #86efac; transform-origin: left center; animation: erxSuccessToastTimer var(--medicine-toast-duration, 3s) linear forwards; }

@media (max-width: 575.98px) {
    .medicine-flash-toast-stack {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
    }
}
