/**
 * OutPLEX native form (.ox-form)
 * ---------------------------------------------------------------------------
 * Single source of truth for the Zoho-backed Contact Form 7 markup that
 * replaced the HubSpot embeds. Used in two contexts:
 *
 *   1. The contact page, inside #contact-steps .form-bottom.
 *   2. The reusable form block (components/form-block.blade.php), inside
 *      .ox-form-panel — the card that replaced the old .formCircle ellipse.
 *
 * This file is hand-maintained and enqueued directly from app/setup.php. It is
 * deliberately outside the Sage build: that pipeline no longer runs on this
 * site and dist/ is stale, so editing the SCSS sources would change nothing.
 *
 * Selectors use a doubled root class (.ox-form.ox-form) where the markup
 * previously depended on the specificity of the old inline block's
 * "#contact-steps .form-bottom" prefix. That preserves the cascade without
 * resorting to !important.
 */

.ox-form {
  --ox-navy: #0c2a7b;
  --ox-ink-strong: #130086;
  --ox-orange: #ef6e22;
  --ox-orange-deep: #d95f16;
  --ox-surface: #f2f4f8;
  --ox-line: #d5d9e4;
  --ox-line-strong: #9aa4c0;
  --ox-error: #dc3232;
  --ox-radius: 12px;
  --ox-gap: 22px;

  /* Heavy, expo-style easing: motion carries mass and settles, never snaps. */
  --ox-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ox-ease-press: cubic-bezier(0.32, 0.72, 0, 1);

  color: var(--ox-navy);
  text-align: left;
}

/* ---------------------------------------------------------------- Headings */

.ox-form-title {
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 28px;
  color: var(--ox-navy);
  position: static;
  top: auto;
}

/* The contact page's step list decorates every h3 in the section. */
.ox-form-title:before {
  display: none;
}

/* ----------------------------------------------------------- Field groups */

.ox-form.ox-form .ox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ox-gap);
  margin-bottom: 30px;
}

.ox-form.ox-form .ox-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ox-form.ox-form label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
  color: var(--ox-navy);
}

.ox-form.ox-form .ox-req {
  color: var(--ox-orange);
}

/* ----------------------------------------------------------- Text controls */

.ox-form.ox-form input[type="text"],
.ox-form.ox-form input[type="email"],
.ox-form.ox-form input[type="tel"],
.ox-form.ox-form textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ox-navy);
  background-color: #fff;
  border: 1px solid var(--ox-line);
  border-radius: var(--ox-radius);
  padding: 13px 15px;
  transition:
    border-color 320ms var(--ox-ease),
    box-shadow 320ms var(--ox-ease),
    background-color 320ms var(--ox-ease);
  -webkit-appearance: none;
  appearance: none;
}

.ox-form.ox-form textarea {
  height: 140px;
  resize: vertical;
  line-height: 1.5;
}

.ox-form.ox-form input:hover,
.ox-form.ox-form textarea:hover {
  border-color: var(--ox-line-strong);
}

.ox-form.ox-form input:focus,
.ox-form.ox-form textarea:focus {
  outline: none;
  border-color: var(--ox-orange);
  box-shadow: 0 0 0 3px rgba(239, 110, 34, 0.18);
}

.ox-form.ox-form ::placeholder {
  color: #9aa4c0;
  font-weight: 400;
  opacity: 1;
}

/* -------------------------------------------------------- Checkbox groups */

.ox-form.ox-form .ox-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 30px;
  min-width: 0;
}

.ox-form.ox-form .ox-legend {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  padding: 0;
  margin-bottom: 14px;
  color: var(--ox-navy);
}

.ox-form.ox-form .ox-fieldset .wpcf7-checkbox {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px var(--ox-gap);
}

.ox-form.ox-form .ox-fieldset .wpcf7-list-item {
  margin: 0;
  min-width: 0;
}

.ox-form.ox-form .ox-fieldset .wpcf7-list-item label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 11px 14px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  border: 1px solid var(--ox-line);
  border-radius: var(--ox-radius);
  cursor: pointer;
  transition:
    border-color 320ms var(--ox-ease),
    background-color 320ms var(--ox-ease),
    box-shadow 320ms var(--ox-ease);
}

.ox-form.ox-form .ox-fieldset .wpcf7-list-item label:hover {
  border-color: var(--ox-line-strong);
  background-color: #fafbfd;
}

.ox-form.ox-form .ox-fieldset input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--ox-orange);
  cursor: pointer;
}

