/*
 * Charte TCS appliquée au thème Sneat (Bootstrap 5).
 * Sneat lit --bs-primary : on le remplace, les variantes (survol, actif) sont calculées par le thème.
 * À charger APRÈS vendor/css/core.css.
 * Le vert du logo (#028A02) offre 4,5:1 avec du texte blanc : il sert directement aux boutons et liens.
 */
:root {
  --tcs-logo: #028a02;
  --tcs-primary: #028a02;
  --tcs-primary-dark: #016601;
  --tcs-tint: #e6f4e6;

  --bs-primary: var(--tcs-primary);
  --bs-primary-rgb: 2, 138, 2;
  --bs-primary-contrast: #fff;
  --bs-primary-text-emphasis: var(--tcs-primary-dark);
  --bs-primary-bg-subtle: var(--tcs-tint);
  --bs-primary-border-subtle: #b3dbb3;
  --bs-link-color: var(--tcs-primary);
  --bs-link-color-rgb: 2, 138, 2;
  --bs-link-hover-color: var(--tcs-primary-dark);
  --bs-link-hover-color-rgb: 1, 102, 1;
}

.btn-primary {
  --bs-btn-bg: var(--tcs-primary);
  --bs-btn-border-color: var(--tcs-primary);
  --bs-btn-hover-bg: var(--tcs-primary-dark);
  --bs-btn-hover-border-color: var(--tcs-primary-dark);
  --bs-btn-active-bg: var(--tcs-primary-dark);
  --bs-btn-active-border-color: var(--tcs-primary-dark);
  --bs-btn-disabled-bg: var(--tcs-primary);
  --bs-btn-disabled-border-color: var(--tcs-primary);
}

.form-check-input:checked,
.form-switch .form-check-input:checked {
  background-color: var(--tcs-primary);
  border-color: var(--tcs-primary);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--tcs-primary);
  box-shadow: 0 0 0 0.2rem rgba(2, 138, 2, 0.15);
}

/* Logo dans la barre latérale */
.app-brand-logo img,
.tcs-logo {
  height: 40px;
  width: auto;
  display: block;
}

/*
 * Lisibilité des messages et des étiquettes d'état.
 * Le thème écrit les textes d'alerte et d'étiquette dans la couleur vive de l'état (contraste de 1,6:1
 * pour le vert sur fond pâle) : on les remplace par des teintes foncées (6:1 et plus).
 */
.alert-success, .alert-success .alert-heading { --bs-alert-color: #1b5e10; --bs-alert-link-color: #1b5e10; color: #1b5e10; }
.alert-warning, .alert-warning .alert-heading { --bs-alert-color: #7a4f00; --bs-alert-link-color: #7a4f00; color: #7a4f00; }
.alert-danger,  .alert-danger  .alert-heading { --bs-alert-color: #a3200b; --bs-alert-link-color: #a3200b; color: #a3200b; }
.alert-info,    .alert-info    .alert-heading { --bs-alert-color: #0b5e73; --bs-alert-link-color: #0b5e73; color: #0b5e73; }

.bg-label-success   { color: #1b5e10 !important; }
.bg-label-warning   { color: #7a4f00 !important; }
.bg-label-danger    { color: #a3200b !important; }
.bg-label-info      { color: #0b5e73 !important; }
.bg-label-secondary { color: #4a5568 !important; }
.bg-label-primary   { color: var(--tcs-primary-dark) !important; }
.text-danger { color: #a3200b !important; }

/* Boutons gris (secondaires) : texte foncé, le gris du thème est trop clair sur son fond (2,7:1). */
.btn-label-secondary { --bs-btn-color: #4a5568; --bs-btn-hover-color: #2d3748; --bs-btn-active-color: #2d3748; color: #4a5568; }
.btn-label-secondary:hover, .btn-label-secondary:focus { color: #2d3748; }
.text-body-secondary { color: #5b6677 !important; }
