/* ============================================================
   BASE — Tous les boutons héritent de .btn
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  font-family: var(--font-corps);
  font-weight: 500;
  font-size: 14px;

  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;

  border: 1px solid transparent;
  background: transparent;
  text-decoration: none;
  box-shadow: none;
}

.btn[hidden] {
  display: none !important;
}

/* ============================================================
   BTN — État disabled universel
   ============================================================ */

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

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

/* ============================================================
   Bouton principal
   ============================================================ */

.btn-primary,
.btn-primaire {
  background: var(--c-primaire);
  color: var(--c-primaire-contrast);
  border-color: var(--c-primaire);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  padding: 8px 16px;
  font-family: var(--font-corps);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary:hover,
.btn-primaire:hover {
  background: var(--c-primaire-hover);
  border-color: var(--c-primaire-hover);
}

.btn-primary:active,
.btn-primaire:active {
  transform: scale(0.98);
}

/* ============================================================
   Bouton avec surbrillance
   ============================================================ */

.btn-surbrillance {
  background: var(--c-accent);
  color: var(--c-accent-contrast);
  border: 1px solid color-mix(in srgb, var(--c-accent) 82%, var(--c-primaire));
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 22%, transparent);
  box-sizing: border-box;
  padding: 8px 16px;
  font-family: var(--font-corps);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease;
}

.btn-surbrillance:hover {
  background: var(--c-accent-hover);
  border-color: var(--c-accent-hover);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-accent) 30%, transparent);
}

.btn-surbrillance:active {
  transform: scale(0.98);
}

.btn-surbrillance:focus-visible {
  outline: 2px solid var(--c-accent-hover);
  outline-offset: 2px;
}

/* ============================================================
   Bouton secondaire (neutre) — style complet
   ============================================================ */
.btn-secondaire {
  background: var(--c-surface-1);
  color: var(--c-texte);
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  padding: 8px 16px;
  font-family: var(--font-corps);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-secondaire:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-border-strong);
}

/* ============================================================
   Bouton tableau
   ============================================================ */

.btn-table {
  font-family: var(--font-corps);
  font-size: 12.5px;
  font-weight: 500;

  padding: 4px 10px;

  border-radius: var(--radius-sm);
  box-shadow: none;

  background: var(--c-surface-2);
  color: var(--c-texte);
  border: 1px solid var(--c-border-subtle);
}

.btn-table:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-border-strong);
}

/* ============================================================
   Bouton danger
   ============================================================ */

.btn-danger {
  background: var(--c-danger);
  color: white;
  border: 1px solid var(--c-danger);
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--c-danger) 12%, var(--c-surface-1));
  border-color: var(--c-danger);
  color: var(--c-danger);
}
/* ============================================================
   Bouton icône
   ============================================================ */

.btn-icon {
  padding: 6px;
  box-shadow: none;
  background: transparent;
}

.btn-icon:hover {
  background: var(--c-surface-hover);
}

/* ============================================================
   BOUTON GÉNÉRATEUR IA
   ============================================================ */

.btn-generateur {
  background: var(--c-accent);
  color: var(--c-accent-contrast);
  border: 1px solid var(--c-accent);
  padding: 10px 20px;
}

.btn-generateur:hover {
  background: var(--c-accent-hover);
}

.btn-generateur .icon-flash {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: currentColor;
  opacity: 0.95;
}

.btn-generateur:hover .icon-flash {
  animation: flash-buzz 0.18s linear;
}

@keyframes flash-buzz {
  0% { transform: translateX(0); }
  33% { transform: translateX(-1px); }
  66% { transform: translateX(1px); }
  100% { transform: translateX(0); }
}

/* loading */

.btn-generateur[data-loading="true"] {
  opacity: 0.7;
  cursor: wait;
  position: relative;
}

.btn-generateur[data-loading="true"] .icon-flash {
  display: none;
}

.btn-generateur[data-loading="true"]::after {
  content: " ";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.5em;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   BOUTON IA SECONDAIRE
   ============================================================ */

.btn-generateur-secondaire {
  background-color: var(--c-bleu-100);
  color: var(--c-bleu-700);
  border: 1px solid var(--c-bleu-200);
}

.btn-generateur-secondaire:hover {
  background-color: var(--c-bleu-200);
}

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

/* ============================================================
   ACTION COMPOSÉE
   ============================================================ */

.action-composite {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;

  padding: 6px 12px 6px 42px;
  border: 1px solid var(--c-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--c-surface-1);
  cursor: pointer;

  font-family: var(--font-corps);
  font-size: 15px;
  color: var(--c-texte);
  text-decoration: none;
}

.action-composite:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-border-strong);
}

.action-composite::before {
  content: "+";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);

  width: 24px;
  height: 24px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 600;
  font-size: 16px;

  border-radius: 999px;
  background: var(--c-bleu-500);
  border: 1px solid var(--c-bleu-200);
  color: var(--c-bleu-600);
}

