// Style for schemaform

.va-growable-background {
  padding: 1em;
  margin-bottom: 1em;
  background-color: $color-gray-lightest;
}

.progress-box .va-growable button {
  width: auto;
  margin-right: 0;
  @media screen and (max-width: 340px) {
    padding-left: 10px;
    padding-right: 10px;
  }
}

.float-right {
  float: right;
}

.float-left {
  float: left;
}

legend {
  color: $color-primary-darkest;
  font-size: 1.35em;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
  padding: 0 0 .5em 0;
}

// IE
fieldset {
  display: inline-block;
  width: 100%;
  max-width: 750px;
  .form-review-panel & {
    width: 100%;
  }
}

@media (max-width: 40.063em) {
  .progress-box {
    border: none;
    padding-left: 2rem - .9375rem;
    padding-right: 2rem - .9375rem;
  }
}

// Overriding a way too broad style in the base va sass
.form-review-panel {
  ul li p {
    margin-top: 16px;
    margin-bottom: 16px;
  }
}

.va-nav-breadcrumbs-list, legend, .nav-header > h4, .nav-header, .usa-input-error, .input-error-date, .usa-alert {
  &:focus {
    outline: none;
  }
}

.form-error-date .input-date-label {
  font-weight: bold;
  font-size: 1.7rem;
  font-weight: 700;
}

dl.review {
  .review-row {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    border-top: 1px solid $color-gray-light;
    padding: 1.5rem;
    padding-left: 0;
    > dd {
      font-weight: bold;
      text-align: right;
    }
    > dt > p {
      margin-top: 0;
      margin-bottom: 0;
    }
    @media (min-width: $small-screen) {
      flex-direction: row;
      > dd {
        padding-left: 5px;
        min-width: 100px;
      }
      > dt {
        max-width: 60%;
        min-width: 40%;
      }
    }
  }
  border-bottom: 1px solid $color-gray-light;
}

form.rjsf {
  max-width: 100%;
}

.va-growable-review {
  margin-top: 16px;
}

// Even up the spacing between multi-line labels and their respective elements
label {
  + div {
    // Space above the date fields
    .form-datefield-month, .form-datefield-day, .usa-form-group-year,
    // And the inputs uswds sets a top margin for
    input:not([type="radio"]),
    input[type="text"], input[type="email"],
    input[type="password"], input[type="url"],
    input[type="tel"], input[type="number"],
    input[type="search"], input[type="file"],
    input[type="date"], input[type="datetime-local"],
    input[type="month"], input[type="time"],
    input[type="week"], textarea, select {
      margin-top: 0.5em;
    }
  }
}

.usa-alert ul:first-child {
  margin-top: 0;
}

.schemaform-buttons {
  [type="submit"] {
    margin-top: 0.5em;
    margin-right: 0.5em;
  }
}

.schemaform-back-buttons {
  margin-bottom: 7rem !important;
}

.schemaform-block {
  margin-top: 2em;
}

.nav-header-schemaform {
  margin-top: 1em !important;
}

.progress-box-schemaform {
  margin-top: 0;
  padding-top: 0;
  border: none;
}

.schemaform-chapter-progress {
  padding-left: 2rem;
  padding-right: 2rem;
  margin-bottom: 1.5em;
  @media (max-width: 40.063em) {
    padding-left: 2rem - .9375rem;
    padding-right: 2rem - .9375rem;
  }
  > h4 {
    padding-bottom: 0 !important;
  }
}

.schemaform-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  > h1 {
    margin-bottom: 0;
    padding-right: 10px;
  }
  > .schemaform-subtitle {
    font-size: 2rem;
  }
  margin-bottom: 3rem;
}

.schemaform-required-span {
  color: $color-secondary-dark;
  margin: 0 0.35em;
}

.schemaform-intro {
  padding-bottom: 1rem;
  margin-bottom: 7rem;
}

// Align the process ol with the title
.schemaform-process {
  ol {
    margin-left: -0.5em;
  }
}

.schemaform-array-row {
  outline: none;
}
.schemaform-array-row {
  outline: none;
}

