/**
 * Bandeau de consentement — Éco-Défis® PACA
 * Reprend les variables du thème ; les valeurs de repli correspondent à la charte.
 */

.ed-consent,
.ed-tally__placeholder {
  --ed-moyen: var(--vert-moyen, #2c6e49);
  --ed-rose: var(--rose, #e8356d);
  --ed-font: var(--font-corps, system-ui, -apple-system, "Segoe UI", sans-serif);
}

.ed-consent[hidden],
.ed-consent [hidden],
.ed-tally__placeholder[hidden] {
  display: none !important;
}

/* ---------- bandeau ---------- */
.ed-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  background: #fff;
  color: var(--ed-moyen);
  border-top: 4px solid var(--ed-moyen);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12);
  font-family: var(--ed-font);
  font-size: 1rem;
  line-height: 1.55;
}

.ed-consent:focus {
  outline: none;
}

.ed-consent:focus-visible {
  outline: 3px solid var(--ed-rose);
  outline-offset: -3px;
}

.ed-consent__inner {
  max-width: 62rem;
  margin: 0 auto;
}

.ed-consent__title {
  margin: 0 0 0.5rem;
  font-weight: 900;
  font-size: 1.15rem;
}

.ed-consent__text {
  margin: 0 0 1rem;
}

.ed-consent a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* ---------- panneau « Personnaliser » ---------- */
.ed-consent__panel {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.ed-consent__choice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(30, 61, 47, 0.25);
}

.ed-consent__choice:last-of-type {
  border-bottom: 1px solid rgba(30, 61, 47, 0.25);
  margin-bottom: 1rem;
}

.ed-consent__choice input[type="checkbox"] {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0.15rem 0 0;
  accent-color: var(--ed-moyen);
}

.ed-consent__choice label {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.ed-consent__choice label span {
  font-size: 0.95rem;
}

/* ---------- boutons : « Tout refuser » et « Tout accepter » strictement identiques ---------- */
.ed-consent__actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ed-btn {
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--ed-moyen, #1e3d2f);
  border-radius: 0.25rem;
  background: var(--ed-moyen, #1e3d2f);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: .5s;
}

.ed-btn:hover {
  background: #fff;
  color: var(--ed-moyen, #1e3d2f);
}

.ed-btn--ghost {
  background: #fff;
  color: var(--ed-moyen, #1e3d2f);
}

.ed-btn--ghost:hover {
  background: var(--ed-moyen, #1e3d2f);
  color: #fff;
}

.ed-btn:focus-visible,
.ed-linklike:focus-visible,
.ed-consent__choice input:focus-visible {
  outline: 3px solid var(--ed-rose, #e8356d);
  outline-offset: 2px;
}

/* ---------- bouton « Gérer mes cookies » du pied de page ---------- */
.ed-linklike {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

/* ---------- emplacement du formulaire Tally ---------- */
.ed-tally__placeholder {
  padding: 1.25rem;
  border: 2px solid var(--ed-moyen);
  border-radius: 0.25rem;
  font-family: var(--ed-font);
  color: var(--ed-moyen);
}

.ed-tally__placeholder p {
  margin: 0 0 0.75rem;
}

.ed-tally__placeholder p:last-child {
  margin-bottom: 0;
}

.ed-tally__frame {
  display: block;
  width: 100%;
  min-height: 500px;
  border: 0;
}

/* ---------- utilitaire ---------- */
.ed-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 40rem) {
  .ed-consent__actions .ed-btn {
    flex: 1 1 100%;
  }
}
