/* ===== GRAVITY FORMS - THEME STYLES
   Gravity Forms' own CSS is disabled (markup.php). Fields carry the theme's
   .form-row / .input-txt classes, so most styling comes from dist/css; this
   file only covers GF-specific structure. Plain CSS so it doesn't depend on
   each site's Sass build.
   ================================================================================ */

.ww-form .gform_fields {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 10px;
    margin: 0;
    padding: 0;
}

.ww-form .gfield {
    grid-column: span 12;
    min-width: 0;
    text-align: left;
}

@media (min-width: 640px) {
    .ww-form .gfield--width-half {
        grid-column: span 6;
    }
}

/* Expandable forms (theme JS animates max-height) - keep the grid from
   stretching the first row */
.ww-form .gform_fields.expandable-fields {
    align-content: start;
}

/* Hidden + honeypot fields */
.ww-form .gfield--type-hidden,
.ww-form .gform_hidden,
.ww-form .gform_validation_container,
.ww-form .ww-hide,
.gform_wrapper .gform_validation_container {
    display: none !important;
}

.ww-form .gfield_required {
    color: inherit;
}

.ww-form .ginput_container {
    position: relative;
}

/* Section headings (survey / warranty / sash) */
.ww-form .gsection {
    margin: 20px 0 10px;
}

.ww-form .gsection_title {
    font-size: 20px;
    margin: 0;
}

/* Static labels: radios, checkboxes, selects with a question as their label */
.ww-form fieldset.gfield {
    border: 0;
    margin: 0 0 10px;
    padding: 0;
}

.ww-form .label-static .gfield_label,
.ww-form .label-static legend,
.ww-form fieldset.gfield legend {
    position: static;
    display: block;
    font: 500 14px/1.4 'Montserrat', Helvetica, Arial, sans-serif;
    margin-bottom: 8px;
    pointer-events: auto;
}

.ww-form .gchoice label,
.ww-form .gfield_checkbox label,
.ww-form .gfield_radio label {
    position: static;
    display: inline;
    pointer-events: auto;
    line-height: 1.4;
}

