:root {
  --fond: #F5F3EE; --carte: #FFFFFF; --encre: #15171C; --doux: #6B6F76; --trait: #E6E2D9;
  --vert: #1F7A4D; --vert-doux: #E6F2EB; --ambre: #A9670F; --ambre-doux: #FBF0DC; --rouge: #B83A2E; --rouge-doux: #F8E4E1;
  --rayon: 16px; --ombre: 0 1px 2px rgba(21, 23, 28, .05), 0 4px 16px rgba(21, 23, 28, .04);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fond); color: var(--encre); }
body { font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 600; text-decoration: none; }
.btn-noir { background: var(--encre); color: #fff; }
.btn-clair { background: var(--carte); color: var(--encre); border: 1px solid var(--trait); }
.erreur { color: var(--rouge); font-size: 14px; margin: 8px 0 0; }

/* Connexion */
#connexion { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.connexion-boite { width: 100%; max-width: 360px; text-align: center; }
.connexion-logo { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--ombre); }
.connexion-boite h1 { font-size: 26px; margin-top: 18px; }
.connexion-boite p { color: var(--doux); margin: 6px 0 24px; }
#form-code { display: grid; gap: 10px; }
#form-code input { border: 1px solid var(--trait); background: var(--carte); border-radius: 12px; padding: 14px 16px; text-align: center; font-size: 17px; }

