.app-flashes {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.app-flash {
    --flash-rgb: 118, 191, 70;
    --flash-border: rgba(118, 191, 70, 0.52);
    --flash-text: #1f7a2f;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 3.35rem;
    overflow: hidden;
    border: 1px solid var(--flash-border);
    border-radius: 0.95rem;
    padding: 0.72rem 1rem;
    color: var(--flash-text);
    background:
        radial-gradient(circle at 2.25rem 50%, rgba(var(--flash-rgb), 0.18), transparent 5.8rem),
        linear-gradient(135deg, rgba(var(--flash-rgb), 0.13), rgba(var(--flash-rgb), 0.045) 48%, rgba(255, 255, 255, 0.62));
    box-shadow:
        0 14px 36px rgba(15, 23, 42, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.28),
        0 0 20px rgba(var(--flash-rgb), 0.12);
    backdrop-filter: blur(14px);
}

.app-flash::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.26), transparent);
    transform: translateX(-115%);
    animation: appFlashScan 5.2s ease-in-out infinite;
}

.app-flash--error {
    --flash-rgb: 239, 68, 68;
    --flash-border: rgba(239, 68, 68, 0.5);
    --flash-text: #dc2626;
}

.app-flash__icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    width: 2.1rem;
    height: 2.1rem;
    flex: 0 0 2.1rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--flash-rgb), 0.44);
    border-radius: 0.72rem;
    background: rgba(var(--flash-rgb), 0.1);
    box-shadow: inset 0 0 16px rgba(var(--flash-rgb), 0.08), 0 0 14px rgba(var(--flash-rgb), 0.1);
}

.app-flash__icon img {
    width: 1.18rem;
    height: 1.18rem;
    object-fit: contain;
    filter: drop-shadow(0 0 7px rgba(var(--flash-rgb), 0.32));
}

.app-flash__message {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    margin: 0;
    color: currentColor;
    font-size: 0.98rem;
    line-height: 1.35;
    font-weight: 500;
}

.app-flash__close {
    position: relative;
    z-index: 1;
    display: inline-flex;
    width: 1.9rem !important;
    min-width: 1.9rem !important;
    max-width: 1.9rem !important;
    height: 1.9rem !important;
    min-height: 1.9rem !important;
    max-height: 1.9rem !important;
    flex: 0 0 1.9rem;
    align-self: center;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border: 1px solid rgba(var(--flash-rgb), 0.26);
    border-radius: 50%;
    color: currentColor;
    background: rgba(var(--flash-rgb), 0.06);
    font-size: 0;
    line-height: 0;
    box-sizing: border-box;
    appearance: none;
    opacity: 0.78;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
}

.app-flash__close::before,
.app-flash__close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.72rem;
    height: 1.5px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: center;
}

.app-flash__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.app-flash__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.app-flash__close:hover,
.app-flash__close:focus-visible {
    border-color: rgba(var(--flash-rgb), 0.48);
    background: rgba(var(--flash-rgb), 0.12);
    opacity: 1;
    transform: translateY(-1px);
    outline: none;
}

.app-flash.is-closing {
    max-height: 0 !important;
    min-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    opacity: 0;
    transform: translateY(-0.35rem);
    transition: max-height 0.22s ease, min-height 0.22s ease, margin 0.22s ease, padding 0.22s ease, border-width 0.22s ease, opacity 0.18s ease, transform 0.18s ease;
}

[data-theme="dark"] .app-flash {
    color: rgb(164, 229, 130);
    background:
        radial-gradient(circle at 2.25rem 50%, rgba(var(--flash-rgb), 0.2), transparent 5.8rem),
        linear-gradient(135deg, rgba(var(--flash-rgb), 0.13), rgba(15, 23, 42, 0.7) 54%, rgba(31, 41, 55, 0.76));
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 0 22px rgba(var(--flash-rgb), 0.13);
}

[data-theme="dark"] .app-flash--error {
    color: rgb(252, 165, 165);
}

@keyframes appFlashScan {
    0%, 58% {
        transform: translateX(-115%);
        opacity: 0;
    }
    68% {
        opacity: 1;
    }
    86%, 100% {
        transform: translateX(115%);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-flash::before {
        animation: none;
    }

    .app-flash,
    .app-flash__close {
        transition: none;
    }
}