.ox-form.ox-form .ox-fieldset label:has(input:checked) {
  border-color: var(--ox-orange);
  background-color: rgba(239, 110, 34, 0.06);
  box-shadow: inset 0 0 0 1px rgba(239, 110, 34, 0.35);
}

.ox-form.ox-form .ox-fieldset label:focus-within {
  border-color: var(--ox-orange);
  box-shadow: 0 0 0 3px rgba(239, 110, 34, 0.18);
}

/* -------------------------------------------------------------- Submit CTA */

.ox-form.ox-form .ox-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

/*
 * Button-in-button: the trailing arrow sits in its own circular chip flush
 * with the button's right inner padding. CF7 renders the submit as an <input>,
 * which cannot hold child nodes or pseudo-elements, so the chip is drawn on
 * the wrapper and the input carries extra right padding to make room for it.
 */
.ox-form.ox-form .ox-submit-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.ox-form.ox-form .ox-submit {
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background-color: var(--ox-orange);
  border: 0;
  border-radius: 999px;
  padding: 15px 68px 15px 34px;
  cursor: pointer;
  transition:
    transform 420ms var(--ox-ease-press),
    box-shadow 420ms var(--ox-ease),
    background-color 320ms var(--ox-ease);
}

.ox-form.ox-form .ox-submit-wrap:after {
  content: "\2197"; /* north-east arrow */
  position: absolute;
  right: 8px;
  top: 50%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 15px;
  font-weight: 400;
  line-height: 36px;
  text-align: center;
  pointer-events: none;
  transform: translateY(-50%);
  transition: transform 420ms var(--ox-ease), background-color 320ms var(--ox-ease);
}

.ox-form.ox-form .ox-submit-wrap:hover .ox-submit {
  background-color: var(--ox-orange-deep);
  transform: translateY(-2px);
  box-shadow:
    0 10px 20px -6px rgba(239, 110, 34, 0.42),
    0 24px 48px -24px rgba(12, 42, 123, 0.28);
}

.ox-form.ox-form .ox-submit-wrap:hover:after {
  background-color: rgba(255, 255, 255, 0.32);
  transform: translateY(-50%) translate(3px, -2px) scale(1.06);
}

.ox-form.ox-form .ox-submit:active {
  transform: scale(0.98);
  box-shadow: none;
}

.ox-form.ox-form .ox-submit:focus-visible {
  outline: 3px solid var(--ox-navy);
  outline-offset: 3px;
}

/*
 * CF7 injects its spinner as a sibling of the submit input, inside .ox-submit-wrap.
 * Left in flow it widens the wrapper past the button, and the arrow chip — which
 * anchors to the wrapper's right edge — drifts off the button onto the spinner.
 * Taking it out of flow makes the wrapper track the button's width exactly.
 */
.ox-form.ox-form .ox-submit-wrap .wpcf7-spinner {
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}

.ox-form.ox-form .wpcf7-spinner {
  margin: 0;
}

/* ------------------------------------------------- CF7 state + validation */

.ox-form.ox-form .wpcf7-not-valid {
  border-color: var(--ox-error);
}

.ox-form.ox-form .wpcf7-not-valid-tip {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ox-error);
  margin-top: 6px;
}

.wpcf7-form:has(.ox-form) .wpcf7-response-output {
  font-size: 15px;
  line-height: 1.5;
  border-radius: 12px;
  border-width: 1px;
  margin: 24px 0 0;
  padding: 14px 18px;
}

/* Honeypot: hidden from people and assistive tech, visible to bots. */
.ox-form.ox-form .ox-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* =========================================================================
   Block context — .ox-form-panel
   Replaces the legacy .formCircle ellipse, which was sized for a 3-field
   HubSpot embed and was already overflowing with 6. Built as a nested
   enclosure: a tinted outer tray holding a white inner card, with concentric
   radii so the curves stay parallel.
   ========================================================================= */

.formGrid .ox-form-panel {
  position: relative;
  background-color: #f2f4f8;
  border-radius: 32px;
  padding: 10px;
  margin-left: 20px;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(19, 0, 134, 0.06);
}

