/* ================================================================
   CI6 Connect — charte commune des boutons
   Reprend la logique validée dans CI6 Cadres :
   - fond noir au repos ;
   - contour de la couleur dominante du bloc ;
   - survol / sélection : rendu « pierre précieuse » de la même couleur ;
   - géométrie compacte et uniforme.
   Les tuiles de navigation et les entêtes repliables de l'administration
   ne sont volontairement pas concernés.
   ================================================================ */

:root {
  --ci6-btn-black:#101418;
  --ci6-btn-black-2:#1a2127;
  --ci6-btn-text:#f8fafc;

  --ci6-gold-border:#e4bb52;
  --ci6-gold-1:#5d4108;
  --ci6-gold-2:#a97810;
  --ci6-gold-3:#f0cf61;
  --ci6-gold-glow:rgba(228,187,82,.42);

  --ci6-blue-border:#5bb8ef;
  --ci6-blue-1:#0f3557;
  --ci6-blue-2:#1d5f90;
  --ci6-blue-3:#39a0e0;
  --ci6-blue-glow:rgba(91,184,239,.42);

  --ci6-silver-border:#dbe3e9;
  --ci6-silver-1:#69737c;
  --ci6-silver-2:#b0b8c0;
  --ci6-silver-3:#f4f7f9;
  --ci6-silver-glow:rgba(230,236,240,.34);

  --ci6-ruby-border:#e05a70;
  --ci6-ruby-1:#4c0712;
  --ci6-ruby-2:#8f1427;
  --ci6-ruby-3:#d83b50;
  --ci6-ruby-glow:rgba(222,56,82,.44);

  --ci6-emerald-border:#50d29b;
  --ci6-emerald-1:#063b28;
  --ci6-emerald-2:#08734a;
  --ci6-emerald-3:#22b878;
  --ci6-emerald-glow:rgba(55,210,151,.42);

  --ci6-orange-border:#f0aa55;
  --ci6-orange-1:#55300a;
  --ci6-orange-2:#a85f14;
  --ci6-orange-3:#ee9c3b;
  --ci6-orange-glow:rgba(238,156,59,.42);

  --ci6-yellow-border:#e5c95b;
  --ci6-yellow-1:#55430a;
  --ci6-yellow-2:#9a7b18;
  --ci6-yellow-3:#e4c94f;
  --ci6-yellow-glow:rgba(229,201,91,.42);

  --ci6-bordeaux-border:#d994a7;
  --ci6-bordeaux-1:#421923;
  --ci6-bordeaux-2:#7f3448;
  --ci6-bordeaux-3:#c16881;
  --ci6-bordeaux-glow:rgba(217,148,167,.38);

  --ci6-amethyst-border:#c79add;
  --ci6-amethyst-1:#34203b;
  --ci6-amethyst-2:#694277;
  --ci6-amethyst-3:#a36db3;
  --ci6-amethyst-glow:rgba(199,154,221,.38);

  /* Par défaut, Connect reste dans sa dominante or. */
  --ci6-button-border:var(--ci6-gold-border);
  --ci6-button-jewel-1:var(--ci6-gold-1);
  --ci6-button-jewel-2:var(--ci6-gold-2);
  --ci6-button-jewel-3:var(--ci6-gold-3);
  --ci6-button-glow:var(--ci6-gold-glow);
}

/* Boutons de commande uniquement : les grandes tuiles restent intactes. */
:where(
  button:not(.tile):not(.child-nav-tile):not(.admin-section-toggle):not(.admin-launcher-button):not(.rubrique-row):not(.rubrique-domain-head),
  a.button,
  .back-btn,
  .primary-button,
  .secondary-button,
  .account-action-button,
  .show-field-button,
  .download-credentials-button,
  .collective-access-button,
  .training-danger-button
) {
  min-height:31px !important;
  padding:6px 10px !important;
  border:1px solid var(--ci6-button-border) !important;
  border-radius:8px !important;
  background:
    linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,0) 45%),
    linear-gradient(180deg,var(--ci6-btn-black-2),var(--ci6-btn-black)) !important;
  color:var(--ci6-btn-text) !important;
  font-size:12.5px !important;
  line-height:1.15 !important;
  font-weight:800 !important;
  text-shadow:0 1px 0 rgba(0,0,0,.38) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    inset 0 -1px 0 rgba(0,0,0,.45),
    0 0 0 1px rgba(11,23,34,.50),
    0 7px 16px rgba(0,0,0,.20) !important;
  transition:background .18s ease,border-color .18s ease,box-shadow .18s ease,transform .14s ease,color .18s ease !important;
}

