/* ================================================================
 * ProVsup Design System — pv-buttons.css
 * Boutons réutilisables.
 *
 * Classes :
 *   .pv-btn              — base commune (ne pas utiliser seul)
 *   .pv-btn-primary      — action principale (vert Autoprog #2FB84A)
 *   .pv-btn-accent       — action principale (couleur d'accentuation)
 *   .pv-btn-ghost        — action secondaire (contour, fond transparent)
 *   .pv-btn-ghost-dark   — action secondaire (fond sombre)
 *   .pv-btn-danger       — action destructive (rouge)
 *
 * Modificateurs :
 *   .pv-btn--rounded     — coins arrondis (r-md) sans être pill
 *
 * Usage : <button class="pv-btn pv-btn-accent pv-btn--rounded">...
 * ================================================================ */


/* ── Base ───────────────────────────────────────────────────────── */

.pv-theme .pv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  border: none;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background 0.14s, box-shadow 0.14s, opacity 0.14s, color 0.14s;
  line-height: 1;
}

.pv-theme .pv-btn:disabled,
.pv-theme .pv-btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

.pv-theme .pv-btn > i {
  font-size: 13px;
  flex: none;
}


/* ── Primaire (vert Autoprog) ───────────────────────────────────── */

.pv-theme .pv-btn-primary {
  background: #2FB84A;
  color: #ffffff;
  box-shadow: 0 1px 4px oklch(0.53 0.15 145 / 0.28);
}

.pv-theme .pv-btn-primary:hover {
  background: oklch(0.50 0.15 145);
  box-shadow: 0 2px 8px oklch(0.53 0.15 145 / 0.38);
  color: #ffffff;
}

.pv-theme .pv-btn-primary:active {
  background: oklch(0.46 0.15 145);
  box-shadow: none;
}


/* ── Ghost (contour) ────────────────────────────────────────────── */

.pv-theme .pv-btn-ghost {
  background: transparent;
  color: oklch(0.38 0 0);
  border: 1.5px solid oklch(0 0 0 / 0.15);
}

.pv-theme .pv-btn-ghost:hover {
  background: oklch(0 0 0 / 0.05);
  color: oklch(0.15 0 0);
  border-color: oklch(0 0 0 / 0.22);
}

.pv-theme .pv-btn-ghost:active {
  background: oklch(0 0 0 / 0.09);
}


/* ── Danger (rouge) ─────────────────────────────────────────────── */

.pv-theme .pv-btn-danger {
  background: oklch(0.55 0.20 20);
  color: #ffffff;
  box-shadow: 0 1px 4px oklch(0.55 0.20 20 / 0.30);
}

.pv-theme .pv-btn-danger:hover {
  background: oklch(0.50 0.22 20);
  box-shadow: 0 2px 8px oklch(0.55 0.20 20 / 0.38);
  color: #ffffff;
}

.pv-theme .pv-btn-danger:active {
  background: oklch(0.46 0.22 20);
  box-shadow: none;
}


/* ── Modificateur de forme ──────────────────────────────────────── */

.pv-theme .pv-btn--rounded {
  border-radius: var(--r-sm);
  height: 36px;
}


/* ── Accent (suit la couleur d'accentuation du site) ────────────── */

.pv-theme .pv-btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 4px var(--accent-ring);
}

.pv-theme .pv-btn-accent:hover {
  background: var(--accent-strong);
  box-shadow: 0 2px 8px var(--accent-ring);
  color: #fff;
}

.pv-theme .pv-btn-accent:active {
  background: var(--accent-strong);
  box-shadow: none;
}


/* ── Ghost sombre (fond sombre, ex: panneau Défauts) ────────────── */

.pv-theme .pv-btn-ghost-dark {
  background: oklch(1 0 0 / 0.07);
  color: oklch(1 0 0 / 0.65);
  border: 1.5px solid oklch(1 0 0 / 0.14);
}

.pv-theme .pv-btn-ghost-dark:hover {
  background: oklch(1 0 0 / 0.12);
  color: oklch(1 0 0 / 0.85);
  border-color: oklch(1 0 0 / 0.22);
}

.pv-theme .pv-btn-ghost-dark:active {
  background: oklch(1 0 0 / 0.18);
}


/* ── Dark mode — ghost ──────────────────────────────────────────── */

:root[data-theme="dark"] .pv-theme .pv-btn-ghost {
  color: var(--text-2);
  border-color: var(--border);
}

:root[data-theme="dark"] .pv-theme .pv-btn-ghost:hover {
  background: oklch(1 0 0 / 0.07);
  color: var(--text);
  border-color: var(--border-2);
}

:root[data-theme="dark"] .pv-theme .pv-btn-ghost:active {
  background: oklch(1 0 0 / 0.12);
}


/* ── Taille réduite ─────────────────────────────────────────────── */

.pv-theme .pv-btn--sm {
  padding: 4px 10px;
  font-size: 11.5px;
  height: auto;
  min-height: unset;
  gap: 5px;
}


/* ── Pleine largeur ─────────────────────────────────────────────── */

.pv-theme .pv-btn--full {
  width: 100%;
  justify-content: center;
}
