/* Logipiste — feuille de style unique, mobile-first. Couleurs tirées du logo :
   bleu marine #17324D, orange #F26B3A, gris-bleu #B8C7D9 */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/poppins-600.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/poppins-700.woff2) format("woff2"); }
:root {
  --navy: #17324d;        /* fond du logo : ne pas modifier, la bande doit s'y fondre */
  --orange: #f26b3a;
  --mist: #b8c7d9;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #edf1f6;
  --text: #14263a;
  --muted: #4f5f72;
  --border: #d6dde6;
  --primary: #17324d;
  --primary-ink: #ffffff;
  --primary-soft: #e7edf4;
  --accent: #f26b3a;
  --accent-text: #b9461b; /* orange assombri : lisible sur fond clair (contraste 5.3) */
  --call: #0b7a3e;
  --call-ink: #ffffff;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --warn-soft: #fff4e0;
  --mark: #ffd9c7;
  --focus: #f26b3a;
  --ad-ink: #5f6670;
  --band-bg: var(--navy);
  --radius: 12px;
  --shadow: 0 1px 2px rgba(23, 50, 77, .06), 0 1px 3px rgba(23, 50, 77, .1);
  --font-title: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ad-top-h: 100px; /* 12 + libellé 14 + 50 (300x50 / 320x50) + 24 marge de sécurité (≥ 20) */
  color-scheme: light dark;
}
@media (min-width: 920px) {
  :root { --ad-top-h: 130px; } /* 8 + libellé 12 + 90 (728x90) + 20 marge de sécurité */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1a27;
    --surface: #152536;
    --surface-2: #1c2f43;
    --text: #e8eef5;
    --muted: #a8b7c8;
    --border: #2a3f55;
    --primary: #9ec3ea;
    --primary-ink: #0e1a27;
    --primary-soft: #1f3550;
    --accent-text: #ff9a70;
    --call: #4cc281;
    --call-ink: #06210f;
    --danger: #ff8a80;
    --danger-soft: #3a1c1a;
    --warn-soft: #33290f;
    --mark: #7a3a1f;
    --ad-ink: #9aa3ad;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--ad-top-h) + 12px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primary); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1, h2, .acc > summary h2 { font-family: var(--font-title); font-weight: 700; letter-spacing: -.01em; }
h1 { color: var(--primary); }
h1 { font-size: clamp(1.45rem, 5vw, 2.05rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1.02rem; }
p { margin: 0 0 .75em; }
ul { margin: 0 0 .75em; padding-left: 1.2em; }
mark.hl { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--surface); padding: 8px 12px; }
.skip:focus { left: 8px; top: calc(var(--ad-top-h) + 8px); }
.icon { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- En-tête : bande bleu marine avec le logo (unique) et la pub ---------- */
/* < 560 px : icône maison + pub 300x50 · 560-919 px : logo réduit + pub 320x50 · ≥ 920 px : logo + pub 728x90 */
.ad-top {
  position: sticky; top: 0; z-index: 50;
  height: var(--ad-top-h);
  background: var(--band-bg);
  padding: 12px 0 24px; /* ≥ 20 px entre la pub et tout bouton du site */
  overflow: hidden;
}
/* Mobile : icône collée à gauche, tout le reste de la largeur pour la pub */
.topbar {
  height: 100%; max-width: 1024px; margin: 0 auto; padding: 0 6px;
  display: flex; align-items: center; justify-content: flex-start; gap: 6px;
}
.topbar-brand { flex: none; line-height: 0; border-radius: 6px; }
/* Hauteur fixée, largeur calculée : le logo garde toujours ses proportions */
.topbar-brand img { width: auto; object-fit: contain; }
.topbar-brand .logo-icon { display: block; height: 44px; }
.topbar-brand .logo-full { display: none; }
.ad-box { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.ad-label {
  display: block; height: 14px; margin: 0;
  font-size: 10px; line-height: 14px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .72);
}
.ad-slot { display: flex; align-items: center; justify-content: center; }
.ad-top .ad-slot { width: 300px; height: 50px; }
.ad-top .ad-placeholder { background-color: #f1f3f5; color: #5f6670; border-color: rgba(255, 255, 255, .4); }
@media (max-width: 359px) { .topbar-brand { display: none; } } /* très petits écrans : la pub d'abord */
@media (min-width: 380px) { .ad-top .ad-slot { width: 320px; } }
@media (min-width: 560px) {
  .topbar { padding: 0 12px; gap: 16px; }
  .topbar-brand .logo-icon { display: none; }
  .topbar-brand .logo-full { display: block; height: 40px; }
}
@media (min-width: 920px) {
  .ad-top { padding: 8px 0 20px; }
  .topbar { padding: 0 16px; justify-content: space-between; gap: 24px; }
  .ad-box { flex: none; align-items: flex-start; }
  .ad-label { height: 12px; line-height: 12px; }
  .topbar-brand .logo-full { height: 48px; }
  .ad-top .ad-slot { width: 728px; height: 90px; }
}
@media (min-width: 1200px) {
  .topbar-brand .logo-full { height: 64px; }
}
.ad-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, transparent 0 8px, rgba(127,127,127,.08) 8px 16px);
  border: 1px dashed rgba(127,127,127,.45);
  color: var(--ad-ink); font-size: 12px;
}

/* ---------- Mise en page ---------- */
.layout { max-width: 820px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 1200px) {
  .layout { max-width: 1024px; }
}
main { min-width: 0; padding-bottom: 32px; }

/* ---------- En-tête ---------- */
.hero { padding: 20px 0 8px; }
.hero .lead { color: var(--muted); margin-bottom: 14px; }
.search { position: relative; margin: 0 0 12px; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 22px; height: 22px; pointer-events: none; }
.search input {
  width: 100%; height: 56px;
  padding: 0 48px 0 46px;
  font: inherit; font-size: 1.08rem;
  color: var(--text); background: var(--surface);
  border: 2px solid var(--primary); border-radius: 14px;
  box-shadow: var(--shadow);
  -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; background: none; color: var(--muted); border-radius: 10px; cursor: pointer;
  display: none; align-items: center; justify-content: center;
}
.search .clear.show { display: flex; }

.urgent {
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
  background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: var(--radius); padding: 10px 12px; margin: 0 0 14px;
}
.urgent p { margin: 0; flex: 1 1 220px; font-size: .95rem; }
.urgent strong { color: var(--danger); }
.btn-urgent {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 14px;
  background: var(--danger); color: #fff; border-radius: 10px; text-decoration: none; font-weight: 700;
}
@media (prefers-color-scheme: dark) { .btn-urgent { color: #2a0a08; } }

.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px;
  scroll-snap-type: x proximity; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 2px 0 10px; } }
.chip {
  flex: none; scroll-snap-align: start;
  min-height: 40px; padding: 8px 14px;
  font: inherit; font-size: .92rem; font-weight: 600;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); } /* bleu foncé du logo, clair ou sombre */

