/* Shared success + toast for QR / PIX / WhatsApp / stickers */

.util-success {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--dica-border, #e8ebf0);
  background: color-mix(in srgb, #079455 10%, var(--dica-surface-soft, #f8fafc));
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
}
.util-success.is-visible {
  display: flex;
}
.util-success[hidden] {
  display: none !important;
}
.util-success-check {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #079455;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}
.util-success-body {
  flex: 1 1 160px;
  min-width: 0;
}
.util-success-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--dica-ink, #101828);
  line-height: 1.25;
}
.util-success-msg {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--dica-body, #344054);
  opacity: 0.92;
  line-height: 1.35;
}
.util-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.util-success-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 10px 16px;
  background: #079455;
  color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, #079455 25%, transparent);
  animation: util-dl-pulse 1.6s ease-in-out 2;
}
.util-success-btn:hover {
  filter: brightness(1.05);
}
.is-ready-pulse {
  animation: util-dl-pulse 1.6s ease-in-out 2 !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, #079455 28%, transparent) !important;
}
@keyframes util-dl-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

.util-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  z-index: 1500;
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 12px;
  background: #101828;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 650;
  box-shadow: 0 12px 40px rgba(16, 24, 40, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.util-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
html[data-theme="dark"] .util-toast {
  background: #e8eaf0;
  color: #101828;
}

@media (max-width: 720px) {
  .util-success {
    flex-direction: column;
    align-items: stretch;
  }
  .util-success-btn {
    width: 100%;
  }
  /* Sticky primary actions on mobile for generator toolbars */
  .itool-toolbar,
  .waf-toolbar,
  .wa-toolbar,
  .qrg-toolbar,
  .sticker-toolbar,
  .pix-toolbar,
  .sg-actions,
  .doc-actions,
  .esig-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--dica-surface, #fff);
    box-shadow: 0 1px 0 var(--dica-border, #e8ebf0);
  }
  .esig-topbar {
    background: linear-gradient(180deg, #0f3462 0%, #0b2a4a 100%);
  }
  .util-success.is-visible {
    top: 48px;
  }
}

/* Generator shells: success bar sits flush at the top of the card */
.sg-app,
.doc-app,
.esig-app,
.qrg-app,
.wa-app,
.pix-app {
  position: relative;
}
.sg-app > .util-success,
.doc-app > .util-success,
.esig-app > .util-success {
  border-radius: 14px 14px 0 0;
  border-bottom: 1px solid var(--dica-border, #e8ebf0);
}
