/* Feedback global minimalista: fica no centro inferior sem painel opaco,
   preservando a leitura da tela enquanto mantém contraste e hierarquia. */
.toast-stack {
  position: fixed;
  z-index: 2000;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(560px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(225, 227, 217, .88);
  border-radius: 14px;
  background: rgba(255, 254, 250, .9);
  box-shadow: 0 8px 24px rgba(38, 48, 30, .1), 0 1px 3px rgba(38, 48, 30, .08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .22s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
  text-shadow: 0 1px 3px rgba(255, 255, 255, .96), 0 0 12px rgba(255, 255, 255, .72);
}

.toast.is-in {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-out {
  opacity: 0;
  transform: translateY(8px);
}

.toast-icon {
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--muted);
  filter: drop-shadow(0 1px 3px rgba(255, 255, 255, .9));
}

.toast-icon svg {
  width: 20px;
  height: 20px;
}

.toast-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast-close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: 2px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: .72;
  transition: opacity .16s, color .16s, transform .16s;
}

.toast-close:hover {
  color: var(--ink);
  opacity: 1;
  transform: scale(1.08);
}

.toast-close svg {
  width: 16px;
  height: 16px;
}

.toast[data-tipo="success"] .toast-icon { color: var(--green); }
.toast[data-tipo="success"] .toast-text { color: #3f613d; }
.toast[data-tipo="error"] .toast-icon { color: var(--red); }
.toast[data-tipo="error"] .toast-text { color: #813d2f; }
.toast[data-tipo="loading"] .toast-text { color: var(--ink); }

.toast-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(70, 101, 68, .2);
  border-top-color: var(--green);
  border-radius: 999px;
  animation: toast-spin .7s linear infinite;
}

@keyframes toast-spin {
  to { transform: rotate(360deg); }
}

.toast[data-tipo="loading"] .toast-close {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity .16s ease;
    transform: none;
  }
  .toast.is-in { transform: none; }
  .toast-spinner { animation: none; border-top-color: var(--green); }
}

@media (max-width: 680px) {
  .toast-stack {
    bottom: 16px;
    width: calc(100vw - 24px);
    gap: 4px;
  }
  .toast {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 12px;
  }
}
