/**
 * Toastr — Organiza DS (superfície clara + acento semântico)
 * Sobrescreve toastr.js; !important necessário pela especificidade da lib.
 */

#toast-container {
  z-index: 13000 !important;
  position: fixed !important;
  top: 16px !important;
  right: 16px !important;
  display: grid !important;
  gap: 10px !important;
  pointer-events: none;
  width: auto !important;
  max-width: calc(100vw - 24px) !important;
}

#toast-container > .toast {
  --cp-toast-accent: var(--layout-primary, #C68927);
  --cp-toast-soft: var(--layout-success-soft, color-mix(in srgb, var(--layout-primary, #C68927) 10%, #ffffff));
  --cp-toast-border: color-mix(in srgb, var(--cp-toast-accent) 22%, #e2e8f0);
  --cp-toast-ink: var(--layout-text, #0f172a);
  --cp-toast-muted: var(--layout-text-secondary, #475569);

  position: relative !important;
  width: min(380px, calc(100vw - 32px)) !important;
  min-height: 0 !important;
  max-width: calc(100vw - 32px) !important;
  margin: 0 !important;
  padding: 12px 40px 14px 52px !important;
  border-radius: var(--layout-radius-md, 10px) !important;
  border: 1px solid var(--cp-toast-border) !important;
  border-left: 3px solid var(--cp-toast-accent) !important;
  background: var(--layout-surface, #ffffff) !important;
  background-image: none !important;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 28px rgba(15, 23, 42, 0.10) !important;
  color: var(--cp-toast-ink) !important;
  font-family: var(--cp-ds-font-family, Inter, "Segoe UI", system-ui, sans-serif) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  opacity: 1 !important;
  overflow: hidden !important;
  pointer-events: auto;
  backdrop-filter: saturate(1.1);
  animation: cp-toast-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) both !important;
  transition: box-shadow 160ms ease, transform 160ms ease !important;
}

#toast-container > .toast::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 8px;
  background: var(--cp-toast-soft);
  color: var(--cp-toast-accent);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cp-toast-accent) 14%, transparent);
}

#toast-container > .toast::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  background-color: var(--cp-toast-accent);
  -webkit-mask: var(--cp-toast-icon) center / 14px 14px no-repeat;
  mask: var(--cp-toast-icon) center / 14px 14px no-repeat;
  pointer-events: none;
}

#toast-container > .toast-success {
  --cp-toast-accent: var(--layout-success, var(--layout-primary, #C68927));
  --cp-toast-soft: var(--layout-success-soft, color-mix(in srgb, var(--layout-primary, #C68927) 10%, #ffffff));
  --cp-toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

#toast-container > .toast-error {
  --cp-toast-accent: var(--layout-danger, #b91c1c);
  --cp-toast-soft: var(--layout-danger-soft, #fef2f2);
  --cp-toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
}

#toast-container > .toast-warning {
  --cp-toast-accent: var(--layout-warning, #b45309);
  --cp-toast-soft: var(--layout-warning-soft, #fffbeb);
  --cp-toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3Cpath d='m10.3 4.3-7.4 12.8A2 2 0 0 0 4.6 20h14.8a2 2 0 0 0 1.7-2.9L13.7 4.3a2 2 0 0 0-3.4 0Z'/%3E%3C/svg%3E");
}

#toast-container > .toast-info {
  --cp-toast-accent: #0369a1;
  --cp-toast-soft: #f0f9ff;
  --cp-toast-border: color-mix(in srgb, #0369a1 18%, #e2e8f0);
  --cp-toast-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}

#toast-container > .toast:hover {
  box-shadow:
    0 2px 4px rgba(15, 23, 42, 0.05),
    0 16px 36px rgba(15, 23, 42, 0.14) !important;
}

#toast-container > .toast.toast--closing {
  animation: cp-toast-out 0.18s ease-in both !important;
}

#toast-container > .toast .toast-title {
  margin: 0 0 2px !important;
  padding: 0 !important;
  color: var(--cp-toast-ink) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.01em;
}

#toast-container > .toast .toast-message {
  margin: 0 !important;
  padding: 0 !important;
  color: var(--cp-toast-muted) !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-height: 104px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--cp-toast-accent) 35%, transparent) transparent;
}

#toast-container > .toast .toast-message::-webkit-scrollbar {
  width: 4px;
}

#toast-container > .toast .toast-message::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--cp-toast-accent) 35%, transparent);
  border-radius: 999px;
}

#toast-container > .toast .toast-message ul,
#toast-container > .toast .toast-message ol {
  margin: 0.25rem 0 0 !important;
  padding-left: 1rem !important;
  font-size: 12.5px !important;
  line-height: 1.4 !important;
}

#toast-container > .toast .toast-message li + li {
  margin-top: 0.15rem;
}

#toast-container > .toast .toast-message p {
  margin: 0 !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

#toast-container > .toast .toast-close-button {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  float: none !important;
  width: 28px !important;
  height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--layout-text-muted, #64748b) !important;
  opacity: 1 !important;
  text-shadow: none !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  transition: background-color 140ms ease, color 140ms ease !important;
}

#toast-container > .toast .toast-close-button:hover {
  background: color-mix(in srgb, var(--cp-toast-accent) 10%, #f8fafc) !important;
  color: var(--cp-toast-ink) !important;
  opacity: 1 !important;
}

#toast-container > .toast .toast-close-button:focus-visible {
  outline: 2px solid var(--cp-toast-accent) !important;
  outline-offset: 1px !important;
}

#toast-container > .toast .toast-progress,
#toast-container > .toast-progress {
  position: absolute !important;
  left: 0 !important;
  bottom: 0 !important;
  height: 3px !important;
  border-radius: 0 0 var(--layout-radius-md, 10px) var(--layout-radius-md, 10px);
  background: color-mix(in srgb, var(--cp-toast-accent) 72%, #ffffff) !important;
  opacity: 1 !important;
}

@keyframes cp-toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px) translateX(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
  }
}

@keyframes cp-toast-out {
  from {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-4px) translateX(12px) scale(0.98);
  }
}

@media (max-width: 640px) {
  #toast-container {
    top: 12px !important;
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
  }

  #toast-container > .toast {
    width: 100% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #toast-container > .toast,
  #toast-container > .toast.toast--closing {
    animation: none !important;
  }

  #toast-container > .toast,
  #toast-container > .toast .toast-close-button {
    transition: none !important;
  }
}
