/* Boutons et liens d'action (resources/views/components/bouton.blade.php). Tokens seulement.
   Les classes .est-survole et .est-focalise reproduisent les états pour la planche des composants.
   Chaque survol redonne la couleur du texte : sur un bouton rendu en <a>, la règle a:hover de
   base.css (plus spécifique que .bouton--…) l'emporterait sinon. */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  height: var(--control-height);
  padding: 0 var(--btn-pad-x);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-none);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.bouton--compacte {
  height: var(--control-height-compact);
  font-size: var(--text-body-sm);
}

.bouton--pleine-largeur {
  width: 100%;
}

/* Principal */
.bouton--principal {
  background: var(--color-terracotta);
  border-color: var(--color-terracotta);
  color: var(--color-white);
}

.bouton--principal:hover,
.bouton--principal.est-survole {
  background: var(--color-terracotta-dark);
  border-color: var(--color-terracotta-dark);
  color: var(--color-white);
}

/* Secondaire */
.bouton--secondaire {
  background: var(--color-bg-white);
  border-color: var(--color-border);
  color: var(--color-text);
}

.bouton--secondaire:hover,
.bouton--secondaire.est-survole {
  background: var(--color-bg);
  color: var(--color-text);
}

/* Destructif : bordure et texte rouges ; plein pour la confirmation définitive */
.bouton--destructif {
  background: var(--color-bg-white);
  border-color: var(--color-error);
  color: var(--color-error);
}

.bouton--destructif:hover,
.bouton--destructif.est-survole {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.bouton--destructif-plein,
.bouton--destructif-plein:hover {
  background: var(--color-error);
  border-color: var(--color-error);
  color: var(--color-white);
}

/* Liens d'action : soulignés, zone tactile de 44 px */
.bouton--lien,
.bouton--lien-destructif {
  height: auto;
  min-height: var(--tap-target);
  padding: 0 var(--space-1);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: var(--text-body-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: normal;
}

.bouton--lien {
  color: var(--color-terracotta);
}

.bouton--lien:hover,
.bouton--lien.est-survole {
  color: var(--color-terracotta-dark);
}

.bouton--lien-destructif {
  color: var(--color-error);
}

.bouton--lien-destructif:hover,
.bouton--lien-destructif.est-survole {
  color: var(--color-terracotta-dark);
}

/* États */
.bouton:focus-visible,
.bouton.est-focalise {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.bouton:disabled,
.bouton[aria-disabled='true'] {
  opacity: 0.6;
  cursor: default;
  pointer-events: none;
}

.bouton[aria-busy='true'] {
  cursor: progress;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .bouton {
    transition: none;
  }
}
