/* ===== CTA + Form module ===== */
section.io-cta {
  --io-bg:#294A96; --io-card:#262e3f; --io-input-bg:#1d2331;
  --io-input-border:#33475b; --io-placeholder:#bfbfbf;
  --io-text:#fff; --io-muted:#d4d4d4; --io-blue:#294a96;
  --io-radius:15px; --io-radius-pill:32px; --io-container:1000px;
  --io-font-head:'Roboto',system-ui,sans-serif; --io-font-ui:'Inter',system-ui,sans-serif;
  background-color: var(--io-bg);
  background-image: linear-gradient(rgba(38,46,63,0.4), rgba(38,46,63,0.4)); /* Figma page overlay */
}

.io-cta__inner {
  max-width: var(--io-container);
  margin: 0 auto;
  padding: 10px 24px 160px;
  box-sizing: border-box;
}

.io-cta__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;   /* was center — Figma left-aligns the icon + text */
  text-align: left;          /* was center */
  gap: 8px;
  padding-bottom: 24px;
}
.io-cta__icon { width: 76px; height: 76px; }
.io-cta__icon svg, .io-cta__icon img { width: 76px; height: 76px; display: block; }
.io-cta__title { font-size: 36px; }
.io-cta__sub {
  font-family: var(--io-font-head);
  font-weight: 400; font-size: 18px; line-height: 28.8px;
  color: var(--io-muted); margin: 0;
}

/* Card that holds the form */
.io-cta__formwrap {
  background: var(--io-card);
  border-radius: var(--io-radius);
  padding: 24px;
}
.io-cta__placeholder { color: var(--io-muted); text-align: center; margin: 0; }

/* ---- HubSpot form styling (targets .hs-form markup) ---- */

/* Make HubSpot's own form background transparent so the dark card (#262E3F)
   shows through. Covers both legacy (.hs-form) and new (.hsfc-*) form markup.
   This also fixes the "invisible labels" — white label text was sitting on
   HubSpot's white form background. */
.io-cta__formwrap form,
.io-cta__formwrap .hs-form,
.io-cta__formwrap .hs_cos_wrapper,
.io-cta__formwrap .hsfc-Form,
.io-cta__formwrap .hsfc-FormWrapper,
.io-cta__formwrap .hsfc-Step,
.io-cta__formwrap .hsfc-Row {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}
/* keep every field label readable on the dark card */
.io-cta__formwrap label,
.io-cta__formwrap legend,
.io-cta__formwrap .hsfc-FieldLabel { color: var(--io-text) !important; }

/* HubSpot legacy forms cap each row (fieldset) at ~500px via the default
   stylesheet — that cap is what left the empty space on the right.
   Remove it so each row fills the full width of the card. */
.io-cta__formwrap .hs_cos_wrapper,
.io-cta__formwrap form,
.io-cta__formwrap .hs-form,
.io-cta__formwrap .hs-form fieldset,
.io-cta__formwrap div[id^="hs_form_target"] {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.io-cta__formwrap .hs-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
}

/* remove dead space at the top of the form caused by empty/hidden leading
   elements (hidden fields, empty fieldsets, blank rich-text blocks) */
.io-cta__formwrap .hs-form > fieldset:empty,
.io-cta__formwrap .hs-form > .hs_cos_wrapper:empty,
.io-cta__formwrap .hs-form > div:empty,
.io-cta__formwrap .hs-form > .hs-richtext:empty { display: none !important; }

/* zero any top margin/padding the theme or HubSpot adds above the first field */
.io-cta__formwrap .hs_cos_wrapper,
.io-cta__formwrap form.hs-form { margin-top: 0 !important; padding-top: 0 !important; padding: 0; }

/* collapse a LEADING row that carries no visible field — i.e. a fieldset/wrapper
   of only hidden inputs (this is the element creating the gap above "First name").
   Real field rows contain a <label>, so they're never matched. */
.io-cta__formwrap .hs-form > fieldset:first-child:not(:has(label)),
.io-cta__formwrap .hs-form > *:first-child:has(> input[type="hidden"]):not(:has(label)):not(:has(select)):not(:has(textarea)) {
  display: none !important;
}
.io-cta__formwrap .hs-form > *:first-child { margin-top: 0 !important; }
/* two-column rows: enable "two column" layout in the HubSpot form editor,
   or these rules will gracefully stack on their own */
