/* Diálogo de confirmação e mensagens do sistema (ver assets/js/ms-dialogo.js) */
.ms-dialogo-aberto { overflow: hidden; }
.ms-dialogo-fundo { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(21, 25, 34, .55); animation: ms-dialogo-entrar .12s ease-out; }
.ms-dialogo { width: min(100%, 460px); padding: 24px; border: 1px solid #e3e5e7; border-radius: 20px; background: #fff; box-shadow: 0 24px 60px rgba(21, 25, 34, .28); font-family: Poppins, Inter, Arial, sans-serif; }
.ms-dialogo__titulo { margin: 0 0 10px; color: #151922; font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.ms-dialogo__texto p { margin: 0 0 8px; color: #4a5160; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.ms-dialogo__texto p:empty { display: none; }
.ms-dialogo__botoes { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.ms-dialogo__botao { min-height: 42px; padding: 0 18px; border: 1px solid #dfe3e8; border-radius: 11px; background: #fff; color: #1b1b1b; font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.ms-dialogo__botao:hover { background: #f8f9fb; }
.ms-dialogo__botao--principal { border-color: #fdcc0d; background: #fdcc0d; }
.ms-dialogo__botao--principal:hover { background: #eebf00; }
.ms-dialogo__botao--perigo { border-color: #c2382f; background: #c2382f; color: #fff; }
.ms-dialogo__botao--perigo:hover { background: #a62d25; }
.ms-dialogo__botao:focus-visible { outline: 3px solid #a17d00; outline-offset: 2px; }

.ms-mensagens { position: fixed; top: 18px; right: 18px; z-index: 1900; display: grid; gap: 10px; width: min(calc(100vw - 36px), 420px); pointer-events: none; }
.ms-mensagem { position: relative; display: flex; align-items: flex-start; gap: 10px; overflow: hidden; padding: 13px 12px 15px 16px; border-radius: 14px; box-shadow: 0 14px 34px rgba(21, 25, 34, .18); font-family: Poppins, Inter, Arial, sans-serif; pointer-events: auto; animation: ms-mensagem-entrar .16s ease-out; }
.ms-mensagem--ok { border: 1px solid #b9e2c8; background: #e7f7ed; color: #1d6a3f; }
.ms-mensagem--erro { border: 1px solid #efcbc7; background: #fff2f1; color: #a1332b; }
.ms-mensagem--atencao { border: 1px solid #f0dc8a; background: #fff8dc; color: #6b5200; }
.ms-mensagem__texto { flex: 1; margin: 0; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; }
.ms-mensagem__links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.ms-mensagem__link { color: inherit; font-weight: 700; text-decoration: underline; }
.ms-mensagem__fechar { flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.ms-mensagem__fechar:hover { background: rgba(0, 0, 0, .06); }
.ms-mensagem__progresso { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: currentColor; opacity: .42; transform-origin: left center; animation: ms-mensagem-tempo 8s linear forwards; }

@keyframes ms-dialogo-entrar { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes ms-mensagem-entrar { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@keyframes ms-mensagem-tempo { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 640px) { .ms-mensagens { top: 12px; right: 12px; left: 12px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .ms-dialogo-fundo, .ms-mensagem, .ms-mensagem__progresso { animation: none; } }

/* .ms-dialogo-fundo agora é um <dialog> nativo (top layer): zera as bordas/tamanho padrão do dialog e deixa o escurecido por conta do próprio fundo */
dialog.ms-dialogo-fundo { margin: 0; max-width: none; max-height: none; width: 100%; height: 100%; border: 0; color: inherit; }
dialog.ms-dialogo-fundo::backdrop { background: transparent; }
