.gform_fields.top_label.form_sublabel_below.description_below {
    clear: both;
}

li[class*="column-count-"] {
    vertical-align: top;
    box-sizing: border-box;
    display: inline-block;
}

li.gfmc-column {
    display: inline-block;
    vertical-align: text-top;
}

li.gfmc-column100 {
    width: 100%;
}

li.gfmc-column50 {
    width: 50%;
}

/* Three Columns */
li[class*="col-1-of-3"],
li[class*="col-3-of-3"] {
    width: 33%;
}

/* Three Columns */
li[class*="col-2-of-3"] {
    width: 34%;
}

/* Four Columns */
li.gfmc-column25 {
    width: 25%;
}

/* Five Columns */
li.gfmc-column20 {
    width: 20%;
}

/* Six Columns */
li[class*="col-1-of-6"],
li[class*="col-3-of-6"],
li[class*="col-4-of-6"],
li[class*="col-6-of-6"] {
    width: 16.5%;
}

/* Six Columns */
li[class*="col-2-of-6"],
li[class*="col-5-of-6"] {
    width: 17%;
}

/* Seven Columns */
li[class*="col-1-of-7"],
li[class*="col-2-of-7"],
li[class*="col-3-of-7"],
li[class*="col-5-of-7"],
li[class*="col-6-of-7"],
li[class*="col-7-of-7"] {
    width: 14.3%;
}

/* Seven Columns */
li[class*="col-4-of-7"] {
    width: 14.2%;
}

/* Eight Columns */
li.gfmc-column12 {
    width: 12.5%;
}

/* Nine Columns */
li[class*="col-1-of-9"],
li[class*="col-2-of-9"],
li[class*="col-3-of-9"],
li[class*="col-4-of-9"],
li[class*="col-6-of-9"],
li[class*="col-7-of-9"],
li[class*="col-8-of-9"],
li[class*="col-9-of-9"] {
    width: 11.1%;
}

/* Nine Columns */
li[class*="col-5-of-9"] {
    width: 11.2%;
}

/* Ten Columns */
li.gfmc-column10 {
    width: 10%;
}

li.gfmc-column .gform_wrapper {
    width: 100%;
}

li.gfmc-column ul {
    margin-left: 0;
    padding-left: 0;
}

@media screen and (max-width: 600px) {
    li.gfmc-column {
        width: 100% !important;
    }
}

/* Class to remove left padding and margins from first column item on the form */
li[class*="column-count-1"] > div > ul {
    padding-left: 0;
    margin-left: 0;
}

/* 2.5 Additional layout options */
.gfmc-container {
    grid-column: 1/-1;
}

.gfmc-container,
.gfmc-field {
    display: flex;
}

.gfmc-field {
    flex-basis: 100%;
    flex-direction: column;
    justify-content: space-around;
}

.gfmc-field div:not(.gchoice) {
    padding-bottom: .5em;
}

@media screen and (min-width: 641px) {
    .gfmc-container {
        align-items: flex-start;
        flex-direction: row;
        justify-content: space-between;
        column-gap: .5em;
    }

    .gform_wrapper.gravity-theme legend.gfield_label {
        padding-top: .35em;
    }
}

@media screen and (max-width: 640px) {
    .gfmc-container {
        align-items: stretch;
        flex-direction: column;
        justify-content: space-around;
    }

    .gfield.gfmc-column.gfmc-field:last-child div {
        padding-bottom: 0;
    }

    .gfmc-field {
        max-width: unset !important;
    }
}

/* ==========================================================================
   Modern CSS Grid Engine
   ========================================================================== */

/* 1. Grid container definition */
.gform_wrapper .gfmc-row,
.gform_wrapper .gform_fields .gfmc-row,
.gform_editor.gform_wrapper {
    display: grid !important;
    grid-template-columns: repeat(var(--gfmc-cols, 1), minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
    margin-bottom: 1rem !important;
    width: 100% !important;
    grid-column: 1 / -1 !important;
    box-sizing: border-box !important;
    float: none !important;
    clear: both !important;
}

/* 2. Grid cell definition */
.gform_wrapper .gfmc-row > .gfmc-col {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    grid-column: auto !important;
    float: none !important;
}

/* 3. Neutralize Gravity Forms width-span classes inside grid columns */
.gform_wrapper .gfmc-row > .gfmc-col > .gfield,
.gform_wrapper .gfmc-row .gfield--width-full,
.gform_wrapper .gfmc-row .gfield--width-half,
.gform_wrapper .gfmc-row .gfield--width-third,
.gform_wrapper .gfmc-row .gfield--width-quarter {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 0 !important;
    grid-column: auto !important;
    box-sizing: border-box !important;
}

/* 4. Enforce left alignment against centering theme cascades */
.gform_wrapper .gfmc-row,
.gform_wrapper .gfmc-row > .gfmc-col,
.gform_wrapper .gfmc-row .gfield,
.gform_wrapper .gfmc-row .gfield_label,
.gform_wrapper .gfmc-row .gform-field-label,
.gform_wrapper .gfmc-row legend.gfield_label,
.gform_wrapper .gfmc-row .ginput_container,
.gform_wrapper .gfmc-row .gfield_radio,
.gform_wrapper .gfmc-row .gfield_checkbox,
.gform_wrapper .gfmc-row .gchoice,
.gform_wrapper .gfmc-row .gchoice label {
    text-align: left !important;
}

/* 5. Apply 100% width ONLY to standard text/select/textarea inputs */
.gform_wrapper .gfmc-row input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]):not([type="hidden"]),
.gform_wrapper .gfmc-row select,
.gform_wrapper .gfmc-row textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 6. Standard HTML element appearance & dimensions for checkboxes and radios */
.gform_wrapper .gfmc-row input[type="checkbox"],
.gform_wrapper .gfmc-row input[type="radio"],
.gform_wrapper .gfmc-row .gfield-choice-input {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    width: var(--gf-ctrl-choice-size, 18px) !important;
    height: var(--gf-ctrl-choice-size, 18px) !important;
    min-width: var(--gf-ctrl-choice-size, 18px) !important;
    max-width: var(--gf-ctrl-choice-size, 18px) !important;
    flex: 0 0 var(--gf-ctrl-choice-size, 18px) !important;
    margin: 0.15rem 0.5rem 0 0 !important;
    display: inline-block !important;
    cursor: pointer;
}

/* 7. Ensure choices sit side-by-side */
.gform_wrapper .gfmc-row .gchoice {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    margin-bottom: 0.35rem !important;
}

.gform_wrapper .gfmc-row .gchoice label,
.gform_wrapper .gfmc-row .gchoice .gform-field-label--type-inline {
    margin-bottom: 0 !important;
    text-align: left !important;
    display: inline-block !important;
    width: auto !important;
    max-width: none !important;
    cursor: pointer;
    transition: font-weight 0.1s ease-in-out;
}

/* 8. Consistent selection feedback: bold the label when the input is checked */
.gform_wrapper .gfmc-row .gchoice input:checked + label,
.gform_wrapper .gfmc-row .gchoice input:checked ~ label,
.gform_wrapper .gfmc-row .gchoice input:checked + .gform-field-label--type-inline {
    font-weight: 700 !important;
}

/* 8. Mobile collapse below 768px */
@media (max-width: 767px) {
    .gform_wrapper .gfmc-row,
    .gform_wrapper .gform_fields .gfmc-row {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
}