.ep-flash-root {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
}

.ep-flash {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.85rem 2.25rem 0.95rem 0.95rem;
    border-radius: 0.65rem;
    border: 1px solid transparent;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    pointer-events: auto;
    animation: ep-flash-in 0.28s ease-out;
}

.ep-flash--success {
    border-color: rgba(25, 135, 84, 0.25);
    background: #f3fbf6;
}

.ep-flash--danger {
    border-color: rgba(220, 53, 69, 0.25);
    background: #fff5f5;
}

.ep-flash--warning {
    border-color: rgba(255, 193, 7, 0.35);
    background: #fffbeb;
}

.ep-flash--info {
    border-color: rgba(13, 110, 253, 0.25);
    background: #f0f7ff;
}

.ep-flash__body {
    flex: 1;
    min-width: 0;
}

.ep-flash__message {
    display: block;
    font-size: 0.875rem;
    line-height: 1.45;
}

.ep-flash__undo-form {
    margin-top: 0.55rem;
}

.ep-flash__undo-btn {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    padding: 0;
    cursor: pointer;
}

.ep-flash--success .ep-flash__undo-btn { color: #146c43; }
.ep-flash--danger .ep-flash__undo-btn { color: #b02a37; }
.ep-flash--warning .ep-flash__undo-btn { color: #997404; }
.ep-flash--info .ep-flash__undo-btn { color: #0a58ca; }

.ep-flash__close {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    border: 0;
    background: transparent;
    color: inherit;
    opacity: 0.55;
    line-height: 1;
    padding: 0.15rem;
    cursor: pointer;
}

.ep-flash__close:hover {
    opacity: 0.9;
}

.ep-flash__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(15, 23, 42, 0.08);
    transform-origin: left center;
    transform: scaleX(1);
}

.ep-flash--success .ep-flash__progress { background: rgba(25, 135, 84, 0.35); }
.ep-flash--danger .ep-flash__progress { background: rgba(220, 53, 69, 0.35); }
.ep-flash--warning .ep-flash__progress { background: rgba(255, 193, 7, 0.45); }
.ep-flash--info .ep-flash__progress { background: rgba(13, 110, 253, 0.35); }

.ep-flash.is-leaving {
    animation: ep-flash-out 0.22s ease-in forwards;
}

.ep-flash.is-undo-expired .ep-flash__undo-form {
    display: none;
}

@keyframes ep-flash-in {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ep-flash-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(0.5rem);
    }
}

@media (max-width: 575.98px) {
    .ep-flash-root {
        left: 1rem;
        right: 1rem;
        width: auto;
    }
}

.ep-page-flash {
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.ep-app .alert.ep-page-flash.alert-success,
.alert.ep-page-flash.alert-success {
    border-left-color: #198754;
    background: #d1e7dd;
    color: #0f5132;
}

.ep-app .alert.ep-page-flash.alert-danger,
.alert.ep-page-flash.alert-danger {
    border-left-color: #dc3545;
    background: #f8d7da;
    color: #842029;
}

.ep-page-flash.is-leaving {
    opacity: 0;
    transform: translateY(-0.35rem);
}
