/* ==========================================================================
   Site officiel A2MH — Association des Musulmans de Magny-les-Hameaux
   Feuille de styles principale — Thèmes clair et sombre
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-subtle: #edf2f4;
  --surface-accent: #f8f4ea;
  --border: #d8e1e5;
  --border-strong: #bccad1;
  --text: #1b242c;
  --text-secondary: #4a5966;
  --text-muted: #5a6a78;
  --brand: #0c4f6e;
  --brand-hover: #093d56;
  --brand-soft: #136886;
  --brand-nav: #09394f;
  --brand-on-dark: #ffffff;
  --brand-muted-on-dark: #cfe4ec;
  --brand-link-on-dark: #a6dce8;
  --hero-bg: #0c445e;
  --accent: #8f640f;
  --accent-hover: #734f0b;
  --accent-text: #ffffff;
  --donate: #c44318;
  --donate-hover: #a63612;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-border: #f3c4bf;
  --success: #0e6245;
  --success-bg: #ebf7f2;
  --success-border: #a3d9c1;
  --input-bg: #ffffff;
  --focus-ring: rgba(12, 79, 110, 0.24);
  --shadow-sm: 0 1px 3px rgba(15, 32, 43, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 32, 43, 0.08);
  --radius-sm: 6px;
  --radius: 10px;
  --font-sans: 'Inter', 'Noto Sans', 'Liberation Sans', 'DejaVu Sans', sans-serif;
  --font-arabic: 'Amiri', 'Noto Naskh Arabic', serif;
  --font-mono: 'JetBrains Mono', 'Liberation Mono', 'DejaVu Sans Mono', monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1419;
  --surface: #161d24;
  --surface-subtle: #1e2832;
  --surface-accent: #241f15;
  --border: #283440;
  --border-strong: #394a59;
  --text: #e8eef2;
  --text-secondary: #b4c2cd;
  --text-muted: #93a5b3;
  --brand: #63bdd4;
  --brand-hover: #82cde0;
  --brand-soft: #4fa9c2;
  --brand-nav: #0c1821;
  --brand-on-dark: #f2f7fa;
  --brand-muted-on-dark: #b9d2dc;
  --brand-link-on-dark: #8dd4e6;
  --hero-bg: #11222e;
  --accent: #d4a644;
  --accent-hover: #e0b75e;
  --accent-text: #121619;
  --donate: #d45225;
  --donate-hover: #e16438;
  --danger: #f58a83;
  --danger-bg: #2b1616;
  --danger-border: #662e2c;
  --success: #5cd1a4;
  --success-bg: #102920;
  --success-border: #245e49;
  --input-bg: #12181f;
  --focus-ring: rgba(99, 189, 212, 0.32);
  --shadow-sm: none;
  --shadow-md: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Transition synchronisée sur l'ensemble de l'interface uniquement pendant le clic sur le sélecteur */
html.theme-switching,
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, fill 0.18s ease, stroke 0.18s ease !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Accessibilité & Utilitaires
   ========================================================================== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-nav);
  color: var(--brand-on-dark);
  padding: 12px 20px;
  font-weight: 600;
  z-index: 9999;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

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

