/* Common message dialog (AppMessage): success / failure messages shown in the middle of the screen,
   always in view, and kept until the user presses OK */
.app-message-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(20, 28, 48, .45);
}

.app-message-overlay.show {
    display: flex;
}

.app-message {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: var(--radius-sm, 14px);
    box-shadow: 0 24px 60px rgba(20, 28, 48, .28);
    border-top: 5px solid var(--success, #2fa36b);
    padding: 24px 24px 20px;
    text-align: center;
    animation: app-message-in .16s ease-out;
}

.app-message.is-error {
    border-top-color: var(--danger, #d84c5f);
}

.app-message-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: var(--success, #2fa36b);
    background: #edf8f1;
}

.app-message.is-error .app-message-icon {
    color: var(--danger, #d84c5f);
    background: #fff1f4;
}

.app-message-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--success, #2fa36b);
}

.app-message.is-error .app-message-title {
    color: var(--danger, #d84c5f);
}

.app-message-text {
    margin: 0;
    color: var(--text, #2e3852);
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.app-message-actions {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.app-message-ok {
    min-width: 120px;
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--success, #2fa36b);
    cursor: pointer;
}

.app-message.is-error .app-message-ok {
    background: var(--danger, #d84c5f);
}

.app-message-ok:focus-visible {
    outline: 3px solid rgba(77, 99, 217, .45);
    outline-offset: 2px;
}

/* A question with Yes / No (e.g. above maximum stock) */
.app-message.is-confirm {
    border-top-color: #e0a52b;
    max-width: 560px;
}

.app-message.is-confirm .app-message-icon {
    color: #b7791f;
    background: #fff6e0;
}

.app-message.is-confirm .app-message-title {
    color: #9a650f;
}

.app-message.is-confirm .app-message-text {
    text-align: left;
    font-size: 14px;
}

.app-message.is-confirm .app-message-ok {
    background: var(--primary, #4d63d9);
}

.app-message-actions {
    gap: 10px;
}

.app-message-no {
    min-width: 120px;
    padding: 10px 24px;
    border: 1px solid var(--border, #d8e0f0);
    border-radius: 10px;
    font: inherit;
    font-weight: 700;
    color: var(--text, #2e3852);
    background: #fff;
    cursor: pointer;
}

.app-message-no:focus-visible {
    outline: 3px solid rgba(77, 99, 217, .45);
    outline-offset: 2px;
}

.app-message-no[hidden] {
    display: none;
}

@keyframes app-message-in {
    from { transform: translateY(8px) scale(.98); opacity: 0; }
    to { transform: none; opacity: 1; }
}
