/* ==========================================================================
   BUTTON COMPONENTS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  line-height: 1;
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  width: fit-content;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-loading {
  opacity: 0.8;
  cursor: wait;
}

.btn-spinner {
  display: block;
  width: 0.875em;
  height: 0.875em;
  border: 0.15em solid rgba(255, 255, 255, 0.4);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

/* Button Variants */
.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
}

.btn-ghost.text-error {
  background: white;
  border: 1px solid #fecaca;
  color: var(--error);
}

.btn-ghost.text-error:hover:not(:disabled) {
  background: white;
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-warning:hover:not(:disabled) {
  background: #d97706;
  border-color: #d97706;
  color: white;
}

/* Button Sizes */
.btn-xs {
  padding: var(--space-1) var(--space-2);
  font-size: 0.75rem;
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: 0.75rem;
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: 1rem;
}

/* Special Button Types */
.btn-icon {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.btn-icon:hover {
  background: white;
}

.btn-icon.text-error {
  color: #ef4444;
}

.btn-remove {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition);
}

.btn-remove:hover {
  background: #dc2626;
}

.btn-document-action {
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.25rem;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-document-action:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn-document-action.text-error {
  color: #ef4444;
}

.btn-document-action.text-error:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}
/* ==========================================================================
   PRICING TOGGLE (Devis / Méthode style pill switch)
   ========================================================================== */

.pricing-toggle {
    display: inline-flex;
    align-items: stretch;
    flex-shrink: 0;
    background: var(--bg-secondary, #f3f4f6);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius, 0.5rem);
    padding: 3px;
}

.pricing-toggle-pill { display: none; }

.pricing-toggle .toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
    border: none;
    background: transparent;
    color: var(--text-secondary, #6b7280);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: calc(var(--radius, 0.5rem) - 3px);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
}

.pricing-toggle .toggle-btn:hover:not(.active) {
    color: var(--text, #1f2937);
}

.pricing-toggle .toggle-btn.active {
    background: white;
    color: var(--primary, #667eea);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
}