.schemaform-block-header {
  margin-bottom: 0.7em;
  > legend, > h5, > p {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
  > p {
    margin-top: 0;
  }
  > .schemaform-block-title + p {
    margin-top: 0.5em;
  }
}
.schemaform-block-title {
  font-family: $font-serif;
  font-size: 1.8rem;
}
.schemaform-block-subtitle {
  font-size: 1.5rem;
  font-weight: 700;
}

.schemaform-first-field {
  .schemaform-label, > .usa-input-error {
    margin-top: 0;
  }
}

legend.schemaform-label {
  font-weight: inherit;
  font-size: inherit;
  color: inherit;
  line-height: inherit;
  max-width: 46rem;
  padding-bottom: 0;
}

fieldset.schemaform-field-template {
  margin-top: 3rem;
  &.schemaform-first-field {
    margin-top: 0;
  }
}

.schemaform-warning-header {
  margin-top: 9px;
}

.schemaform-failure-alert {
  margin-bottom: 1.5em;
}

.schemaform-radio-indent {
  margin-left: 27px;
}

.schemaform-expandUnder-indent {
  margin-left: 29px;
}

.schemaform-currency-input .schemaform-widget-wrapper {
  position: relative;
  &:before {
    content: "$";
    display: block;
    position: absolute;
    top: 9px;
    left: 10px;
  }
  > input {
    padding-left: 25px !important;
  }
}

//duplicated from claims-status.scss
.help-talk {
  margin: 0.5em 0;
  padding: 0;
}

.help-phone-number {
  margin: 0.5em 0 2em;
}

.help-phone-number-link {
    font-weight: bold;
    text-decoration: none;
    margin: 0.5em 0;
}

//duplicated/renamed from claims-status.scss
.help-footer-box {
  padding: 2em 0;
  @include media($medium-large-screen) {
    padding-top: 0.6em;
    // padding-left: inherit;
  }
}
//duplicated/renamed from claims-status.scss
.help-footer-box {
  padding-top: 0.3em;
}

//duplicated/renamed from claims-status.scss
.help-heading {
  border-bottom: 3px solid $color-primary;
  margin: 0.3em 0;
  font-size: 1.35em;
  line-height: 1.5;
  font-weight: bold;
}

.usa-button.schemaform-file-remove-button {
  width: auto;
}

.schemaform-file-list {
  list-style: none;
  padding-left: 0;
  > li {
    list-style: none;
  }
}

.usa-input-error .schemaform-upload-label {
  margin-top: 0.5em;
}

.schemaform-file-upload > div > .schemaform-label {
  font-weight: bold;
}

.schemaform-file-error.usa-input-error {
  // border size is 4px
  right: 4px;
  width: calc(100% + 4px);
  margin-top: inherit;
}

legend.schemaform-label.schemaform-file-label {
  font-weight: bold;
}

.schemaform-file-attachment {
  margin-top: 1em;
  margin-bottom: 1em;
  .usa-input-error {
    margin-top: 0;
  }
}

.schemaform-file-list-buttons-editing > .usa-button {
  margin: 0.5em 0.5em 0.5em 0;
}

.schemaform-file-upload-review {
  margin-bottom: 1.5em;
}

.va-growable-background:focus {
  outline: none;
}

.schemaform-save-error {
  margin-top: 0;
  margin-bottom: 1em;
}

.schemaform-address-view {
  white-space: pre-wrap;
  p {
    margin-bottom: 0;
  }
  p:not(:first-child) {
    margin-top: 0;
  }
}

.schemaform-array-readonly-header {
  padding-bottom: 1.5rem;
}

.schemaform-prefill-message {
  margin-top: 0;
  margin-bottom: 1rem;
  min-height: auto;
}

.schemaform-process-sip {
  padding-bottom: 0;
}

.schemaform-sip-alert {
  margin-top: 0;
}

.schemaform-sip-alert-title {
  padding-bottom: 16px;
}

.schemaform-label-no-top-margin {
  > .schemaform-label {
    margin-top: 1rem;
  }
}

.schemaform-file-uploading {
  width: 100%;
}

.schemaform-review-array-warning {
  margin: -1em -0.8em 0;
  border: 2px solid $color-gold-lightest;
  > .form-review-panel-page-header-row {
    padding: 1em 0.8em;
    background-color: $color-gold-lightest;
  }
  > .va-growable-review {
    padding: 0 1em;
  }
}

.schemaform-review-array-warning-icon {
  background-image: url("~uswds/dist/img/alerts/warning.png");
  background-image: url("~uswds/dist/img/alerts/warning.svg");
  width: 2em;
  height: 1.4em;
  background-size: 2em;
  margin-right: 1em;
}

.schemaform-review-page-warning {
  margin: -1em -1em 5rem;
  .form-review-panel-page-header-row {
    padding: 1em 1em;
    background-color: $color-gold-lightest;
    &:after {
      display: block;
      order: 2;
      content: " ";
      background-image: url("~uswds/dist/img/alerts/warning.png");
      background-image: url("~uswds/dist/img/alerts/warning.svg");
      width: 2em;
      height: 1.3em;
      background-size: 2em;
      margin-right: 1em;
    }
    .edit-btn {
      order: 3;
    }
  }
  dl.review {
    padding: 0 1em;
    margin-top: 0;
    margin-bottom: 0;
    border-bottom: none;
  }
}

.schemaform-review-chapter-warning {
  .schemaform-chapter-accordion-header {
    position: relative;
    > .usa-button-unstyled {
      background-color: $color-gold-lightest;
    }
    .schemaform-review-chapter-warning-icon {
      position: absolute;
      top: 2.8rem;
      right: 4rem;
      display: block;
      background-image: url("~uswds/dist/img/alerts/warning.png");
      background-image: url("~uswds/dist/img/alerts/warning.svg");
      width: 2em;
      height: 1.2em;
      background-size: 1.8em;
      margin-right: 1em;
    }
  }
  .schemaform-chapter-accordion-content {
    border-right-color: $color-gold-lightest;
    border-left-color: $color-gold-lightest;
    border-bottom-color: $color-gold-lightest;
  }
}

#content .panel.saved-success-container {
  background-color: $color-green-lightest;
}

