/* Minimal shim layered on top of Unbounce shell CSS + Heyflow flow CSS.
   Goals:
   - Keep Unbounce chrome (logo / secure badge / blue footer / gray canvas) readable
     without the original fixed-height absolute canvas trapping the multi-step form
   - Hide our generic .ss-progress when Heyflow progress UI is already in the steps
   - Preserve step/loader visibility + honeypot + error / back-button helpers
   Must never restyle Heyflow's own components beyond what's needed for layout. */

/* ---- Step / loader visibility (engine contract) ---- */
.ss-step[hidden],
.ss-loader-step[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Generic bar kept in DOM for form-engine aria updates, but both variants already
   render Heyflow progress blocks in-step (rect for A, circle for B). */
.ssform .ss-progress {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.ss-error {
    display: block;
    color: #d0011b;
    font-size: 14px;
    margin-top: 6px;
    min-height: 0;
}

.ss-field.is-invalid .ss-error {
    min-height: 1.2em;
    font-weight: 500;
}

/* Force Heyflow input error boxes visible whenever .error is applied by form-engine */
.ssform .input.error .error-box {
    display: flex !important;
    align-items: center;
}

/* Hide floating label / faux-placeholder once the field has a value */
.ssform .input-floating-label.ss-label-hidden,
.ssform .input.has-value > .input-inner .input-floating-label,
.ssform .input-box.has-value .input-floating-label.ss-label-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Match text/tel/email inputs to select font size (Heyflow floating-label uses .9em) */
.ssform .input-box.with-floating-label input,
.ssform .input-box.with-floating-label.floating-label-inline input,
.ssform .ss-field input[type="text"],
.ssform .ss-field input[type="tel"],
.ssform .ss-field input[type="email"],
.ssform .ss-field input[type="number"] {
    font-size: 1rem !important;
    font-weight: 400 !important;
    text-align: left;
}

.ssform .select select,
.ssform .ss-field select {
    text-align: left;
    text-align-last: left;
}

.ssform .ss-field.is-invalid select,
.ssform .ss-field.is-invalid .select select {
    border-color: #d0011b !important;
    box-shadow: 0 0 0 1px #d0011b;
}

.ssform .ss-field.is-invalid .select.error::after,
.ssform .ss-field.is-invalid .multiple-choice,
.ssform .ss-field.is-invalid fieldset.scale,
.ssform .ss-field.is-invalid .scale {
    outline: 2px solid #d0011b;
    outline-offset: 3px;
    border-radius: 8px;
}

.ssform .ss-field.is-invalid[data-type="checkbox"] {
    outline: 2px solid #d0011b;
    outline-offset: 4px;
    border-radius: 8px;
    padding: 4px;
}

.ss-btn-back-minimal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #56637a;
    font-size: 15px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 12px 8px;
    margin: 0;
    flex: 0 0 auto;
    order: 1;
    min-height: 44px;
}

.ss-btn-back-minimal:hover,
.ss-btn-back-minimal:focus-visible {
    color: #2f3a4a;
}

/* Previous (light) + Next/Submit (primary) — Next stays visually dominant */
.ssform .ss-nav-actions,
.ssform .generic-button-block > div:has(> [data-action="back"]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: stretch;
    gap: 8px 16px;
}

.ssform .ss-nav-actions > .generic-button.continue,
.ssform .ss-nav-actions > .generic-button.submit,
.ssform .generic-button-block > div:has(> [data-action="back"]) > .generic-button.continue,
.ssform .generic-button-block > div:has(> [data-action="back"]) > .generic-button.submit {
    flex: 1 1 220px;
    order: 2;
    min-width: min(100%, 220px);
}

@media (max-width: 480px) {
    .ssform .ss-nav-actions,
    .ssform .generic-button-block > div:has(> [data-action="back"]) {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .ssform .ss-nav-actions > .generic-button.continue,
    .ssform .ss-nav-actions > .generic-button.submit,
    .ssform .generic-button-block > div:has(> [data-action="back"]) > .generic-button.continue,
    .ssform .generic-button-block > div:has(> [data-action="back"]) > .generic-button.submit {
        width: 100%;
        flex-basis: auto;
    }

    .ssform .ss-btn-back-minimal {
        width: 100%;
        text-align: center;
        padding: 8px 4px 4px;
        min-height: 40px;
    }
}

/* ---- Unbounce shell → fluid document flow ----
   Original page-styles use a fixed 940/760 canvas with absolute children.
   Convert to a stacked header / form / footer so step height can grow. */

.ssform.lp-pom-body {
    margin: 0;
    min-height: 100vh;
}

.ssform #lp-pom-root {
    min-width: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.ssform #lp-pom-root-color-overlay,
.ssform [id$="-color-overlay"] {
    display: none !important;
}

.ssform #lp-pom-root .lp-positioned-content {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 940px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto !important;
    z-index: auto !important;
    box-sizing: border-box;
}

/* Hide empty Unbounce spacer blocks — flex layout replaces them */
.ssform #lp-pom-block-267,
.ssform #lp-pom-block-6,
.ssform #lp-pom-block-62,
.ssform #lp-pom-block-11 {
    display: none !important;
}

/* ---- Form A chrome ---- */
.ssform-a #lp-pom-root {
    background: #fff !important;
}

.ssform-a #lp-pom-image-193,
.ssform-a #lp-pom-image-278 {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    z-index: auto !important;
}

