/* Cookie consent banner. Owned by assets/js/public/website/cookie-consent.js */

.tp-consent {
  position: fixed;
  z-index: 100000;
  left: clamp(12px, 3vw, 24px);
  bottom: clamp(12px, 3vw, 24px);
  /* Desktop: a compact card bottom-left, clear of the WhatsApp button. */
  width: min(560px, calc(100vw - 24px));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 16px;
  border: 1px solid var(--tp-line, #E7E0D4);
  border-radius: var(--tp-card-radius, 18px);
  background: var(--tp-surface, #fff);
  color: var(--tp-ink, #0B2239);
  box-shadow: var(--tp-shadow-xl, 0 20px 46px rgba(15, 27, 45, 0.16));
  font-family: var(--tp-body-font, "Inter", system-ui, sans-serif);
  animation: tp-consent-in 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tp-consent.is-leaving {
  animation: tp-consent-out 180ms ease forwards;
}

.tp-consent__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--tp-slate, #3A4A57);
}

.tp-consent__link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  color: var(--tp-accent-text, #066D79);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.tp-consent__link:hover {
  color: var(--tp-ink, #0B2239);
}

.tp-consent__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.tp-consent__btn {
  min-height: 44px;
  min-width: 120px;
  padding: 0 20px;
  border-radius: var(--tp-control-radius, 12px);
  font: 600 15px/1 var(--tp-action-font, "Inter", system-ui, sans-serif);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.tp-consent__btn--secondary {
  border: 1px solid var(--tp-ink, #0B2239);
  background: transparent;
  color: var(--tp-ink, #0B2239);
}

.tp-consent__btn--secondary:hover {
  background: var(--tp-cream, #F1ECE3);
}

.tp-consent__btn--primary {
  border: 1px solid var(--tp-action, #087C89);
  background: var(--tp-action, #087C89);
  color: var(--tp-on-primary, #fff);
}

.tp-consent__btn--primary:hover {
  border-color: var(--tp-action-hover, #066D79);
  background: var(--tp-action-hover, #066D79);
}

.tp-consent__btn:focus-visible,
.tp-consent__link:focus-visible {
  outline: 3px solid var(--tp-cyan, #1BBACA);
  outline-offset: 2px;
}

/* Details popup: « En savoir plus » and « Gérer mes cookies ». */
html.tp-consent-locked,
html.tp-consent-locked body {
  overflow: hidden;
}

.tp-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: grid;
  place-items: center;
  padding: 16px;
}

.tp-consent-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 34, 57, 0.55);
  animation: tp-consent-fade 200ms ease;
}

.tp-consent-modal__panel {
  position: relative;
  box-sizing: border-box;
  width: min(560px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px;
  border-radius: var(--tp-r-card-lg, 20px);
  background: var(--tp-surface, #fff);
  color: var(--tp-ink, #0B2239);
  box-shadow: var(--tp-shadow-xl, 0 20px 46px rgba(15, 27, 45, 0.16));
  font-family: var(--tp-body-font, "Inter", system-ui, sans-serif);
  animation: tp-consent-pop 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tp-consent-modal.is-leaving .tp-consent-modal__backdrop,
.tp-consent-modal.is-leaving .tp-consent-modal__panel {
  animation: tp-consent-fade-out 180ms ease forwards;
}

.tp-consent-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--tp-muted, #5C6B79);
  font-size: 16px;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.tp-consent-modal__close:hover {
  background: var(--tp-cream, #F1ECE3);
  color: var(--tp-ink, #0B2239);
}

.tp-consent-modal__title {
  margin: 0 48px 8px 0;
  font: 700 24px/1.2 var(--tp-heading-font, "Bricolage Grotesque", system-ui, sans-serif);
  color: var(--tp-ink, #0B2239);
}

.tp-consent-modal__intro {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--tp-slate, #3A4A57);
}

.tp-consent-modal__list {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.tp-consent-modal__item {
  padding: 12px 14px;
  border: 1px solid var(--tp-line, #E7E0D4);
  border-radius: var(--tp-control-radius, 12px);
  background: var(--tp-surface-2, #FBF9F5);
}

.tp-consent-modal__item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 4px;
  font-size: 15px;
}

/* The public theme resets <strong> to 400; category names stay bold. */
.tp-consent-modal__item-head strong {
  font-weight: 700;
  color: var(--tp-ink, #0B2239);
}

.tp-consent-modal__item p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tp-slate, #3A4A57);
}

.tp-consent-modal__badge {
  padding: 3px 10px;
  border-radius: var(--tp-r-pill, 11px);
  background: var(--tp-cyan-tint, #DDF6F8);
  color: var(--tp-accent-text, #066D79);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tp-consent-modal__badge.is-always {
  background: var(--tp-cream, #F1ECE3);
  color: var(--tp-slate, #3A4A57);
}

.tp-consent-modal__current {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--tp-slate, #3A4A57);
}

.tp-consent-modal__current strong {
  font-weight: 700;
  color: var(--tp-ink, #0B2239);
}

.tp-consent-modal__policy {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tp-accent-text, #066D79);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tp-consent-modal__close:focus-visible,
.tp-consent-modal__policy:focus-visible {
  outline: 3px solid var(--tp-cyan, #1BBACA);
  outline-offset: 2px;
}

/* « Gérer mes cookies » button on the privacy page. */
.tp-consent-manage {
  margin-top: 8px;
}

@media (max-width: 600px) {
  .tp-consent {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    padding: 16px;
    gap: 12px;
  }

  .tp-consent__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tp-consent__btn {
    min-width: 0;
  }

  .tp-consent-modal {
    align-items: end;
    padding: 0;
  }

  .tp-consent-modal__panel {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--tp-r-card-lg, 20px) var(--tp-r-card-lg, 20px) 0 0;
  }

  .tp-consent-modal__title {
    font-size: 20px;
  }
}

@keyframes tp-consent-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tp-consent-pop {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tp-consent-fade-out {
  to { opacity: 0; }
}

@keyframes tp-consent-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes tp-consent-out {
  to { opacity: 0; transform: translateY(12px); }
}

@media (prefers-reduced-motion: reduce) {
  .tp-consent,
  .tp-consent.is-leaving,
  .tp-consent-modal__backdrop,
  .tp-consent-modal__panel,
  .tp-consent-modal.is-leaving .tp-consent-modal__backdrop,
  .tp-consent-modal.is-leaving .tp-consent-modal__panel {
    animation: none;
  }

  .tp-consent__btn,
  .tp-consent-modal__close {
    transition: none;
  }
}
