/* Bandeau de consentement (templates/partials/consent.html).
   Fichier autonome : les pages projet ne chargent ni variables.css ni
   components.css, d'où les valeurs de repli des jetons du design system. */
.consent {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9000;
  width: min(440px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  background: var(--color-white, #fff);
  color: var(--color-primary, #12001F);
  border-radius: var(--radius-2xl, 1.5rem);
  box-shadow: 0 30px 80px -20px rgba(18, 0, 31, 0.4);
  font-family: var(--font-primary, 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 0.875rem;
  line-height: 1.5;
  animation: consentIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.consent[hidden] { display: none; }
.consent::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: var(--radius-2xl, 1.5rem) var(--radius-2xl, 1.5rem) 0 0;
  background: var(--gradient-primary, linear-gradient(135deg, #8B4DFF, #F000B9, #D6BFFF));
}
.consent__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 800;
}
.consent__text {
  margin: 0 0 16px;
  color: var(--color-gray-600, #525252);
}
.consent__text a { color: var(--color-secondary, #8900FF); text-decoration: underline; }
.consent__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 16px;
}
.consent__options[hidden] { display: none; }
.consent__option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--color-gray-600, #525252);
  cursor: pointer;
}
.consent__option input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-secondary, #8900FF);
}
.consent__option strong {
  display: block;
  color: var(--color-primary, #12001F);
  font-weight: 600;
}
.consent__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.consent__link {
  margin-right: auto;
  padding: 8px 0;
  background: none;
  border: 0;
  color: var(--color-primary, #12001F);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
/* Même style pour « Tout refuser », « Tout accepter » et « Enregistrer » :
   aucun choix n'est mis en avant. */
.consent__btn {
  min-height: 44px;
  padding: 10px 20px;
  background: var(--color-primary, #12001F);
  color: var(--color-white, #fff);
  border: 0;
  border-radius: var(--radius-full, 9999px);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms ease;
}
.consent__btn:hover { background: #2a1040; }
.consent__btn[hidden], .consent__link[hidden] { display: none; }
.consent__btn:focus-visible, .consent__link:focus-visible {
  outline: 2px solid var(--color-secondary, #8900FF);
  outline-offset: 2px;
}
/* Sur téléphone, le bandeau ne doit pas cacher la page : bande basse compacte,
   « Tout refuser » et « Tout accepter » côte à côte, à égalité. */
@media (max-width: 600px) {
  .consent {
    left: 8px; bottom: 8px; width: calc(100% - 16px);
    padding: 14px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    font-size: 0.78rem; line-height: 1.4;
    max-height: 70vh;
  }
  .consent__title { font-size: 0.9rem; margin-bottom: 4px; }
  .consent__text { margin-bottom: 10px; }
  .consent__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .consent__link { grid-column: 1 / -1; order: 3; margin: 0 auto; padding: 4px 0; font-size: 0.78rem; }
  .consent__btn { min-height: 44px; padding: 8px 12px; width: 100%; }
}
@media (max-width: 380px), (max-height: 760px) and (max-width: 600px) {
  .consent { padding-top: 12px; font-size: 0.74rem; line-height: 1.35; }
  .consent__title { font-size: 0.85rem; }
  .consent__text { margin-bottom: 8px; }
  .consent__btn { min-height: 42px; }
}
@keyframes consentIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .consent { animation: none; }
}
