/* =====================================================================
 *  Annuaire pair-aidance — styles
 *  Reprend la palette du site (violet #667eea / #764ba2).
 * ===================================================================== */

.apa {
  --apa-violet: #667eea;
  --apa-violet2: #764ba2;
  --apa-vert: #10b981;
  --apa-gris: #6b7280;
  --apa-bord: #e5e7eb;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1f2937;
}

/* --- Formulaire ----------------------------------------------------- */

.apa-filtres {
  background: #f9fafb;
  border: 1px solid var(--apa-bord);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.apa-filtres-ligne {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}

.apa-champ { display: flex; flex-direction: column; gap: 4px; flex: 1 1 200px; }
.apa-champ-large { flex: 2 1 260px; }
.apa-champ > span { font-size: .88em; font-weight: 600; color: #4b5563; }

.apa-champ select,
.apa-champ input[type="search"] {
  padding: 9px 11px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1em;
  font-family: inherit;
  background: #fff;
  width: 100%;
}

.apa-cases { border: 0; padding: 0; margin: 0 0 12px; }
.apa-cases legend { font-size: .88em; font-weight: 600; color: #4b5563; padding: 0 0 6px; }
.apa-cases-liste { display: flex; flex-wrap: wrap; gap: 6px 18px; }

.apa-case { display: inline-flex; align-items: center; gap: 6px; font-size: .95em; cursor: pointer; }
.apa-case input { margin: 0; }

.apa-repli { margin-bottom: 12px; }
.apa-repli summary {
  cursor: pointer; font-size: .88em; font-weight: 600; color: #4b5563;
  padding: 6px 0;
}
.apa-repli .apa-cases-liste { padding-top: 8px; flex-direction: column; gap: 6px; }

.apa-actions {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  border-top: 1px solid var(--apa-bord); padding-top: 12px;
}

.apa-resume { margin: 0; font-size: .92em; color: var(--apa-gris); }

.apa-bouton-discret {
  background: #fff; border: 1px solid #d1d5db; border-radius: 6px;
  padding: 7px 14px; font-size: .9em; cursor: pointer; color: #4b5563;
  font-family: inherit; text-transform: none; letter-spacing: normal;
  box-shadow: none; -webkit-appearance: none; appearance: none;
}
.apa-bouton-discret:hover { border-color: var(--apa-violet); color: var(--apa-violet); }

/* --- Carte et panneau ----------------------------------------------- */

.apa-corps { display: flex; gap: 18px; align-items: stretch; }

.apa-carte {
  flex: 1 1 60%;
  min-height: 520px;
  border-radius: 12px;
  border: 1px solid var(--apa-bord);
  z-index: 0;               /* reste sous les menus du thème */
}

.apa-panneau {
  flex: 1 1 34%;
  min-width: 280px;
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--apa-bord);
  border-radius: 12px;
  padding: 18px 20px;
  background: #fff;
}

.apa-panneau-vide { color: var(--apa-gris); font-size: .95em; }
.apa-note { font-size: .88em; color: var(--apa-gris); margin-top: 12px; }
.apa-chargement, .apa-erreur { color: var(--apa-gris); font-style: italic; }
.apa-erreur { color: #dc2626; font-style: normal; }

/* --- Marqueurs ------------------------------------------------------ */

.apa-marqueur { background: none; border: 0; }

.apa-pastille {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--apa-violet), var(--apa-violet2));
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  border: 2px solid #fff;
  transition: transform .12s ease;
}
.apa-pastille b { font-size: 1.05em; font-weight: 700; }
.apa-marqueur:hover .apa-pastille { transform: scale(1.12); }

/* --- Contenu du panneau --------------------------------------------- */

.apa-panneau-tete { border-bottom: 1px solid var(--apa-bord); padding-bottom: 12px; margin-bottom: 14px; }
.apa-panneau-tete h3 { margin: 0; font-size: 1.25em; color: #111827; }
.apa-sous-titre { margin: 4px 0 0; font-size: .9em; color: var(--apa-gris); }

.apa-retour {
  background: none; border: 0; padding: 0 0 8px; cursor: pointer;
  font-size: .9em; color: var(--apa-violet);
  font-family: inherit; text-transform: none; letter-spacing: normal;
  box-shadow: none; -webkit-appearance: none; appearance: none;
}
.apa-retour:hover { text-decoration: underline; }

.apa-champs-bassin { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.apa-etiquette {
  background: #eef2ff; color: #4338ca;
  border-radius: 20px; padding: 3px 11px; font-size: .82em;
}

.apa-personnes { list-style: none; margin: 0; padding: 0; }
.apa-personnes li { margin: 0 0 6px; }

/* Les couleurs et la typographie sont fixées explicitement : de nombreux
   thèmes stylent <button> globalement (texte blanc, majuscules, ombre),
   ce qui rendait le nom illisible sur fond clair. */
.apa-personne {
  display: flex; flex-direction: column; gap: 2px;
  width: 100%; text-align: left; cursor: pointer;
  background: #f9fafb; border: 1px solid var(--apa-bord);
  border-radius: 8px; padding: 10px 13px;
  color: #1f2937;
  font-family: inherit; font-size: 1em; line-height: 1.4;
  text-transform: none; letter-spacing: normal; box-shadow: none;
  -webkit-appearance: none; appearance: none;
}
.apa-personne:hover { border-color: var(--apa-violet); background: #f5f7ff; color: #1f2937; }
.apa-personne:focus-visible { outline: 2px solid var(--apa-violet); outline-offset: 2px; }
.apa-nom { font-weight: 600; color: #111827; }
.apa-commune { font-size: .85em; color: var(--apa-gris); font-weight: 400; }

.apa-fiche { margin: 0 0 18px; }
.apa-fiche dt { font-size: .82em; font-weight: 600; color: var(--apa-gris);
                text-transform: uppercase; letter-spacing: .02em; margin-top: 12px; }
.apa-fiche dd { margin: 3px 0 0; font-size: .95em; }

.apa-contact-zone { margin: 18px 0 6px; }
.apa-bouton {
  display: inline-block; background: var(--apa-vert); color: #fff;
  padding: 11px 20px; border-radius: 8px; text-decoration: none; font-weight: 600;
}
.apa-bouton:hover { background: #059669; color: #fff; }

.apa-verif { font-size: .82em; color: var(--apa-gris); margin-top: 14px; }

/* --- Écrans étroits -------------------------------------------------- */

@media (max-width: 860px) {
  .apa-corps { flex-direction: column; }
  .apa-carte { min-height: 380px; }
  .apa-panneau { max-height: none; }
  .apa-filtres-ligne { flex-direction: column; gap: 12px; }
}

/* --- Formulaire de mise en relation ---------------------------------- */

.apa-contact {
  max-width: 680px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --apa-violet: #667eea; --apa-vert: #10b981;
  --apa-gris: #6b7280; --apa-bord: #e5e7eb;
}
.apa-contact h2 { margin-top: 0; }
.apa-contact .apa-note { margin-bottom: 22px; }
.apa-contact-form { display: flex; flex-direction: column; gap: 14px; }
.apa-contact-ligne { display: flex; gap: 14px; flex-wrap: wrap; }
.apa-contact-ligne .apa-champ { flex: 1 1 200px; }

.apa-contact .apa-champ { display: flex; flex-direction: column; gap: 4px; }
.apa-contact .apa-champ > span { font-size: .9em; font-weight: 600; color: #4b5563; }
.apa-contact input[type="text"],
.apa-contact input[type="email"],
.apa-contact textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: 1em; font-family: inherit; background: #fff;
}
.apa-contact textarea { resize: vertical; }

.apa-contact .apa-bouton {
  display: inline-block; background: var(--apa-vert); color: #fff;
  border: 0; padding: 12px 24px; border-radius: 8px; font-size: 1em;
  font-weight: 600; cursor: pointer; font-family: inherit;
}
.apa-contact .apa-bouton:hover { background: #059669; }

.apa-contact-ok { border-left: 4px solid var(--apa-vert); padding-left: 18px; }

/* Piège à robots : hors écran plutôt que display:none, que certains
   automates détectent. Inaccessible au clavier et aux lecteurs d'écran. */
.apa-piege {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden;
}
