@import "../error-message/index";
@import "../hint/index";
@import "../label/index";

@include tbxforms-exports("govuk/component/textarea") {
  .tbxforms-textarea {
    @include tbxforms-font($size: 19, $line-height: 1.25);

    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 40px;
    @include tbxforms-responsive-margin(6, "bottom");
    padding: tbxforms-spacing(1);

    resize: vertical;

    border: $tbxforms-border-width-form-element solid $tbxforms-input-border-colour;
    border-radius: 0;

    -webkit-appearance: none;

    &:focus {
      outline: $tbxforms-focus-width solid $tbxforms-focus-colour;
      // Ensure outline appears outside of the element
      outline-offset: 0;
      // Double the border by adding its width again. Use `box-shadow` to do
      // this instead of changing `border-width` (which changes element size)
      // and since `outline` is already used for the yellow focus state.
      box-shadow: inset 0 0 0 $tbxforms-border-width-form-element;
    }

    &:disabled {
      opacity: 0.5;
      color: inherit;
      background-color: transparent;
      cursor: not-allowed;
    }
  }

  .tbxforms-textarea--error {
    border-color: $tbxforms-error-colour;

    &:focus {
      border-color: $tbxforms-input-border-colour;
    }
  }
}
