@use '../../sass/abstracts/variables' as *;
@use '../../sass/abstracts/typography';

// Need to have for old radio to work
#{$object-prefix}radio,
#{$object-prefix}checkbox {
  @include typography.body-large;
  display: grid;
  grid-template-columns: 1em auto;
  gap: 0.5em;
  align-items: baseline;

  input[type='checkbox'],
  input[type='radio'] {
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
    background-color: $white;
    margin: 0;
    display: grid;
    place-content: center;
    width: 1em;
    height: 1em;
    border: 1px solid $sodra-black-50;
  }

  input[type='checkbox']::before,
  input[type='radio']::before {
    content: '';
    width: 0.5em;
    height: 0.5em;
    margin: 0;
    transform: scale(0);
    transition: 60ms transform ease-in-out;
    box-shadow: inset 0.5em 0.5em $sodra-green;
  }

  input[type='radio'],
  input[type='radio']::before {
    border-radius: 50%;
  }

  input[type='checkbox']:checked::before,
  input[type='radio']:checked::before {
    transform: scale(1);
  }

  input[type]:disabled {
    background-color: $light-grey;
    cursor: not-allowed;
  }

  a {
    color: $sodra-black-75;
    text-decoration: underline;
  }
}
