/* Bandeau de consentement aux cookies : site public et outil (feuille autonome, mêmes couleurs que le site). */
.nu-cookie {
  --ck-bg: #0B241D; --ck-line: #163B30; --ck-text: #F5F4EA; --ck-muted: #C9D3CF; --ck-accent: #DCFA56; --ck-accent-hover: #D0F23A;
  position: fixed; inset: auto 0 0 0; z-index: 2000;
  display: flex; justify-content: center; padding: 16px;
  pointer-events: none;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.nu-cookie[hidden] { display: none; }
.nu-cookie__card {
  pointer-events: auto;
  width: min(100%, 720px);
  background: var(--ck-bg); color: var(--ck-text);
  border: 1px solid var(--ck-line); border-radius: 10px;
  box-shadow: 0 18px 48px rgba(7, 27, 22, .35);
  padding: 20px 22px;
  animation: nu-cookie-in .45s cubic-bezier(.2, .8, .2, 1) both;
}
.nu-cookie.is-leaving .nu-cookie__card { animation: nu-cookie-out .3s ease-in both; }
@keyframes nu-cookie-in { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes nu-cookie-out { to { opacity: 0; transform: translateY(16px); } }
[data-cookie-view] { animation: nu-cookie-fade .25s ease both; }
@keyframes nu-cookie-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.nu-cookie__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.nu-cookie__icon { color: var(--ck-accent); flex: none; }
.nu-cookie__title { margin: 0; font-family: "Inter Tight", "Inter", system-ui, sans-serif; font-size: 1.125rem; font-weight: 700; color: var(--ck-text); }
.nu-cookie__text { margin: 0 0 14px; font-size: .875rem; line-height: 1.55; color: var(--ck-muted); }
.nu-cookie__link { color: var(--ck-accent); text-decoration: underline; text-underline-offset: 2px; }
.nu-cookie__link:hover { color: var(--ck-accent-hover); }

.nu-cookie__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
/* « Tout refuser » et « Tout accepter » ont exactement le même poids visuel (recommandation CNIL) */
.nu-cookie__btn {
  min-height: 44px; padding: 10px 18px; border-radius: 6px; cursor: pointer;
  font: 600 .875rem/1.2 "Inter", system-ui, sans-serif;
  background: var(--ck-accent); color: #0B241D; border: 1px solid var(--ck-accent);
  transition: background-color .2s, transform .15s, border-color .2s;
}
.nu-cookie__btn:hover { background: var(--ck-accent-hover); border-color: var(--ck-accent-hover); transform: translateY(-1px); }
.nu-cookie__btn:active { transform: none; }
.nu-cookie__btn--ghost { background: transparent; color: var(--ck-text); border-color: #3E5F54; }
.nu-cookie__btn--ghost:hover { background: rgba(245, 244, 234, .08); border-color: var(--ck-muted); }
.nu-cookie__btn:focus-visible, .nu-cookie__link:focus-visible, .nu-cookie__switch input:focus-visible + span { outline: 2px solid var(--ck-accent); outline-offset: 2px; }

.nu-cookie__list { list-style: none; margin: 4px 0 16px; padding: 0; }
.nu-cookie__item { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--ck-line); }
.nu-cookie__name { margin: 0 0 2px; font-weight: 600; font-size: .9375rem; color: var(--ck-text); }
.nu-cookie__desc { margin: 0; font-size: .8125rem; line-height: 1.5; color: var(--ck-muted); }

/* interrupteur */
.nu-cookie__switch { position: relative; flex: none; width: 46px; height: 26px; margin-top: 2px; cursor: pointer; }
.nu-cookie__switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.nu-cookie__switch input + span { position: absolute; inset: 0; border-radius: 999px; background: #3E5F54; transition: background-color .2s; }
.nu-cookie__switch input + span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--ck-text); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.nu-cookie__switch input:checked + span { background: var(--ck-accent); }
.nu-cookie__switch input:checked + span::after { transform: translateX(20px); background: #0B241D; }
.nu-cookie__switch input:disabled { cursor: not-allowed; }
.nu-cookie__switch input:disabled + span { opacity: .7; }

.nu-cookie__sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* lien « Gérer les cookies » (pied de page), présenté comme un lien */
.nu-cookie-manage { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: inherit; }
.nu-cookie-manage:hover { text-decoration: underline; }

@media (max-width: 575.98px) {
  .nu-cookie { padding: 10px; }
  .nu-cookie__card { padding: 16px; max-height: calc(100vh - 20px); overflow-y: auto; }
  .nu-cookie__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .nu-cookie__actions .nu-cookie__btn--ghost { grid-column: 1 / -1; order: 3; }
}
@media (prefers-reduced-motion: reduce) {
  .nu-cookie__card, .nu-cookie.is-leaving .nu-cookie__card, [data-cookie-view] { animation: none; }
  .nu-cookie__btn, .nu-cookie__switch span, .nu-cookie__switch span::after { transition: none; }
}