.ww-form .gfield_checkbox,
.ww-form .gfield_radio {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.ww-form .gchoice {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ww-form .gfield--type-select .gfield_label {
    z-index: 3;
}

.ww-form .gfield_label .gfield_required_asterisk {
    margin-left: 0;
}

/* Hidden-label fields (consent / newsletter / sash type) */
.ww-form .hidden_label > .gfield_label,
.ww-form .hidden_label > legend {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* Validation */
.ww-form .gfield_error .input-txt,
.ww-form .gfield_error .selector span {
    border-color: #eb0000;
}

.ww-form .gfield_validation_message,
.ww-form .validation_message {
    color: #eb0000;
    font: 500 12px/1.1 'Montserrat', Helvetica, Arial, sans-serif;
    padding: 6px 2px 0;
}

.gform_wrapper .gform_validation_errors {
    color: #eb0000;
    font: 500 14px/1.3 'Montserrat', Helvetica, Arial, sans-serif;
    margin-bottom: 15px;
}

.gform_wrapper .gform_validation_errors h2 {
    font-size: 14px;
    margin: 0;
}

/* Submit row - Lincoln's legacy buttons followed the last .form-row's 10px margin */
.ww-form .gform_footer,
.ww-form .gform_page_footer {
    display: flex;
    gap: 10px;
    margin-top: 0;
}

.ww-form .gform_footer button,
.ww-form .gform_page_footer button,
.ww-form .gform_page_footer input[type="button"],
.ww-form .gform_page_footer input[type="submit"] {
    width: 100%;
    min-width: auto !important;
    padding: 13px;
}

.ww-form .gform_ajax_spinner,
.ww-form .gform-loader {
    display: none;
}

/* Stepped LP: GF page steps in place of the legacy .steps-nav */
.ww-form .gf_page_steps {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.ww-form .gf_step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 2px solid #1875df;
    border-radius: 50%;
    color: #1875df;
    font-weight: 700;
}

.ww-form .gf_step_active,
.ww-form .gf_step_completed {
    background: #1875df;
    color: #fff;
}

.ww-form .gf_step_label,
.ww-form .gf_step_clear {
    display: none;
}

.ww-form .gf_step_number {
    font-size: 14px;
}

/* Confirmation text (if a form is ever set to a message instead of the theme redirect) */
.gform_confirmation_message {
    padding: 20px 0;
}

/* LP hero spacing belongs to the legacy outer form, now a div wrapper.
   Keep the nested GF form from inheriting the hero's negative form margin. */
.block-lp-hero .form-general form.ww-form,
.block-lp-hero .form-stepped form.ww-form {
    margin: 0;
}
.block-lp-hero.size-large .wrapper > div.form-general,
.block-lp-hero.size-large .wrapper > div.form-stepped {
    margin: -40px auto 0;
}
.block-lp-hero.size-small .wrapper > div.form-general,
.block-lp-hero.size-small .wrapper > div.form-stepped {
    margin-top: -110px;
}
@media (min-width: 960px) {
    .block-lp-hero.size-large .wrapper > div.form-general,
    .block-lp-hero.size-large .wrapper > div.form-stepped,
    .block-lp-hero.size-small .wrapper > div.form-general,
    .block-lp-hero.size-small .wrapper > div.form-stepped {
        margin: 0 auto;
    }
}


/* ===== LEGACY LAYOUT PARITY
   Each placement used to be one <form> wrapping its own rows and button, and
   the theme CSS targets that <form> (".sticky-footer-form form", ".blog
   article.form-block form", "#newsletter .form-fields .form-row"...). The
   wrapper is a <div> now, with GF's <form> two levels deeper, so the rules
   below restore those layouts. Values are copied from the compiled theme CSS.
   ================================================================================ */

/* Forms have no title/description; the empty heading only added space */
.ww-form_wrapper .gform_heading {
    display: none;
}

/* The browser's default form margin sat outside the legacy <form>; GF's form is inside the box */
.ww-form_wrapper form.ww-form {
    margin-bottom: 0;
}

/* ----- Template forms (careers / survey / warranty / sash / referral) */

/* Section headings were <br><h3> (two <br>s before the first) */
.ww-form .gsection {
    margin: 26px 0 30px;
}
.ww-form .gform_fields > .gsection:first-child,
.ww-form .gform_fields > .gform_validation_container:first-child + .gsection {
    margin-top: 51px;
}
/* Survey's two <br>s sit outside .form-fields, so its first heading starts at the top */
.ww-form.ww-form-survey .gform_fields > .gsection:first-child,
.ww-form.ww-form-survey .gform_fields > .gform_validation_container:first-child + .gsection {
    margin-top: 0;
}
.ww-form .gsection_title {
    color: #000;
    font: 700 18px/1.4 'Montserrat', Helvetica, Arial, sans-serif;
}

/* Radios (survey / sash): label.label<br> + .form-check-group-inline (.form-check padding
   spaces the choices; uniform's .radio has its own 5px) */
.form-internal .ww-form fieldset.gfield--type-radio:not(.hidden_label) legend {
    line-height: 17px;
    padding-top: 5px;
    margin-bottom: 4px;
}
.form-internal .ww-form .gfield--type-radio .gfield_radio {
    min-height: 27px;
    align-items: flex-start;
}
.form-internal .ww-form .gfield--type-radio .gchoice {
    gap: 0;
}

/* ----- Footer + thin CTA newsletter: email and button on one row */
#newsletter .form-fields .ww-form .gfield,
#newsletter-cta .form-fields .ww-form .gfield {
    margin: 0 0 10px;
}
#newsletter .ww-form .gform_footer button,
#newsletter-cta .ww-form .gform_footer button {
    min-width: 220px !important;
    padding: 13px 30px;
    margin: 0 !important;
}
/* Legacy label was "Email", no asterisk */
#newsletter .ww-form .gfield_required,
#newsletter-cta .ww-form .gfield_required {
    display: none;
}
@media screen and (min-width: 960px) {
    #newsletter .form-fields > .gform_wrapper,
    #newsletter-cta .form-fields > .gform_wrapper {
        flex: 1 0 100%;
    }
    #newsletter .form-fields .ww-form,
    #newsletter-cta .form-fields .ww-form {
        display: flex;
        align-items: center;
    }
    /* The theme's "#newsletter .form-fields .form-row" rule still sizes the field row */
    #newsletter .ww-form .gform-body,
    #newsletter-cta .ww-form .gform-body {
        flex: 1 0 auto;
    }
    #newsletter .ww-form .gform_footer,
    #newsletter-cta .ww-form .gform_footer {
        flex: 1;
    }
}

