/*
 * WHAT:  Styles for the themed confirm dialog (window.dwConfirm), the
 *        `dwtheme-dialog` handle. A dim backdrop + a centered card with the
 *        message and Cancel / OK buttons.
 * WHY:   The native confirm() is off-brand and ignores dark mode. This is a
 *        self-contained stylesheet (no SCSS source — like lightbox.css) so it
 *        can be enqueued site-wide on every dw front-end cheaply.
 * THEME: Reads the design tokens (--bg/--ink/--rule/--accent) WITH fallbacks
 *        so it stays legible even where the LP design overlay (which defines
 *        the tokens) is absent. The tokens flip in dark mode, so the dialog
 *        follows the theme automatically.
 */

.dwdialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100000; /* above topbar, menus, lightbox */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  /* Respect iOS safe areas so the card never hides behind the notch. */
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  animation: dwdialog-fade 0.16s ease-out;
}

.dwdialog-card {
  width: min(420px, 100%);
  max-height: calc(100% - 0px);
  overflow-y: auto;
  background: var(--bg, #ffffff);
  color: var(--ink, #1a1a1a);
  border: 1px solid var(--rule, rgba(0, 0, 0, 0.12));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  padding: 22px 22px 18px;
  /* System font stack — matches the design-system sans kernel; harmless on a
     bare dwtheme page. */
  font-family: var(--font-sans, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  animation: dwdialog-pop 0.16s ease-out;
}

.dwdialog-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink, #1a1a1a);
}

.dwdialog-message {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink, #1a1a1a);
}

.dwdialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Buttons mirror the LP .lp-btn look: square rect, accent fill for OK,
   ghost outline for Cancel. Self-contained so they don't depend on .lp-btn
   being present on the page. */
.dwdialog-btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  padding: 11px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.dwdialog-btn:focus-visible {
  outline: 2px solid var(--rubric, #710500);
  outline-offset: 2px;
}

.dwdialog-btn--cancel {
  background: transparent;
  color: var(--ink, #1a1a1a);
  border-color: var(--rule, rgba(0, 0, 0, 0.25));
}

.dwdialog-btn--cancel:hover {
  border-color: var(--ink, #1a1a1a);
}

.dwdialog-btn--ok {
  background: var(--rubric, #710500);
  color: #fff;
  border-color: var(--rubric, #710500);
}

.dwdialog-btn--ok:hover {
  /* --accent-2 is the deeper/brighter accent cousin; fall back to a darken. */
  background: var(--rubric-2, #580400);
  border-color: var(--rubric-2, #580400);
}

/* Danger variant uses the same accent fill per the brief (the accent IS the
   sanguine red). Kept as a distinct class so the intent is explicit and a
   future deviation has a single hook. */
.dwdialog-btn--danger {
  background: var(--rubric, #710500);
  border-color: var(--rubric, #710500);
}

@keyframes dwdialog-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes dwdialog-pop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
