/* ==========================================================================
   Extensions Django : sections modulaires, messages, RGPD, accessibilité
   ========================================================================== */

/* --- Sections « collées » (KPIs, bandeaux) --- */
.section-continued {
  padding-top: 0;
}

.section:has(+ .section-continued),
.hero-section:has(+ .section-continued) {
  padding-bottom: 3rem;
}

.section:has(+ .section-continued) > .container > :last-child {
  margin-bottom: 0;
}

.section-continued .metrics-strip,
.section-continued .trust-bar,
.section-continued .plaquette-banner {
  margin-top: 0;
}

.hero-section + .section-continued .trust-bar,
.section-continued + .section-continued .trust-bar {
  padding-top: 2rem;
}

/* --- Logo personnalisé --- */
.brand-logo-img {
  max-height: 46px;
  width: auto;
}

/* --- Comparatif : couleurs des pictos --- */
.comp-list svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.comp-card-standard .comp-list svg {
  color: #DC2626;
}

.comp-card-verde .comp-list svg {
  color: var(--c-primary);
}

/* --- Accessibilité --- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 2000;
  background: var(--c-primary);
  color: var(--c-text-inverse);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 3px solid rgba(var(--rgb-secondary), 0.55);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Messages Django --- */
.flash-messages {
  position: fixed;
  top: 96px;
  right: 1.5rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
}

.flash-message {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover);
  font-size: 0.9375rem;
  line-height: 1.5;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.flash-message.success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.flash-message.error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.flash-message.info,
.flash-message.warning { background: var(--c-accent-light); color: var(--c-text-dark); border: 1px solid var(--c-border); }

.flash-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
}

/* --- Formulaire : case de consentement & erreurs --- */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.875rem;
  color: var(--c-text-muted);
  line-height: 1.5;
}

.form-check input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--c-primary);
}

.field-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: #B91C1C;
}

.form-control[aria-invalid="true"] {
  border-color: #DC2626;
}

/* --- Témoignages --- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem;
}

.testimonial-card {
  background-color: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.testimonial-quote {
  font-family: var(--font-heading);
  font-size: calc(1.3rem * var(--heading-scale));
  line-height: 1.45;
  color: var(--c-primary-deep);
  font-style: italic;
}

.testimonial-author {
  font-weight: 700;
  color: var(--c-text-dark);
}

.testimonial-role {
  font-size: 0.875rem;
  color: var(--c-text-muted);
}

/* --- Texte libre --- */
.rich-text {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.rich-text p + p {
  margin-top: 1rem;
}

.rich-text-media {
  margin: 0 auto 2.5rem;
  max-width: 900px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* --- Pied de page : réseaux sociaux --- */
.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
}

.footer-social a:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* --- Bandeau de prévisualisation (brouillon) --- */
.preview-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  background: var(--c-accent);
  color: #FFFFFF;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-hover);
}

/* --- Bandeau cookies (RGPD) --- */
.cookie-banner {
  position: fixed;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 1300;
  max-width: 760px;
  margin: 0 auto;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  flex: 1 1 320px;
  font-size: 0.9rem;
  color: var(--c-text-body);
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* --- Page « bientôt en ligne » & erreurs --- */
.simple-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 1.5rem 4rem;
}

.simple-page .section-title {
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .flash-messages {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }

  .cookie-banner {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

/* --- Coordonnées : libellé au-dessus de la valeur --- */
.channel-content {
  display: flex;
  flex-direction: column;
}
