body.wp-child-theme-graceatwork-divi {
  .gform_wrapper,
  .gform_wrapper.gform-theme--foundation {
    .gform_heading {
      h2.gform_title,
      h3.gform_title {
        color: var(--primary-color);
        font-size: var(--t-h2);
        text-align: center;
        margin-bottom: 1rem;
      }

      .gform_description {
        text-align: center;
        max-width: 700px;
        margin: 0 auto 2rem;
      }

      .gform_required_legend {
        display: none;
      }
    }

    form {
      max-width: 800px;
      margin: 0 auto;

      .gform_body {
        .gform_fields {
          --gf-form-gap-y: 1rem !important;
          --gf-form-gap-x: 1rem !important;
          --gf-field-gap-y: 1rem !important;
          --gf-field-gap-x: 1rem !important;

          .gfield {
            .ginput_container {
              margin-top: 0 !important;
            }

            .gfield_description,
            .gfield_description a {
              font-size: var(--t-small);
            }

            .gfield_label,
            .gform-field-label {
              color: var(--text-color);

              .gfield:not(.gfield--input-type-radio):not(
                  .gfield--input-type-checkbox
                )
                & {
                display: none;
              }
            }

            &.gfield--input-type-radio {
              .ginput_container_radio {
                .gfield_radio {
                  .gchoice {
                    cursor: pointer;

                    .gfield-choice-input {
                      &:checked {
                        border-color: var(--primary-color);

                        &::before {
                          background-color: var(--primary-color);
                        }
                      }
                    }
                  }
                }
              }
            }

            &.gfield--input-type-checkbox {
              .ginput_container_checkbox {
                .gfield_checkbox {
                  .gchoice {
                    cursor: pointer;
                    display: flex;
                    align-items: center;
                    gap: 0.75rem;
                    margin-bottom: 0.5rem;

                    .gfield-choice-input {
                      width: 24px;
                      height: 24px;
                      border: 2px solid var(--light-blue);
                      border-radius: 4px;
                      background-color: var(--light-blue);
                      cursor: pointer;
                      position: relative;
                      appearance: none;
                      -webkit-appearance: none;
                      -moz-appearance: none;
                      margin: 0;

                      &:checked {
                        border-color: var(--primary-color);
                        background-color: var(--primary-color);

                        &::before {
                          content: "✓";
                          position: absolute;
                          top: 50%;
                          left: 50%;
                          transform: translate(-50%, -50%);
                          color: var(--white);
                          font-size: 1rem;
                          font-weight: bold;
                          line-height: 1;
                        }
                      }

                      &:hover {
                        border-color: var(--primary-color);
                        opacity: 0.8;
                      }
                    }

                    .gform-field-label {
                      color: var(--text-color);
                      font-size: var(--t-body);
                      line-height: 1.3;
                      cursor: pointer;
                      margin: 0;
                      margin-top: 3px;
                      font-weight: 400;
                    }
                  }
                }
              }
            }

            .gfield_required_asterisk {
              color: var(--text-color);
            }

            input[type="text"],
            input[type="email"],
            input[type="tel"],
            input[type="url"],
            input[type="number"],
            select,
            textarea {
              border-radius: var(--form-input-radius);
              border: none;
              padding: 20px;
              font-size: var(--t-body);
              line-height: 1.3;
              outline: none;
              block-size: 100%;
              background-color: var(--light-blue);

              &::placeholder {
                color: var(--brown);
                font-size: var(--t-body);
                line-height: 1.3;
                opacity: 0.5;
              }
            }

            option[value=""] {
              color: var(--brown) !important;
              opacity: 0.5;
            }

            select {
              position: relative;
              appearance: none;
              -webkit-appearance: none;
              -moz-appearance: none;
              padding-right: 2.5rem;
              cursor: pointer;
              display: inline-block;
              margin-top: 0;
              margin-bottom: 0;
              max-height: 59px;

              /* Custom chevron using background image since pseudo-elements don't render on select */
              background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
              background-repeat: no-repeat;
              background-position: right 0.75rem center; /* horizontal placement */
              background-size: 1rem 10px; /* arrow size */
            }

            /* Old IE/Edge Legacy native arrow */
            select::-ms-expand {
              display: none;
            }
          }

          #field_submit {
            grid-column: 4 / span 6;

            input {
              line-height: 1 !important;
              border-color: var(--primary-color);
              max-height: 64px;
              box-sizing: border-box;
              background-color: var(--primary-color);
              color: var(--white);
            }
          }

          .gf_inline & {
            display: flex;
            justify-content: space-between;
            gap: 1.5rem;

            #field_submit {
              min-width: 150px;
              align-items: flex-start;

              input {
                max-height: 64px;
              }
            }

            .gfield:not(#field_submit) {
              flex-grow: 1;
            }

            @media (max-width: 1200px) {
              & {
                gap: 1rem;
              }
            }

            @media (max-width: 767px) {
              & {
                flex-direction: column;
                align-items: stretch;

                #field_submit {
                  flex-grow: 1;

                  input {
                    width: 100%;
                  }
                }
              }
            }
          }
        }
      }

      .gform-footer {
        .gf_inline & {
          display: none;
        }
      }

      input[type="submit"].gform-button,
      input[type="submit"].gform_button {
        font-family: var(--body-font-family);
        font-weight: 600;
        font-style: normal;
        font-size: var(--body-font-size);
        line-height: var(--default-line-height) !important;
        text-transform: uppercase;
        padding: 14px 30px;
        cursor: pointer;
        border-radius: var(--button-radius) !important;
        border: 2px solid var(--light-blue) !important;
        background-color: var(--light-blue) !important;
        color: var(--primary-color) !important;
        transition: all 0.3s ease;

        &:hover {
          opacity: 0.9;
        }

        .gf_inline & {
          height: 100%;
        }
      }

      /* This assumes a complex address field, and that the first line consists of the street address */
      .ginput_complex {
        row-gap: 0;

        @media (min-width: 642px) {
          .ginput_full {
            display: inline-block;
            box-sizing: border-box;
          }

          .ginput_full.address_line_1 {
            width: 50%;
            margin: 0 -4px 0 0;
            margin-right: 8px;
            padding-right: 8px;
          }

          .ginput_full.address_line_2 {
            width: 50%;
            margin-right: -8px;
            padding-right: 8px;
            padding-left: 0;
          }
        }

        & > span {
          padding-top: 0 !important;
        }

        .address_city,
        .ginput_address_state,
        .ginput_address_zip,
        .ginput_address_country {
          margin-top: 1rem;
        }

        @media (max-width: 641px) {
          .ginput_address_line_2,
          .name_last {
            margin-top: 1rem;
          }
        }
      }
    }

    .bvi-form-centered-fields {
      .gform_fields {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
      }

      .gfield {
        width: 100%;
        padding: 0 !important;
        margin-top: 0 !important;
      }

      .ginput_container {
        width: 100%;
        display: flex;
        justify-content: center;
        max-width: 400px;
        margin: 0 auto;

        input {
          width: 100% !important;
        }
      }

      .gfield_description {
        max-width: 400px;
        margin: 0 auto 8px;
      }

      .ginput_complex {
        flex-direction: column;
        align-items: stretch;
        row-gap: 1rem;

        .gform-grid-col {
          padding: 0 !important;
        }

        .ginput_full.address_line_1 {
          width: 100%;
          margin: 0;
        }

        .ginput_full.address_line_2 {
          width: 100%;
          margin: 0;
        }

        .address_city,
        .ginput_address_state,
        .ginput_address_zip,
        .ginput_address_country {
          width: 100%;
          margin-top: 0;
        }
      }

      #field_submit {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        grid-column: none;
      }

      .gform-footer {
        max-width: 400px;
        margin: 0 auto;
      }
    }
  }

  .newsletter-signup-section {
    @media (min-width: 981px) {
      .et_pb_column_2_3 {
        display: flex;
        align-items: center;
      }
    }

    .gaw-newsletter-form {
      input[type="email"],
      input[type="text"] {
        width: 100%;
        height: 64px !important;
        max-height: 64px !important;
        background-color: var(--white) !important;
      }

      input[type="submit"].gform-button {
        background-color: var(--light-blue) !important;
        color: var(--primary-color) !important;
        border-color: var(--white) !important;
      }
    }

    &.newsletter-signup-section--inverted {
      input[type="email"],
      input[type="text"]:not(.adminbar-input) {
        background-color: var(--light-blue) !important;
        height: 64px !important;
        max-height: 64px !important;
      }

      input[type="submit"].gform-button {
        background-color: var(--primary-color) !important;
        color: var(--white) !important;

        &:hover {
          opacity: 0.8;
        }
      }
    }
  }

  .gform_confirmation_message {
    text-align: center;
    font-size: var(--t-h4);
    line-height: 1.2;
  }
}