/* Liste */
.haut { position: sticky; top: 0; z-index: 5; background: rgba(245, 243, 238, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px; border-bottom: 1px solid var(--trait); }
.haut-ligne { display: flex; align-items: baseline; justify-content: space-between; max-width: 720px; margin: 0 auto 10px; }
.haut h1 { font-size: 28px; font-weight: 750; }
.compte { color: var(--doux); font-size: 15px; font-variant-numeric: tabular-nums; }
.filtres { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 720px; margin: 0 auto; }
.filtres input { grid-column: 1 / -1; }
.filtres input, .filtres select { width: 100%; border: 1px solid var(--trait); background: var(--carte); border-radius: 11px; padding: 10px 12px; font-size: 15px; appearance: none; -webkit-appearance: none; }
.filtres select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6F76' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 30px; }
.cartes { max-width: 720px; margin: 0 auto; padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.carte { display: block; width: 100%; text-align: left; background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 15px 16px; box-shadow: var(--ombre); transition: transform .12s ease; }
.carte:active { transform: scale(.985); }
.carte-haut { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.carte h2 { font-size: 17px; font-weight: 650; line-height: 1.3; }
.carte .sous { color: var(--doux); font-size: 14px; margin-top: 2px; }
.carte .bas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.puce { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: #F0EDE6; color: #45484E; white-space: nowrap; }
.puce.vert { background: var(--vert-doux); color: var(--vert); }
.puce.ambre { background: var(--ambre-doux); color: var(--ambre); }
.puce.rouge { background: var(--rouge-doux); color: var(--rouge); }
.vide { text-align: center; color: var(--doux); padding: 56px 24px; }
.vide strong { display: block; color: var(--encre); font-size: 17px; margin-bottom: 4px; }
.squelette { height: 92px; border-radius: var(--rayon); background: linear-gradient(90deg, #ECE9E2 0%, #F4F2EC 50%, #ECE9E2 100%); background-size: 200% 100%; animation: luire 1.2s infinite linear; }
@keyframes luire { to { background-position: -200% 0; } }

.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--trait);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.onglets button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: #9A9DA3; padding: 4px 0; }
.onglets button.on { color: var(--encre); }

/* Fiche */
.fiche { position: fixed; inset: 0; z-index: 10; background: var(--fond); overflow-y: auto; -webkit-overflow-scrolling: touch; animation: entrer .22s ease-out; }
@keyframes entrer { from { transform: translateX(24px); opacity: 0; } }
.fiche-barre { position: sticky; top: 0; z-index: 2; background: rgba(245, 243, 238, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  padding: calc(8px + env(safe-area-inset-top)) 8px 8px; border-bottom: 1px solid var(--trait); }
.retour { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; font-weight: 600; font-size: 16px; padding: 6px 8px; color: var(--encre); }
.fiche-contenu { max-width: 720px; margin: 0 auto; padding: 18px 16px calc(40px + env(safe-area-inset-bottom)); }
.fiche-tete h1 { font-size: 26px; font-weight: 750; line-height: 1.2; }
.fiche-tete .sous { color: var(--doux); margin-top: 4px; }
.fiche-tete .adresse { color: var(--doux); font-size: 14px; margin-top: 2px; }
.fiche-tete .bas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.appeler { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 18px 0 10px; padding: 16px; border-radius: 14px;
  background: var(--vert); color: #fff; font-size: 19px; font-weight: 700; text-decoration: none; letter-spacing: .01em; box-shadow: 0 6px 18px rgba(31, 122, 77, .25); }
.appeler svg { width: 22px; height: 22px; }
.liens { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.liens .btn { font-size: 14.5px; padding: 11px; }
.liens .btn:only-child { grid-column: 1 / -1; }

.bloc { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px; margin-top: 14px; box-shadow: var(--ombre); }
.bloc > h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); font-weight: 700; margin-bottom: 10px; }
.astuce { display: flex; gap: 10px; background: var(--ambre-doux); border-color: #F1DDB6; color: #5C3E0A; font-size: 14.5px; }
.astuce svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--ambre); }
.astuce p { margin: 0; }
.astuce p + p { margin-top: 6px; }

.etapes { list-style: none; margin: 0; padding: 0; counter-reset: e; }
.etapes > li { position: relative; padding: 0 0 18px 40px; counter-increment: e; }
.etapes > li:last-child { padding-bottom: 0; }
.etapes > li::before { content: counter(e); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--encre); color: #fff;
  font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.etapes > li:not(:last-child)::after { content: ""; position: absolute; left: 12.5px; top: 30px; bottom: 4px; width: 1px; background: var(--trait); }
.etapes h3 { font-size: 16px; font-weight: 650; line-height: 26px; }
.etapes .aide { color: var(--doux); font-size: 14px; margin: 2px 0 8px; }
.dire { margin: 6px 0 0; padding: 12px 14px; background: #F7F5F0; border-radius: 12px; border-left: 3px solid var(--encre); font-size: 15.5px; }
.points { margin: 6px 0 0; padding-left: 18px; }
.points li { margin: 3px 0; }
.idees { display: grid; gap: 8px; margin-top: 8px; }
.idee { border: 1px solid var(--trait); border-radius: 12px; padding: 12px 14px; }
.idee h4 { margin: 0; font-size: 15.5px; }
.idee p { margin: 4px 0 0; font-size: 14.5px; color: #3D4046; }
.idee .gain { color: var(--vert); font-weight: 600; }

details.objection { border-top: 1px solid var(--trait); }
details.objection:first-of-type { border-top: 0; }
details.objection summary { list-style: none; cursor: pointer; padding: 12px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; }
details.objection summary::-webkit-details-marker { display: none; }
details.objection summary::after { content: "+"; color: var(--doux); font-weight: 400; font-size: 20px; line-height: 1; }
details.objection[open] summary::after { content: "−"; }
details.objection p { margin: 0 0 12px; color: #3D4046; }

.resultats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.resultats button { border: 1px solid var(--trait); background: var(--carte); border-radius: 12px; padding: 12px 8px; font-weight: 600; font-size: 14.5px; }
.resultats button.on { background: var(--encre); border-color: var(--encre); color: #fff; }
.champ { display: grid; gap: 6px; margin-top: 12px; font-size: 14px; color: var(--doux); font-weight: 600; }
.champ input, .champ textarea { border: 1px solid var(--trait); background: #fff; border-radius: 11px; padding: 11px 12px; font-size: 16px; color: var(--encre); font-weight: 400; }
.champ textarea { min-height: 84px; resize: vertical; }
.enregistrer { width: 100%; margin-top: 14px; padding: 15px; font-size: 16px; }
.historique { color: var(--doux); font-size: 13.5px; margin-top: 10px; }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; background: var(--encre); color: #fff;
  padding: 11px 18px; border-radius: 99px; font-weight: 600; font-size: 14.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); animation: monter .2s ease-out; }
@keyframes monter { from { transform: translate(-50%, 10px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 760px) { .cartes { grid-template-columns: 1fr 1fr; } }
.alerte { background: var(--rouge-doux); border-color: #EFC9C3; color: var(--rouge); font-size: 15px; }
.aide-bloc { color: var(--doux); font-size: 14px; margin: -4px 0 8px; }
.sms { width: 100%; margin-top: 8px; padding: 14px; font-size: 15.5px; }
.resultats button:last-child:nth-child(odd) { grid-column: 1 / -1; }
