/*
 * One button scale for the public site.
 *
 *   small   36px  14px text   in-row actions, header buttons, card buttons
 *   regular 44px  15px text   most actions (Bootstrap .btn)
 *   large   52px  16px text   the one main call to action on a page
 *   icon    40px square (36px on phones)
 *
 * Heights are fixed with min-height + line-height 1 (not padding), so the
 * same button measures the same on Windows, macOS, iOS and Android whatever
 * font metrics the platform uses. Page styles use these variables instead
 * of their own padding/font sizes.
 */
:root {
  --bb-btn-h-sm: 36px;
  --bb-btn-h: 44px;
  --bb-btn-h-lg: 52px;
  --bb-btn-icon: 40px;
  --bb-btn-fs-sm: 0.875rem;
  --bb-btn-fs: 0.9375rem;
  --bb-btn-fs-lg: 1rem;
  --bb-btn-px-sm: 14px;
  --bb-btn-px: 20px;
  --bb-btn-px-lg: 28px;
  --bb-btn-radius: 10px;
}
@media (max-width: 575.98px) {
  :root { --bb-btn-icon: 36px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--bb-btn-h);
  padding: 0 var(--bb-btn-px);
  font-size: var(--bb-btn-fs);
  line-height: 1.2;
  border-radius: var(--bb-btn-radius);
  vertical-align: middle;
}
.btn-sm, .btn-group-sm > .btn {
  min-height: var(--bb-btn-h-sm);
  padding: 0 var(--bb-btn-px-sm);
  font-size: var(--bb-btn-fs-sm);
  border-radius: var(--bb-btn-radius);
}
.btn-lg, .btn-group-lg > .btn {
  min-height: var(--bb-btn-h-lg);
  padding: 0 var(--bb-btn-px-lg);
  font-size: var(--bb-btn-fs-lg);
  border-radius: var(--bb-btn-radius);
}
.btn-block { display: flex; width: 100%; }
.btn-icon {
  width: var(--bb-btn-icon);
  min-height: var(--bb-btn-icon);
  height: var(--bb-btn-icon);
  padding: 0;
}
.btn-group > .btn:not(:first-child), .input-group > .input-group-append > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.btn-group > .btn:not(:last-child), .input-group > .input-group-prepend > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
/* A button beside a form field matches the field's height. */
.input-group > .input-group-append > .btn, .input-group > .input-group-prepend > .btn { min-height: 0; }

button, input[type="submit"], input[type="button"], input[type="reset"] {
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

/* Fields line up with the button beside them. */
.form-control:not(textarea):not([multiple]):not([size]), .custom-select { height: var(--bb-btn-h); }
.form-control-sm:not(textarea), .custom-select-sm { height: var(--bb-btn-h-sm); }
.form-control-lg:not(textarea), .custom-select-lg { height: var(--bb-btn-h-lg); }
