/* AccessiCheck — feuille de style unique. Sobre, contrastée (AA+), animations légères et désactivables. */
:root {
  --ink: #0b1220;
  --text: #1e293b;
  --muted: #475569;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #2447d6;
  --accent-strong: #1b37a8;
  --accent-soft: #eaefff;
  --ok: #0b6b3a;
  --ok-soft: #e7f6ee;
  --crit: #b42318;
  --crit-soft: #fef3f2;
  --imp: #b54708;
  --imp-soft: #fffaeb;
  --low: #175cd3;
  --low-soft: #eff8ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); font-weight: 750; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
code { font-family: var(--mono); font-size: 0.88em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; color: #fff; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.wrap { width: min(100% - 32px, var(--max)); margin-inline: auto; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 248, 251, 0.88); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { white-space: nowrap; color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 550; font-size: 0.95rem; }
.nav a:not(.btn):hover { background: #e9edf5; color: var(--ink); }
.nav a[aria-current="page"] { color: var(--accent-strong); }
.nav .btn { margin-left: 6px; }
@media (max-width: 640px) {
  .nav a.hide-sm { display: none; }
  .nav .btn { padding: 9px 14px; font-size: 0.9rem; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: 1rem; line-height: 1.2;
  padding: 13px 22px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -8px rgba(36, 71, 214, .7); }
.btn-primary:hover { background: var(--accent-strong); color: #fff; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: #f1f5f9; color: var(--ink); border-color: #94a3b8; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: progress; transform: none; }
.btn-lg { padding: 15px 26px; font-size: 1.05rem; }
.btn-sm { padding: 8px 14px; font-size: .9rem; border-radius: 8px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(48px, 9vw, 96px) 0 clamp(40px, 7vw, 72px);
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(36, 71, 214, .12), transparent 60%),
    radial-gradient(700px 360px at 0% 0%, rgba(11, 107, 58, .07), transparent 60%),
    var(--bg);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 650; color: var(--accent-strong);
  background: var(--accent-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 { max-width: 22ch; }
.hero .lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); max-width: 62ch; margin-bottom: 28px; }
.scan-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; max-width: 760px;
}
.scan-form { display: flex; flex-direction: column; gap: 12px; }
.scan-form label { font-weight: 650; color: var(--ink); font-size: .95rem; }
.scan-row { display: flex; gap: 10px; }
.scan-row input { flex: 1; min-width: 0; }
@media (max-width: 560px) { .scan-row { flex-direction: column; } .scan-row .btn { width: 100%; } }
input[type="text"], input[type="email"], input[type="url"], textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line-strong);
  border-radius: 10px; padding: 13px 14px; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #64748b; }
input:hover, textarea:hover { border-color: #94a3b8; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(36, 71, 214, .18); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--crit); }
.hint { color: var(--muted); font-size: .9rem; margin: 0; }
.scan-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; padding: 0; color: var(--muted); font-size: .9rem; }
.scan-meta li { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.check-ico { width: 16px; height: 16px; color: var(--ok); flex: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; }
.link-btn:hover { color: var(--accent-strong); }

/* ---------- Sections génériques ---------- */
section.block { padding: clamp(44px, 7vw, 80px) 0; }
.section-head { max-width: 62ch; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.kicker { color: var(--accent-strong); font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-4, .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card p:last-child { margin-bottom: 0; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step { position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 750; margin-bottom: 14px;
}
.card.lift { transition: transform .2s ease, box-shadow .2s ease; }
.card.lift:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(15, 23, 42, .06), 0 16px 32px -14px rgba(15, 23, 42, .2); }
.ico { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; margin-bottom: 14px; }
.ico svg { width: 22px; height: 22px; }
.callout { border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); padding: 20px 22px; }
.callout.info { background: var(--low-soft); border-color: #b2ddff; }
.callout.warn { background: var(--imp-soft); border-color: #fedf89; }
.callout.error { background: var(--crit-soft); border-color: #fecdca; color: #7a271a; }
.callout h3 { margin-bottom: 6px; }
.callout p:last-child { margin: 0; }
.two-col { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.tick-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.tick-list li { display: flex; gap: 10px; align-items: flex-start; }
.tick-list svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: var(--ok); }
.tick-list.no svg { color: var(--crit); }

/* ---------- Chargement ---------- */
.loading { display: flex; gap: 16px; align-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.progress > span { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 99px; animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }

/* ---------- Rapport ---------- */
#rapport { padding: 8px 0 56px; }
#rapport:empty { display: none; }
.report-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.report-head h2 { margin-bottom: 4px; }
.report-meta { color: var(--muted); font-size: .92rem; margin: 0; overflow-wrap: anywhere; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash { display: grid; grid-template-columns: 300px 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } }
.score-card { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.ring { position: relative; width: 168px; height: 168px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .bar { transition: stroke-dashoffset 1.1s cubic-bezier(.2, .8, .2, 1); }
.ring-value { position: absolute; inset: 0; display: grid; place-content: center; }
.ring-value strong { font-size: 2.8rem; line-height: 1; color: var(--ink); letter-spacing: -0.04em; }
.ring-value span { font-size: .85rem; color: var(--muted); }
.score-label { font-weight: 650; color: var(--ink); margin: 6px 0 0; }
.score-note { font-size: .82rem; color: var(--muted); margin: 0; max-width: 24ch; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }
.stat { border-radius: var(--radius-sm); padding: 16px; border: 1px solid transparent; }
.stat b { display: block; font-size: 2rem; line-height: 1.1; letter-spacing: -0.03em; }
.stat span { font-size: .92rem; font-weight: 600; }
.stat.crit { background: var(--crit-soft); color: var(--crit); border-color: #fecdca; }
.stat.imp { background: var(--imp-soft); color: var(--imp); border-color: #fedf89; }
.stat.low { background: var(--low-soft); color: var(--low); border-color: #b2ddff; }
.summary-line { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 16px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: .92rem; }
.summary-line strong { color: var(--ink); }
.stack-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--line); margin: 16px 0 0; }
.stack-bar i { display: block; height: 100%; transition: width .9s ease; }
.stack-bar .c { background: var(--crit); } .stack-bar .i { background: #dc6803; } .stack-bar .l { background: #2e90fa; }
.disclaimer { margin: 0 0 24px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 14px; }
.toolbar h3 { margin: 0; font-size: 1.3rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .9rem; font-weight: 600; padding: 7px 14px; border-radius: 99px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1.5px solid var(--line-strong); transition: all .15s;
}
.chip:hover { border-color: #64748b; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.issues { display: grid; gap: 10px; }
.issue { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.issue[hidden] { display: none; }
.issue > summary {
  list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 16px 18px;
}
.issue > summary::-webkit-details-marker { display: none; }
.issue > summary:hover { background: #fafbfd; }
.issue-title { font-weight: 650; color: var(--ink); }
.issue-count { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.chev { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; }
.issue[open] > summary .chev { transform: rotate(180deg); }
@media (max-width: 640px) {
  .issue > summary { grid-template-columns: 1fr auto; }
  .issue > summary .badge { grid-column: 1 / -1; justify-self: start; }
  .issue-count { grid-column: 1; }
}
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; letter-spacing: .02em; }
.badge.crit { background: var(--crit-soft); color: var(--crit); border: 1px solid #fecdca; }
.badge.imp { background: var(--imp-soft); color: var(--imp); border: 1px solid #fedf89; }
.badge.low { background: var(--low-soft); color: var(--low); border: 1px solid #b2ddff; }
.issue-body { padding: 4px 18px 20px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.issue-body h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 14px 0 4px; font-weight: 700; }
.issue-body p { margin: 0; }
.fix { background: var(--ok-soft); border: 1px solid #b7e4c7; border-radius: var(--radius-sm); padding: 12px 14px; color: #0b3d22; }
.fix h4 { color: var(--ok); margin-top: 0; }
.refs { display: flex; flex-wrap: wrap; gap: 6px; }
.ref { font-size: .8rem; background: #eef2f7; color: var(--text); padding: 3px 9px; border-radius: 6px; font-weight: 600; }
.els { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.el { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: #fbfcfe; }
.el .sel { font-family: var(--mono); font-size: .82rem; color: var(--accent-strong); overflow-wrap: anywhere; }
.el .snip { display: block; margin-top: 6px; font-family: var(--mono); font-size: .8rem; color: #334155; background: #eef2f7; padding: 8px 10px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.el .det { margin: 6px 0 0; font-size: .88rem; color: var(--muted); }
.demo-banner { margin-bottom: 18px; }
.notes { display: grid; gap: 10px; margin-top: 10px; }
.note-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; }
.note-item b { color: var(--ink); }
.note-item p { margin: 4px 0 0; color: var(--muted); font-size: .94rem; }
.empty-state { text-align: center; padding: 32px 20px; }

/* ---------- CTA + formulaire ---------- */
.cta {
  margin-top: 36px; border-radius: 20px; padding: clamp(24px, 5vw, 44px);
  background: linear-gradient(135deg, #0b1220 0%, #16224a 100%); color: #e2e8f0;
}
.cta h3, .cta h2 { color: #fff; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.cta p { color: #cbd5e1; max-width: 60ch; }
.form-panel { background: var(--surface); color: var(--text); border-radius: var(--radius); padding: 22px; margin-top: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 650; color: var(--ink); margin-bottom: 6px; font-size: .95rem; }
.field .opt { font-weight: 500; color: var(--muted); }
.err { color: var(--crit); font-size: .88rem; margin: 6px 0 0; font-weight: 550; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--accent); }
.form-status { margin-top: 14px; }
.success { background: var(--ok-soft); border: 1px solid #b7e4c7; color: #0b3d22; border-radius: var(--radius-sm); padding: 16px 18px; font-weight: 550; }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: .92rem; background: var(--surface); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.site-footer p { margin: 0 0 6px; max-width: 70ch; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Page service ---------- */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: t; }
.timeline li { counter-increment: t; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.timeline li::before { content: counter(t); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 750; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 650; color: var(--ink); }
.faq details > div { padding: 0 18px 16px; color: var(--muted); }

/* ---------- Animations d'apparition (progressives) ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Impression / export PDF du rapport ---------- */
@media print {
  body { background: #fff; }
  .site-header, .site-footer, .hero, #comment, #detection, .report-actions, .cta, .filters, .skip-link, #honnetete, .no-print { display: none !important; }
  .card, .issue, .note-item { box-shadow: none; break-inside: avoid; }
  #rapport { padding: 0; }
  .issue-body { display: grid !important; }
}

/* ---------- Utilitaires (la CSP interdit les styles inline) ---------- */
.flush-top { padding-top: 0 !important; }
.cta-spaced { margin-top: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

#rapport, #report-title, section[id] { scroll-margin-top: 80px; }
