/*
 * Shared flash-message styling, used on every layout (public "default"
 * and logged-in "cms") so a flash message looks and behaves the same
 * everywhere: same colors, same floating-toast position, same dismiss
 * behavior.
 */

.message {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 22px;
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.message.hidden {
    display: none;
}

.message-text {
    flex: 1 1 auto;
}

.message-close {
    flex: 0 0 auto;
    margin: -4px -4px 0 0;
    padding: 4px;
    border: none;
    background: none;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    opacity: 0.55;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.message-close:hover,
.message-close:focus-visible {
    opacity: 1;
}

.message.error {
    border: 1px solid var(--site-danger-border);
    background: var(--site-danger-background);
    color: var(--site-danger-dark);
}

.message.success {
    border: 1px solid var(--site-success-border);
    background: var(--site-success-background);
    color: var(--site-success-dark);
}


/* ========================================================================
   FLOATING FLASH MESSAGES
   ======================================================================== */
.flash-overlay {
    position: fixed;
    top: 6.5rem;
    left: 50%;
    z-index: 1080;
    width: min(720px, calc(100vw - 2rem));
    transform: translateX(-50%);
    pointer-events: none;
}

.flash-overlay .alert,
.flash-overlay .message {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 0.75rem !important;
    pointer-events: auto;
    box-shadow: 0 12px 30px color-mix(in srgb, var(--site-heading) 14%, transparent);
}

.flash-overlay .alert.flash-hiding,
.flash-overlay .message.flash-hiding {
    opacity: 0;
    transform: translateY(-0.5rem);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

@media (max-width: 767.98px) {
    .flash-overlay {
        top: 7.5rem;
        width: calc(100vw - 2rem);
    }
}
