/* Toast — avisos rápidos (cores vindas das variáveis --ui-* do tema). Cartão de vidro com ícone em pílula. */
.toast-region {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  --toast-color: var(--ui-info, #3E7BFA);
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 13px 12px 13px 14px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--ui-surface-raised, var(--ui-surface, #24203A)) 92%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  color: var(--ui-text, #EDEBF5);
  border: 1px solid var(--ui-border-strong, rgba(255, 255, 255, .12));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent),
    var(--ui-shadow-lg, 0 20px 50px -18px rgba(0, 0, 0, .5));
  font-family: var(--ui-font, inherit);
  font-size: .9rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateX(18px) scale(.98);
  transition: opacity .24s ease, transform .3s cubic-bezier(.2, .9, .3, 1.1);
  overflow: hidden;
}
/* faixa de cor da variante */
.toast::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--toast-color);
}
.toast.is-visible { opacity: 1; transform: none; }
.toast--success { --toast-color: var(--ui-success, #2E9E6A); }
.toast--error   { --toast-color: var(--ui-danger, #E5484D); }
.toast--warning { --toast-color: var(--ui-warning, #D9822B); }
.toast--info    { --toast-color: var(--ui-info, #3E7BFA); }
.toast-icon {
  width: 30px; height: 30px;
  padding: 5px;
  border-radius: 10px;
  color: var(--toast-color);
  background: color-mix(in srgb, var(--toast-color) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--toast-color) 26%, transparent);
}
.toast-text { overflow-wrap: anywhere; padding-top: 4px; font-weight: 500; }
.toast-close {
  width: 30px; height: 30px; margin: -2px -2px 0 0;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent;
  color: var(--ui-muted, #A29FB5); cursor: pointer;
  transition: background .15s, color .15s;
}
.toast-close:hover { background: var(--ui-hover, rgba(255, 255, 255, .07)); color: var(--ui-text, #EDEBF5); }
.toast-close svg { width: 16px; height: 16px; }

@media (max-width: 640px) {
  .toast-region {
    top: auto;
    bottom: calc(16px + var(--bottom-nav-height, 0px) + env(safe-area-inset-bottom));
    right: 16px;
    left: 16px;
    width: auto;
  }
  .toast { transform: translateY(18px) scale(.98); }
}
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

/* Transição suave ao trocar o tema */
html.theme-transition, html.theme-transition *, html.theme-transition *::before, html.theme-transition *::after {
  transition: background-color .3s ease, border-color .3s ease, color .25s ease, box-shadow .3s ease !important;
}

/* DS 4: aviso sólido, cantos de 10px, sem vidro. A barra lateral na cor do tipo continua sendo o sinal. */
.toast { border-radius: 10px; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--ui-surface-raised, var(--ui-surface, #1C1B19)); }
.toast-icon { border-radius: 6px; box-shadow: none; }
.toast-close { border-radius: 6px; }
