/*!
 * sus.css - styles for CI-J forms and the sus scripts
 * Surgical Science - version 0.2.1
 *
 * How to load it (in the page <head>):
 *   Upload with the version in the filename (keep the previous file on the
 *   server for rollback) and load that exact file:
 *   <link rel="stylesheet" href="/wp-content/uploads/sus/sus-0.2.1.css">
 *
 * Changes
 *   0.2.1  Section 4: no padding under the Submit button. CI-J's Submit
 *          block has 20px above and below the button, which left extra
 *          space at the bottom of every form (most visible in the content
 *          download card). Forms are now about 20px shorter; the section 8
 *          minimums still fit under them.
 *   0.2.0  Section 8: reserves space for each form until it loads, so the
 *          page doesn't jump when the form appears (layout shift, CLS).
 *          Replaces the "Reserve Space for Dynamics Forms" snippet (10685):
 *          same idea, but the space is released once the form or its
 *          thank-you message is there, Book Demo gets its own minimum,
 *          and Get Gated Content is re-measured.
 *
 * Parts
 *   PART A  CI-J forms (every form in a [data-form-id] wrapper;
 *           sections 6 and 7 work together with sus-forms.js;
 *           section 8 reserves space while a form loads)
 *   PART B  Embed placeholders (used by sus-embeds.js)
 */


/* #####################################################################
 * PART A: CI-J FORMS
 *
 * Why the long selectors: CI-J injects its own CSS into the page AFTER
 * WordPress loads its stylesheets, so a WordPress rule with the same
 * specificity loses. Prefixing with "[data-form-id] .marketingForm"
 * makes these rules win. !important is used only where CI-J sets inline
 * styles or uses !important itself.
 * ##################################################################### */


/* 1. Site font for all form text --------------------------------------
   !important is needed because CI-J sets Segoe UI on many individual
   elements (labels, inputs, consent text, button). */
[data-form-id],
[data-form-id] * {
  font-family: var(--Inter), sans-serif !important;
}


/* 2. Hide field labels ------------------------------------------------
   Visually hidden only – screen readers still announce them.
   Placeholders carry the label text instead (sus-forms.js adds the " *").
   Checkbox/radio groups (e.g. Platforms of Interest), dropdowns, date
   fields and the consent checkbox keep their visible labels. */
[data-form-id] .marketingForm .textFormFieldBlock > label,
[data-form-id] .marketingForm .phoneFormFieldBlock > label,
[data-form-id] .marketingForm .lookupFormFieldBlock > label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}


/* 3. Spacing: tighter containers, everything aligned to the form edge --
   --sus-field-gap is the space between fields (rows and columns).
   Change this one value to make the form looser or tighter.
   !important overrides CI-J's inline padding on sections, columns
   and the consent block. */
[data-form-id] {
  --sus-field-gap: 20px;
}

/* Space between side-by-side columns only. Space between rows comes from
   the field padding below; a row gap would double it when CI-J stacks
   the columns on screens up to 768px. */
[data-form-id] .marketingForm .innerSection {
  padding: 0 !important;
  column-gap: var(--sus-field-gap);
}

[data-form-id] .marketingForm .columnContainer {
  padding: 0 !important;
}

/* Multi-select checkbox lists (e.g. Platforms of Interest): when 6 or
   more options are visible, show them in 3 columns that read top to
   bottom (2 columns on screens up to 768px). With 1-5 options the list
   stays a single column.
   "Visible" = not hidden by sus-forms.js, which hides options with an
   inline style="display: none". The six "~" steps mean "6 visible
   options". (Not nth-child(6 of ...): Chrome didn't re-check that after
   sus-forms.js hid options, so lists kept the column layout but lost
   their row spacing on first load.) */
[data-form-id] .marketingForm .multiOptionSetFormFieldBlock
  fieldset:has(> div:not([style*="display: none"]) ~ div:not([style*="display: none"])
             ~ div:not([style*="display: none"]) ~ div:not([style*="display: none"])
             ~ div:not([style*="display: none"]) ~ div:not([style*="display: none"])) {
  display: block;
  columns: 3;
  column-gap: 16px;
}

/* Space between options in column mode (4px above + 4px below = 8px);
   keeps each checkbox and its label together in one column */
[data-form-id] .marketingForm .multiOptionSetFormFieldBlock
  fieldset:has(> div:not([style*="display: none"]) ~ div:not([style*="display: none"])
             ~ div:not([style*="display: none"]) ~ div:not([style*="display: none"])
             ~ div:not([style*="display: none"]) ~ div:not([style*="display: none"])) > div {
  padding: 4px 0;
  break-inside: avoid;
}

