fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  max-width: $input-max-width;
}

/* only legends that are first-level descendents of sections should inherit this style */
section > fieldset {
  legend {
    font-size: $h4-font-size;
    font-weight: $font-bold;
    margin-top: $spacer-3;
    margin-bottom: $spacer-1;
    padding-left: 0;
    float: left;
    width: 100%;
  }

  div label.ds-c-label {
    margin-top: 0;
  }
}

fieldset.full-width {
  max-width: max-content;

  div.ds-c-choice-wrapper {
    max-width: max-content;
  }
}

button,
.ds-c-button {
  &:disabled {
    // pointer events and cursor style are mutually exclusive.
    // Leave pointer-events: none set for disabled classes, but set it to all here because
    // the disabled attribute will disable button interactions for us anyway.
    pointer-events: all !important;
    cursor: not-allowed;
  }
}

.data-entry-box .ds-c-label {
  margin-top: 0;
}

.data-entry-box .ds-c-label--full-width {
  max-width: initial;
}

div.form--with-reviews {
  border-bottom: 2px solid $border-color;
  margin-bottom: $spacer-2;
  margin-top: $spacer-2;
  padding-bottom: $spacer-2;
}

// Above is a previous class that was used by the APD key personnel form/review
// section. Properties below are derived from what was kind of scattered around
// the activity subsection form/review lists, plus some convenience things to
// account for the "Add new..." and "Done" buttons being placed automatically
// by the wrapper.
//
// .form--with-reviews isn't being used anywhere at the moment, but preserved
// here temporarily until reviews, to make it easier to decide which set of
// styles we should keep.

.form-and-review-list {
  > button {
    margin-top: $spacer-2;
  }
}

.form-and-review-list div:last-child {
  border-bottom: none;
}

.form-and-review-list--item__expanded {
  border-bottom: 2px solid $border-color;
  padding-bottom: $spacer-1;
  padding-top: $spacer-1;
}

.form-and-review-list--item__collapsed:not(:last-of-type) {
  border-bottom: 2px solid $border-color;
  padding-bottom: $spacer-3;
  padding-top: $spacer-2;
}

#form-and-review-list--done-btn {
  margin-top: $spacer-4;
}

.input-holder__percent {
  display: inline-block;
  position: relative;
  &:after {
    content: '%';
    font-weight: $font-normal;
    font-size: $lead-font-size;
    position: absolute;
    right: $spacer-1;
    top: 12px;
  }

  input {
    padding-right: 28px;
  }
}

/* for forms that display computed values, but those computed values should
be aligned vertically with their input field comrades */
div.form--computed-value__input-aligned {
  margin: ($spacer-half + $input-padding) 0;
}

/* Rich text editor border */
.public-DraftEditor-content {
  border: 2px solid $color-base;
  border-radius: $border-radius;
}

.rdw-editor-toolbar {
  border-radius: $border-radius;
}

/* dolla dolla inputs */
.budget-table--input-holder {
  padding-bottom: 0;
  .input-holder__percent:after {
    font-size: 12px;
    top: 12px;
  }
}

.budget-table--input__number {
  font-family: $font-family-mono;
  font-size: inherit;
  text-align: right;
  border: 1px solid $color-gray-lighter;
  border-radius: $border-radius;
  padding: $spacer-1;
  width: 100%;
}

.budget-table--number {
  font-family: $font-family-mono;
  font-size: inherit;
  text-align: right;
}

.budget-table--subtotal,
.budget-table--total,
.budget-table--sum {
  font-weight: $font-bold;
}

.fake-radio-button {
  min-height: 20px;
  padding-left: 28px;
  padding-top: 0;
  position: relative;
  display: inline;

  &:before {
    border-radius: 100%;
    height: 20px;
    top: 2px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #212121;
    box-sizing: border-box;
    content: '\a0';
    left: 0;
    line-height: 1.5;
    position: absolute;
    text-indent: 0.15em;
  }
}

.eapd-autocomplete__search-icon {
  position: relative;
  width: 20px;
  float: right;
  right: 12px;
  bottom: 34px;
}

.align-content-right {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
}

.full-width-label {
  max-width: initial;
}

.missing-text-error {
  color: $color-error;
  font-weight: 700;
}

.subform__container {
  border-left: 3px $color-primary solid;
  margin-left: 22px;
  padding-left: 18px;
}

.label-extended {
  .ds-c-field__hint {
    width: 640px;
  }
}

.label-header {
  font-size: 21px;

  .ds-c-field__hint {
    font-size: initial !important;
  }
}

.apd_disabled_choice {
  margin-top: 0;
  width: 150px;

  .ds-c-choice[type='radio']:checked {
    border-color: #fff;
  }

  .ds-c-choice[type='radio']:checked::before {
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
    border-radius: 0;
    border: solid;
    border-color: #fff;
    border-width: 0 0 4px 4px;
    content: '';
    grid-area: 1/-1;
    height: 4px;
    opacity: 1;
    transform: rotate(-45deg) translateX(0.075em);
    width: 10px;
  }
}

.apd_type_choice-container {
  display: flex;
  flex-direction: row;

  .tooltip-container {
    margin-top: 9px;
  }
}
