/* Buttons: one green primary per view, quieter secondaries, and text-only quiet buttons. Works on <a>, <button> and <input>. */
@layer components {
  .button {
    display: inline-flex;
    gap: var(--space-2);
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    padding: 0 var(--space-5);
    border: 0;
    border-radius: var(--radius-md);
    background: var(--color-button);
    color: var(--color-on-button);
    font: var(--weight-bold) var(--text-md) / 1 var(--font-sans);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease);

    &:hover { background: var(--color-button-hover); }
    &:disabled, &[aria-disabled="true"] { opacity: 0.5; cursor: default; }
  }

  .button--secondary {
    background: var(--fill);
    color: var(--color-ink);

    &:hover { background: var(--fill-hover); }
  }

  /* A button that reads as a link: "Sign out", "Remove", "Resend code". */
  .button--quiet {
    min-height: 2.75rem; /* a thumb-sized target, though it reads as a link */
    padding: 0;
    background: none;
    color: inherit;
    font-weight: var(--weight-medium);
    text-decoration: underline;
    text-underline-offset: 0.18em;

    &:hover { background: none; text-decoration-thickness: 2px; }
  }

  .button--small { min-height: var(--control-height-sm); padding: 0 var(--space-4); font-size: var(--text-sm); }
  .button--large { min-height: var(--control-height-lg); padding: 0 var(--space-6); font-size: var(--text-lg); }
  .button--full { width: 100%; }
  .button--icon { width: var(--control-height); padding: 0; }

  /* button_to wraps its button in a form; keep that form out of the layout. */
  form.button_to { display: contents; }
}