:where(
  button:not(.tile):not(.child-nav-tile):not(.admin-section-toggle):not(.admin-launcher-button):not(.rubrique-row):not(.rubrique-domain-head),
  a.button,
  .back-btn,
  .primary-button,
  .secondary-button,
  .account-action-button,
  .show-field-button,
  .download-credentials-button,
  .collective-access-button,
  .training-danger-button
):not(:disabled):is(:hover,:focus-visible,.active,[aria-pressed="true"]) {
  background:
    radial-gradient(circle at 22% 18%,rgba(255,255,255,.34),transparent 27%),
    radial-gradient(circle at 78% 78%,rgba(255,255,255,.13),transparent 25%),
    linear-gradient(145deg,var(--ci6-button-jewel-1) 0%,var(--ci6-button-jewel-2) 55%,var(--ci6-button-jewel-3) 100%) !important;
  border-color:var(--ci6-button-border) !important;
  color:#fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.20),
    inset 0 -1px 0 rgba(0,0,0,.32),
    0 0 0 1px rgba(10,25,35,.35),
    0 0 15px var(--ci6-button-glow),
    0 9px 20px rgba(0,0,0,.26) !important;
  transform:translateY(-1px) !important;
}

:where(button:not(.tile):not(.child-nav-tile):not(.admin-section-toggle):not(.admin-launcher-button):not(.rubrique-row):not(.rubrique-domain-head),a.button):disabled {
  opacity:.45 !important;
  cursor:not-allowed !important;
  transform:none !important;
}

a.button { text-decoration:none !important; }

/* Boutons de l'entête Administration : dominante argent. */
.header .actions {
  --ci6-button-border:var(--ci6-silver-border);
  --ci6-button-jewel-1:var(--ci6-silver-1);
  --ci6-button-jewel-2:var(--ci6-silver-2);
  --ci6-button-jewel-3:var(--ci6-silver-3);
  --ci6-button-glow:var(--ci6-silver-glow);
}
.header .actions :is(button,a.button):is(:hover,:focus-visible,.active) {
  color:#11161b !important;
  text-shadow:none !important;
}

/* Administration : les commandes héritent de la couleur du panneau. */
.admin-theme-accounts {
  --ci6-button-border:var(--ci6-blue-border);
  --ci6-button-jewel-1:var(--ci6-blue-1);
  --ci6-button-jewel-2:var(--ci6-blue-2);
  --ci6-button-jewel-3:var(--ci6-blue-3);
  --ci6-button-glow:var(--ci6-blue-glow);
}
.admin-theme-access {
  --ci6-button-border:var(--ci6-bordeaux-border);
  --ci6-button-jewel-1:var(--ci6-bordeaux-1);
  --ci6-button-jewel-2:var(--ci6-bordeaux-2);
  --ci6-button-jewel-3:var(--ci6-bordeaux-3);
  --ci6-button-glow:var(--ci6-bordeaux-glow);
}
.admin-theme-sanctions {
  --ci6-button-border:var(--ci6-orange-border);
  --ci6-button-jewel-1:var(--ci6-orange-1);
  --ci6-button-jewel-2:var(--ci6-orange-2);
  --ci6-button-jewel-3:var(--ci6-orange-3);
  --ci6-button-glow:var(--ci6-orange-glow);
}
.admin-theme-promotion {
  --ci6-button-border:var(--ci6-emerald-border);
  --ci6-button-jewel-1:var(--ci6-emerald-1);
  --ci6-button-jewel-2:var(--ci6-emerald-2);
  --ci6-button-jewel-3:var(--ci6-emerald-3);
  --ci6-button-glow:var(--ci6-emerald-glow);
}

/* Une action destructive reste rouge, même dans un panneau vert/bleu. */
:is(.training-danger-button,.delete-account,.fiche-editor-button.danger) {
  --ci6-button-border:var(--ci6-ruby-border);
  --ci6-button-jewel-1:var(--ci6-ruby-1);
  --ci6-button-jewel-2:var(--ci6-ruby-2);
  --ci6-button-jewel-3:var(--ci6-ruby-3);
  --ci6-button-glow:var(--ci6-ruby-glow);
}

/* Les petits boutons d'affichage de mot de passe restent compacts. */
:is(.show-field-button,.show-password,.toggle-password) {
  min-height:28px !important;
  padding:4px 8px !important;
  font-size:11.5px !important;
}

/* Bouton natif de sélection de fichier : même logique visuelle. */
input[type="file"]::file-selector-button {
  margin-right:9px;
  padding:5px 9px;
  border:1px solid var(--ci6-button-border);
  border-radius:7px;
  background:linear-gradient(180deg,var(--ci6-btn-black-2),var(--ci6-btn-black));
  color:#fff;
  font-weight:800;
  cursor:pointer;
}
input[type="file"]::file-selector-button:hover {
  background:linear-gradient(145deg,var(--ci6-button-jewel-1),var(--ci6-button-jewel-2) 55%,var(--ci6-button-jewel-3));
}
