@use '../abstracts' as *;

/* Atom - form field */
%a-form-field-text {
  width: 100%;
  min-height: toRem(36);
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: toRem(4) toRem(12);
  cursor: pointer;
  border-width: toRem(1);
  border-style: solid;
  overflow: hidden;
  transition: all 150ms ease;
}

textarea.a-form-field {
  @extend %a-form-field-text;
  min-height: 110px;
  padding-top: 7px;

  &.-width-sm {
    width: toRem(355);
  }

  &.-width-md {
    width: toRem(461);
  }

  &.-width-xl {
    width: toRem(700);
  }
}

.a-form-field {
  @include outlineOnFocus($border-radius: 4px);

  &[type='text'],
  &[type='url'],
  &[type='email'],
  &[type='date'],
  &[type='number'],
  &[type='datetime-local'] {
    @extend %a-form-field-text;
  }

  &[type='radio'] {
    position: relative;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    margin: 0;
    padding-left: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 50%;
    border-width: 1px;
    border-style: solid;
    transition: 0.2s all linear;

    &:checked {
      border-width: 6px;
      border-style: solid;
    }

    &:not(:disabled),
    &:not(:disabled) + label {
      cursor: pointer;
    }
  }
}