.saved-success-icon {
  margin: 0 .5em 0 0;
}

.usa-alert-no-color {
  background-color: transparent;
}
.usa-alert-mini {
  margin-top: 0;
  margin-bottom: 1em;
  background-size: 3rem;
  background-position: 1rem 2.2rem;
  > .usa-alert-body {
    padding-left: 3rem;
  }
  &::before {
    display: none;
  }
}

.expires-container {
  margin-top: 8px;
  margin-bottom: 8px;
}

.expires {
  font-weight: bold;
}

.saved-form-metadata-container {
  margin-bottom: 16px;
}
.saved-form-metadata {
  display: block;
}
.saved-form-autosaving {
  font-style: italic;
  padding: 1em 0;
  margin-top: 0;
  margin-bottom: 1.5em;
}
.confirmation-guidance-container {
  margin-top: 16px;
}
.confirmation-guidance-heading {
  padding-bottom: 0;
  padding-top: 16px;
}
.confirmation-guidance-message {
  margin-top: 0;
}

.autosuggest-container {
  position: relative;
}

.autosuggest-input {
  // override accordion styles, which are the bane of our existence
  background-image: none !important;
}

.autosuggest-input {
  // override accordion styles, which are the bane of our existence
  background-image: none !important;
}

.autosuggest-list {
  background: $color-white;
  border: 1px solid $color-gray;
  // Box shadow only sides and bottom of suggestion list.
  box-shadow: 3px 3px 3px -3px $color-focus,
              -3px 3px 3px -3px $color-focus,
              7px 7px 7px -7px $color-focus,
              -7px 7px 7px -7px $color-focus;
  list-style: none;
  margin-top: -.5rem;
  max-width: 46rem;
  max-height: 46rem;
  overflow: auto;
  padding: 0;
  position: absolute;
  width: 100%;
  top: 46px;
  left: 0;
  z-index: 1;

  @media screen and (max-width: $small-screen) {
    font-size: 1.3rem;
  }
}

.usa-input-error > .schemaform-widget-wrapper > .autosuggest-container > .autosuggest-list {
  width: calc(100% + 1.9rem);
}

.autosuggest-item {
  padding: .5rem 1rem;
  list-style-type: none;

  &-highlighted {
    background-color: $color-primary-alt-light;
    cursor: pointer;
  }
  &-selected {
    font-weight: bold;
  }
}

// More correcting of overly broad uswds accordion styles
.react-autosuggest__input[aria-expanded=false] {
  background-image: inherit !important;
  background-repeat: inherit !important;
  background-size: inherit !important;
}

.schemaform-confirmation-section-header {
  font-size: $h3-font-size;
}

.schemaform-confirmation-claim-header {
  font-size: $h4-font-size;
  margin-top: 1em;
}

.usa-accordion, .usa-accordion-bordered {
  > ul {
    button:not(.usa-button-unstyled) {
      border-radius: $button-border-radius;
    }
  }
}

.schemaform-title-underline {
  border-bottom: 3px solid $color-primary;
}

.schemaform-downtime-after-steps {
  margin-top: 0;
  margin-bottom: 1em;
}

// Screen Readers
.sr-only {
  position: absolute;
  left: -9999em;
  float: left;
}
