/* ════════════════════════════════════════════════════════════
   FONDATION ALODO - HOUSING ARCHITECTURE & DESIGN SYSTEMS (MVC)
   ════════════════════════════════════════════════════════════ */

/* ─── Variables de Base (Model-View) ─── */
:root {
  --primary:      #0b5d4e;
  --primary-dark: #083f35;
  --primary-light:#e8f5f2;
  --accent:       #f4c542;
  --accent-light: #fef9e7;
  --text:         #1f2937;
  --muted:        #6b7280;
  --bg:           #f7faf9;
  --card:         #ffffff;
  --border:       #e5e7eb;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:    0 4px 12px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:    0 10px 30px rgba(0,0,0,.12);
  --radius:       16px;
  --radius-sm:    10px;
  --nav-h:        72px;
}

/* ─── Reset & Configurations Globales ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  padding-top: var(--nav-h);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
ul { list-style: none; }

/* ─── Contrôle des Vues Multi-pages ─── */
.page { display: none; animation: fadeIn .35s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ─── 🧭 Navigation Supérieure Fixe (Ordinateur Ajusté) ─── */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  background: #fff; box-shadow: var(--shadow-sm); z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
}
.top-nav__brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.top-nav__logo {
  width: 44px; height: 44px; background: white(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1rem; flex-shrink: 0; overflow: hidden;
}
.top-nav__logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Zone de titre épurée (Reste stable et droite) */
.top-nav__text-zone { display: flex; align-items: center; white-space: nowrap; }
.top-nav__title { font-weight: 700; font-size: 1.1rem; color: var(--primary); }

/* Alignement idéal des 6 boutons au centre sur ordinateur */
.top-nav__links { display: flex; align-items: center; gap: 24px; }
.top-nav__links a {
  font-weight: 500; font-size: .95rem; color: var(--text); text-decoration: none;
  padding: 6px 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.top-nav__links a:hover, .top-nav__links a.active { color: var(--primary); border-color: var(--primary); }

/* Zone d'action droite : Bouton de don jaune calé parfaitement dans le coin */
.top-nav__right-zone { display: flex; align-items: center; }
.desktop-don-button {
  background: var(--accent); color: #111827; padding: 10px 20px;
  border-radius: 8px; font-weight: 700; font-size: .9rem;
  display: inline-flex; align-items: center; gap: 8px; transition: background .2s;
}
.desktop-don-button:hover { background: #e8b730; }
.menu-toggle { display: none; background: none; border: none; color: var(--primary); cursor: pointer; }

/* ─── 📱 Ajustements Modulaires pour Écrans Mobiles (max-width: 768px) ─── */
@media (max-width: 768px) {
  :root { --nav-h: 60px; }
  .top-nav { padding: 0 16px; }
  
  /* Déclenchement du burger mobile */
  .menu-toggle { display: block; margin-left: 12px; }
  
  /* Transformation instantanée des 6 boutons en menu vertical déroulant en haut */
  .top-nav__links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: #fff; flex-direction: column; gap: 0; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-top: 1px solid var(--border);
  }
  .top-nav__links.open { display: flex; }
  .top-nav__links a { width: 100%; padding: 16px 24px; border-bottom: 1px solid var(--border); }
  .top-nav__links a.active { background: var(--primary-light); border-left: 4px solid var(--primary); }
  
  /* Version compacte du bouton de don pour mobile */
  .desktop-don-button { padding: 8px 14px; font-size: .85rem; border-radius: 6px; }
}

/* ─── 💬 Flotteur WhatsApp Remonté (Évite l'espace vide sur PC) ─── */
.footer {
  background: #111827;
  color: #9ca3af;
  padding: 30px 24px;
  position: relative; /* Indispensable pour caler l'icône à l'intérieur */
}

.footer__container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* L'icône WhatsApp ancrée de manière fixe dans le coin droit (Ordinateur) */
.wa-footer-icon {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%); /* Centre verticalement par rapport au bandeau bleu */
  width: 48px;
  height: 48px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
  transition: transform 0.2s ease, background 0.2s;
}

.wa-footer-icon:hover {
  background: #20ba5a;
  transform: translateY(-50%) scale(1.08); /* Conserve l'alignement tout en zoomant un peu */
}

.wa-footer-icon svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

/* ─── 📱 Adaptation Mobile (Repasse en flottant sur l'écran si l'affichage rétrécit) ─── */
@media (max-width: 768px) {
  .wa-footer-icon {
    position: fixed !important;
    right: 20px !important;
    bottom: 25px !important;
    top: auto !important;
    transform: none !important;
    width: 56px;
    height: 56px;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(37,211,102,.5);
  }
  .wa-footer-icon:hover {
    transform: scale(1.1) !important;
  }
  .wa-footer-icon svg {
    width: 30px;
    height: 30px;
  }
}

/* ─── 📱 Adaptation Mobile (Repasse en Flottant si l'écran est petit) ─── */
@media (max-width: 768px) {
  .wa-footer-link {
    position: fixed !important;
    right: 20px !important;
    bottom: 25px !important;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(37,211,102,.5);
  }
  .wa-footer-link span {
    display: none; /* Cache le texte sur mobile pour ne laisser que le rond vert */
  }
  .wa-footer-link svg {
    width: 30px;
    height: 30px;
  }
}

/* ─── Structures de Mise en Page Utilitaires ─── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-header h1, .section-header h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; color: var(--text); margin-bottom: 12px; }
.section-header .bar { width: 64px; height: 5px; background: var(--accent); border-radius: 99px; margin: 0 auto 18px; }
.section-header p { font-size: 1.1rem; color: var(--muted); max-width: 600px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-sm); }
.card:hover { box-shadow: var(--shadow-md); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 999px; font-weight: 700; font-size: .95rem; border: 2px solid transparent; transition: transform .2s, box-shadow .2s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #111827; }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-green { background: var(--primary); color: #fff; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }

/* ─── Section Accueil & Statistiques ─── */
.hero { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); color: #fff; padding: 80px 24px 96px; text-align: center; position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 800; line-height: 1.1; margin-bottom: 18px; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.15rem; color: rgba(255,255,255,.82); max-width: 680px; margin: 0 auto 32px; }
.stats-bar { background: #fff; border-bottom: 1px solid var(--border); padding: 36px 0; }
.stat-item { text-align: center; padding: 8px 12px; }
.stat-item strong { display: block; font-size: 2.2rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 6px; }
.stat-item span { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.about-section { background: var(--bg); }
.about-text { font-size: 1.05rem; color: var(--muted); line-height: 1.8; max-width: 800px; margin: 0 auto 20px; }

/* ─── Vues Spécifiques : Missions ─── */
.mission-card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .25s, transform .25s; }
.mission-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.mission-card__top { height: 6px; }
.mission-card__top.red { background: #ef4444; }
.mission-card__top.blue { background: #3b82f6; }
.mission-card__top.green { background: #22c55e; }
.mission-card__body { padding: 36px 28px 32px; }
.mission-card__icon { width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.mission-card__icon svg { width: 32px; height: 32px; }
.mission-card__icon.red { background: #fef2f2; color: #ef4444; }
.mission-card__icon.blue { background: #eff6ff; color: #3b82f6; }
.mission-card__icon.green { background: #f0fdf4; color: #22c55e; }
.mission-card h3 { font-size: 1.35rem; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.mission-card p { color: var(--muted); font-size: .95rem; margin-bottom: 20px; }
.mission-card ul { display: flex; flex-direction: column; gap: 10px; }
.mission-card ul li { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: .9rem; }
.mission-card ul li .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.dot.red { background: #ef4444; }
.dot.blue { background: #3b82f6; }
.dot.green { background: #22c55e; }

/* ─── Vues Spécifiques : Galerie ─── */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 48px; }
.gallery-item { aspect-ratio: 4/3; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border); background: linear-gradient(135deg, var(--primary-light), #d1fae5); position: relative; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.video-wrap { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); border: 1px solid var(--border); background: #000; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; }
.video-wrap video { width: 100%; height: 100%; object-fit: cover; }

/* ─── Vues Spécifiques : Équipe (Membres) ─── */
.member-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 24px; text-align: center; box-shadow: var(--shadow-sm); transition: box-shadow .25s, transform .25s; }
.member-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.member-badge { display: inline-block; background: var(--accent-light); color: #92400e; font-size: .8rem; font-weight: 600; padding: 5px 14px; border-radius: 999px; }

/* ─── 💰 Vues Spécifiques : Système de Dons ─── */
.amount-btn {
  width: 100%; padding: 16px 8px; background: var(--card); color: var(--text);
  border: 2px solid var(--border); border-radius: 14px; font-size: 1.25rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.amount-btn:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.amount-btn.selected { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; box-shadow: 0 4px 16px rgba(11,93,78,.25); }

/* ─── ✉️ Vues Spécifiques : Zone Contact (Correction Complète Formulaire) ─── */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.6fr; gap: 32px;
  align-items: start; margin-top: 24px;
}
.contact-info-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.contact-info-card__header { background: var(--primary); color: #fff; padding: 24px 28px; }
.contact-info-card__body { padding: 28px; display: flex; flex-direction: column; gap: 24px; }
.contact-detail { display: flex; align-items: flex-start; gap: 14px; }
.contact-detail__icon { width: 42px; height: 42px; border-radius: 50%; background: var(--accent-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.form-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
}
.form-group { margin-bottom: 20px; display: block; width: 100%; }
.form-group label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: #fafafa; color: var(--text);
  font-family: inherit; font-size: .95rem; outline: none; transition: border-color .2s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); background: #fff; }
.form-group textarea { min-height: 120px; resize: vertical; }

.form-btn { display: flex; align-items: center; justify-content: flex-start; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.error-msg { font-size: .8rem; color: #dc2626; margin-top: 5px; display: none; font-weight: 500; }
.form-group.has-error input, .form-group.has-error textarea { border-color: #dc2626; background: #fff5f5; }
.form-group.has-error .error-msg { display: block; }

.form-status { font-size: .9rem; font-weight: 600; display: none; padding: 6px 12px; border-radius: 6px; }
.form-status.visible { display: block; }
.form-status.success { color: #16a34a; background: #e8f5e9; }
.form-status.error { color: #dc2626; background: #ffebee; }
.submit-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 28px;
  background: var(--primary); color: #fff; border: none; border-radius: 999px;
  font-weight: 700; transition: background .2s, transform .2s;
}
.submit-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* Responsive Mobile Spécifique pour Contact */
@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; gap: 24px; }
  .form-card { padding: 24px 20px; }
}

/* ─── Partenaires ─── */
.partner-grid { display: grid; grid-template-columns: 1fr; gap: 28px; max-width: 780px; margin: 0 auto; }
@media (min-width: 600px) { .partner-grid { grid-template-columns: repeat(2, 1fr); } }
.partner-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 24px 28px; text-align: center; box-shadow: var(--shadow-sm); transition: all .25s; }
.partner-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.partner-photo { width: 100px; height: 100px; border-radius: 50%; overflow: hidden; margin: 0 auto 18px; border: 4px solid var(--primary-light); background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.6rem; font-weight: 800; position: relative; }
.partner-photo img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.partner-detail { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .875rem; color: var(--muted); margin-bottom: 6px; }
.partner-detail svg { width: 15px; height: 15px; stroke: var(--primary); fill: none; stroke-width: 2; }
.partner-wa-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; background: #25D366; color: #fff; padding: 9px 20px; border-radius: 999px; font-weight: 700; font-size: .85rem; }

/* ─── Pied de Page (Footer Style) ─── */
.footer { background: #111827; color: #9ca3af; padding: 40px 24px; text-align: center; }
.footer__brand { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 6px; }
.footer__links { display: flex; justify-content: center; gap: 20px; margin-top: 16px; flex-wrap: wrap; }
.footer__links a { font-size: .875rem; color: #9ca3af; }
.footer__links a:hover { color: var(--accent); }
.footer__divider { border: none; border-top: 1px solid #1f2937; margin: 20px 0; }
.footer__copy { font-size: .8rem; color: #6b7280; }