@media (max-width: 768px) {
  [data-form-id] .marketingForm .multiOptionSetFormFieldBlock
    fieldset:has(> div:not([style*="display: none"]) ~ div:not([style*="display: none"])
               ~ div:not([style*="display: none"]) ~ div:not([style*="display: none"])
               ~ div:not([style*="display: none"]) ~ div:not([style*="display: none"])) {
    columns: 2;
  }
}

[data-form-id] .marketingForm :is(
  .textFormFieldBlock,
  .phoneFormFieldBlock,
  .lookupFormFieldBlock,
  .dateTimeFormFieldBlock,
  .twoOptionFormFieldBlock,
  .optionSetFormFieldBlock,
  .multiOptionSetFormFieldBlock
) {
  padding: calc(var(--sus-field-gap) / 2) 0;
}

[data-form-id] .marketingForm :is(.radiobuttons, .multiOptionSetFormFieldBlock fieldset) {
  margin-top: 0;
}

/* Padding on consent block */
[data-form-id] .marketingForm .consentBlock {
  padding: var(--sus-field-gap) 2px !important;
}

/* Consent checkbox, for when the text wraps (mobile):
   - the box lines up with the first line, not the middle
   - the text is left-aligned (CI-J centres every <p> in the form)
   - the <p> is inline so CI-J's hidden required "*" (label::after) sits
     after the text; as an inline-block the <p> filled the row and pushed
     the "*" onto an empty extra line below it */
[data-form-id] .marketingForm .consentBlock > div {
  align-items: flex-start;
}

[data-form-id] .marketingForm .consentBlock label {
  text-align: left;
}

[data-form-id] .marketingForm .consentBlock label p {
  display: inline;
}

/* "By submitting this form…" text (CI-J sets margin: 10px inline) */
[data-form-id] .marketingForm [data-editorblocktype="Text"] {
  margin: 10px 0 0 !important;
}


/* 4. Submit button ----------------------------------------------------
   The embed placeholder button (PART B) shares this style, so both
   change together. */
[data-form-id] .marketingForm .submitButtonWrapper {
  text-align: left;
}

/* No space under the button: CI-J's Submit block pads 20px above and
   below it, so every form ended with extra space at the bottom. The
   space above the button stays. */
[data-form-id] .marketingForm [data-editorblocktype="SubmitButton"] {
  padding-bottom: 0;
}

[data-form-id] .marketingForm .submitButton,
.sus-embed-placeholder button {
  background-color: var(--Dark-Blue);
  color: var(--white);
  border: none;
  border-radius: 30px;
  transition: background-color 0.2s ease;
}

[data-form-id] .marketingForm .submitButton:hover,
[data-form-id] .marketingForm .submitButton:focus-visible,
.sus-embed-placeholder button:hover,
.sus-embed-placeholder button:focus,
.sus-embed-placeholder button:active {
  background-color: var(--Nigh-blue);
  color: var(--white);
}


/* 5. Field padding and rounded corners (CI-J colours unchanged) ------- */
[data-form-id] .marketingForm .textFormFieldBlock input,
[data-form-id] .marketingForm .lookupFormFieldBlock input,
[data-form-id] .marketingForm textarea {
  padding: 16px 18px;
  border-radius: 8px;
}

/* Phone focus ring: draw it on the rounded wrapper instead of the input.
   The wrapper clips the input (overflow: hidden), which cut the ring off. */
[data-form-id] .marketingForm .phoneFormFieldBlock .phoneCountryCode:focus-within {
  outline: auto;
}

[data-form-id] .marketingForm .phoneFormFieldBlock input:focus {
  outline: none;
}

/* Lookup fields show a search icon on the right.
   Fixed 18px from the edge (CI-J uses 98%, which shrinks on narrow
   fields), and text stops before the icon. */
[data-form-id] .marketingForm .lookupFormFieldBlock input {
  background-position: right 18px center;
  padding-right: 44px;
}

/* Phone: the border sits on the wrapper, not on the input itself */
[data-form-id] .marketingForm .phoneFormFieldBlock .phoneCountryCode {
  border-radius: 8px;
}

[data-form-id] .marketingForm .phoneFormFieldBlock input {
  padding: 16px 18px;
}


