/* ==========================================================
   Flash messages - container flottant
   ========================================================== */

.app-flash-container {
    position: fixed;
    top: 92px;
    right: 22px;
    z-index: 2200;
    display: grid;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.app-flash-message {
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid var(--app-border);
    box-shadow: 0 18px 40px rgba(15, 24, 19, 0.16);
    color: var(--app-text);
    animation: appFlashIn .22s ease both;
}

.app-flash-message.is-removing {
    animation: appFlashOut .18s ease both;
}

.app-flash-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 1.05rem;
}

.app-flash-content {
    min-width: 0;
    padding-top: 2px;
    color: var(--app-text);
    font-size: .92rem;
    font-weight: 750;
    line-height: 1.45;
    word-break: break-word;
}

.app-flash-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .7);
    color: var(--app-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.app-flash-close:hover,
.app-flash-close:focus-visible {
    background: #ffffff;
    color: var(--app-text);
    transform: translateY(-1px);
}

.app-flash-title {
    display: block;
    margin-bottom: 2px;
    font-size: .96rem;
    font-weight: 950;
}

.app-flash-text {
    margin: 0;
    font-size: .9rem;
    font-weight: 750;
    line-height: 1.45;
}

/* ==========================================================
   Flash messages - variantes avec fond
   ========================================================== */

.app-flash-message.app-flash-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 72%);
    border-color: rgba(47, 125, 79, .24);
}

.app-flash-message.app-flash-success .app-flash-icon {
    background: #dcfce7;
    color: #15803d;
}

.app-flash-message.app-flash-success .app-flash-content {
    color: #166534;
}

.app-flash-message.app-flash-info {
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 72%);
    border-color: rgba(61, 111, 143, .24);
}

.app-flash-message.app-flash-info .app-flash-icon {
    background: #dbeafe;
    color: #2563eb;
}

.app-flash-message.app-flash-info .app-flash-content {
    color: #1d4ed8;
}

.app-flash-message.app-flash-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 72%);
    border-color: rgba(183, 121, 31, .30);
}

.app-flash-message.app-flash-warning .app-flash-icon {
    background: #fef3c7;
    color: #b45309;
}

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

.app-flash-message.app-flash-danger {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 72%);
    border-color: rgba(194, 65, 63, .28);
}

.app-flash-message.app-flash-danger .app-flash-icon {
    background: #fee2e2;
    color: #dc2626;
}

.app-flash-message.app-flash-danger .app-flash-content {
    color: #991b1b;
}

/* ==========================================================
   Flash messages - animations
   ========================================================== */

@keyframes appFlashIn {
    from {
        opacity: 0;
        transform: translateY(-8px) translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

@keyframes appFlashOut {
    from {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }

    to {
        opacity: 0;
        transform: translateY(-6px) translateX(12px);
    }
}

@media (max-width: 767.98px) {
    .app-flash-container {
        top: 76px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .app-flash-message {
        border-radius: 16px;
        padding: 14px;
    }
}