/* Finition commune : les variantes conservent leurs couleurs Bootstrap ou métier. */
body .btn:where(:not(.btn-link)) {
  --bs-btn-border-radius: .65rem;
  --piaf-button-finish: linear-gradient(165deg, rgba(255, 255, 255, .1), transparent 45%),
    linear-gradient(180deg, transparent 45%, rgba(12, 38, 62, .12));
  --piaf-button-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 5px rgba(24, 50, 79, .14);
  background-image: var(--piaf-button-finish);
  box-shadow: var(--piaf-button-shadow);
  transition: color .16s ease, background-color .16s ease, border-color .16s ease,
    box-shadow .16s ease, transform .1s ease;
}

body .btn-sm,
body .btn-group-sm > .btn {
  --bs-btn-border-radius: .45rem;
}

body .btn-lg,
body .btn-group-lg > .btn {
  --bs-btn-border-radius: .8rem;
}

body .btn-primary {
  --bs-btn-bg: #0064b1;
  --bs-btn-border-color: #005b9e;
  --bs-btn-hover-bg: #006db6;
  --bs-btn-hover-border-color: #005b9e;
  --bs-btn-active-bg: #004b87;
  --bs-btn-active-border-color: #004578;
  --bs-btn-disabled-bg: #567086;
  --bs-btn-disabled-border-color: #567086;
  --bs-btn-focus-shadow-rgb: 0, 100, 177;
}

body .btn:where(.btn-primary, .auth-primary, .btn-piaf-primary, .btn-piaf-cap-primary) {
  --piaf-button-finish: radial-gradient(ellipse at 90% 0, rgba(40, 207, 235, .23), transparent 65%),
    linear-gradient(165deg, rgba(255, 255, 255, .08), transparent 42%),
    linear-gradient(180deg, transparent 35%, rgba(0, 43, 83, .22));
}

body .btn:where([class*="btn-outline-"]:not(.btn-outline-light)) {
  --bs-btn-bg: #fff;
}

body .btn-outline-primary {
  --bs-btn-color: #0064b1;
  --bs-btn-border-color: #86b4d5;
  --bs-btn-hover-bg: #0064b1;
  --bs-btn-hover-border-color: #005b9e;
  --bs-btn-active-bg: #004b87;
  --bs-btn-active-border-color: #004578;
  --bs-btn-focus-shadow-rgb: 0, 100, 177;
  --bs-btn-disabled-color: #567086;
  --bs-btn-disabled-border-color: #b4c5d3;
}

@media (hover: hover) {
  body .btn:where(:not(.btn-link)):hover:where(:not(:disabled, .disabled, [aria-disabled="true"])) {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 3px 8px rgba(24, 50, 79, .2);
  }
}

body .btn:where(:not(.btn-link)):is(:active, .active, .show),
body .btn-check:checked + .btn:where(:not(.btn-link)) {
  box-shadow: inset 0 2px 4px rgba(12, 38, 62, .18), inset 0 1px 0 rgba(255, 255, 255, .15);
}

body .btn:where(:not(.btn-link)):active:where(:not(:disabled, .disabled, [aria-disabled="true"])) {
  transform: translateY(1px);
}

body .btn:where(:not(.btn-link)):focus-visible,
body .btn-check:focus-visible + .btn:where(:not(.btn-link)) {
  outline: 2px solid #0064b1;
  outline-offset: 3px;
  box-shadow: var(--piaf-button-shadow);
}

body .btn:where(:not(.btn-link)):is(:disabled, .disabled, [aria-disabled="true"]),
body fieldset:disabled .btn:where(:not(.btn-link)),
body .btn-check:disabled + .btn:where(:not(.btn-link)) {
  background-image: none;
  box-shadow: none;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  body .btn:where(:not(.btn-link)) {
    transition: none;
  }

  body .btn:where(:not(.btn-link)):active {
    transform: none;
  }
}

@media (forced-colors: active) {
  body .btn:where(:not(.btn-link)) {
    background-image: none;
    box-shadow: none;
  }

  body .btn:focus-visible,
  body .btn-check:focus-visible + .btn {
    outline-color: Highlight;
  }
}
