/* assistance.geneatique.com — charte Généatique (couleurs globales du site www.geneatique.com). */

:root {
  --vert: #4FA066;
  --vert-fonce: #2A6B4A;
  --ocre: #B95817;
  --or: #D0A53D;
  --texte: #2F322F;
  --discret: #5f655f;
  --fond: #f7f8f5;
  --carte: #ffffff;
  --cadre: #CAE0D0;
  --bord: #dde3dc;
  --lien: #23693f;
  --accent-fond: #eef6f0;
  --alerte-fond: #fdf1e8;
  --mark: #fbeaa0;
  --ombre: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --texte: #e6e9e4; --discret: #a6ada5; --fond: #161917; --carte: #1f2420; --cadre: #2f4a39; --bord: #2f3631;
    --lien: #8fd0a4; --accent-fond: #1d2c22; --alerte-fond: #3a2618; --mark: #5c4b12; --ombre: none;
    --vert-fonce: #7cc495; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte);
  font: 17px/1.6 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--lien); text-underline-offset: 2px; }
a:hover { color: var(--ocre); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: "Roboto Slab", Georgia, serif; font-weight: 500; line-height: 1.25; color: var(--vert-fonce); }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); margin: .4em 0 .6em; }
h2 { font-size: 1.35rem; margin: 1.6em 0 .6em; }
h3 { font-size: 1.1rem; margin: 0 0 .5em; }
.invisible { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: -9999px; }
.evitement:focus { left: 16px; top: 8px; z-index: 10; background: var(--carte); padding: 8px 12px; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }

