.custom-file {
  /* taken from theme-variables.css */
  --body-text-color: #243953;
  --gray-40: #F6F8FA;
  --gray-50: #F5F7F9;
  --gray-60: #F1F4F7;
  --gray-200: #D3D9E0;
  --gray-400: #94A3AF;
  --gray-500: #6B7884;
  --gray-700: #2F3841;
  --light-gray-70: #E8E8E8;
  --light-gray-100: #DCDCDC;
}

.custom-file label {
  margin-bottom: 0;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group.required .control-label::after,
.form-group.required .label-heading::after {
  content: '*';
  color: red;
  margin-left: 1px;
}

.custom-file-label {
  padding: 10px 28px 10px 15px;
  border-color: var(--input-border-color);
  border-radius: 4px;
  color: var(--body-text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
}

.custom-file-label.selected {
  padding-left: 112px;
}

.custom-file-label::after {
  display: block;
  position: absolute;
  top: 5px;
  right: auto;
  left: 6px;
  bottom: auto;
  height: 34px;
  padding: 5px 12px;
  color: var(--body-text-color);
  font-size: 14px;
  line-height: 1.5;
  background-color: var(--gray-60);
  border: 1px solid var(--light-gray-70) !important;
  border-radius: 4px;
  border-left: inherit;
  cursor: pointer;
  transition: 0.3s;
  z-index: 3;
}

.custom-file-input:lang(en)~.custom-file-label::after {
  content: "Choose File";
}

.custom-file-input,
.custom-file-label {
  height: 46px;
}

.custom-file .image-preview {
  position: relative;
  display: flex;
  align-self: start;
  flex-grow: 0;
}

.custom-file .image-preview img,
.image-preview-outside img {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 300px;
  max-height: 0;
}

p.small.text-muted.mt-1.mb-2 {
  margin-bottom: 0 !important;
}

.custom-file.custom-file__with-preview {
  display: flex;
  flex-direction: column;
  height: auto;
}

.custom-file__with-preview .image-preview:has(img[src]:not([src=""])) {
  margin-top: 16px;
}

.custom-file__with-preview .image-preview img[src]:not([src=""]) {
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px dashed var(--light-gray-100);
  max-height: 150px;
  transition: max-height 0.5s;
}

.image-preview-outside img[src]:not([src=""]) {
  max-height: 150px;
  transition: max-height 0.5s;
}

.upload_file_with_preview__reset_input_btn,
.upload_file_with_preview__delete_upload_btn {
  display: none;
  position: absolute;
  z-index: 2;
  transition: 0.3s;
}

.upload_file_with_preview__reset_input_btn:focus,
.upload_file_with_preview__delete_upload_btn:focus {
  outline: none;
}

.upload_file_with_preview__reset_input_btn svg,
.upload_file_with_preview__delete_upload_btn svg {
  transition: 0.3s;
}

.upload_file_with_preview__reset_input_btn {
  background: #ffffff;
  border: none;
  border-radius: 0;
  color: var(--gray-500);
  opacity: 0.65;
  padding-top: 5px;
  padding-bottom: 5px;
  top: 5px;
  right: 5px;
}

.upload_file_with_preview__delete_upload_btn {
  align-items: center;
  justify-content: center;
  background: var(--gray-40);
  border: 1px solid var(--light-gray-70);
  border-radius: 50px;
  padding: 4px;
  width: 24px;
  height: 24px;
  top: -10px;
  right: -8px;
}

.upload_file_with_preview__delete_upload_btn:hover {
  background-color: var(--gray-200);
  border-color: var(--gray-200);
}

.upload_file_with_preview__delete_upload_btn svg {
  opacity: 0.4;
  width: 14px;
  height: auto;
}

.upload_file_with_preview__delete_upload_btn:hover svg {
  opacity: 1;
}

.upload_file_with_preview__reset_input_btn:hover {
  opacity: 1;
}

.upload_file_with_preview__reset_input_btn:hover svg {
  color: var(--body-text-color);
}

.custom-file__with-preview .image-preview:has(img[src]:not([src=""])) .upload_file_with_preview__delete_upload_btn {
  display: flex;
}