/* IWS Popup Engine — modal shell */
body.iws-popup-open {
  overflow: hidden;
}

.iws-popup-root[hidden] {
  display: none !important;
}

.iws-popup-root:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.iws-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.iws-popup-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  max-height: min(90vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
  padding: 24px 24px 20px;
  box-sizing: border-box;
}

.iws-popup-dialog--success {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(240px, 70vh);
  overflow: visible;
}

.iws-popup-dialog--success .iws-popup-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-height: 0;
}

.iws-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  border-radius: 8px;
}

.iws-popup-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.iws-popup-title {
  margin: 0 40px 16px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  font-family: inherit;
}

.iws-popup-field {
  margin-bottom: 14px;
}

.iws-popup-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.iws-popup-field-row .iws-popup-field {
  margin-bottom: 0;
}

@media (max-width: 520px) {
  .iws-popup-field-row {
    grid-template-columns: 1fr;
  }
}

.iws-popup-field select[multiple] {
  min-height: 7.5rem;
  padding: 8px 10px;
}

/* Multi-select dropdown (same pattern as iws-careers-filter job-filter.js) */
.iws-popup-form .iws-select {
  position: relative;
  width: 100%;
}

.iws-popup-form .iws-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.iws-popup-form .iws-select-trigger:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.iws-popup-form .iws-select.is-open .iws-select-trigger {
  border-color: #0f172a;
  background: #fff;
}

.iws-popup-form .iws-select-trigger-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.iws-popup-form .iws-select-caret {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #64748b;
  transition: transform 0.2s ease;
}

.iws-popup-form .iws-select.is-open .iws-select-caret {
  transform: rotate(180deg);
}

.iws-popup-form .iws-select-summary {
  margin-top: 6px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #64748b;
  min-height: 1.25em;
}

.iws-popup-form .iws-select-panel {
  margin-top: 0;
  padding: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  overflow: auto;
  box-sizing: border-box;
}

.iws-popup-form .iws-select-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.iws-popup-form .iws-select-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9375rem;
  color: #1e293b;
  line-height: 1.45;
}

.iws-popup-form .iws-select-option:hover {
  background: #f1f5f9;
}

.iws-popup-form .iws-select-option input {
  margin: 3px 0 0;
  flex-shrink: 0;
}

.iws-popup-field--consent .iws-popup-checkbox-row label {
  font-weight: 600;
  color: #0f172a;
}

.iws-popup-advanced {
  margin-top: 4px;
  margin-bottom: 14px;
}

.iws-advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  margin: 0;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #334155;
  text-align: left;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.iws-advanced-toggle:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.iws-advanced-toggle:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.iws-advanced-toggle.is-open .iws-advanced-toggle__icon {
  transform: rotate(-180deg);
}

.iws-advanced-toggle__icon {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.75rem;
  color: #64748b;
  transition: transform 0.2s ease;
}