/* --- Bandeau ----------------------------------------------------------------------------------- */
.bandeau { background: var(--carte); border-bottom: 3px solid var(--vert); }
.bandeau-int { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texte); }
.marque-logo { display: flex; }
.marque-nom { font-family: "Roboto Slab", Georgia, serif; font-size: 1.3rem; font-weight: 600; color: var(--vert-fonce); }
.marque-nom span { font-weight: 400; color: var(--ocre); }
.recherche-bandeau { flex: 1 1 220px; max-width: 420px; }
.recherche-bandeau input { width: 100%; padding: 8px 12px; border: 1px solid var(--bord); border-radius: 20px; background: var(--fond); color: var(--texte); font: inherit; font-size: .95rem; }
.menu { display: flex; gap: 6px; margin-left: auto; }
.menu a { text-decoration: none; padding: 8px 12px; border-radius: 6px; color: var(--texte); font-weight: 500; }
.menu a:hover, .menu a[aria-current] { background: var(--accent-fond); color: var(--vert-fonce); }
.menu .menu-contact { background: var(--ocre); color: #fff; }
.menu .menu-contact:hover, .menu .menu-contact[aria-current] { background: #9c4810; color: #fff; }
@media (max-width: 720px) {
  .bandeau-int { gap: 10px; }
  .recherche-bandeau { order: 3; flex-basis: 100%; max-width: none; }
  .menu { margin-left: auto; }
  .menu a { padding: 6px 8px; font-size: .95rem; }
}

/* --- Mise en page ------------------------------------------------------------------------------ */
.page { max-width: 1240px; margin: 0 auto; padding: 8px 16px 48px; min-height: 60vh; }
.fil ol { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: .88rem; color: var(--discret); }
.fil li + li::before { content: "›"; margin-right: 4px; }
.fil a { color: var(--discret); }
.chapeau { font-size: 1.08rem; color: var(--discret); max-width: 70ch; }
.deux-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .deux-colonnes { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

.bouton { display: inline-block; background: var(--vert); color: #fff; border: 0; border-radius: 6px; padding: 10px 18px;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.bouton:hover { background: var(--vert-fonce); color: #fff; }
.bouton-clair { background: var(--carte); color: var(--vert-fonce); }
.bouton-clair:hover { background: var(--accent-fond); color: var(--vert-fonce); }
.bouton-grand { font-size: 1.05rem; padding: 12px 26px; background: var(--ocre); }
.bouton-grand:hover { background: #9c4810; }

/* --- Accueil ----------------------------------------------------------------------------------- */
.accroche { text-align: center; padding: 40px 0 24px; }
.accroche p { color: var(--discret); margin-top: -.4em; }
.recherche-grande { position: relative; display: flex; gap: 8px; max-width: 720px; margin: 18px auto; }
.recherche-grande input { flex: 1; min-width: 0; padding: 13px 16px; font: inherit; border: 2px solid var(--cadre); border-radius: 8px; background: var(--carte); color: var(--texte); }
.recherche-grande input:focus { border-color: var(--vert); outline: none; }
.page > .recherche-grande, .erreur .recherche-grande { margin-left: 0; }
.suggestions { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin-top: 4px; background: var(--carte); border: 1px solid var(--bord);
  border-radius: 8px; box-shadow: var(--ombre); text-align: left; overflow: hidden; }
.suggestions a { display: block; padding: 9px 14px; text-decoration: none; color: var(--texte); border-top: 1px solid var(--bord); }
.suggestions a:first-child { border-top: 0; }
.suggestions a:hover, .suggestions a:focus { background: var(--accent-fond); }
.suggestions small { display: block; color: var(--discret); font-size: .8rem; }

.trois-portes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0 10px; }
@media (max-width: 760px) { .trois-portes { grid-template-columns: 1fr; } }
.porte { display: flex; flex-direction: column; gap: 4px; padding: 22px; background: var(--carte); border: 1px solid var(--bord); border-radius: 10px;
  text-decoration: none; color: var(--texte); box-shadow: var(--ombre); }
.porte:hover { border-color: var(--vert); color: var(--texte); }
.porte strong { font-size: 1.15rem; color: var(--vert-fonce); }
.porte span:last-child { color: var(--discret); font-size: .95rem; }
.porte-icone { font-size: 1.6rem; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-fond); color: var(--vert-fonce); font-weight: 700; }
.porte-contact .porte-icone { background: var(--alerte-fond); color: var(--ocre); }

.grille-rubriques { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.carte-rubrique { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; }
.carte-rubrique h3 a { text-decoration: none; color: var(--vert-fonce); }
.carte-rubrique ul { padding-left: 18px; margin: 0 0 10px; font-size: .95rem; flex: 1; }
.carte-rubrique li { margin: 4px 0; }
.tout-voir { font-size: .9rem; font-weight: 500; }

/* --- FAQ --------------------------------------------------------------------------------------- */
.sommaire-rubriques ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sommaire-rubriques a { display: inline-block; padding: 6px 12px; border-radius: 16px; background: var(--accent-fond); text-decoration: none; font-size: .92rem; }
.rubrique h2 a { text-decoration: none; color: inherit; }
.liste-faq { list-style: none; padding: 0; margin: 0; columns: 2 360px; column-gap: 32px; }
.liste-faq li { break-inside: avoid; padding: 7px 0 7px 22px; position: relative; border-bottom: 1px solid var(--bord); }
.liste-faq li::before { content: "?"; position: absolute; left: 0; top: 7px; color: var(--ocre); font-weight: 700; }
.deux-colonnes .liste-faq { columns: 1; }
.sous-titre { font-size: 1.15rem; }
details.question { background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; margin: 8px 0; }
details.question summary { cursor: pointer; padding: 12px 16px; font-weight: 500; }
details.question[open] summary { border-bottom: 1px solid var(--bord); }
.reponse { padding: 4px 16px 10px; }
.lien-permanent { font-size: .85rem; }

.article { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 8px 32px 28px; }
@media (max-width: 600px) { .article { padding: 4px 18px 20px; } }
.texte-article { overflow-wrap: anywhere; }
.texte-article img { border: 1px solid var(--bord); border-radius: 4px; margin: 8px 0; cursor: zoom-in; }
.texte-article iframe { max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.texte-article table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.texte-article td, .texte-article th { border: 1px solid var(--bord); padding: 6px 10px; }
.maj { color: var(--discret); font-size: .88rem; margin-top: 2em; }
.pas-resolu { margin-top: 28px; padding: 16px 20px; border-radius: 8px; background: var(--accent-fond); display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.pas-resolu p { margin: 0; }

.colonne-aide { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
@media (max-width: 900px) { .colonne-aide { position: static; } }
.encart { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 14px 18px; font-size: .95rem; }
.encart h2 { font-size: 1.05rem; margin: .3em 0 .6em; }
.encart ul { padding-left: 18px; margin: 0; }
.encart li { margin: 5px 0; }
.encart-contact { background: var(--alerte-fond); border-color: transparent; }

/* --- Guides ------------------------------------------------------------------------------------ */
.grille-guides { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.carte-guide { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 6px 24px 20px; }
.carte-guide h2 a { text-decoration: none; color: inherit; }
.chapitres { padding-left: 22px; }
.chapitres li { margin: 4px 0; }
.recherche-guide { display: flex; gap: 8px; max-width: 560px; margin: 16px 0 24px; }
.recherche-guide input { flex: 1; min-width: 0; padding: 10px 14px; font: inherit; border: 1px solid var(--bord); border-radius: 6px; background: var(--carte); color: var(--texte); }

.guide { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: start; margin-top: 12px; }
.guide-sommaire { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 10px 8px; font-size: .9rem; }
.guide-sommaire-bouton { display: none; }
.guide-page { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 18px 32px 24px; min-width: 0; }
@media (max-width: 900px) {
  .guide { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .guide-sommaire { position: static; max-height: none; padding: 0; }
  .guide-sommaire-bouton { display: block; width: 100%; text-align: left; padding: 12px 16px; font: inherit; font-weight: 500; background: none; border: 0; color: var(--vert-fonce); cursor: pointer; }
  .guide-sommaire-bouton::after { content: " ▾"; }
  .guide-sommaire nav { display: none; padding: 0 8px 10px; }
  .guide-sommaire.ouvert nav { display: block; }
  .guide-page { padding: 12px 18px 20px; }
}
.arbre { list-style: none; margin: 0; padding-left: 0; }
.arbre .arbre { padding-left: 14px; border-left: 1px solid var(--bord); margin-left: 6px; }
.arbre li { margin: 1px 0; }
.arbre a { display: inline-block; padding: 3px 6px; border-radius: 4px; text-decoration: none; color: var(--texte); }
.arbre a:hover { background: var(--accent-fond); }
.arbre a[aria-current] { background: var(--vert); color: #fff; }
.arbre > li > a { margin-left: 14px; }
.arbre summary { cursor: pointer; list-style-position: outside; margin-left: 14px; }
.arbre summary::marker { color: var(--discret); }
.arbre-0 > li > a, .arbre-0 > li > details > summary > a { font-weight: 600; color: var(--vert-fonce); }
.sommaire-complet { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 16px 20px; columns: 2 380px; }
.sommaire-complet .arbre-0 > li { break-inside: avoid; margin-bottom: 8px; }

.guide-texte { overflow-wrap: anywhere; }
.guide-texte h1 { display: block; font-size: 1.6rem; color: var(--vert-fonce); font-family: "Roboto Slab", Georgia, serif; font-weight: 500; }
.guide-texte h2, .guide-texte h3, .guide-texte h4 { display: block; font-family: "Roboto Slab", Georgia, serif; color: var(--vert-fonce); }
.guide-texte img { vertical-align: middle; }
.guide-texte img.capture { display: block; max-width: 100%; height: auto; margin: 10px 0; border: 1px solid var(--bord); border-radius: 4px; cursor: zoom-in; }
.guide-texte table { max-width: 100%; }
.guide-texte div.p a { color: var(--lien); text-decoration: underline; }
.guide-navigation { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--bord); font-size: .95rem; }
.guide-navigation .suivante { text-align: right; margin-left: auto; }

/* --- Recherche --------------------------------------------------------------------------------- */
.filtres { display: flex; gap: 8px; flex-wrap: wrap; }
.filtres a { padding: 4px 12px; border-radius: 14px; border: 1px solid var(--bord); text-decoration: none; font-size: .9rem; }
.filtres a[aria-current] { background: var(--vert); border-color: var(--vert); color: #fff; }
.resultats { list-style: none; padding: 0; max-width: 860px; }
.resultats li { padding: 14px 0; border-bottom: 1px solid var(--bord); }
.resultats li > a { font-size: 1.08rem; font-weight: 500; }
.resultats p { margin: 4px 0 0; color: var(--discret); font-size: .95rem; }
.resultat-fil { display: block; font-size: .82rem; color: var(--discret); }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 1px 7px; border-radius: 4px; margin-right: 6px; vertical-align: 2px; }
.badge-article, .badge-question { background: var(--accent-fond); color: var(--vert-fonce); }
.badge-guide { background: var(--alerte-fond); color: var(--ocre); }
mark { background: var(--mark); color: inherit; padding: 0 1px; }
.aucun-resultat { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 8px 22px 16px; max-width: 760px; }

/* --- Formulaire -------------------------------------------------------------------------------- */
.formulaire fieldset { border: 1px solid var(--bord); border-radius: 10px; background: var(--carte); padding: 10px 22px 6px; margin: 0 0 18px; }
.formulaire legend { font-family: "Roboto Slab", Georgia, serif; color: var(--vert-fonce); font-size: 1.1rem; padding: 0 6px; }
.formulaire label { display: block; font-weight: 500; margin-bottom: 4px; }
.formulaire input:not([type=file]):not([type=hidden]), .formulaire select, .formulaire textarea {
  width: 100%; padding: 9px 12px; font: inherit; border: 1px solid #b9c2b8; border-radius: 6px; background: var(--carte); color: var(--texte); }
.formulaire textarea { resize: vertical; min-height: 9em; }
.formulaire [aria-invalid="true"] { border-color: var(--ocre); box-shadow: 0 0 0 1px var(--ocre); }
.ligne-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .ligne-2 { grid-template-columns: 1fr; gap: 0; } }
.requis { color: var(--ocre); }
.facultatif, .aide { font-weight: 400; color: var(--discret); font-size: .88rem; }
.aide { display: block; margin-top: 4px; }
.erreur-champ { color: var(--ocre); font-size: .92rem; margin: 4px 0 0; font-weight: 500; }
.alerte { background: var(--alerte-fond); border-left: 4px solid var(--ocre); padding: 12px 16px; border-radius: 6px; margin-bottom: 18px; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rgpd { font-size: .85rem; color: var(--discret); }
.suggestions-contact { background: var(--accent-fond); border-radius: 8px; padding: 10px 16px; margin: -6px 0 14px; font-size: .95rem; }
.suggestions-contact strong { display: block; margin-bottom: 4px; }
.suggestions-contact ul { margin: 0; padding-left: 18px; }
.merci, .erreur { max-width: 720px; margin: 40px auto; background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 10px 32px 26px; }

/* --- Pied -------------------------------------------------------------------------------------- */
.pied { background: var(--vert-fonce); color: #e9f3ec; margin-top: 40px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pied { background: #12251a; } }
.pied-int { max-width: 1240px; margin: 0 auto; padding: 28px 16px 8px; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .pied-int { grid-template-columns: 1fr; } }
.pied a { color: #fff; }
.pied ul { list-style: none; padding: 0; margin: 8px 0 0; }
.pied li { margin: 5px 0; }
.pied .bouton-clair { color: var(--vert-fonce); }
.pied-copyright { text-align: center; font-size: .82rem; opacity: .8; margin: 0; padding: 12px 16px 18px; }

/* --- Visionneuse d'images ------------------------------------------------------------------------ */
.visionneuse { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.82); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.visionneuse[hidden] { display: none; }
.visionneuse img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 4px; }
.visionneuse-fermer { position: absolute; top: 10px; right: 14px; font-size: 2rem; line-height: 1; background: none; border: 0; color: #fff; cursor: pointer; }

/* --- Assistant « Silvia » (FAQ, contact) --------------------------------------------------------- */
.assistant { background: var(--carte); border: 1px solid var(--cadre); border-radius: 12px; box-shadow: var(--ombre); margin: 8px 0 28px; max-width: 860px; overflow: hidden; }
.assistant[hidden] { display: none; }
.assistant-tete { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--accent-fond); border-bottom: 1px solid var(--cadre); }
.assistant-tete strong { display: block; color: var(--vert-fonce); }
.assistant-tete span:not(.assistant-avatar) { font-size: .85rem; color: var(--discret); }
.assistant-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--carte); display: grid; place-items: center; flex: none; }
.assistant-recommencer { margin-left: auto; background: none; border: 1px solid var(--bord); border-radius: 14px; padding: 4px 12px; font: inherit; font-size: .85rem; color: var(--texte); cursor: pointer; }
.assistant-fil { padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 560px; overflow-y: auto; }
.bulle { max-width: 85%; padding: 10px 14px; border-radius: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.bulle p { margin: .3em 0; }
.bulle ol, .bulle ul { margin: .4em 0; padding-left: 22px; }
.bulle-silvia { align-self: flex-start; background: var(--fond); border: 1px solid var(--bord); border-bottom-left-radius: 4px; }
.bulle-moi { align-self: flex-end; background: var(--vert); color: #fff; border-bottom-right-radius: 4px; }
.assistant-liens li { margin: 4px 0; }
.assistant-liens small { color: var(--discret); }
.bulle-attente { display: flex; gap: 4px; padding: 14px 16px; }
.bulle-attente span { width: 7px; height: 7px; border-radius: 50%; background: var(--discret); animation: rebond 1.2s infinite ease-in-out; }
.bulle-attente span:nth-child(2) { animation-delay: .15s; }
.bulle-attente span:nth-child(3) { animation-delay: .3s; }
@keyframes rebond { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .bulle-attente span { animation: none; } }
.assistant-saisie { padding: 4px 16px 14px; }
.assistant-choix { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { font: inherit; font-size: .95rem; padding: 8px 14px; border-radius: 18px; border: 1px solid var(--vert); background: var(--carte); color: var(--vert-fonce); cursor: pointer; }
.puce:hover, .puce:focus-visible { background: var(--vert); color: #fff; }
.puce-discrete { border-color: var(--bord); color: var(--discret); }
.assistant-champ { display: flex; gap: 8px; align-items: flex-end; }
.assistant-champ textarea { flex: 1; min-width: 0; font: inherit; padding: 9px 12px; border: 1px solid #b9c2b8; border-radius: 8px; resize: vertical; background: var(--carte); color: var(--texte); }
.lien { background: none; border: 0; padding: 0; font: inherit; color: var(--lien); text-decoration: underline; cursor: pointer; }
.alerte-info { background: var(--accent-fond); border-left-color: var(--vert); }
