button,
input,
a {
  &.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--button-padding-y) var(--button-padding-x);
    font-size: var(--form-font-size);
    font-family: var(--ff-secondary);
    font-weight: 700;
    text-align: center;
    border-radius: var(--input-border-radius);
    transition:
      color 0.2s ease-in-out,
      background-color 0.2s ease-in-out,
      border-color 0.2s ease-in-out,
      box-shadow 0.2s ease-in-out;
    cursor: pointer;
    @media (max-width: 1024px) {
      width: 100%;
      font-size: 18px;
      line-height: 106%;
      border-radius: 17px;
    }

    /* Focus (Fibbl Design System, Button): a 2px ring, 3px outside the button */
    &:focus-visible {
      outline: 2px solid var(--c-gray-900);
      outline-offset: 3px;
    }

    /* Hover (Fibbl Design System, Button, primary/secondary/tertiary, option A): the border
       fades, the Shadow/Lift shadow comes in outside the button and the label grows to 108%.
       Colours stay as at rest. btn-light is the tertiary look used on dark backgrounds;
       btn-white is tertiary sm and never inverts its colours.
       The label element is added by scripts/build-website.js (wrapButtonLabels). */
    &.btn-primary,
    &.btn-secondary,
    &.btn-transparent,
    &.btn-light,
    &.btn-white {
      transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease;

      .btn-label {
        display: inline-block;
        transition: transform 0.4s ease;
      }

      @media (hover: hover) {
        &:hover {
          border-color: transparent;
          box-shadow: var(--shadow-lift);
        }

        @media (prefers-reduced-motion: no-preference) {
          &:hover .btn-label {
            transform: scale(1.08);
          }
        }
      }
    }

    &.btn-primary {
      color: var(--c-gray-900);
      background-color: var(--c-primary-200);
      border: 1px solid var(--c-gray-900);

      &:disabled {
        color: var(--c-gray-300);
        background-color: var(--c-gray-50);
        cursor: default;
      }
    }

    &.btn-secondary {
      color: var(--c-gray-25);
      background-color: var(--c-gray-900);
      border: 1px solid transparent;

      &:disabled {
        color: var(--c-gray-300);
        background-color: var(--c-gray-50);
        cursor: default;
      }
    }

    &.btn-light {
      color: var(--c-gray-900);
      background-color: var(--c-gray-25);
      border: 1px solid var(--c-gray-900);

      &:disabled {
        color: var(--c-gray-300);
        background-color: var(--c-gray-50);
        cursor: default;
      }
    }

    &.btn-transparent {
      color: var(--c-gray-900);
      background-color: transparent;
      border: 1px solid var(--c-gray-900);

      &:disabled {
        color: var(--c-gray-300);
        background-color: var(--c-gray-50);
        cursor: default;
      }
    }

    &.btn-white {
      height: 42px;
      color: var(--c-gray-900);
      background-color: var(--c-gray-25);
      border: 1px solid var(--c-gray-900);
      font-size: 18px;

      &:disabled {
        color: var(--c-gray-300);
        background-color: var(--c-gray-50);
        cursor: default;
      }
    }

    &.btn-dark {
      &:hover {
        border: 1px solid;
      }
    }

    &.btn-small {
      padding: var(--button-padding-y-small) var(--button-padding-x-small);
      font-size: var(--form-font-size-small);
      border-radius: var(--input-border-radius-small);
    }

    &.btn-smaller {
      height: auto !important;
      padding: 10px 18px;
      font-size: 18px;
      font-weight: 700;
      line-height: 100%;
      border-radius: 16px !important;
    }
  }
}