.formGrid .ox-form-panel__inner {
  background-color: #fff;
  border-radius: 22px;
  padding: 40px 36px;
  /* Ambient, highly diffused depth — no hard drop shadow. */
  box-shadow:
    0 1px 1px rgba(12, 42, 123, 0.03),
    0 8px 24px -14px rgba(12, 42, 123, 0.14),
    0 36px 64px -34px rgba(12, 42, 123, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Eyebrow + title ---------------------------------------------------- */

.formGrid .ox-form-panel .ox-form-eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background-color: rgba(239, 110, 34, 0.09);
  color: #ef6e22;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.formGrid .ox-form-panel .ox-form-panel__inner > h3 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: #130086;
  max-width: none;
  margin: 0 0 28px;
  padding: 0;
  text-align: left;
}

.formGrid .ox-form-panel .ox-form-panel__inner > h3:before {
  display: none;
}

/* Give the form column room for the two-up field grid. */
.formGrid:has(.ox-form-panel) {
  grid-template-columns: 1fr 0.95fr;
  align-items: start;
}

@media (min-width: 993px) {
  .formGrid:has(.ox-form-panel) .formContent {
    position: sticky;
    top: 120px;
  }
}

.formGrid .ox-form-panel p {
  padding: 0;
}

/*
 * The Customizer's global "form.sent .wpcf7-response-output" rule paints the
 * success message as a circular overlay sized for the old ellipse. Inside the
 * panel it is re-drawn as a calm inline confirmation.
 */
.formGrid .ox-form-panel form.sent .wpcf7-response-output {
  position: static;
  height: auto;
  width: auto;
  border-radius: 12px;
  background-color: rgba(70, 180, 80, 0.08);
  border: 1px solid rgba(70, 180, 80, 0.35);
  color: #1c6b28 !important;
  padding: 16px 20px !important;
  margin: 24px 0 0;
  display: block;
}

/* Panel-specific field density ---------------------------------------- */

/* Two-up keeps the panel from running to ~1500px; labels wrap to two lines. */
.formGrid .ox-form-panel .ox-form.ox-form .ox-fieldset .wpcf7-checkbox {
  gap: 8px 12px;
}

.formGrid .ox-form-panel .ox-form.ox-form .ox-fieldset .wpcf7-list-item label {
  padding: 10px 12px;
  font-size: 14px;
}

.formGrid .ox-form-panel .ox-form.ox-form .ox-fieldset {
  margin-bottom: 24px;
}

.formGrid .ox-form-panel .ox-form.ox-form .ox-grid {
  gap: 16px;
  margin-bottom: 24px;
}

.formGrid .ox-form-panel .ox-form.ox-form textarea {
  height: 104px;
}

/* =========================================================================
   Scroll entry — the panel's contents settle in after the block reveals.
   AOS adds .aos-animate to .form-block; the stagger keys off that so nothing
   animates until the block is actually in view. transform/opacity only.
   ========================================================================= */

@media (prefers-reduced-motion: no-preference) {
  .form-block[data-aos] .ox-form-panel__inner > * {
    opacity: 0;
    transform: translateY(18px);
  }

  .form-block[data-aos].aos-animate .ox-form-panel__inner > * {
    animation: ox-rise 760ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .form-block[data-aos].aos-animate .ox-form-panel__inner > *:nth-child(1) { animation-delay: 90ms; }
  .form-block[data-aos].aos-animate .ox-form-panel__inner > *:nth-child(2) { animation-delay: 150ms; }
  .form-block[data-aos].aos-animate .ox-form-panel__inner > *:nth-child(3) { animation-delay: 210ms; }
}

@keyframes ox-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================================================ Responsive */

@media (max-width: 1200px) {
  .formGrid .ox-form-panel__inner {
    padding: 32px 28px;
  }
}

@media (max-width: 992px) {
  .formGrid:has(.ox-form-panel) {
    grid-template-columns: 1fr;
  }

  .formGrid .ox-form-panel {
    width: 100%;
    max-width: 620px;
    margin: 40px auto 0;
  }
}

@media (max-width: 700px) {
  .formGrid .ox-form-panel {
    border-radius: 26px;
    padding: 8px;
    /* Keep the centring set at <=992px; only the radius and padding tighten. */
    margin-left: auto;
    margin-right: auto;
  }

  .formGrid .ox-form-panel__inner {
    border-radius: 18px;
    padding: 26px 20px;
  }

  .formGrid .ox-form-panel .ox-form-panel__inner > h3 {
    font-size: 23px;
  }
}

@media (max-width: 560px) {
  .ox-form.ox-form .ox-grid,
  .ox-form.ox-form .ox-fieldset .wpcf7-checkbox {
    grid-template-columns: 1fr;
  }

  .ox-form-title {
    font-size: 20px;
  }

  .ox-form.ox-form .ox-submit-wrap,
  .ox-form.ox-form .ox-submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ox-form.ox-form *,
  .ox-form.ox-form .ox-submit-wrap:after {
    transition: none !important;
    animation: none !important;
  }

  .ox-form.ox-form .ox-submit-wrap:hover .ox-submit {
    transform: none;
  }
}
