/* ============================================================================
   CAPRICE DESIGN SYSTEM — BUTTONS
   Version: 1.0.0
   Premium • Sobre • Actions claires • Hiérarchie visuelle évidente
   ============================================================================ */

/* ============================================================================
   BASE COMMUNE — TOUS LES BOUTONS
   ============================================================================ */

.btn,
a.btn,
a.btn:link,
a.btn:visited,
a.btn:hover,
a.btn:active {
  /* Structure */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  /* Taille */
  padding: 14px 32px;
  min-height: 48px;

  /* Typographie */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  white-space: nowrap;

  /* Forme */
  border-radius: 12px;
  border: none;

  /* Comportement */
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;

  /* Anti-aliasing */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   ACTIONS POSITIVES (PRIMARY)
   Valider • Commander • Accéder • Confirmer • Continuer
   ============================================================================ */

.btn-primary,
a.btn-primary,
a.btn-primary:link,
a.btn-primary:visited {
  background: linear-gradient(135deg, var(--rose-fuchsia), var(--rouge-passion));
  color: #fff !important;
  border: none;
  box-shadow: 0 4px 12px rgba(255, 62, 181, 0.3);
}

.btn-primary:hover,
a.btn-primary:hover,
a.btn-primary:active {
  background: linear-gradient(135deg, #ff4ec0, #f0005a);
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 62, 181, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 62, 181, 0.4);
}

.btn-primary:focus-visible {
  outline: 3px solid rgba(255, 62, 181, 0.5);
  outline-offset: 2px;
}

/* ============================================================================
   ACTIONS NÉGATIVES (NEGATIVE)
   Annuler • Refuser • Non • Fermer • Retour
   ============================================================================ */

.btn-negative {
  background: transparent;
  border: 2px solid var(--gris-perle);
  color: var(--gris-perle);
  box-shadow: none;
}

.btn-negative:hover {
  background: rgba(182, 182, 182, 0.1);
  border-color: var(--blanc-pur);
  color: var(--blanc-pur);
  transform: translateY(-1px);
}

.btn-negative:active {
  transform: translateY(0);
  background: rgba(182, 182, 182, 0.15);
}

.btn-negative:focus-visible {
  outline: 3px solid rgba(182, 182, 182, 0.5);
  outline-offset: 2px;
}

/* ============================================================================
   ACTIONS SECONDAIRES (SECONDARY)
   Actions importantes mais moins prioritaires que PRIMARY
   ============================================================================ */

.btn-secondary {
  background: rgba(255, 62, 181, 0.15);
  border: 2px solid rgba(255, 62, 181, 0.4);
  color: var(--blanc-pur);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 62, 181, 0.25);
  border-color: rgba(255, 62, 181, 0.6);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
  background: rgba(255, 62, 181, 0.3);
}

.btn-secondary:focus-visible {
  outline: 3px solid rgba(255, 62, 181, 0.5);
  outline-offset: 2px;
}

/* ============================================================================
   ÉTAT DÉSACTIVÉ — TOUS LES BOUTONS
   ============================================================================ */

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================================================
   VARIANTES DE TAILLE
   ============================================================================ */

.btn-small {
  padding: 10px 20px;
  min-height: 40px;
  font-size: 14px;
  border-radius: 10px;
}

.btn-large {
  padding: 18px var(--page-side-padding);
  min-height: 56px;
  font-size: 18px;
  border-radius: 14px;
}

/* ============================================================================
   BOUTONS PLEINE LARGEUR
   ============================================================================ */

.btn-block {
  display: flex;
  width: 100%;
}

/* ============================================================================
   BOUTONS ICONIQUES (icône seule, pas de texte)
   ============================================================================ */

.btn-icon {
  padding: 12px;
  min-height: 48px;
  width: 48px;
  gap: 0;
}

.btn-icon.btn-small {
  padding: 8px;
  min-height: 40px;
  width: 40px;
}

.btn-icon.btn-large {
  padding: 16px;
  min-height: 56px;
  width: 56px;
}

/* ============================================================================
   GROUPE DE BOUTONS
   ============================================================================ */

.btn-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-group .btn {
  flex: 1;
  min-width: max-content;
}

/* ============================================================================
   RESPONSIVE — MOBILE
   ============================================================================ */

@media (max-width: 768px) {
  .btn {
    padding: 12px 24px;
    min-height: 44px;
    font-size: 15px;
  }

  .btn-small {
    padding: 8px 16px;
    min-height: 36px;
    font-size: 13px;
  }

  .btn-large {
    padding: 14px 32px;
    min-height: 52px;
    font-size: 16px;
  }

  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    width: 100%;
  }
}

/* ============================================================================
   ÉTATS DE CHARGEMENT (optionnel)
   ============================================================================ */

.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