.iws-advanced-fields--card {
  margin-top: 10px;
  padding: 14px 14px 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.iws-advanced-fields--card .iws-popup-field:last-child {
  margin-bottom: 8px;
}

.iws-popup-fieldset--tags .iws-popup-checkbox-row {
  position: relative;
  display: inline-flex;
  margin: 0 8px 10px 0;
  vertical-align: top;
}

.iws-popup-fieldset--tags .iws-popup-checkbox-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.iws-popup-fieldset--tags .iws-popup-checkbox-row label {
  display: inline-block;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.iws-popup-fieldset--tags .iws-popup-checkbox-row input:focus-visible + label {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.iws-popup-fieldset--tags .iws-popup-checkbox-row input:checked + label {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.iws-popup-fieldset--tags.iws-popup-fieldset {
  border-style: dashed;
  background: #fff;
}

.iws-popup-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #334155;
}

.iws-popup-required {
  color: #d92d20;
}

.iws-popup-field input[type="text"],
.iws-popup-field input[type="email"],
.iws-popup-field select,
.iws-popup-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
}

.iws-popup-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px 8px;
  margin: 0;
}

.iws-popup-legend {
  padding: 0 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.iws-popup-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.iws-popup-checkbox-row input {
  margin-top: 4px;
}

.iws-popup-checkbox-row label {
  font-size: 0.9375rem;
  color: #1e293b;
  cursor: pointer;
}

.iws-popup-help {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.iws-popup-actions {
  margin-top: 18px;
}

.iws-popup-submit {
  width: 100%;
  padding: 12px 16px;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  background: #d92d20;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
}

.iws-popup-submit:hover:not(:disabled) {
  opacity: 0.95;
}

.iws-popup-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.iws-popup-message {
  margin-top: 12px;
  font-size: 0.9375rem;
  min-height: 1.25em;
}

.iws-popup-message.is-success {
  color: #166534;
}

.iws-popup-message.is-error {
  color: #b91c1c;
}

.iws-popup-message--success-hero {
  margin-top: 0;
  padding: 32px 24px 40px;
  font-size: clamp(1.2rem, 3.2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  color: #166534;
}

/* Shortcode trigger — optional red button (match docs) */
.iws-popup-trigger.iws-subscribe-btn,
.iws-subscribe-btn.iws-popup-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: #d92d20;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(217, 45, 32, 0.22);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.iws-popup-trigger.iws-subscribe-btn:hover,
.iws-subscribe-btn.iws-popup-trigger:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}



/* Job Subscribe Button */
.job-alert-btn {
  display: inline-block;
}

.job-alert-btn a,
.job-alert-btn button,
.job-alert-btn .iws-popup-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid rgba(10, 56, 117, 0.22);
  border-radius: 10px;
  background: #0a3875;
  color: #ffffff;
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    0 10px 30px rgba(10, 56, 117, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease;
  overflow: hidden;
}

.job-alert-btn a::before,
.job-alert-btn button::before,
.job-alert-btn .iws-popup-trigger::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0) 80%
  );
  transform: translateX(-140%);
  transition: transform 0.7s ease;
}

.job-alert-btn a::after,
.job-alert-btn button::after,
.job-alert-btn .iws-popup-trigger::after {
  content: "↗";
  font-size: 14px;
  line-height: 1;
  opacity: 0.88;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.job-alert-btn a:hover,
.job-alert-btn button:hover,
.job-alert-btn .iws-popup-trigger:hover {
  transform: translateY(-2px);
  background: #0c458f;
  border-color: rgba(10, 56, 117, 0.35);
  box-shadow:
    0 16px 40px rgba(10, 56, 117, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  text-decoration: none;
}

.job-alert-btn a:hover::before,
.job-alert-btn button:hover::before,
.job-alert-btn .iws-popup-trigger:hover::before {
  transform: translateX(140%);
}

.job-alert-btn a:hover::after,
.job-alert-btn button:hover::after,
.job-alert-btn .iws-popup-trigger:hover::after {
  transform: translate(2px, -1px);
  opacity: 1;
}

.job-alert-btn a:active,
.job-alert-btn button:active,
.job-alert-btn .iws-popup-trigger:active {
  transform: translateY(0);
  box-shadow:
    0 8px 20px rgba(10, 56, 117, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.job-alert-btn a:focus-visible,
.job-alert-btn button:focus-visible,
.job-alert-btn .iws-popup-trigger:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(10, 56, 117, 0.28),
    0 12px 32px rgba(10, 56, 117, 0.22);
}

/* FAB: hidden until JS (scroll + main CTA out of view); below modal layer */
.job-alert-fab {
  position: fixed;
  right: 32px;
  bottom: max(32px, env(safe-area-inset-bottom, 0px));
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.job-alert-fab.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.job-alert-fab .iws-popup-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: inherit;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.job-alert-fab .iws-popup-trigger:hover {
  background: #000000;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.24);
}

.job-alert-fab .iws-popup-trigger:active {
  transform: translateY(0);
}

.job-alert-fab .iws-popup-trigger:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.35),
    0 10px 24px rgba(17, 24, 39, 0.18);
}

.job-alert-fab .iws-popup-trigger svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 1200px) {
  .job-alert-fab {
    right: 64px;
    bottom: max(36px, env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 1400px) {
  .job-alert-fab {
    right: 90px;
  }
}

@media (max-width: 900px) {
  .job-alert-fab {
    right: 16px;
    bottom: max(18px, env(safe-area-inset-bottom, 0px));
  }

  .job-alert-fab .iws-popup-trigger {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .job-alert-fab .iws-popup-trigger svg {
    width: 18px;
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .job-alert-fab,
  .job-alert-fab .iws-popup-trigger {
    transition: none;
  }
}