/* ============================================================
   ATLANTICA — FLASH MESSAGES
   Design system global Admin + Public
   ============================================================ */

:root {
    --atl-flash-blue: #38B7FF;
    --atl-flash-blue-dark: #1C96D9;
    --atl-flash-green: #80D957;
    --atl-flash-green-dark: #5EA83A;
    --atl-flash-black: #111111;
    --atl-flash-text: #374151;
    --atl-flash-muted: #66737D;
    --atl-flash-border: #E1E8ED;
    --atl-flash-white: #FFFFFF;
    --atl-flash-bg: #F5F8FA;
    --atl-flash-danger: #C2414D;
    --atl-flash-warning: #C58A16;
    --atl-flash-shadow: 0 18px 50px rgba(17, 17, 17, .14);
}

.atl-flash-stack {
    position: fixed;
    top: 96px;
    right: 24px;
    z-index: 120000;
    width: min(420px, calc(100vw - 48px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.atl-flash-stack-public {
    top: 140px;
}

.atl-flash-stack-admin {
    top: 92px;
}

.atl-flash {
    --atl-flash-accent: var(--atl-flash-blue-dark);
    --atl-flash-surface: #F7FCFF;
    --atl-flash-icon-bg: #EAF7FD;
    --atl-flash-title: var(--atl-flash-black);
    --atl-flash-message: var(--atl-flash-text);
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 34px;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 15px 15px 18px;
    overflow: hidden;
    pointer-events: auto;
    background: var(--atl-flash-white);
    border: 1px solid var(--atl-flash-border);
    border-left: 4px solid var(--atl-flash-accent);
    border-radius: 16px;
    box-shadow: var(--atl-flash-shadow);
    color: var(--atl-flash-message);
    opacity: 0;
    transform: translate3d(26px, -6px, 0) scale(.985);
    animation: atlFlashEnter .32s cubic-bezier(.2, .7, .2, 1) forwards;
}

.atl-flash.is-closing {
    animation: atlFlashExit .24s ease forwards;
}

.atl-flash-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--atl-flash-icon-bg);
    color: var(--atl-flash-accent);
    font-size: 18px;
    line-height: 1;
}

.atl-flash-body {
    min-width: 0;
    padding-top: 1px;
}

.atl-flash-title {
    margin-bottom: 3px;
    color: var(--atl-flash-title);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.atl-flash-message {
    max-height: 150px;
    overflow-y: auto;
    padding-right: 2px;
    color: var(--atl-flash-message);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.atl-flash-message a {
    color: var(--atl-flash-blue-dark);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.atl-flash-close {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--atl-flash-muted);
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.atl-flash-close:hover,
.atl-flash-close:focus-visible {
    background: #F5F8FA;
    color: var(--atl-flash-black);
    transform: scale(1.03);
    outline: none;
}

.atl-flash-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--atl-flash-accent);
    transform-origin: left center;
    animation: atlFlashProgress var(--atl-flash-duration, 5.2s) linear forwards;
}

.atl-flash:hover .atl-flash-progress,
.atl-flash:focus-within .atl-flash-progress {
    animation-play-state: paused;
}

.atl-flash-success {
    --atl-flash-accent: var(--atl-flash-green-dark);
    --atl-flash-icon-bg: #EFF9E9;
    --atl-flash-surface: #FBFFF9;
}

.atl-flash-error {
    --atl-flash-accent: var(--atl-flash-danger);
    --atl-flash-icon-bg: #FEF1F2;
    --atl-flash-surface: #FFF9F9;
}

.atl-flash-warning {
    --atl-flash-accent: var(--atl-flash-warning);
    --atl-flash-icon-bg: #FFF8E8;
    --atl-flash-surface: #FFFDF8;
}

.atl-flash-info,
.atl-flash-default {
    --atl-flash-accent: var(--atl-flash-blue-dark);
    --atl-flash-icon-bg: #EAF7FD;
    --atl-flash-surface: #F8FCFF;
}

@keyframes atlFlashEnter {
    from {
        opacity: 0;
        transform: translate3d(26px, -6px, 0) scale(.985);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes atlFlashExit {
    from {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        max-height: 180px;
        margin-bottom: 0;
    }
    to {
        opacity: 0;
        transform: translate3d(20px, 0, 0) scale(.98);
        max-height: 0;
        margin-bottom: -12px;
    }
}

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

@media (max-width: 767.98px) {
    .atl-flash-stack,
    .atl-flash-stack-admin,
    .atl-flash-stack-public {
        top: 78px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .atl-flash {
        grid-template-columns: 38px minmax(0, 1fr) 32px;
        gap: 10px;
        padding: 13px 12px 16px;
        border-radius: 14px;
    }

    .atl-flash-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        font-size: 16px;
    }

    .atl-flash-title {
        font-size: 12.5px;
    }

    .atl-flash-message {
        max-height: 125px;
        font-size: 12.5px;
    }

    .atl-flash-close {
        width: 32px;
        height: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .atl-flash,
    .atl-flash.is-closing,
    .atl-flash-progress {
        animation: none;
    }

    .atl-flash {
        opacity: 1;
        transform: none;
    }
}
