/* Racines : identité IDPEI (vert profond, crème, orange). Ton sobre et chaleureux. */
:root {
  /* Couleurs liturgiques : violet du deuil et du recueillement, or et blanc de la lumière, parchemin de la mémoire. */
  --fond: #f4eddd;
  --carte: #fffaf0;
  --texte: #2b2233;
  --discret: #6e6378;
  --trait: #e3d6bf;
  --marque: #4b2c5e;
  --marque-claire: #6d4a85;
  --accent: #b08a3e;
  --or-clair: #e8d39a;
  --erreur: #8c2a2a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: 17px;
  line-height: 1.6;
  /* Lumière douce venue d'en haut, et en filigrane une croix et un cierge. */
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(255, 246, 214, .95), rgba(244, 237, 221, 0) 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='320' viewBox='0 0 220 320'%3E%3Cg fill='none' stroke='%234b2c5e' stroke-opacity='.06' stroke-width='2'%3E%3Cpath d='M110 30v160M70 80h80'/%3E%3Cpath d='M100 300v-70h20v70z'/%3E%3Cpath d='M110 222c-7-9-7-18 0-28 7 10 7 19 0 28z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: top center, right 4% bottom 2%;
  background-attachment: scroll, fixed;
  background-size: 100% 420px, 180px auto;
}
header.haut { background: linear-gradient(180deg, #3a2148, var(--marque)); color: #fbf3df; border-bottom: 2px solid var(--accent); }
header.haut .contenu {
  max-width: 44rem; margin: 0 auto; padding: 10px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
}
header.haut a { color: #fff; text-decoration: none; font-weight: 600; }
header.haut .marque { font-size: 1.35rem; margin-right: auto; letter-spacing: .06em; font-weight: 500; color: #fbf3df; }
header.haut .marque::before { content: "✝"; color: var(--or-clair); margin-right: 8px; font-size: 1rem; }
header.haut .devise { display: block; font-size: .75rem; letter-spacing: .08em; color: var(--or-clair); font-style: italic; font-weight: 400; }
.nav-admin { display: flex; gap: 12px; }
.nav-admin a { opacity: .85; }
.nav-admin a[aria-current="page"] { opacity: 1; border-bottom: 2px solid var(--or-clair); }
main { max-width: 44rem; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.6rem; margin: 10px 0 12px; color: var(--marque); font-weight: 500; letter-spacing: .01em; }
h1::after { content: "✦"; display: block; color: var(--accent); font-size: .8rem; margin-top: 4px; }
h2 { font-size: 1.15rem; margin: 26px 0 8px; color: var(--marque); font-weight: 500; font-style: italic; }
h3 { font-size: 1rem; margin: 18px 0 6px; color: var(--marque-claire); }
a { color: var(--marque-claire); }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: 6px; padding: 12px 14px; margin: 8px 0;
  box-shadow: 0 1px 0 rgba(176, 138, 62, .15), inset 0 0 24px rgba(232, 211, 154, .12); }
.discret { color: var(--discret); font-size: .9rem; }
.etat {
  display: inline-block; margin: 4px 0 12px; padding: 2px 12px;
  border: 1px solid var(--accent); border-radius: 999px; color: #7a5a1c; background: #f7ecd0;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .1em;
}
button, .bouton {
  display: inline-block; margin-top: 14px; padding: 10px 16px; font: inherit; font-weight: 600;
  background: var(--marque); color: #fbf3df; border: 1px solid #3a2148; border-radius: 6px; text-decoration: none; cursor: pointer;
  font-family: inherit; letter-spacing: .02em;
}
button.secondaire, .bouton.secondaire { background: #fff; color: var(--marque); border: 1px solid var(--marque); }
.document { background: var(--carte); border: 1px solid var(--trait); border-radius: 12px; padding: 4px 16px 12px; }
.document ul { padding-left: 1.2rem; }
.document li { margin: 4px 0; }
.document .tableau { overflow-x: auto; }
.document table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.document th, .document td { border: 1px solid var(--trait); padding: 4px 8px; text-align: left; }
footer.bas { max-width: 44rem; margin: 28px auto; padding: 12px 16px 0; color: var(--discret); font-size: .8rem; text-align: center; border-top: 1px solid var(--trait); }
/* Recherche, fiches, formulaires (v0.2) */
.recherche .ligne, .position .ligne { display: flex; gap: 8px; }
.recherche input { flex: 1; }
input, textarea { font: inherit; padding: 9px 10px; border: 1px solid var(--trait); border-radius: 8px; background: #fff; width: 100%; }
.recherche button { margin-top: 0; }
.formulaire label, fieldset label { display: block; margin: 8px 0; font-size: .95rem; }
fieldset { border: 1px solid var(--trait); border-radius: 10px; margin: 10px 0; padding: 8px 12px; }
legend { color: var(--marque); font-weight: 600; padding: 0 4px; }
label.choix { display: flex; gap: 8px; align-items: center; }
label.choix input { width: auto; }
.resultats { list-style: none; padding: 0; margin: 12px 0; }
a.carte.lien { display: block; text-decoration: none; color: inherit; }
a.carte.lien strong { color: var(--marque); }
a.carte.lien span { display: block; }
.rangee { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pastille { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .75rem; background: #f7ecd0; color: #7a5a1c; border: 1px solid var(--accent); }
.pastille.grise { background: #eee9df; color: var(--discret); border-color: var(--trait); }
.photo { display: block; width: 100%; max-height: 60vh; object-fit: contain; border-radius: 8px; background: #eee9df; }
button.petit, .bouton.petit { margin-top: 0; padding: 6px 10px; font-size: .85rem; }
button.danger { color: var(--erreur); border-color: var(--erreur); }
button:disabled { opacity: .55; cursor: not-allowed; }
.erreur { border-color: var(--erreur); color: var(--erreur); }
/* Relevés, identification, guidage */
.plan { width: 100%; height: auto; background: #fff; border-radius: 8px; }
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.vignette { display: block; background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit; font-size: .85rem; }
.vignette img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.vignette span { display: block; padding: 4px 8px; }
.vignette.a-identifier { border-color: var(--accent); border-width: 2px; }
.photo.grande { max-height: 70vh; }
.ligne { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ligne .bouton, .ligne button { margin-top: 8px; }
.guider-titre { font-size: 1.25rem; }
.guidage .consigne { font-weight: 600; color: var(--marque); min-height: 1.5em; }
.cadran { position: relative; max-width: 360px; margin: 8px auto; }
.cadran svg { display: block; width: 100%; height: auto; background: #fff; border-radius: 50%; border: 1px solid var(--trait); }
.fleche { position: absolute; top: 6px; right: 6px; width: 54px; height: 54px; display: grid; place-items: center;
  font-size: 34px; color: #fff; background: var(--accent); border-radius: 50%; transition: transform .3s; }
.mesures { text-align: center; font-size: 1.6rem; font-weight: 700; color: var(--marque); }
.mesures span + span { font-size: .9rem; font-weight: 400; color: var(--discret); }
.arrivee { border-color: var(--accent); }
/* v0.3 : défunts, entrées en photo */
.defunts { list-style: none; padding: 0; margin: 6px 0; }
.defunts li { padding: 2px 0; }
img.mini { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; }
.grandit { flex: 1; }
.rangee input { width: auto; flex: 1; }
details summary { cursor: pointer; margin: 8px 0; }
.vignette form { padding: 4px 6px; }
.vignette form input { padding: 4px 6px; font-size: .85rem; }
.acces-admin { display: inline-block; margin-left: 8px; color: var(--discret); text-decoration: none; opacity: .7; }
.acces-admin:hover { opacity: 1; }
/* Où suis-je ? */
.case-actuelle { text-align: center; }
.grande-case { font-size: 3rem; font-weight: 600; color: var(--marque); line-height: 1.1; }
.plan-direct { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--trait); border-radius: 10px; margin-top: 10px; }
.historique { max-height: 12rem; overflow-y: auto; }
.cases { text-align: center; margin-top: 4px; }
select { font: inherit; padding: 6px 8px; border: 1px solid var(--trait); border-radius: 8px; background: #fff; }
.succes { border-color: var(--marque-claire); color: var(--marque); }
.case-cible { animation: clignote 1.6s ease-in-out infinite; }
@keyframes clignote { 50% { opacity: .45; } }
/* Affiches de sépultures (résultats de recherche) */
.affiches { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 10px 0; }
@media (min-width: 720px) { .affiches { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.affiche { display: flex; flex-direction: column; background: var(--carte); border: 1px solid var(--accent); border-radius: 6px; box-shadow: 0 2px 6px rgba(75, 44, 94, .12); overflow: hidden; text-decoration: none; color: inherit; }
.affiche img, .affiche .sans-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #ece2cc; filter: sepia(.12); }
.affiche .sans-photo { display: grid; place-items: center; color: var(--discret); font-size: .85rem; }
.affiche-texte { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.affiche-texte .defunts { margin: 0; }
.affiche .aller { color: var(--marque); font-weight: 700; }

/* Recueillement : accueil, citation, séparateurs ornés */
.accueil-voeu { text-align: center; margin: 6px 0 14px; color: var(--marque-claire); font-style: italic; }
.accueil-voeu .cierge { display: block; font-size: 1.8rem; margin-bottom: 2px; }
hr { border: 0; text-align: center; margin: 18px 0; }
hr::before { content: "✦  ✝  ✦"; color: var(--accent); letter-spacing: .4em; font-size: .8rem; }
input, textarea, select { font-family: inherit; }
.defunts li { display: flex; gap: 8px; align-items: center; }
img.portrait { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--accent); filter: sepia(.15); flex: none; }
.defunt-bloc { background: rgba(255, 250, 240, .6); }
.titre-affiche { color: var(--marque); font-weight: 500; font-style: italic; }
/* Parcours de recueillement */
.affiche-lien { display: flex; flex-direction: column; text-decoration: none; color: inherit; flex: 1; }
.ajout-parcours { margin: 0 8px 8px; }
button.dans-parcours { background: #f2e8cc; border-color: var(--accent); color: #6b4f15; }
.lien-parcours { background: rgba(232, 211, 154, .18); border: 1px solid var(--or-clair); border-radius: 999px; padding: 2px 10px; font-size: .9rem; }
.liste-parcours { list-style: none; padding: 0; }
.etape { display: flex; gap: 10px; align-items: flex-start; }
.etape.fait { opacity: .6; }
.numero-etape { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.etape.fait .numero-etape { background: #c9bfd1; }
.partage .ligne .bouton, .partage .ligne button { margin-top: 4px; }
.completer-defunt { margin: .2rem 0 1rem; }
.completer-defunt > summary { cursor: pointer; color: var(--violet, #6d4a85); font-size: .95rem; }
.nb-defunts { margin: .3rem 0 .1rem; font-size: .9rem; color: var(--violet, #6d4a85); }
.bouquets p { margin: .25rem 0; }
.envoi { margin: .6rem 0; display: grid; gap: .3rem; }
.envoi progress { width: 100%; height: .9rem; accent-color: #6d4a85; }
.envoi-erreur [data-envoi-texte] { color: #8b2d2d; font-weight: 600; }
.filtres { flex-wrap: wrap; gap: .5rem; align-items: end; margin-top: .4rem; }
.filtres label { font-size: .9rem; }
.liste-admin { display: grid; gap: 10px; margin: 10px 0; }
.fiche-admin { display: grid; gap: .5rem; }
.fiche-admin-tete { display: flex; gap: 10px; text-decoration: none; color: inherit; }
.fiche-admin-tete img, .fiche-admin-tete .sans-photo { width: 72px; height: 96px; object-fit: cover; border-radius: 4px; background: #ece2cc; flex: none; display: grid; place-items: center; font-size: .75rem; color: var(--discret); }
.fiche-admin .pastille { margin-left: .4rem; }
.lien-prive .ligne, .fiche-admin [data-lien-prive] { flex-wrap: wrap; gap: .4rem; align-items: center; }
.prive { border-color: #b08a3e; }
.choix-sexe { display: flex; gap: 1rem; align-items: center; border: 0; padding: 0; margin: .2rem 0; }
.choix-sexe legend { float: left; margin-right: .5rem; }
.affiche .ajout-parcours { margin: 0 14px 14px; }
.affiche .sans-photo { aspect-ratio: auto; min-height: 3rem; }
/* Bulle d'aide « ? » en haut à droite (site public) */
.menu-aide { position: relative; margin-left: 8px; }
.menu-aide > summary { list-style: none; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--or-clair); color: var(--or-clair); font-weight: 700; font-size: 1.05rem; }
.menu-aide > summary::-webkit-details-marker { display: none; }
.menu-aide[open] > summary { background: var(--or-clair); color: var(--marque); }
.menu-aide nav { position: absolute; right: 0; top: 42px; z-index: 20; min-width: 230px; display: grid; background: var(--carte);
  border: 1px solid var(--accent); border-radius: 6px; box-shadow: 0 6px 18px rgba(40, 20, 50, .25); overflow: hidden; }
header.haut .menu-aide nav a { color: var(--marque); font-weight: 500; padding: 11px 14px; border-bottom: 1px solid #eadfc6; }
header.haut .menu-aide nav a:last-child { border-bottom: 0; font-size: .9rem; }
.aide p { margin: .2rem 0 .9rem; }
.contact-racines { margin: .8rem 0; }