.is-searching .toolbar { display: none; }
.status { min-height: 1.5em; margin: 4px 0 8px; font-weight: 600; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 16px; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; }
.toc summary { padding: 12px 14px; cursor: pointer; font-weight: 700; min-height: 44px; }
.toc ol { margin: 0; padding: 0 14px 12px 36px; columns: 1; }
@media (min-width: 640px) { .toc ol { columns: 2; } }
.toc li { padding: 3px 0; break-inside: avoid; }
.btn-small {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px;
  font: inherit; font-size: .88rem; font-weight: 600; text-decoration: none; cursor: pointer;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}

/* ---------- Sections ---------- */
.section { margin: 28px 0 0; }
/* Mobile : on ne calcule le rendu des sections qu'à l'approche de l'écran (gros gain sur téléphone) */
@media (max-width: 1199px) { .section { content-visibility: auto; contain-intrinsic-size: auto 900px; } }
.section > h2, .acc > summary h2 { display: flex; align-items: center; gap: 10px; }
.section > h2::before { content: ""; width: 6px; height: 1.1em; border-radius: 3px; background: var(--accent); }
.bloc { margin: 0 0 18px; }
.bloc > h3 { font-size: 1.05rem; color: var(--accent-text); margin: 18px 0 10px; }
.grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .grid--compact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.acc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.acc > summary { list-style: none; cursor: pointer; padding: 14px 16px; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary h2 { margin: 0; font-size: 1.15rem; }
.acc > summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--accent-text); font-weight: 400; }
.acc[open] > summary::after { content: "−"; }
.acc .acc-body { padding: 0 16px 14px; }
.acc .acc-body li { margin-bottom: .45em; }
.checklist { list-style: none; padding: 0; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; min-height: 44px; }
.checklist li:last-child label { border-bottom: 0; }
.checklist input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--call); }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }
.progress { font-size: .9rem; color: var(--muted); margin-top: 6px; }
.textblock { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.textblock ul { margin-bottom: .75em; }

/* ---------- Cartes ---------- */
.card {
  min-width: 0; overflow-wrap: anywhere;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 14px 12px; box-shadow: var(--shadow);
}
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; margin-bottom: 6px; }
.card-head h3, .card-head h4 { margin: 0; flex: 1 1 200px; font-size: 1.08rem; }
.badge { flex: none; font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); white-space: nowrap; }
.badge--urgence { background: var(--danger-soft); color: var(--danger); }
.desc { color: var(--text); font-size: .96rem; }
.meta { list-style: none; padding: 0; margin: 0 0 8px; color: var(--muted); font-size: .93rem; }
.meta li { display: flex; gap: 8px; align-items: flex-start; padding: 2px 0; }
.meta .icon { margin-top: .2em; }
.conds { margin: 0 0 8px; background: var(--surface-2); border-radius: 10px; }
.conds summary { cursor: pointer; padding: 8px 12px; font-weight: 700; font-size: .92rem; min-height: 40px; display: flex; align-items: center; }
.conds ul { padding: 0 12px 8px 30px; margin: 0; font-size: .93rem; }
.notes { list-style: none; padding: 0; margin: 0 0 8px; font-size: .92rem; }
.notes li { background: var(--warn-soft); border-radius: 8px; padding: 6px 10px; margin-bottom: 4px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.actions + .actions { margin-top: 8px; }
.pair { display: flex; gap: 6px; flex: 1 1 100%; min-width: 0; }
/* ≥ 520 px : téléphone, e-mail et site web se partagent la même ligne quand la place le permet */
@media (min-width: 520px) { .pair { flex: 1 1 320px; } }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 8px 14px;
  font: inherit; font-size: .95rem; font-weight: 700; text-decoration: none; cursor: pointer;
  color: var(--primary); background: var(--surface); border: 1.5px solid var(--primary); border-radius: 10px;
  max-width: 100%; min-width: 0;
}
.pair .btn:first-child { flex: 1; min-width: 0; justify-content: flex-start; }
.btn small { font-weight: 500; font-size: .85rem; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn .lbl { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; min-width: 0; overflow: hidden; }
.btn small { display: block; max-width: 100%; }
/* Boutons carrés à droite du numéro / de l'e-mail : seule l'icône d'action est colorée */
.btn--copy, .btn--icon { width: 48px; padding: 0; flex: none; }
.btn--copy { color: var(--muted); border-color: var(--border); }
.btn--icon .icon { width: 22px; height: 22px; }
.btn--call { background: var(--call); border-color: var(--call); color: var(--call-ink); }
.btn--mail { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn--copy.ok { color: var(--call); border-color: var(--call); }
.btn--link { flex: 1 1 auto; justify-content: flex-start; }
@media (min-width: 520px) { .btn--link { flex: 0 1 auto; } }
.hours { font-size: .85rem; color: var(--muted); margin: -2px 0 6px; flex: 1 1 100%; }

.empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; }
.empty .chips { justify-content: center; flex-wrap: wrap; overflow: visible; margin: 8px 0 0; padding: 0; }
[hidden] { display: none !important; }

/* ---------- Pied de page, pages légales ---------- */
.disclaimer { font-size: .9rem; color: var(--muted); background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; margin: 28px 0 12px; }
.site-footer { border-top: 1px solid var(--border); margin-top: 20px; padding: 18px 0 40px; font-size: .9rem; color: var(--muted); }
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 8px; margin-top: 12px; }
.prose h2 { font-size: 1.15rem; margin-top: 1.2em; }
.prose li { margin-bottom: .4em; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-bottom: 8px; }
.site-footer nav a { color: var(--muted); padding: 8px 0; display: inline-block; }

/* ---------- Guides et FAQ ---------- */
.crumbs { font-size: .88rem; color: var(--muted); margin: 16px 0 4px; }
.crumbs a { color: var(--muted); }
.guide { margin-top: 8px; }
.guide h1 { margin-bottom: .2em; }
.guide-meta { color: var(--muted); font-size: .88rem; }
.guide-cta { margin: 20px 0 12px; }
.lead { color: var(--muted); }
.guide-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .guide-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.guide-card {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 14px 16px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.guide-card:hover .guide-title { text-decoration: underline; }
.guide-title { font-family: var(--font-title); font-weight: 600; color: var(--primary); line-height: 1.3; }
.guide-sum { font-size: .92rem; color: var(--muted); }
.faq { display: grid; gap: 10px; margin-bottom: 8px; }
.faq-item > summary h2 { font-size: 1.02rem; }

.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .ad-top, .chips, .search, .to-top, .btn--copy { display: none !important; } }
