@mixin direct-uploads {

  .cached-image {
    max-height: rem-calc(150);
    max-width: rem-calc(150);
  }

  .progress-bar-placeholder {
    display: none;
    margin-bottom: $line-height;
  }

  .document-fields,
  .image-fields {

    .document-attachment,
    .image-attachment {
      padding-left: 0;

      p {
        margin-bottom: 0;
      }

      &:focus-within label {
        @include focus-outline;
      }
    }

    .attachment-errors {

      > [type=file] {
        @include element-invisible;

        ~ .error {
          display: inline-block;
        }
      }
    }
  }

  .progress-bar {
    background-color: $light-gray;
    width: 100%;
  }

  .file-name {
    margin-top: 0;
    padding-left: 0;

    &:empty {
      display: none;
    }

    &:not(:empty) + .document-attachment,
    &:not(:empty) + .image-attachment {
      display: none;
    }
  }

  .loading-bar {
    height: 5px;
    transition: width 500ms ease-out;
    width: 0;

    &.uploading {
      background-color: $dark-gray;
    }

    &.complete {
      background-color: $success-color;
    }

    &.errors {
      background-color: $alert-color;
      margin-top: calc($line-height / 2);
    }
  }

  .loading-bar.no-transition {
    transition: none;
  }
}