.ssform-a #lp-pom-root .ssform-a-top.lp-positioned-content {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "logo badge"
        "form form";
    align-items: start;
    align-content: start;
    column-gap: 16px;
    /* Content-sized only — do not grow under the footer (avoids white form overlapping blue bar) */
    flex: 0 0 auto;
    width: 100% !important;
    max-width: 940px;
    margin: 0 auto !important;
    padding: 24px 24px 32px;
    background: transparent;
    box-sizing: border-box;
    min-height: 0 !important;
    height: auto !important;
    z-index: 0 !important;
    overflow: visible;
}

.ssform-a #lp-pom-image-193 {
    grid-area: logo;
    justify-self: start;
    padding: 8px 0 16px;
}

.ssform-a #lp-pom-image-278 {
    grid-area: badge;
    justify-self: end;
    padding: 8px 0 16px;
}

.ssform-a #lp-pom-box-282 {
    grid-area: form;
    position: relative !important;
    left: auto !important;
    top: auto !important;
    bottom: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: 586px;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 auto;
    z-index: auto !important;
    border-radius: 9px;
    overflow: visible;
    transform: none !important;
}

.ssform-a #lp-code-274 {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    bottom: auto !important;
    right: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    z-index: auto !important;
    transform: none !important;
}

/* Full-bleed blue footer — sibling of .ssform-a-top, not inside max-width band */
.ssform-a .ssform-a-footer {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    width: 100%;
    margin-top: auto;
    background: #4c8dd8;
    min-height: 100px;
    box-sizing: border-box;
    clear: both;
}

.ssform-a .ssform-a-footer__inner {
    max-width: 940px;
    margin: 0 auto;
    padding: 40px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    box-sizing: border-box;
}

.ssform-a .ssform-a-footer__copy {
    margin: 0;
    color: #fff;
    font-family: Poppins, sans-serif;
    font-weight: 300;
    font-size: 14px;
    line-height: 1.3;
}

.ssform-a .ssform-a-footer__links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 28px;
}

.ssform-a .ssform-legal-trigger {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    color: #fff;
    font-family: Poppins, sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
}

.ssform-a .ssform-legal-trigger:hover,
.ssform-a .ssform-legal-trigger:focus-visible {
    color: #ffc500;
}

@media (min-width: 720px) {
    .ssform-a #lp-pom-root .ssform-a-top.lp-positioned-content {
        padding: 40px 40px 40px;
    }

    .ssform-a .ssform-a-footer {
        min-height: 145px;
    }

    .ssform-a .ssform-a-footer__inner {
        padding: 48px 40px;
    }
}

/* ---- Legal modals (Unbounce-style lightbox) ---- */
.ss-modal[hidden] {
    display: none !important;
}

.ss-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.ss-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.ss-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
    max-height: 80vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
    padding: 28px 32px 36px;
    box-sizing: border-box;
}

.ss-modal__close {
    position: sticky;
    top: 0;
    float: right;
    z-index: 2;
    appearance: none;
    border: 0;
    background: transparent;
    color: #333;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    margin: -8px -8px 0 12px;
}

.ss-modal__close:hover,
.ss-modal__close:focus-visible {
    color: #4c8dd8;
}

.ss-modal__body {
    clear: both;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.55;
}

.ss-modal__body h1 {
    margin: 0 0 18px;
    color: #4c8dd8;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
}

.ss-modal__body h2 {
    margin: 22px 0 10px;
    color: #4c8dd8;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.ss-modal__body p {
    margin: 0 0 12px;
}

.ss-modal__body ul {
    margin: 0 0 12px;
    padding-left: 1.4em;
}

.ss-modal__body li {
    margin-bottom: 4px;
}

.ss-modal__body strong {
    font-weight: 700;
}

/* ---- Form B chrome (gray Unbounce canvas, Heyflow widget) ---- */
.ssform-b.lp-pom-body {
    display: block !important;
    height: auto !important;
    min-height: 100vh;
    background: #eeeeee;
    overflow-x: auto;
}

.ssform-b #lp-pom-root {
    background: #eeeeee !important;
    min-height: 100vh;
}

.ssform-b #lp-pom-root .lp-positioned-content {
    max-width: 760px;
    width: 100% !important;
    padding: 14px 9px 24px;
    box-sizing: border-box;
    display: block !important;
}

.ssform-b #lp-code-15 {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 732px;
    height: auto !important;
    min-height: 696px !important;
    z-index: auto !important;
    overflow: visible !important;
    background: #fff;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 0;
}

/* Heyflow hides every <section> unless .visible — keep the active step on screen */
.ssform-b section.ss-step.visible {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.ssform-b html,
.ssform-b {
    --primary: #0985ff;
    --secondary: #0985ff;
}

.ssform-main {
    display: block;
    width: 100%;
}

#ss-form {
    width: 100%;
}

@media (max-width: 600px) {
    .ssform-a #lp-pom-image-193 .lp-pom-image-container,
    .ssform-a #lp-pom-image-193 .lp-pom-image-container img {
        width: 172px !important;
        height: auto !important;
        max-width: 100%;
    }

    .ssform-a #lp-pom-image-278 .lp-pom-image-container,
    .ssform-a #lp-pom-image-278 .lp-pom-image-container img {
        width: 95px !important;
        height: auto !important;
    }

    .ssform-a #lp-pom-box-282 {
        max-width: 100%;
    }
}
