/* IFPA Poitiers — Bandeau cookies CNIL conforme
   ----------------------------------------------
   Charte 2026 : rose #E71B5B, ink #071322, bg #fafafd
   - Animation discrète d'apparition
   - 3 boutons équilibrés (refus ≡ accept en taille/contraste)
   - Mobile-first responsive
   - prefers-reduced-motion + prefers-color-scheme respectés
*/

#ifpa-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #ffffff;
  border-top: 4px solid #E71B5B;
  box-shadow: 0 -10px 40px rgba(7, 19, 34, 0.18);
  padding: 1.25rem 1.5rem;
  font-family: 'Inter', system-ui, sans-serif;
  color: #071322;
  animation: ifpa-consent-slide 0.35s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  #ifpa-consent-banner { animation: none; }
}
@keyframes ifpa-consent-slide {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.ifpa-consent-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 900px) {
  .ifpa-consent-inner {
    grid-template-columns: 1.7fr auto;
    grid-template-areas:
      "text actions"
      "detail detail";
    align-items: center;
  }
  .ifpa-consent-text    { grid-area: text; }
  .ifpa-consent-actions { grid-area: actions; }
  .ifpa-consent-detail  { grid-area: detail; }
}

.ifpa-consent-text h2 {
  margin: 0 0 0.4rem;
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #071322;
  outline: none;
}
.ifpa-consent-text p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #4a4f5e;
}
.ifpa-consent-text a {
  color: #E71B5B;
  text-decoration: underline;
}

.ifpa-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.ifpa-consent-btn {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.125rem;
  border-radius: 6px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  min-width: 130px;
  text-align: center;
}
.ifpa-consent-btn:focus-visible {
  outline: 2px solid #E71B5B;
  outline-offset: 2px;
}

/* Refus et Accept ont une importance VISUELLE EQUIVALENTE (exigence CNIL) */
.ifpa-consent-refuse {
  background: #ffffff;
  border-color: #071322;
  color: #071322;
}
.ifpa-consent-refuse:hover {
  background: #f4f5fb;
}

.ifpa-consent-accept {
  background: #E71B5B;
  border-color: #E71B5B;
  color: #ffffff;
}
.ifpa-consent-accept:hover {
  background: #c41250;
  border-color: #c41250;
}

.ifpa-consent-custom {
  background: transparent;
  border-color: transparent;
  color: #4a4f5e;
  text-decoration: underline;
  min-width: auto;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.ifpa-consent-custom:hover {
  color: #071322;
}

/* Panneau de détail (personnalisation) */
.ifpa-consent-detail {
  margin-top: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #e3e6ee;
}
.ifpa-consent-detail[hidden] {
  display: none !important;
}
.ifpa-consent-row {
  border: 1px solid #e3e6ee;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0 0 0.625rem;
  background: #fafafd;
}
.ifpa-consent-row legend {
  font-weight: 600;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  color: #071322;
}
.ifpa-consent-row label {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #4a4f5e;
  cursor: pointer;
}
.ifpa-consent-row label:has(input:disabled) {
  cursor: default;
  opacity: 0.65;
}
.ifpa-consent-row input[type="checkbox"] {
  margin-top: 0.25rem;
  accent-color: #E71B5B;
  cursor: pointer;
  width: 1.0625rem;
  height: 1.0625rem;
}
.ifpa-consent-row input[type="checkbox"]:disabled {
  cursor: not-allowed;
}
.ifpa-consent-row code {
  font-size: 0.8125rem;
  background: #ffffff;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}

.ifpa-consent-detail-actions {
  display: flex;
  justify-content: flex-end;
}
.ifpa-consent-save {
  background: #071322;
  border-color: #071322;
  color: #ffffff;
}
.ifpa-consent-save:hover {
  background: #1f2940;
}

/* Compact mobile : boutons en colonne pour éviter qu'ils débordent */
@media (max-width: 600px) {
  .ifpa-consent-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .ifpa-consent-btn {
    width: 100%;
  }
  .ifpa-consent-custom {
    text-align: center;
  }
}

/* Lien dans le footer pour rouvrir le bandeau */
.footer-cookies-link {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.footer-cookies-link:hover {
  color: #E71B5B;
}
