.area-mensagens {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.mensagem {
  width: 100%;
  max-width: 440px;
  padding: 12px 8px 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--cor-borda, #d6e2e2);
  border-left: 4px solid var(--cor-header, #0f3d3e);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  color: var(--cor-texto-principal, #1a1a1a);
  font-family: "Inter", sans-serif;
  font-size: 15px;
  line-height: 1.35;
  pointer-events: auto;
  animation: mensagem-entrar 0.2s ease-out;
}

.mensagem .material-icons {
  flex-shrink: 0;
  font-size: 22px;
}

.mensagem-sucesso {
  border-left-color: #2f8f6b;
}

.mensagem-sucesso .material-icons {
  color: #2f8f6b;
}

.mensagem-erro {
  border-left-color: #b23b3b;
}

.mensagem-erro .material-icons {
  color: #b23b3b;
}

.mensagem-texto {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mensagem-fechar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  color: var(--cor-texto-principal, #1a1a1a);
  font-size: 22px;
  line-height: 1;
  opacity: 0.55;
}

.mensagem-fechar:hover {
  background: rgba(0, 0, 0, 0.06);
}

.dialogo-fundo {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  animation: dialogo-fundo-entrar 0.18s ease-out;
}

.dialogo {
  width: 100%;
  padding: 22px 16px calc(16px + env(safe-area-inset-bottom));
  background: white;
  border-radius: 16px 16px 0 0;
  font-family: "Inter", sans-serif;
  animation: dialogo-subir 0.22s ease-out;
}

.dialogo-texto {
  margin: 0 0 20px;
  color: var(--cor-texto-principal, #1a1a1a);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}

.dialogo-acoes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dialogo-acoes button {
  width: 100%;
  min-height: 50px;
  font-size: 16px;
}

.dialogo-confirmar {
  background: var(--cor-header, #0f3d3e);
}

.dialogo-confirmar:hover {
  background: var(--cor-botao-hover, #0a2b2c);
}

.dialogo-perigo {
  background: #b23b3b;
}

.dialogo-perigo:hover {
  background: #953232;
}

.dialogo-cancelar {
  background: var(--cor-fundo-secundario, #eef4f3);
  color: var(--cor-texto-principal, #1a1a1a);
}

.dialogo-cancelar:hover {
  background: var(--cor-borda, #d6e2e2);
}

.mensagem.saindo,
.dialogo-fundo.saindo {
  opacity: 0;
  transition: opacity 0.18s;
}

@media (min-width: 769px) {
  .area-mensagens {
    left: auto;
    right: 20px;
    top: 20px;
    align-items: flex-end;
  }

  .dialogo-fundo {
    align-items: center;
    padding: 20px;
  }

  .dialogo {
    max-width: 400px;
    padding: 26px 24px 22px;
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    animation: dialogo-entrar 0.18s ease-out;
  }

  .dialogo-acoes {
    flex-direction: row-reverse;
  }

  .dialogo-acoes button {
    min-height: 44px;
  }
}

@keyframes mensagem-entrar {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes dialogo-fundo-entrar {
  from {
    opacity: 0;
  }
}

@keyframes dialogo-subir {
  from {
    transform: translateY(100%);
  }
}

@keyframes dialogo-entrar {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}