/* 6. State/Province hidden until a country that uses it is selected ---
   Only on forms that also have the Country lookup. sus-forms.js adds
   .sus-show for the countries in its CONFIG.stateProvince.countries.
   While the State column is hidden, Country stretches to the full row. */
[data-form-id] .marketingForm:has([data-targetproperty="abra_leadcountry"])
  .columnContainer:has([data-targetproperty="abra_leadstateprovince"]):not(.sus-show) {
  display: none !important;
}



/* 7. Segment groups (sus-forms.js 0.4.0) ------------------------------
   With data-sus-form_show_segments="all", sus-forms.js moves the segment
   options into collapsible groups inside the picker's fieldset:
     .sus-groups > .sus-group (+ .sus-group-open)
       > .sus-group-head > .sus-group-check + .sus-group-toggle
         (.sus-group-check is a <button role="checkbox" aria-checked="…">)
       > .sus-group-options > CI-J's option rows
   The fieldset then has one child, so the 3-column rule in section 3
   doesn't apply. The moved rows are no longer direct children of the
   fieldset, so CI-J's row and checkbox styles are repeated here.
   The toggle is a <button>: every property is set explicitly so theme
   (Elementor) button styles can't change it. */
[data-form-id] .marketingForm .multiOptionSetFormFieldBlock fieldset > .sus-groups {
  display: grid;
  gap: 6px;
  width: 100%;
  align-self: stretch;
}

[data-form-id] .marketingForm .sus-group {
  border: 1px solid rgb(225, 223, 221);    /* CI-J field border */
  border-radius: 8px;
  background: rgb(250, 249, 248);          /* CI-J field background */
}

[data-form-id] .marketingForm .sus-group.sus-group-open {
  background: transparent;
}

[data-form-id] .marketingForm .sus-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 0 14px;
}

[data-form-id] .marketingForm .sus-group-toggle,
[data-form-id] .marketingForm .sus-group-toggle:hover,
[data-form-id] .marketingForm .sus-group-toggle:focus,
[data-form-id] .marketingForm .sus-group-toggle:active {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  margin: 0;
  padding: 0 12px 0 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}

[data-form-id] .marketingForm .sus-group-toggle:focus-visible {
  outline: auto;
}

[data-form-id] .marketingForm .sus-group-name {
  font-weight: 600;
}

[data-form-id] .marketingForm .sus-group-total {
  color: rgb(96, 94, 92);
}

/* Arrow on the right: down when closed, up when open */
[data-form-id] .marketingForm .sus-group-toggle::after {
  content: "";
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgb(96, 94, 92);
  border-bottom: 2px solid rgb(96, 94, 92);
  transform: rotate(45deg);
}

[data-form-id] .marketingForm .sus-group-open .sus-group-toggle::after {
  transform: rotate(-135deg);
  margin-top: 5px;
}

/* Options: 2 columns, 1 on screens up to 768px (same breakpoint as section 3) */
[data-form-id] .marketingForm .sus-group-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  padding: 2px 14px 14px 44px;
}

[data-form-id] .marketingForm .sus-group-options[hidden] {
  display: none;
}

@media (max-width: 768px) {
  [data-form-id] .marketingForm .sus-group-options {
    grid-template-columns: 1fr;
  }
}

/* Moved option rows: same look as CI-J's own rows */
[data-form-id] .marketingForm .sus-group-options > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-form-id] .marketingForm .sus-group-options > div > label {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

/* Option boxes: same size and colour as CI-J's checkboxes */
[data-form-id] .marketingForm .sus-group-options input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  flex-shrink: 0;
  accent-color: rgb(0, 120, 212);          /* CI-J checkbox colour */
  cursor: pointer;
}

/* Heading box: a button drawn as a checkbox (sus-forms.js 0.4.1).
   aria-checked="false" = empty, "true" = tick, "mixed" = dash.
   Every property is set so theme button styles can't change it. */
[data-form-id] .marketingForm .sus-group-check,
[data-form-id] .marketingForm .sus-group-check:hover,
[data-form-id] .marketingForm .sus-group-check:focus,
[data-form-id] .marketingForm .sus-group-check:active {
  appearance: none;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid rgb(50, 49, 48);
  border-radius: 2px;
  background: rgb(255, 255, 255) no-repeat center / 14px 14px;
  box-shadow: none;
  cursor: pointer;
}

[data-form-id] .marketingForm .sus-group-check:focus-visible {
  outline: auto;
}

