// See COPYRIGHT.md for copyright information

input[type="text"],
select,
button {
  padding: 1rem;
  border: solid 1px var(--colour-border-grey);
  border-radius: 0.4rem;
  color: var(--colour-text);
  background-color: unset;
  box-sizing: border-box;
  font-size: 1.4rem;
  line-height: 1.8rem;
}

label.checkbox {
  position: relative;
  padding-left: 2.2rem;
  cursor: pointer;
  user-select: none;
  line-height: 1.6rem;

  &:focus-within {
    outline: solid 0.2rem #000;
    outline-offset: 0.3rem;
  }

  input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
  }

  .checkmark {
    position: absolute;
    box-sizing: border-box;
    top: 0;
    left: 0;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.4rem;
    border: solid 0.1rem var(--colour-border-grey);
  }

  input:checked ~ .checkmark::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0.4rem;
    width: 0.4rem;
    height: 1.1rem;
    border: solid var(--colour-primary);
    border-width: 0 0.2rem 0.2rem 0;
    transform: rotate(45deg);
  }
}

input:disabled {
  background-color: #eee;
}

.inline-button {
  display: inline;
  cursor: pointer;
  color: var(--colour-primary);
  padding: 0.3rem;
  border: none;
  line-height: 2.6rem;
  text-align: left;
  
  &.underline {
    padding-top: 0;
    padding-bottom: 0;
    text-decoration: underline;
    text-decoration-color: var(--colour-primary-light);
    text-underline-offset: 0.5rem;

    &.link-icon > div {
      position: relative;
      margin-left: 2.8rem;

      &::before {
        .icon-link();

        position: absolute;
        font-size: 1.8rem;
        left: -2.8rem;
      }
    }
  }

  &.negate-padding {
    margin-left: -0.3rem;
  }
}

.primary-button() {
  background-color: var(--colour-button-primary-bg);
  border: solid 0.1rem var(--colour-button-primary-border);
  color: var(--colour-button-primary-text);
  cursor: pointer;

  &:hover {
    background-color: var(--colour-button-primary-bg-hover);
  }
}

.secondary-button() {
  background-color: var(--colour-button-secondary-bg);
  border: solid 0.1rem var(--colour-button-secondary-border);
  color: var(--colour-button-secondary-text);
  cursor: pointer;

  &:hover {
    background-color: var(--colour-button-secondary-bg-hover);
  }
}

.icon-button() {
  cursor: pointer;
  padding: 0.8rem;
  border: none;

  &:hover {
    background-color: var(--colour-row-hover);
  }

  &.checked {
    background-color: var(--colour-row-hover);
  }
}
