/* EngageDialog — the shared confirm / alert box (public/js/dialog.js).
   Visually the automations-list delete modal, under its own namespace so it
   renders identically on public, dashboard and admin pages. Falls back to
   theme.css tokens where a page does not load dashboard.css. */

.edlg-overlay {
  /* Above the consent panel (2147483001) — the reject-all question is asked from
     inside it, and a confirm box under the thing that opened it is unreachable. */
  position: fixed; inset: 0; z-index: 2147483100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: edlg-fade 140ms ease-out;
}
.edlg-overlay[hidden] { display: none; }

.edlg-box {
  width: 100%; max-width: 420px;
  background: var(--bg-card, var(--bg-elevated, #1D1B18));
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 20px;
  padding: 28px 32px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: edlg-rise 160ms ease-out;
}

.edlg-title {
  font-size: 17px; font-weight: 800; line-height: 1.3;
  color: var(--text-primary, #F5F2EA);
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}
.edlg-copy {
  font-size: 13px; line-height: 1.6;
  color: var(--text-muted, #A39C8E);
  overflow-wrap: anywhere;
}
.edlg-copy p { margin: 0; }
.edlg-copy p + p { margin-top: 8px; }

/* Column-reverse on a phone so Cancel is the one under the thumb. */
.edlg-actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 18px; }
.edlg-btn {
  min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-pill, 999px);
  font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--t-fast, 120ms), opacity var(--t-fast, 120ms);
}
.edlg-btn.cancel {
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  color: var(--text-secondary, var(--text-muted, #A39C8E));
}
.edlg-btn.cancel:hover {
  background: var(--bg-hover, var(--bg-sunken, rgba(255,255,255,0.05)));
  color: var(--text-primary, #F5F2EA);
}
.edlg-btn.cancel[hidden] { display: none; }
.edlg-btn.confirm { background: var(--accent, #D98A55); border: none; color: #fff; }
.edlg-btn.confirm:hover { opacity: 0.9; }
.edlg-btn.confirm.danger { background: var(--danger, #ef4444); }
.edlg-btn:focus-visible { outline: 2px solid var(--accent, #D98A55); outline-offset: 2px; }

@media (min-width: 480px) {
  .edlg-actions { flex-direction: row; }
  .edlg-btn     { flex: 1; }
  .edlg-box.is-alert .edlg-btn { flex: 0 0 auto; min-width: 120px; margin-left: auto; }
}

/* The page behind must not scroll while the box is up. */
html.edlg-open, html.edlg-open body { overflow: hidden; }

@keyframes edlg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes edlg-rise { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .edlg-overlay, .edlg-box { animation: none; }
}
