.app-flash-stack {
    position: fixed;
    inset: 0;
    z-index: 2147483640;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 24px;
    pointer-events: none;
}

.app-flash-stack:has(.app-flash) {
    pointer-events: auto;
}

.app-flash-stack:has(.app-flash)::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at center, rgba(0, 48, 96, .18), rgba(15, 23, 42, .52));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;
    animation: app-flash-backdrop-in .22s ease-out;
}

.app-flash {
    --flash-navy: #003060;
    --flash-gold: #b8882d;
    --flash-accent: var(--flash-navy);
    pointer-events: auto;
    position: relative;
    z-index: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(440px, calc(100vw - 40px));
    min-height: 360px;
    box-sizing: border-box;
    margin: 0;
    padding: 2.85rem 1.8rem 2.55rem;
    border: 1px solid rgba(184, 136, 45, .18);
    border-radius: 26px;
    background:
        radial-gradient(ellipse 90% 55% at 50% -8%, rgba(184, 136, 45, .16), transparent 58%),
        linear-gradient(180deg, #fffefb 0%, #ffffff 46%, #f8f4ea 100%);
    box-shadow:
        0 30px 80px rgba(15, 23, 42, .26),
        0 10px 24px rgba(0, 48, 96, .12),
        inset 0 1px 0 rgba(255, 255, 255, .9);
    color: #0f172a;
    text-align: center;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.5;
    animation: app-flash-in .32s cubic-bezier(.22, 1, .36, 1);
}

.app-flash::after {
    content: "";
    position: absolute;
    top: 4.4rem;
    left: 50%;
    width: 168px;
    height: 168px;
    margin-left: -84px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(184, 136, 45, .16) 0%, rgba(184, 136, 45, 0) 72%);
    pointer-events: none;
    z-index: 0;
}

.app-flash__accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--flash-navy) 0%, var(--flash-gold) 52%, var(--flash-navy) 100%);
}

.app-flash__icon {
    position: relative;
    z-index: 1;
    width: 92px;
    height: 92px;
    margin: .2rem auto 1.35rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    font-size: 2.25rem;
    background: color-mix(in srgb, var(--flash-accent) 12%, #fff);
    color: var(--flash-accent);
    box-shadow:
        0 0 0 10px color-mix(in srgb, var(--flash-accent) 8%, #fff),
        0 0 0 18px color-mix(in srgb, var(--flash-gold) 10%, #fff);
    animation: app-flash-icon-in .42s cubic-bezier(.22, 1, .36, 1) .04s both;
}

.app-flash__body {
    position: relative;
    z-index: 1;
    min-width: 0;
    width: 100%;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-flash__title {
    display: block;
    margin: 0 0 .85rem;
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.4;
    text-transform: none;
    color: var(--flash-navy);
    opacity: 1;
}

.app-flash__title::after {
    content: "";
    display: block;
    width: 46px;
    height: 3px;
    margin: .75rem auto 0;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--flash-gold), var(--flash-navy));
}

.app-flash__text {
    margin: 0 auto;
    max-width: 32ch;
    color: #475569;
    font-size: 1rem;
    font-weight: 550;
    line-height: 1.75;
    word-break: break-word;
}

.app-flash__text ul {
    margin: .5rem 0 0;
    padding-inline-start: 1.1rem;
    text-align: start;
    font-weight: 600;
    color: #64748b;
    font-size: .88rem;
}

.app-flash__close {
    position: absolute;
    top: .95rem;
    inset-inline-end: .95rem;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .78);
    color: #64748b;
    display: inline-grid;
    place-items: center;
    font-size: .9rem;
    opacity: 1;
    box-shadow: inset 0 0 0 1px rgba(0, 48, 96, .08);
    cursor: pointer;
    z-index: 2;
}

.app-flash__close:hover {
    background: #fff;
    color: var(--flash-navy);
}

.app-flash--success {
    --flash-accent: var(--flash-navy);
}

.app-flash--success .app-flash__icon {
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .22), transparent 42%),
        linear-gradient(180deg, #064b80 0%, #003060 100%);
    color: #fff;
    box-shadow:
        0 0 0 9px rgba(184, 136, 45, .16),
        0 0 0 18px rgba(0, 48, 96, .06),
        0 16px 30px rgba(0, 48, 96, .22);
}

.app-flash--danger,
.app-flash--error {
    --flash-accent: #dc2626;
}

.app-flash--danger .app-flash__title,
.app-flash--error .app-flash__title {
    color: #991b1b;
}

.app-flash--warning {
    --flash-accent: #d97706;
}

.app-flash--warning .app-flash__title {
    color: #92400e;
}

.app-flash--info {
    --flash-accent: #0369a1;
}

.app-flash--info .app-flash__title {
    color: #075985;
}

.app-flash--out {
    animation: app-flash-out .2s ease-in forwards;
}

@keyframes app-flash-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes app-flash-in {
    from { opacity: 0; transform: scale(.94) translateY(10px); }
    to { opacity: 1; transform: none; }
}

@keyframes app-flash-out {
    from { opacity: 1; transform: none; }
    to { opacity: 0; transform: scale(.96); }
}

@keyframes app-flash-icon-in {
    from { opacity: 0; transform: scale(.68); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 767.98px) {
    .app-flash-stack {
        padding: 16px;
    }

    .app-flash {
        min-height: 320px;
        width: min(440px, calc(100vw - 24px));
        padding: 2.4rem 1.35rem 2.15rem;
    }

    .app-flash__icon {
        width: 80px;
        height: 80px;
        font-size: 2rem;
        margin-bottom: 1.15rem;
    }

    .app-flash__title {
        font-size: 1.18rem;
    }
}
