/* ─────────────────────────────────────────────────────────────
   Webform "Application Complete" confirmation modal
   Drupal's jQuery UI dialog used by webform confirmation_type: modal.
   Scoped to .webform-confirmation-modal to leave other ui-dialogs untouched.

   Design tokens + spacing/shadow/backdrop mirror the apply/contact modal
   pattern defined in dist/css/home.css (.modal, .modal-overlay, .modal-inner,
   .modal-eyebrow, .modal-title, .modal-lede, .modal-close).
   ───────────────────────────────────────────────────────────── */

.ui-dialog.webform-confirmation-modal {
  background: var(--bg-raised) !important;
  border: none;
  border-radius: 20px !important;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.4);
  padding: 48px 40px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: calc(100vw - 32px);
}

.ui-dialog.webform-confirmation-modal .ui-dialog-titlebar {
  display: contents;
  background: transparent;
  border: none;
}

.ui-dialog.webform-confirmation-modal .ui-dialog-title {
  order: 1;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-55);
  font-weight: 500;
  margin: 0 0 14px;
  padding: 0;
  text-align: start;
}

/* High specificity: 5 classes to beat Gin's .ui-dialog .ui-widget-content.ui-dialog-content rule. */
.ui-dialog.webform-confirmation-modal .webform-confirmation-modal--content.ui-dialog-content.ui-widget-content {
  order: 2;
  padding: 0;
  padding-inline: 0;
  padding-block: 0;
  margin: 0;
  color: var(--ink);
  max-height: none;
  min-height: 0;
  background: transparent;
  border: none;
  overflow: visible;
}

.ui-dialog.webform-confirmation-modal .webform-confirmation-modal--content h2 {
  font-family: "Poppins", "IBM Plex Sans Arabic", sans-serif;
  font-weight: 500;
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 12px;
}

.ui-dialog.webform-confirmation-modal .webform-confirmation-modal--content p {
  font-family: inherit;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-70);
  margin: 0 0 28px;
}

/* The default jQuery UI close button is icon-only with off-screen text and a
   sprite icon. Reset it to a normal pill button at the bottom of the modal. */
.ui-dialog.webform-confirmation-modal .ui-button.ui-dialog-titlebar-close {
  position: static;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  inset: auto;
  transform: none;
  order: 3;
  align-self: flex-start;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 999px;
  background: #1a2540;
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-indent: 0;
  overflow: visible;
  width: auto;
  height: auto;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
}

.ui-dialog.webform-confirmation-modal .ui-button.ui-dialog-titlebar-close:hover,
.ui-dialog.webform-confirmation-modal .ui-button.ui-dialog-titlebar-close:focus,
.ui-dialog.webform-confirmation-modal .ui-button.ui-dialog-titlebar-close:active {
  background: #1a2540;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(26, 37, 64, 0.22);
}

.ui-dialog.webform-confirmation-modal .ui-button.ui-dialog-titlebar-close .ui-button-icon,
.ui-dialog.webform-confirmation-modal .ui-button.ui-dialog-titlebar-close .ui-button-icon-space {
  display: none;
}

/* X icon at top-right of the dialog. Rendered as ::before of the close button
   so a click on the X still fires the button's close handler; the button itself
   is in static flow so the pseudo's position: absolute resolves against the
   .ui-dialog (which is position: fixed, so it acts as the containing block). */
.ui-dialog.webform-confirmation-modal .ui-button.ui-dialog-titlebar-close::before {
  content: "\2715";
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--ink-40);
  background: var(--bg-raised);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 32px;
  text-align: center;
  text-indent: 0;
  transition: border-color 0.2s, background-color 0.2s;
}

.ui-dialog.webform-confirmation-modal .ui-button.ui-dialog-titlebar-close:hover::before {
  border-color: var(--ink);
  background-color: var(--ink-05);
}

/* Dark backdrop behind the webform confirmation modal.
   Color + blur match the .modal-overlay in dist/css/home.css.
   Uses :has() so the overlay only appears when this specific dialog is open;
   other ui-dialogs (admin overlays, etc.) keep their default backdrop. */
body:has(> .ui-dialog.webform-confirmation-modal)::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15, 21, 34, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  pointer-events: none;
}

/* Mobile/narrow viewports: tighten padding to match the apply/contact modal
   .modal-inner mobile pattern in dist/css/home.css. */
@media (max-width: 600px) {
  .ui-dialog.webform-confirmation-modal {
    padding: 36px 24px 28px;
  }

  .ui-dialog.webform-confirmation-modal .webform-confirmation-modal--content p {
    margin-bottom: 22px;
  }

  .ui-dialog.webform-confirmation-modal .ui-button.ui-dialog-titlebar-close::before {
    top: 12px;
    inset-inline-end: 12px;
    width: 30px;
    height: 30px;
    line-height: 28px;
  }
}
