/* ==========================================================================
   RIATD — Feuille de style principale
   Palette : nuit du Sahel (marine), or savane, terre cuite, sable
   Typographies : Sora (titres) / Inter (texte courant)
   ========================================================================== */

:root {
  --navy: #162957;       /* couleur exacte du logo RIATD */
  --navy-light: #1E3568;
  --navy-soft: #2A4784;
  --gold: #E4A93B;
  --gold-deep: #C88A1F;
  --clay: #C0522F;
  --sand: #F6F1E7;
  --sand-deep: #EDE4D2;
  --ink: #1E1B16;
  --ink-soft: #55503F;
  --line: #DED4C0;
  --white: #FFFFFF;

  --font-titre: 'Sora', sans-serif;
  --font-texte: 'Inter', sans-serif;

  --rayon: 4px;
  --ombre: 0 10px 30px rgba(16, 23, 58, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-texte);
  color: var(--ink);
  background: var(--sand);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4 {
  font-family: var(--font-titre);
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--clay); }

img { max-width: 100%; display: block; }

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

.conteneur {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.conteneur-etroit {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------------
   En-tête / navigation
   -------------------------------------------------------------------- */
.entete {
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.entete-barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1180px;
  margin: 0 auto;
  gap: 24px;
}

.logo-site {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.logo-site img { height: 40px; width: auto; display: block; }

.nav-principale {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-principale a {
  color: #D8DCEE;
  padding: 10px 14px;
  border-radius: var(--rayon);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-principale a:hover,
.nav-principale a.actif {
  background: rgba(255,255,255,0.08);
  color: var(--white);
}

.nav-actions { display: flex; gap: 10px; align-items: center; }

.btn-menu-mobile {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  padding: 8px 12px;
  border-radius: var(--rayon);
  font-size: 1.1rem;
  cursor: pointer;
}

/* --------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--rayon);
  font-weight: 700;
  font-family: var(--font-texte);
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-or { background: var(--gold); color: var(--navy); }
.btn-or:hover { background: var(--gold-deep); color: var(--navy); }

.btn-contour { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.5); }
.btn-contour:hover { border-color: var(--white); color: var(--white); }

.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-light); color: var(--white); }

.btn-clay { background: var(--clay); color: var(--white); }
.btn-clay:hover { background: #a34526; color: var(--white); }

.btn-petit { padding: 7px 14px; font-size: 0.82rem; }
.btn-large { padding: 15px 30px; font-size: 1.05rem; }
.btn-bloc { width: 100%; }

/* --------------------------------------------------------------------
   Section héro — grand chiffre, pas de dégradé décoratif
   -------------------------------------------------------------------- */
.hero {
  background: var(--navy);
  color: var(--white);
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 420px;
  height: 420px;
  border: 60px solid rgba(228, 169, 59, 0.08);
  border-radius: 50%;
}

.hero-grille {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
}

.hero-eyebrow {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.hero h1 { color: var(--white); margin-bottom: 18px; }
.hero p.lead { color: #C4CAE4; font-size: 1.15rem; max-width: 46ch; }

.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  overflow: hidden;
}

.stat-case {
  background: var(--navy-light);
  padding: 26px 20px;
  text-align: left;
}
.stat-chiffre {
  font-family: var(--font-titre);
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  display: block;
}
.stat-libelle {
  color: #C4CAE4;
  font-size: 0.85rem;
  margin-top: 8px;
}

/* --------------------------------------------------------------------
   Sections génériques
   -------------------------------------------------------------------- */
.section { padding: 64px 0; }
.section-alt { background: var(--white); }

.section-entete {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.section-entete p { margin: 6px 0 0; max-width: 60ch; }

/* --------------------------------------------------------------------
   Cartes "à la une" (variées, pas identiques à la grille d'annuaire)
   -------------------------------------------------------------------- */
.grille-une {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.carte-une {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  padding: 26px;
  border-radius: var(--rayon);
}
.carte-une.type-expert { border-top-color: var(--clay); }
.carte-une.type-initiative { border-top-color: var(--navy); }

.carte-une .etiquette-type {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-deep);
  margin-bottom: 10px;
}
.carte-une.type-expert .etiquette-type { color: var(--clay); }
.carte-une.type-initiative .etiquette-type { color: var(--navy-soft); }

.carte-une h3 { margin-bottom: 8px; font-size: 1.15rem; }
.carte-une p { font-size: 0.95rem; margin-bottom: 14px; }
.carte-une a.lien-plus { font-weight: 700; font-size: 0.9rem; }

/* --------------------------------------------------------------------
   Annuaire — mise en registre (lignes), fidèle au contenu (un répertoire)
   -------------------------------------------------------------------- */
.barre-filtres {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--rayon);
  padding: 20px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.barre-filtres input,
.barre-filtres select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--rayon);
  font-family: var(--font-texte);
  font-size: 0.95rem;
  background: var(--sand);
  color: var(--ink);
}
.barre-filtres input[type="text"] { flex: 2; min-width: 200px; }
.barre-filtres select { flex: 1; min-width: 160px; }

.registre { border-top: 1px solid var(--line); }

.ligne-registre {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
}

.vignette {
  width: 72px;
  height: 72px;
  border-radius: var(--rayon);
  object-fit: cover;
  background: var(--sand-deep);
  border: 1px solid var(--line);
}

.ligne-registre h3 { font-size: 1.15rem; margin-bottom: 4px; }
.meta-registre {
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.meta-registre span::before { content: "•"; margin-right: 12px; color: var(--line); }
.meta-registre span:first-child::before { content: none; margin-right: 0; }

.etat-vide {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------
   Badges de statut
   -------------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-attente { background: #FCEACB; color: #8A5A00; }
.badge-valide  { background: #DCEFDD; color: #1E6B2D; }
.badge-rejete  { background: #FBE0DA; color: #A03A22; }

/* --------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------- */
.carte-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 40px;
  box-shadow: var(--ombre);
}

.groupe-champ { margin-bottom: 20px; }
.groupe-champ label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 0.92rem;
  color: var(--navy);
}
.groupe-champ .aide { font-size: 0.82rem; color: var(--ink-soft); margin-top: 4px; }

.groupe-champ input[type="text"],
.groupe-champ input[type="email"],
.groupe-champ input[type="password"],
.groupe-champ input[type="tel"],
.groupe-champ input[type="url"],
.groupe-champ input[type="date"],
.groupe-champ input[type="number"],
.groupe-champ select,
.groupe-champ textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--rayon);
  font-family: var(--font-texte);
  font-size: 0.98rem;
  background: var(--sand);
  color: var(--ink);
}
.groupe-champ textarea { min-height: 130px; resize: vertical; }
.groupe-champ input:focus,
.groupe-champ select:focus,
.groupe-champ textarea:focus {
  border-color: var(--gold-deep);
  background: var(--white);
}

.ligne-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

fieldset { border: 1px dashed var(--line); border-radius: var(--rayon); padding: 20px; margin: 0 0 24px; }
legend { font-family: var(--font-titre); font-weight: 700; color: var(--navy); padding: 0 8px; }

.selecteur-type {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
.carte-type {
  display: block;
  border: 2px solid var(--line);
  border-radius: var(--rayon);
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  background: var(--white);
}
.carte-type input { display: none; }
.carte-type .icone-type { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.carte-type strong { display: block; color: var(--navy); font-family: var(--font-titre); }
.carte-type.actif { border-color: var(--gold-deep); background: #FDF6E8; }

/* --------------------------------------------------------------------
   Alertes
   -------------------------------------------------------------------- */
.alerte {
  padding: 14px 18px;
  border-radius: var(--rayon);
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 0.95rem;
}
.alerte-succes { background: #DCEFDD; color: #1E6B2D; border: 1px solid #B7DBBA; }
.alerte-erreur { background: #FBE0DA; color: #A03A22; border: 1px solid #F0BBAC; }

/* --------------------------------------------------------------------
   Fiche détail
   -------------------------------------------------------------------- */
.fil-ariane { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 24px; }
.fil-ariane a { color: var(--ink-soft); font-weight: 600; }

.entete-fiche {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.entete-fiche img { width: 120px; height: 120px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.entete-fiche .etiquette-type { color: var(--gold-deep); font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }

.grille-fiche { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; }

.bloc-info {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--rayon);
  padding: 24px;
}
.bloc-info h4 { font-size: 0.85rem; text-transform: none; color: var(--navy); margin-bottom: 14px; }
.bloc-info dl { margin: 0; }
.bloc-info dt { font-size: 0.8rem; color: var(--ink-soft); margin-top: 12px; }
.bloc-info dd { margin: 2px 0 0; font-weight: 600; color: var(--ink); }

/* --------------------------------------------------------------------
   Tableau (dashboard membre)
   -------------------------------------------------------------------- */
.tableau-simple { width: 100%; border-collapse: collapse; background: var(--white); }
.tableau-simple th, .tableau-simple td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.tableau-simple th { color: var(--navy); font-family: var(--font-titre); font-size: 0.82rem; background: var(--sand-deep); }

/* --------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------- */
.pied {
  background: var(--navy);
  color: #B7BEDD;
  padding: 56px 0 24px;
  margin-top: 64px;
}
.pied-grille {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
}
.pied h4 { color: var(--white); font-size: 0.95rem; margin-bottom: 14px; }
.pied a { color: #B7BEDD; display: block; padding: 4px 0; font-size: 0.92rem; }
.pied a:hover { color: var(--gold); }
.pied-bas {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* --------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; }
.pagination a, .pagination span {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--rayon);
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--white);
}
.pagination .actif { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* --------------------------------------------------------------------
   Page de connexion / inscription
   -------------------------------------------------------------------- */
.page-auth {
  min-height: calc(100vh - 300px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}
.page-auth .carte-form { max-width: 440px; width: 100%; }
.page-auth .lien-bas { text-align: center; margin-top: 18px; font-size: 0.92rem; }

/* --------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-grille { grid-template-columns: 1fr; }
  .grille-une { grid-template-columns: 1fr; }
  .grille-fiche { grid-template-columns: 1fr; }
  .pied-grille { grid-template-columns: 1fr 1fr; }
  .selecteur-type { grid-template-columns: 1fr; }
  .ligne-champs { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .btn-menu-mobile { display: inline-block; }
  .nav-principale, .nav-actions.desktop { display: none; }
  .nav-principale.ouvert {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--navy);
    padding: 12px 24px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .ligne-registre { grid-template-columns: 56px 1fr; }
  .ligne-registre .action-registre { grid-column: span 2; }
  .entete-fiche { flex-direction: column; }
  .pied-grille { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