.io-cta__formwrap .hs-form-field { margin: 0; }

.io-cta__formwrap .hs-form-field > label,
.io-cta__formwrap .hs-form .hs-field-desc {
  font-family: var(--io-font-head);
  font-weight: 500;
  font-size: 13px;
  line-height: 20px;
  color: var(--io-text);
  display: block;
  margin-bottom: 4px;
}
.io-cta__formwrap .hs-form-required { color: var(--io-primary, #7781ff); }

.io-cta__formwrap input[type="text"],
.io-cta__formwrap input[type="email"],
.io-cta__formwrap input[type="tel"],
.io-cta__formwrap input[type="number"],
.io-cta__formwrap select,
.io-cta__formwrap textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--io-input-bg);
  border: 1px solid var(--io-input-border);
  border-radius: var(--io-radius);
  color: var(--io-text);
  font-family: var(--io-font-ui);
  font-size: 16px;
  padding: 10px 15px;
  outline: none;
  transition: border-color .12s ease;
}
.io-cta__formwrap textarea { min-height: 88px; resize: vertical; }
.io-cta__formwrap input::placeholder,
.io-cta__formwrap textarea::placeholder { color: var(--io-placeholder); }
.io-cta__formwrap input:focus,
.io-cta__formwrap select:focus,
.io-cta__formwrap textarea:focus { border-color: var(--io-blue); }

.io-cta__formwrap select option { color: #000; }

/* Submit button — centered pill */
.io-cta__formwrap .hs-submit,
.io-cta__formwrap .hs_submit,
.io-cta__formwrap .actions {
  width: 100%;
  text-align: center;   /* centers the inline-flex button */
}
.io-cta__formwrap .hs-button,
.io-cta__formwrap input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto !important;   /* pill sized to its text, not full width */
  float: none !important;
  background: var(--io-blue);
  color: #fff;
  border: none;
  border-radius: var(--io-radius-pill);
  font-family: var(--io-font-ui);
  font-weight: 500;
  font-size: 16px;
  line-height: 24px;
  padding: 10px 40px;
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease;
}
.io-cta__formwrap .hs-button:hover,
.io-cta__formwrap input[type="submit"]:hover {
  background: #1f3d78 !important;   /* deeper blue — overrides HubSpot's default hover color */
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(41,74,150,.4);
}
.io-cta__formwrap .hs-button:active,
.io-cta__formwrap input[type="submit"]:active { box-shadow: none; }

/* validation messages */
.io-cta__formwrap .hs-error-msgs label { color: #ff8d8d; font-size: 13px; }

@media (max-width: 900px) {
  .io-cta__inner { padding: 8px 16px 80px; }
  .io-cta__title { font-size: 28px; }
  .io-cta__formwrap { padding: 18px; }

  /* Force every field to span the full card width — covers legacy
     (.form-columns-*/.hs-form-field) AND new (.hsfc-*) HubSpot markup,
     which is what was leaving the big gaps on the left and right. */
  .io-cta__formwrap .hs-form-field,
  .io-cta__formwrap .form-columns-1 .hs-form-field,
  .io-cta__formwrap .form-columns-2 .hs-form-field,
  .io-cta__formwrap .form-columns-3 .hs-form-field,
  .io-cta__formwrap .hsfc-Row,
  .io-cta__formwrap .hsfc-Column,
  .io-cta__formwrap .hsfc-Field {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    float: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .io-cta__formwrap .hs-input,
  .io-cta__formwrap .input {
    width: 100% !important;
    margin-right: 0 !important;
  }
}

/* Phone: tighten everything — less space at the top, sides, and inside the card. */
@media (max-width: 600px) {
  .io-cta__inner { padding: 4px 12px 64px; }   /* less top + side space */
  .io-cta__formwrap { padding: 14px; }          /* shrink the card's inner padding */
  .io-cta__head { padding-bottom: 16px; }
  .io-cta__title { font-size: 24px; line-height: 1.25; }
  .io-cta__sub { font-size: 16px; line-height: 24px; }
  .io-cta__icon,
  .io-cta__icon svg,
  .io-cta__icon img { width: 60px; height: 60px; }
}