[data-form-id] .marketingForm .sus-group-check[aria-checked="true"] {
  border-color: rgb(0, 120, 212);
  background-color: rgb(0, 120, 212);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7.5' fill='none' stroke='white' stroke-width='2.2'/%3E%3C/svg%3E");
}

[data-form-id] .marketingForm .sus-group-check[aria-checked="mixed"] {
  border-color: rgb(0, 120, 212);
  background-color: rgb(0, 120, 212);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8h9' fill='none' stroke='white' stroke-width='2.2'/%3E%3C/svg%3E");
}

/* Windows high-contrast (forced colours) mode replaces page colours, which
   would hide the white tick and dash. Keep the heading box's own colours. */
@media (forced-colors: active) {
  [data-form-id] .marketingForm .sus-group-check {
    forced-color-adjust: none;
  }
}


/* 8. Reserved space while a form loads --------------------------------
   The embed is empty until CI-J's loader builds the form, so the form
   would push everything below it down when it appears (layout shift).
   A minimum height keeps that space free in advance. It never cuts a
   form off: a taller form simply grows.
   - Applies only while the embed has no form and no thank-you message.
     After a successful submit CI-J removes the <form> and adds
     .onFormSubmittedFeedback (seen in CI-J's loader code, Nov 2026; an
     internal class name, not documented). If Microsoft renames it, the
     space comes back under the thank-you message.
   - Minimums are about 90% of the shortest form measured on staging
     (Nov 2026, 1280px and 390px wide), so the space stays just under the
     real height. Re-measure when a form's fields or layout change.
     Shortest measured (desktop / phone): long forms 652 / 900,
     Book Demo 493 / 710, Get Gated Content 351 / 531.
   - Not !important and not scoped to .marketingForm: these rules style
     the embed itself, which CI-J doesn't size. */
[data-form-id]:not(:has(form, .onFormSubmittedFeedback)) {
  min-height: 580px;
}

/* Book Demo */
[data-form-id="78070677-22ce-f111-a05a-000d3a22a19a"]:not(:has(form, .onFormSubmittedFeedback)) {
  min-height: 445px;
}

/* Get Gated Content */
[data-form-id="ba73f4a1-22ce-f111-a05a-000d3a22a19a"]:not(:has(form, .onFormSubmittedFeedback)) {
  min-height: 315px;
}

/* Same breakpoint as section 3: CI-J stacks the columns, so forms grow */
@media (max-width: 768px) {
  [data-form-id]:not(:has(form, .onFormSubmittedFeedback)) {
    min-height: 800px;
  }

  [data-form-id="78070677-22ce-f111-a05a-000d3a22a19a"]:not(:has(form, .onFormSubmittedFeedback)) {
    min-height: 640px;
  }

  [data-form-id="ba73f4a1-22ce-f111-a05a-000d3a22a19a"]:not(:has(form, .onFormSubmittedFeedback)) {
    min-height: 480px;
  }
}

/* Forms in Elementor popups: no reserved space (the popup sizes itself).
   Must stay last in this section: it has the same specificity as the
   rules above, so only its later position makes it win. */
.elementor-popup-modal [data-form-id] {
  min-height: 0;
}


/* #####################################################################
 * PART B: EMBED PLACEHOLDERS (sus-embeds.js)
 * Covers any iframe Cookiebot blocks with one generic message and a
 * "Cookie settings" button. Swap the colors for brand colors.
 * Elementor videos with an image overlay show the thumbnail first; the
 * message appears when the visitor clicks play.
 * ##################################################################### */
.sus-embed-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
  background: #d4d4d4;
  color: #000000;
}

.sus-embed-placeholder p {
  margin: 0;
  max-width: 40em;
}

/* Colours, shape and hover come from the submit button style (PART A,
   section 4). CI-J gives its own button size; this button needs its own. */
.sus-embed-placeholder button {
  padding: 12px 28px;
  font: inherit;
  cursor: pointer;
}

/* Elementor Video widget with an image overlay: keep the thumbnail and
   play button above the placeholder. sus-embeds.js adds the placeholder
   after the thumbnail, so without this it would cover the thumbnail.
   When the visitor clicks play, Elementor removes the thumbnail, which
   reveals the placeholder. Only applies while a placeholder is there.
   (Checked with Elementor 4.4.1, Vimeo, inline video, not lightbox.) */
.elementor-wrapper:has(> .sus-embed-placeholder) > .elementor-custom-embed-image-overlay {
  z-index: 1;
}
