@use "../../../css/functions" as f;

.qld-text-input {
  @extend %form-control;

  @media (prefers-color-scheme: dark) {
    --table-row-border-color: var(--qld-white);
  }

  //Table dark
  @include table-variant("dark", $qld-brand-primary);
}

.qld-text-input-label {
  color: var(--#{$prefix}text-grey);
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: $input-line-height;
  margin-bottom: f.remify(8px);

  .label-text-optional {
    font-size: f.remify(14px);
    color: $qld-dark-grey-muted;
    font-weight: 400;
  }

  &.field-required {
    &:before {
      content: " *";
    }
  }
}

.qld-text-input-label.field-required:not(.field-disabled) {
  &:before {
    color: $qld-notify-warning;
  }
}

* + .date-container {
  margin-top: f.remify(4px);
}

.qld-hint-text {
  color: $qld-hint-text-color;
  display: block;
  font-size: f.remify(14px);
  line-height: f.snap-line-height(1.5);
  margin-block: f.remify(8px);
}

// .qld-select style moved to formcheck.scss

@include media-breakpoint-up(md) {
  input.qld-field-width-1-quarter,
  select.qld-field-width-1-quarter {
    max-width: $qld-fluid-width-1-quarter;
  }

  input.qld-field-width-half,
  select.qld-field-width-half {
    max-width: $qld-fluid-width-half;
  }

  input.qld-field-width-3-quarters,
  select.qld-field-width-3-quarters {
    max-width: $qld-fluid-width-3-quarters;
  }
}

.dark {
  .qld-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='%23FFEF60' d='M4.251 181.1C7.392 177.7 11.69 175.1 16 175.1c3.891 0 7.781 1.406 10.86 4.25l197.1 181.1l197.1-181.1c6.5-6 16.64-5.625 22.61 .9062c6 6.5 5.594 16.59-.8906 22.59l-208 192c-6.156 5.688-15.56 5.688-21.72 0l-208-192C-1.343 197.7-1.749 187.6 4.251 181.1z'/%3E%3C/svg%3E");
  }

  .qld-text-input-label {
    color: $qld-white;

    .label-text-optional {
      color: $qld-hint-text-color-muted;
    }
  }

  .qld-hint-text {
    color: $qld-hint-text-color-muted;
  }

  .form-style-filled {
    background-color: $qld-color-dark-background--shade;
  }
}