.ico {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.ico-sm {
  width: 16px;
  height: 16px;
}

.ico-spin {
  animation: spin 0.9s linear infinite;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

/* ==========================================================================
   En-tête, Titre sur une seule ligne, Sélecteur de thème & Navigation
   ========================================================================== */
header {
  background-color: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.header-top {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  padding: 2px;
}

:root[data-theme="dark"] .logo-link {
  background-color: #f3f6f7;
  padding: 4px 8px;
}

.logo-img {
  height: 54px;
  width: auto;
  object-fit: contain;
  display: block;
}

.header-title {
  min-width: 0;
}

/* Exigence stricte : le titre reste sur une seule ligne sur tous les écrans */
.header-title h1 {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--brand);
  white-space: nowrap;
}

.header-title .subtitle-main {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
  line-height: 1.35;
}

.header-title .subtitle-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-arabic {
  font-size: 1.25rem;
  font-family: var(--font-arabic);
  color: var(--brand);
  white-space: nowrap;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background-color: var(--surface-subtle);
  color: var(--text);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.theme-toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.theme-toggle .ico-sun,
.theme-toggle .theme-label-light {
  display: none;
}

.theme-toggle .ico-moon,
.theme-toggle .theme-label-dark {
  display: inline-block;
}

:root[data-theme="dark"] .theme-toggle .ico-sun,
:root[data-theme="dark"] .theme-toggle .theme-label-light {
  display: inline-block;
}

:root[data-theme="dark"] .theme-toggle .ico-moon,
:root[data-theme="dark"] .theme-toggle .theme-label-dark {
  display: none;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  background-color: var(--brand-nav);
  color: var(--brand-on-dark);
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
}

.nav-toggle:hover {
  background-color: var(--brand-soft);
}

nav {
  background-color: var(--brand-nav);
}

nav ul {
  max-width: 1080px;
  margin: 0 auto;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  padding: 0 24px;
  gap: 4px;
}

nav ul li a {
  display: block;
  color: var(--brand-muted-on-dark);
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

nav ul li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--brand-on-dark);
  text-decoration: none;
}

nav ul li a.active {
  background-color: rgba(255, 255, 255, 0.16);
  color: var(--brand-on-dark);
  font-weight: 600;
  text-decoration: none;
}

/* ==========================================================================
   Hero & Structure principale
   ========================================================================== */
.hero {
  background-color: var(--hero-bg);
  color: var(--brand-on-dark);
  padding: 48px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-inner {
  max-width: 880px;
  margin: 0 auto;
}

.hero h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.02rem;
  color: var(--brand-muted-on-dark);
  max-width: 640px;
  margin: 0;
}

.hero strong {
  color: var(--brand-on-dark);
  font-weight: 600;
}

main {
  flex: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 36px 24px 56px;
}

.page-title {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.015em;
  padding-left: 14px;
  border-left: 3px solid var(--brand);
  margin-bottom: 20px;
  line-height: 1.3;
}

.page-lead {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: -10px;
  margin-bottom: 24px;
}

.page-meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: -10px;
  margin-bottom: 24px;
}

h3 {
  font-size: 1.12rem;
  color: var(--text);
  margin: 32px 0 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

p {
  margin-bottom: 14px;
}

p:last-child {
  margin-bottom: 0;
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.card > h3:first-child {
  margin-top: 0;
}

.card-gold {
  background-color: var(--surface-accent);
  border-color: var(--border-strong);
}

.card-centered {
  text-align: center;
}

.card-highlight-text {
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.text-accent {
  font-weight: 600;
  color: var(--brand);
}

.text-muted {
  color: var(--text-secondary);
}

.text-center {
  text-align: center;
}

.mt-sm {
  margin-top: 12px;
}

.mt-md {
  margin-top: 20px;
}

.mt-lg {
  margin-top: 28px;
}

.mb-md {
  margin-bottom: 16px;
}

/* ==========================================================================
   Statistiques & Avancement de la collecte
   ========================================================================== */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

.stat-item {
  padding: 20px 16px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.stat-item:last-child {
  border-right: none;
}

.stat-item .number {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.stat-item .label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.progress-wrap {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 12px;
  margin: 12px 0 8px;
  overflow: hidden;
}

.progress-bar {
  background-color: var(--brand);
  height: 100%;
  border-radius: 999px;
}

.progress-60 {
  width: 60.27%;
}

.progress-label {
  font-size: 0.86rem;
  color: var(--text-secondary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Citations / Hadith & Encarts
   ========================================================================== */
.hadith-block {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  padding: 20px 24px;
  color: var(--text);
  border-radius: var(--radius-sm);
  margin: 24px 0;
  font-size: 0.96rem;
  box-shadow: var(--shadow-sm);
}

.hadith-block-center {
  text-align: center;
  border-left: 1px solid var(--border);
  border-top: 3px solid var(--brand);
}

.hadith-title-arabic {
  font-size: 1.05rem;
  color: var(--brand);
  font-weight: 600;
  display: inline-block;
  margin-bottom: 6px;
}

.hadith-arabic-inline {
  font-family: var(--font-arabic);
  font-size: 1.25rem;
}

.hadith-source {
  display: block;
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
}

.info-callout {
  margin-top: 16px;
  padding: 14px 16px;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text);
}

.warn-callout {
  margin-top: 14px;
  padding: 14px 16px;
  background-color: var(--surface-accent);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.warn-callout .ico {
  color: var(--accent);
  margin-top: 2px;
}

/* ==========================================================================
   Images & Vidéo
   ========================================================================== */
.img-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}

.img-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
}

.img-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.img-card img.img-contain {
  object-fit: contain;
  background-color: #ffffff;
  padding: 6px;
}

.img-card .img-caption {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background-color: var(--surface);
  border-top: 1px solid var(--border);
}

.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 16px 0 24px;
  background-color: #000000;
}

.video-wrap video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background-color: #000000;
  object-fit: contain;
}

/* ==========================================================================
   Chronologie & Valeurs (Histoire)
   ========================================================================== */
.timeline {
  position: relative;
  padding-left: 24px;
  margin-top: 16px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background-color: var(--border-strong);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  padding: 20px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 24px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--brand);
  border: 2px solid var(--bg);
}

.timeline-year {
  font-weight: 600;
  color: var(--brand);
  font-size: 0.96rem;
  margin-bottom: 8px;
}

.timeline-list {
  list-style: disc;
  padding-left: 20px;
  margin-top: 8px;
}

.timeline-list li {
  margin-bottom: 6px;
}

.values-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 24px;
}

.values-list li {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
}

.values-list li .ico {
  color: var(--brand);
  margin-top: 3px;
}

/* ==========================================================================
   Notre Ville & Carte unique OpenStreetMap
   ========================================================================== */
.chiffres-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0 24px;
}

.chiffre-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.chiffre-box .chiffre {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

.chiffre-box .chiffre-label {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.map-container-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin: 16px 0 24px;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.map-location-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-map-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--surface-subtle);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.btn-map-action:hover {
  border-color: var(--brand);
  color: var(--brand);
  text-decoration: none;
}

#carte-magny {
  height: 420px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  z-index: 0;
  background-color: var(--surface-subtle);
  overflow: hidden;
  position: relative;
}

.map-unavailable-host {
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-unavailable {
  padding: 28px 24px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.map-unavailable-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 8px;
}

.map-unavailable-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.map-unavailable-coords {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.map-unavailable-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.map-div-icon {
  background: transparent;
  border: none;
}

.map-pin {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.map-pin-ville {
  background-color: #0c4f6e;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.map-pin-assoc {
  background-color: #8f640f;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.map-popup {
  text-align: center;
  font-family: var(--font-sans);
  line-height: 1.45;
  color: var(--text);
}

.map-popup strong {
  color: var(--brand);
  font-size: 0.94rem;
}

/* Adaptation Leaflet en mode sombre */
:root[data-theme="dark"] #carte-magny .leaflet-tile-pane {
  filter: brightness(0.84) contrast(1.06) saturate(0.9);
}

:root[data-theme="dark"] .leaflet-popup-content-wrapper,
:root[data-theme="dark"] .leaflet-popup-tip {
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

:root[data-theme="dark"] .leaflet-control-zoom a {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

:root[data-theme="dark"] .leaflet-control-zoom a:hover {
  background-color: var(--surface-subtle);
}

:root[data-theme="dark"] .leaflet-control-attribution,
:root[data-theme="dark"] .leaflet-control-scale-line {
  background-color: rgba(22, 29, 36, 0.88);
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

:root[data-theme="dark"] .leaflet-control-attribution a {
  color: var(--brand);
}

.carte-legende {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.legende-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legende-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legende-dot-ville {
  background-color: #0c4f6e;
}

.legende-dot-assoc {
  background-color: #8f640f;
}

.legende-credit {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Sections Loi 1905 / Mentions légales / RGPD
   ========================================================================== */
.loi-section {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.loi-section h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.loi-list {
  list-style: none;
  margin: 8px 0 0;
}

.loi-list li {
  padding: 8px 0 8px 18px;
  position: relative;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
}

.loi-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 17px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--brand);
}

.loi-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* ==========================================================================
   Page Don, Simulateur fiscal & HelloAsso
   ========================================================================== */
.don-hero {
  background-color: var(--hero-bg);
  color: var(--brand-on-dark);
  padding: 36px 28px;
  border-radius: var(--radius);
  margin-bottom: 28px;
}

.don-hero h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.65rem);
  font-weight: 600;
  margin-bottom: 10px;
}

.don-hero p {
  font-size: 0.98rem;
  color: var(--brand-muted-on-dark);
  max-width: 620px;
}

.don-hero strong {
  color: var(--brand-on-dark);
}

.avantages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0 28px;
}

.avantage-box {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.avantage-box h4 {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 6px;
}

.avantage-box p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Simulateur fiscal 66 % */
.fiscal-simulator {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}

.fiscal-simulator h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.fiscal-intro {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.fiscal-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.preset-btn {
  background-color: var(--surface-subtle);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.preset-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.preset-btn.is-selected {
  background-color: var(--brand-nav);
  color: var(--brand-on-dark);
  border-color: var(--brand-nav);
}

:root[data-theme="dark"] .preset-btn.is-selected {
  background-color: var(--brand);
  color: #0c1821;
  border-color: var(--brand);
}

.fiscal-custom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fiscal-custom-row label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.fiscal-input-wrap {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--input-bg);
  overflow: hidden;
}

.fiscal-input-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.fiscal-input-wrap input {
  width: 120px;
  border: none;
  padding: 8px 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  color: var(--text);
  background: transparent;
}

.fiscal-input-wrap input:focus {
  outline: none;
}

.fiscal-input-wrap span {
  padding: 0 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--surface-subtle);
  align-self: stretch;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border);
}

.fiscal-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.fiscal-result-card {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  text-align: center;
}

.fiscal-result-card.is-highlight {
  background-color: var(--hero-bg);
  border-color: var(--hero-bg);
  color: var(--brand-on-dark);
}

.fiscal-result-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: block;
}

.fiscal-result-card.is-highlight .fiscal-result-label {
  color: var(--brand-muted-on-dark);
}

.fiscal-result-value {
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  display: block;
  margin-top: 4px;
}

.fiscal-result-card.is-highlight .fiscal-result-value {
  color: var(--brand-on-dark);
}

.fiscal-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

/* Badge & Widget HelloAsso */
.ha-badge {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.ha-badge .ha-logo {
  background-color: var(--donate);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: center;
  line-height: 1.2;
}

.ha-badge .ha-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
  min-width: 220px;
}

.ha-badge .ha-text strong {
  color: var(--text);
}

.ha-widget-wrap {
  background-color: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin: 16px 0 24px;
}

.ha-widget-header {
  background-color: var(--surface-subtle);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ha-widget-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* L'iframe HelloAsso externe rend son propre fond clair : on conserve un fond blanc propre à l'intérieur */
.ha-widget-body {
  position: relative;
  min-height: 640px;
  background-color: #ffffff;
}

.ha-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  background-color: var(--surface);
  color: var(--text-secondary);
  text-align: center;
  z-index: 2;
}

.ha-loader.is-hidden {
  display: none;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ha-fallback-alert {
  display: none;
  background-color: var(--surface-accent);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--text);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ha-fallback-alert.is-visible {
  display: flex;
}

#ha-iframe {
  width: 100%;
  min-height: 640px;
  height: 760px;
  border: none;
  display: block;
}

.ha-direct-link {
  color: var(--donate);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.securite-liste {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 24px;
}

.securite-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.securite-item strong {
  color: var(--text);
}

.securite-item .s-icon {
  color: var(--brand);
  flex-shrink: 0;
  margin-top: 2px;
}

.don-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 16px 0 24px;
}

.don-method {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.don-method h4 {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 6px;
}

.don-method p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
}

.autre-methode {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.autre-methode .am-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-subtle);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.autre-methode h4 {
  color: var(--text);
  margin: 0 0 6px;
  font-size: 0.98rem;
  font-weight: 600;
}

.autre-methode p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.rib-box {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  margin-top: 10px;
  line-height: 1.7;
  color: var(--text);
}

.rib-box p {
  margin-bottom: 4px;
  color: var(--text);
}

.rib-box p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Page Contact & Formulaire
   ========================================================================== */
.status-banner {
  display: none;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 0.92rem;
  align-items: flex-start;
  gap: 12px;
}

.status-banner.is-visible {
  display: flex;
}

.status-banner-success {
  background-color: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  align-items: start;
}

.contact-info-box,
.contact-form {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.contact-info-box h3,
.contact-form h3 {
  margin-top: 0;
  margin-bottom: 16px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.contact-item .ci-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background-color: var(--surface-subtle);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.94rem;
  font-family: inherit;
  background-color: var(--input-bg);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-group input[aria-invalid="true"],
.form-group textarea[aria-invalid="true"],
.form-group select[aria-invalid="true"] {
  border-color: var(--danger);
  background-color: var(--danger-bg);
}

.form-group textarea {
  resize: vertical;
  min-height: 128px;
}

.field-hint {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.field-error {
  display: none;
  font-size: 0.82rem;
  color: var(--danger);
  margin-top: 6px;
  font-weight: 500;
}

.field-error.is-visible {
  display: block;
}

.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.form-feedback {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.form-feedback.is-visible {
  display: block;
}

.form-feedback-error {
  background-color: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

.form-feedback-info {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text);
}

.form-fallback-box {
  display: none;
  margin-top: 16px;
  padding: 16px;
  background-color: var(--surface-accent);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text);
}

.form-fallback-box.is-visible {
  display: block;
}

.form-fallback-box .btn {
  margin-top: 12px;
}

/* ==========================================================================
   Boutons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--brand-nav);
  color: var(--brand-on-dark);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  width: 100%;
  text-align: center;
  text-decoration: none;
}

:root[data-theme="dark"] .btn {
  background-color: #146c8a;
  color: #ffffff;
}

.btn:hover:not(:disabled) {
  background-color: var(--brand-soft);
  color: #ffffff;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-auto {
  width: auto;
  padding: 12px 28px;
}

.btn-gold {
  background-color: var(--accent);
  color: var(--accent-text);
}

.btn-gold:hover:not(:disabled) {
  background-color: var(--accent-hover);
  color: var(--accent-text);
}

/* ==========================================================================
   RGPD : Consentement, Tableaux & Grille des droits
   ========================================================================== */
.rgpd-consent {
  margin-top: 4px;
}

.rgpd-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.rgpd-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--brand);
}

.rgpd-label span {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.rgpd-label a {
  color: var(--brand);
  text-decoration: underline;
  font-weight: 500;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.rgpd-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rgpd-table th {
  background-color: var(--brand-nav);
  color: var(--brand-on-dark);
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
}

.rgpd-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}

.rgpd-table tr:nth-child(even) td {
  background-color: var(--surface-subtle);
}

.rgpd-table tr:last-child td {
  border-bottom: none;
}

.rights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}

.right-box {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.right-box h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--brand);
  margin: 0 0 6px;
}

.right-box p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Page 404 */
.error-page-card {
  text-align: center;
  padding: 40px 24px;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 8px;
}

.error-title {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.error-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* ==========================================================================
   Pied de page
   ========================================================================== */
footer {
  background-color: var(--brand-nav);
  color: var(--brand-muted-on-dark);
  text-align: center;
  padding: 28px 24px;
  font-size: 0.85rem;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

footer p {
  margin-bottom: 6px;
}

footer a {
  color: var(--brand-link-on-dark);
}

footer a:hover {
  color: var(--brand-on-dark);
}

footer .footer-assoc {
  color: var(--brand-on-dark);
  font-weight: 600;
  font-size: 0.94rem;
  margin-bottom: 6px;
}

footer .footer-copy {
  margin-top: 12px;
  color: var(--brand-muted-on-dark);
  opacity: 0.85;
  font-size: 0.8rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .header-arabic {
    display: none;
  }

  .chiffres-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-top {
    padding: 10px 16px;
    gap: 10px;
  }

  .logo-img {
    height: 44px;
  }

  .header-title .subtitle-sub {
    display: none;
  }

  :root .theme-toggle .theme-toggle-label,
  :root[data-theme="dark"] .theme-toggle .theme-toggle-label {
    display: none;
  }

  .theme-toggle {
    padding: 6px 10px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  nav.js-collapsible ul {
    display: none;
    flex-direction: column;
    padding: 8px 12px 12px;
  }

  nav.js-collapsible.is-open ul {
    display: flex;
  }

  nav ul {
    padding: 0 12px;
  }

  nav ul li a {
    padding: 10px 12px;
    font-size: 0.92rem;
    border-radius: var(--radius-sm);
  }

  main {
    padding: 24px 16px 48px;
  }

  .hero {
    padding: 36px 16px;
  }

  .img-section,
  .contact-grid,
  .rights-grid,
  .values-list,
  .securite-liste,
  .fiscal-results,
  .avantages,
  .don-methods,
  .stats-banner {
    grid-template-columns: 1fr;
  }

  .stat-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .stat-item:last-child {
    border-bottom: none;
  }

  #carte-magny {
    height: 320px;
  }

  .legende-credit {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 520px) {
  .header-top {
    padding: 10px 12px;
    gap: 8px;
  }

  .header-logo {
    gap: 10px;
  }

  .logo-img {
    height: 36px;
  }

  .header-title h1 {
    font-size: 1.02rem;
  }

  .header-title .subtitle-main {
    font-size: 0.76rem;
  }

  .header-actions {
    gap: 6px;
  }

  .nav-toggle-label {
    display: none;
  }

  .nav-toggle,
  .theme-toggle {
    padding: 6px 8px;
    min-width: 36px;
    min-height: 36px;
  }

  .form-row-2,
  .chiffres-grid {
    grid-template-columns: 1fr;
  }

  #ha-iframe {
    min-height: 700px;
  }

  .autre-methode {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 380px) {
  .header-top {
    padding: 8px 10px;
    gap: 6px;
  }

  .header-logo {
    gap: 8px;
  }

  :root[data-theme="dark"] .logo-link {
    padding: 3px 5px;
  }

  .logo-img {
    height: 28px;
  }

  .header-title h1 {
    font-size: 0.94rem;
  }

  .header-title .subtitle-main {
    display: none;
  }

  .header-actions {
    gap: 4px;
  }

  .nav-toggle,
  .theme-toggle {
    padding: 4px 6px;
    min-width: 32px;
    min-height: 32px;
  }
}
