/* Toast nativo do pjAlert. Usa os tokens de theme.css e acompanha claro/escuro. */

:root {
  --pj-alert-success: #059669;
  --pj-alert-error: #dc2626;
  --pj-alert-warning: #d97706;
  --pj-alert-info: #2563eb;
}

:root[data-bs-theme="dark"] {
  --pj-alert-success: #34d399;
  --pj-alert-error: #f87171;
  --pj-alert-warning: #fbbf24;
  --pj-alert-info: #93c5fd;
}

.pj-alert-wrap {
  position: fixed;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.pj-alert-wrap--top-center {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.pj-alert-wrap--top-left {
  top: 16px;
  left: 16px;
}

.pj-alert-wrap--top-right {
  top: 16px;
  right: 16px;
}

.pj-alert-wrap--bottom-left {
  bottom: 16px;
  left: 16px;
}

.pj-alert-wrap--bottom-right {
  bottom: 16px;
  right: 16px;
}

.pj-alert-wrap--bottom-center {
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.pj-alert-wrap--mid-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.pj-alert {
  --pj-alert-accent: var(--pj-alert-info);
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 36px 14px 14px;
  overflow: hidden;
  pointer-events: auto;
  font-family: inherit;
  color: var(--app-text);
  background: var(--app-surface);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  animation: pj-alert-in 180ms ease-out;
}

:root[data-bs-theme="dark"] .pj-alert {
  border-color: var(--bs-border-color);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
}

.pj-alert--out {
  animation: pj-alert-out 160ms ease-in forwards;
}

.pj-alert__bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--pj-alert-accent);
}

.pj-alert__icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--pj-alert-accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--pj-alert-accent) 12%, transparent);
}

.pj-alert__icon svg {
  width: 18px;
  height: 18px;
}

.pj-alert__body {
  min-width: 0;
  flex: 1 1 auto;
  padding-top: 2px;
}

.pj-alert__title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--app-heading);
}

.pj-alert__message {
  font-size: 13px;
  line-height: 1.45;
  color: var(--app-text-2);
  overflow-wrap: anywhere;
}

.pj-alert__message ul {
  margin: 0;
  padding-left: 1.1rem;
  list-style: disc;
}

.pj-alert__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--app-text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.pj-alert__close:hover,
.pj-alert__close:focus-visible {
  background: var(--app-hover);
  color: var(--app-text);
  outline: none;
}

.pj-alert__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 3px;
  height: 2px;
  transform-origin: left center;
  background: var(--pj-alert-accent);
  opacity: 0.45;
  animation-name: pj-alert-progress;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.pj-alert--paused .pj-alert__progress {
  animation-play-state: paused;
}

.pj-alert--success {
  --pj-alert-accent: var(--pj-alert-success);
}

.pj-alert--error {
  --pj-alert-accent: var(--pj-alert-error);
}

.pj-alert--warning {
  --pj-alert-accent: var(--pj-alert-warning);
}

.pj-alert--info {
  --pj-alert-accent: var(--pj-alert-info);
}

@keyframes pj-alert-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pj-alert-out {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes pj-alert-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pj-alert,
  .pj-alert--out,
  .pj-alert__progress {
    animation: none;
  }
}