/* ----- Sticky footer form */
.sticky-footer-form > .form-general {
    min-height: auto;
    box-shadow: none;
}
.sticky-footer-form > .form-general .form-title .title {
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.sticky-footer-form > .form-general .form-body {
    padding: 50px 20px;
}
.sticky-footer-form.mobile-button-left > .form-general .form-body,
.sticky-footer-form.mobile-button-right > .form-general .form-body {
    padding-bottom: 70px;
}
@media screen and (min-width: 960px) {
    .sticky-footer-form > .form-general {
        max-width: 1140px;
        background: rgba(255, 255, 255, 0);
    }
    .sticky-footer-form > .form-general .form-title .title {
        color: #000;
        font-size: 22px;
        padding: 0;
        margin-bottom: 20px;
    }
    .sticky-footer-form > .form-general .form-title .title:after {
        content: none;
    }
    .sticky-footer-form > .form-general .form-body {
        padding: 45px 20px;
    }
    .sticky-footer-form .ww-form {
        display: flex;
        align-items: stretch;
        justify-content: center;
    }
    /* Rows and button were siblings in one flex row */
    .sticky-footer-form .ww-form .gform-body,
    .sticky-footer-form .ww-form .gform_fields {
        display: contents;
    }
    .sticky-footer-form .ww-form .gfield {
        margin: 0 13px 0 0;
    }
    .sticky-footer-form .ww-form .gform_footer {
        margin: 0;
    }
    .sticky-footer-form .ww-form .gform_footer button {
        width: auto;
        padding: 13px 30px;
    }
}
@media screen and (min-width: 1280px) {
    .sticky-footer-form .ww-form .gfield.large {
        flex: 1 0 21%;
    }
}

/* ----- Blog index estimate / newsletter cards */
.blog article.form-block .form-general {
    max-width: none;
    min-height: auto;
    background: rgba(255, 255, 255, 0);
}
.blog article.form-block .form-general .form-body {
    padding: 0;
}
/* Split rows stacked below 1280px */
.blog article.form-block .ww-form .gfield--width-half {
    grid-column: span 12;
}
@media screen and (min-width: 1280px) {
    .blog article.form-block .ww-form .gfield--width-half {
        grid-column: span 6;
    }
}


/* ===== LANDING PAGE FORMS
   Values from landing-pages/sass/modules/_forms.scss + the legacy markup.
   ================================================================================ */

/* GF's .ginput_container is position: relative, which painted the input over
   the absolutely positioned floating label */
.ww-form.ww-form-lp-general .gfield > .gfield_label,
.ww-form.ww-form-lp-stepped .gfield > .gfield_label {
    z-index: 2;
}

/* Phone + zip shared a .form-row.split at every width: phone flex: 1, zip 40% */
.ww-form.ww-form-lp-general .gfield--width-half,
.ww-form.ww-form-lp-stepped .gfield--width-half {
    grid-column: span 7;
}
.ww-form.ww-form-lp-general .gfield--width-half + .gfield--width-half,
.ww-form.ww-form-lp-stepped .gfield--width-half + .gfield--width-half {
    grid-column: span 5;
}

/* Newsletter opt-in: .form-row.form-check-group-inline + label.label.
   Legacy 15px top margin collapsed into the previous row's 10px; grid margins don't */
.ww-form.ww-form-lp-general .newsletter-opt-in,
.ww-form.ww-form-lp-stepped .newsletter-opt-in {
    margin: 5px 0 15px !important;
}
.ww-form.ww-form-lp-general .newsletter-opt-in .gchoice,
.ww-form.ww-form-lp-stepped .newsletter-opt-in .gchoice {
    gap: 0;
}
.ww-form.ww-form-lp-general .newsletter-opt-in .gchoice label,
.ww-form.ww-form-lp-stepped .newsletter-opt-in .gchoice label {
    cursor: pointer;
    flex: 1;
    color: #444;
    font: 700 14px/1.25 'Montserrat', Helvetica, Arial, sans-serif;
    text-align: left;
    padding: 5px;
    margin: 0;
}
@media screen and (min-width: 960px) {
    .ww-form.ww-form-lp-general .newsletter-opt-in .gchoice label,
    .ww-form.ww-form-lp-stepped .newsletter-opt-in .gchoice label {
        font-size: 15px;
    }
}

/* ----- Stepped: .steps-nav */
.ww-form.ww-form-lp-stepped .gf_page_steps {
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
}
.ww-form.ww-form-lp-stepped .gf_step {
    cursor: pointer;
    position: relative;
    width: 22px;
    height: 22px;
    color: #999;
    font: 700 13px/1 'Montserrat', Helvetica, Arial, sans-serif;
    background: #eaedf1;
    border: 0;
    border-radius: 50%;
}
.ww-form.ww-form-lp-stepped .gf_step:not(.gf_step_last) {
    margin-right: 25px;
}
.ww-form.ww-form-lp-stepped .gf_step:not(.gf_step_last):after {
    content: "";
    position: absolute;
    top: 50%;
    right: -20px;
    width: 15px;
    height: 1px;
    background: #999;
}
.ww-form.ww-form-lp-stepped .gf_step_completed {
    color: #999;
    background: #eaedf1;
}
.ww-form.ww-form-lp-stepped .gf_step_active {
    color: white;
    background: #999;
}
.ww-form.ww-form-lp-stepped .gf_step_number {
    font-size: inherit;
}

/* ----- Stepped: questions (.label) and choices (.checkboxes / .radios) */
.ww-form.ww-form-lp-stepped fieldset.gfield legend {
    color: #444;
    font: 700 14px/1.25 'Montserrat', Helvetica, Arial, sans-serif;
    text-align: left;
    border-radius: 4px;
    padding: 5px;
    margin: 0 6px 12px 0;
    transition: 0.2s;
}
@media screen and (min-width: 960px) {
    .ww-form.ww-form-lp-stepped fieldset.gfield legend {
        font-size: 15px;
    }
}
.ww-form.ww-form-lp-stepped .gfield_error legend {
    color: #eb0000;
    background: rgba(235, 0, 0, 0.1);
}
.ww-form.ww-form-lp-stepped .label-static .gfield_checkbox,
.ww-form.ww-form-lp-stepped .label-static .gfield_radio {
    gap: 0;
    width: 100%;
    padding-left: 5px;
}
.ww-form.ww-form-lp-stepped .label-static .gchoice {
    gap: 0;
    width: 50%;
    padding-right: 10px;
    margin-bottom: 15px;
}
.ww-form.ww-form-lp-stepped .label-static .gchoice label {
    cursor: pointer;
    color: #444;
    font: 500 14px/1.25 'Montserrat', Helvetica, Arial, sans-serif;
    text-align: left;
}
@media screen and (min-width: 960px) {
    .ww-form.ww-form-lp-stepped .label-static .gchoice label {
        font-size: 16px;
    }
}
/* .checkboxes.inline */
.ww-form.ww-form-lp-stepped .ww-inline .gchoice {
    width: auto;
    padding-right: 10px;
    margin-right: 15px;
}
.ww-form.ww-form-lp-stepped .ww-inline .gchoice:last-child {
    margin-right: 0;
}
.ww-form.ww-form-lp-stepped .ww-inline.columns-4 .gchoice {
    width: 40%;
    margin-right: 0;
}
@media screen and (min-width: 640px) {
    .ww-form.ww-form-lp-stepped .ww-inline .gchoice {
        margin-right: 30px;
    }
    .ww-form.ww-form-lp-stepped .ww-inline.columns-4 .gfield_checkbox {
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    .ww-form.ww-form-lp-stepped .ww-inline.columns-4 .gchoice {
        width: auto;
        margin-right: 0;
    }
    .ww-form.ww-form-lp-stepped .ww-inline.columns-4 .gchoice label {
        font-size: 15px;
    }
}
/* .radios */
.ww-form.ww-form-lp-stepped .gfield--type-radio .gchoice {
    width: auto;
}
.ww-form.ww-form-lp-stepped .gfield--type-radio .gchoice:not(:last-child) {
    margin-right: 10px;
}
.ww-form.ww-form-lp-stepped .gfield--type-radio.columns-2 .gchoice {
    width: calc(43% - 10px);
}

/* ----- Stepped: Continue (.btn-green.next-step + chevron); steps went back via the nav */
.ww-form.ww-form-lp-stepped .gform_next_button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
.ww-form.ww-form-lp-stepped .gform_next_button svg {
    width: 6px;
    fill: white;
    margin-left: 10px;
    margin-bottom: -2px;
}
/* Not display: none - GF refuses to submit from a button that isn't displayed,
   and the steps nav clicks it to go back */
.ww-form.ww-form-lp-stepped .gform_previous_button {
    position: absolute;
    visibility: hidden;
    pointer-events: none;
}

/* ----- Validation: the legacy LP forms showed no summary, and the stepped
   questions only turned their label red (.form-row.error .label) */
.ww-form-lp-general_wrapper .gform_validation_errors,
.ww-form-lp-stepped_wrapper .gform_validation_errors {
    display: none;
}
.ww-form.ww-form-lp-stepped .label-static .gfield_validation_message {
    display: none;
}

/* Centered-form hero: the theme shows/pins the last image with .image:last-of-type,
   which matched when the legacy form was a <form>; the GF wrapper is a <div> */
.hero.form-center .image:nth-last-child(2) {
    display: block;
}

@media screen and (min-width: 960px) {
    .hero.form-center .image:nth-last-child(2) {
        left: auto;
        right: 0;
        border-left: 3px solid white;
    }
}
