/*
 * Foundation message presentation.
 *
 * Foundation owns message state; Hub owns presentation.
 * Messages are rendered as viewport-level toast notifications so feedback
 * remains visible wherever the user is on the page.
 */

.foundation-messages {
    position: fixed;
    top: var(--foundation-message-top, 24px);
    left: var(--foundation-message-left, 50%);
    transform: translateX(-50%);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(450px, 80vw);
    max-width: 80vw;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.foundation-message {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: Figtree, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    margin: 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 220ms ease, transform 220ms ease;
}

.foundation-message.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
}

.foundation-message-success {
    background: #edf8f0;
    border-color: #b9dfc2;
    color: #246b36;
}

.foundation-message-error {
    background: #fff0f0;
    border-color: #e8b8b8;
    color: #9b2c2c;
}

.foundation-message-warning {
    background: #fff8e6;
    border-color: #ecd79b;
    color: #735900;
}

.foundation-message-info {
    background: #eef5fb;
    border-color: #bfd6ea;
    color: #285b7f;
}

.foundation-message-text {
    flex: 1 1 auto;
    min-width: 0;
}

.foundation-message-dismiss {
    flex: 0 0 auto;
    margin: -2px -4px 0 0;
    padding: 2px 4px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

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

.foundation-message-dismiss:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 3px;
}

@media (max-width: 640px) {
    .foundation-messages {
        top: var(--foundation-message-top, 16px);
        width: min(450px, 80vw);
        max-width: 80vw;
    }

    .foundation-message {
        padding: 11px 13px;
        font-size: 13px;
    }
}