.action-composite .btn {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
#btn-ajouter-os-evaluation,
#btn-ajouter-contenus-evaluation {
  width: 0;
  height: 0;
  padding: 0;
  border: none;
  background: none;
  display: block;      /* nécessaire pour que le bouton existe et reçoive le clic */
  position: absolute;  /* positionné sur le bouton texte */
  left: 0; top: 0;     /* ou ajuster selon le container */
  opacity: 0;          /* totalement invisible */
  pointer-events: all; /* le clic fonctionne */
}

/* ============================================================
   Bouton suppression inline
   ============================================================ */

.btn-delete-inline {
  background: none;
  border: none;
  color: var(--c-danger);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;

  padding: 6px 8px;
  line-height: 1;
  border-radius: 8px;

  opacity: 0.65;
  box-shadow: none;
}

.btn-delete-inline:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--c-danger) 10%, transparent);
}

.btn-delete-inline:focus-visible {
  opacity: 1;
  outline: 2px solid color-mix(in srgb, var(--c-danger) 50%, transparent);
  outline-offset: 2px;
}
/* ============================================================
   Bouton danger léger — version adoucie
   ============================================================ */
.btn-danger-light {
  background: color-mix(in srgb, var(--c-danger) 10%, var(--c-surface-1));
  color: var(--c-danger);
  border: 1px solid color-mix(in srgb, var(--c-danger) 32%, var(--c-border-subtle));
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  box-shadow: none;
}

.btn-danger-light:hover {
  background: color-mix(in srgb, var(--c-danger) 16%, var(--c-surface-1));
  border-color: color-mix(in srgb, var(--c-danger) 48%, var(--c-border-subtle));
}

.btn-danger-light:active {
  transform: scale(0.98);
}
/* ============================================================
   Bouton lien Planif
   ============================================================ */

.btn-link-planif {
  background: var(--c-bleu-100);
  border: 1px solid var(--c-bleu-200);
  border-radius: var(--radius-sm);

  padding: 4px 10px;

  font-family: var(--font-corps);
  font-size: 0.8rem;
  font-weight: 500;

  color: var(--c-bleu-800);
  cursor: pointer;
}

.btn-link-planif:hover {
  background: var(--c-bleu-200);
}

/* ============================================================
   Bouton Google
   ============================================================ */

.btn-google {
  background: var(--c-surface-1);
  color: var(--c-texte);
  border: 1px solid var(--c-border-subtle);

  width: 100%;
  margin-top: 10px;
  box-sizing: border-box;
  justify-content: center;
}

.btn-google:hover {
  background: var(--c-surface-hover);
  border-color: var(--c-border-strong);
}

/* ============================================================
   Bouton Facebook
   ============================================================ */

.btn-facebook {
  background: #1877f2;
  color: white;
  border: 1px solid #1877f2;
box-sizing: border-box;
  width: 100%;
  margin-top: 10px;
  justify-content: center;
}

.btn-facebook:hover {
  background: #166fe0;
}

/* ============================================================
   Séparateur login
   ============================================================ */

.auth-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--c-texte-muted);
  font-size: 13px;
}

.auth-separator::before,
.auth-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-border-subtle);
}

.auth-separator span {
  font-weight: 500;
}

/* ============================================================
   Bouton téléchargement
   ============================================================ */

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-download svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ============================================================
   Bouton d'évidence scintillant (jaune Planif)
   Pour une action clé qui doit attirer l'œil (ex. : publier).
   ============================================================ */

.btn-scintillant {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-accent);
  color: var(--c-accent-contrast);
  border: 1px solid color-mix(in srgb, var(--c-accent) 82%, var(--c-primaire));
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 22%, transparent);
  box-sizing: border-box;
  padding: 10px 22px;
  font-family: var(--font-corps);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease;
}

/* Reflet lumineux qui balaie le bouton en boucle.
   Utilise ::before (et non ::after) pour ne pas entrer en collision avec
   la bulle .tooltip[data-tooltip]::after quand un bouton cumule les deux. */
.btn-scintillant::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    color-mix(in srgb, #fff 72%, transparent) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  animation: btnScintillement 2.6s ease-in-out infinite;
  pointer-events: none;
}

.btn-scintillant:hover {
  background: var(--c-accent-hover);
  border-color: var(--c-accent-hover);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-accent) 32%, transparent);
}

.btn-scintillant:active {
  transform: scale(0.98);
}

.btn-scintillant:focus-visible {
  outline: 2px solid var(--c-accent-hover);
  outline-offset: 2px;
}

.btn-scintillant:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-scintillant:disabled::before {
  animation: none;
}

@keyframes btnScintillement {
  0%   { left: -75%; }
  55%  { left: 130%; }
  100% { left: 130%; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-scintillant::before {
    animation: none;
  }
}
