/* Outil d'audit : formulaire, chargement, rapport, administration */
/* La barre d'appel mobile masquerait le formulaire et le rapport : retirée sur les pages de l'outil */
.mobile-cta { display: none !important; }
.audit-form-card [hidden], [data-after-report][hidden], #audit-app [hidden] { display: none !important; }
.audit-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); grid-template-areas: "copy form" "promises form"; column-gap: clamp(28px, 5vw, 64px); row-gap: 8px; align-items: center; }
.audit-hero-grid .page-hero-copy { grid-area: copy; align-self: end; }
.audit-hero-grid .audit-promises { grid-area: promises; align-self: start; }
.audit-hero-grid .audit-form-card { grid-area: form; }
.audit-hero-grid .hero-lead { margin-bottom: 18px; }
@media (max-width: 920px) { .audit-hero-grid { grid-template-columns: 1fr; grid-template-areas: "copy" "form" "promises"; row-gap: 24px; } }
/* Mobile : le formulaire doit être visible dès l'arrivée (publicités Instagram, écran réduit
   par la barre de l'application) et le bandeau cookies ne doit pas le recouvrir. */
@media (max-width: 640px) {
  .audit-hero { padding-top: 14px; padding-bottom: 40px; }
  .audit-hero .breadcrumb { display: none; }
  .audit-hero .eyebrow { margin-bottom: 6px; font-size: 0.72rem; }
  .audit-hero h1 { font-size: 1.62rem; line-height: 1.15; margin-bottom: 0; }
  .audit-hero .hero-lead { display: none; }
  .audit-hero-grid { row-gap: 16px; }
  .audit-form-card { padding: 18px 16px; }
  .audit-form-card .form-steps { margin-bottom: 14px; font-size: 0.82rem; }
  .audit-form-card .form { gap: 14px; }
  .audit-form-card #audit-url-help { display: none; }
  .cookie-banner { bottom: calc(10px + env(safe-area-inset-bottom)); }
}
.audit-promises { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: var(--on-dark); }
.audit-promises li { display: flex; gap: 10px; align-items: flex-start; }
.audit-promises svg { width: 20px; height: 20px; color: var(--blue); flex-shrink: 0; margin-top: 3px; }
.audit-form-card { color: var(--text); }
.audit-form-card .form { display: grid; gap: 18px; }
.form-steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 22px; font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.form-steps li { display: flex; align-items: center; gap: 8px; flex: 1; padding-bottom: 10px; border-bottom: 3px solid var(--line); }
.form-steps li span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gray); font-size: 0.85rem; }
.form-steps li.is-current { color: var(--navy); border-color: var(--blue-strong); }
.form-steps li.is-current span { background: var(--blue); color: var(--navy); }
.field-help { margin: 6px 0 0; font-size: 0.85rem; color: var(--muted); }
.audit-url-recap { margin: 0; padding: 12px 14px; background: var(--blue-soft); border-radius: var(--radius-sm); font-size: 0.95rem; overflow-wrap: anywhere; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.form.is-loading button[type="submit"] { opacity: 0.7; cursor: progress; }
.audit-cats { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Chargement */
.audit-report-section { padding-top: clamp(28px, 4vw, 48px); }
.audit-loading { max-width: 720px; margin-inline: auto; }
.audit-loading h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.audit-steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
/* Flex (et non grille) : le texte d'aide long ne doit pas élargir la colonne d'état */
.audit-steps li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.audit-step-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #cbd5e1; flex-shrink: 0; margin-inline: 4px; }
.step-label { font-weight: 600; color: var(--navy); flex: 1 1 0; min-width: 0; }
.step-state { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.step-detail { flex-basis: 100%; margin: 0; padding-left: 34px; font-size: 0.85rem; color: var(--muted); }
.audit-steps li[data-state="running"] { border-color: var(--blue-strong); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15); }
.audit-steps li[data-state="running"] .audit-step-dot { border-color: var(--blue-strong); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.audit-steps li[data-state="done"] .audit-step-dot { background: var(--success); border-color: var(--success); }
.audit-steps li[data-state="done"] .step-state { color: var(--success); }
.audit-steps li[data-state="partial"] .audit-step-dot { background: #d97706; border-color: #d97706; }
.audit-steps li[data-state="partial"] .step-state { color: #b45309; }
.audit-steps li[data-state="failed"] .audit-step-dot { background: var(--danger); border-color: var(--danger); }
.audit-steps li[data-state="failed"] .step-state { color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .audit-steps li[data-state="running"] .audit-step-dot { animation: none; } }
.audit-error { max-width: 720px; margin-inline: auto; }

/* Rapport */
.report { display: grid; gap: clamp(20px, 3vw, 32px); }
.report:focus, #audit-result:focus { outline: none; }
.report-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: center; background: var(--navy); color: var(--on-dark-muted); border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 44px); }
.report-head .eyebrow { color: var(--blue); margin-bottom: 6px; }
.report-site { color: #fff; font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 8px; overflow-wrap: anywhere; }
.report-meta { margin: 0 0 12px; font-size: 0.95rem; }
.report-message { color: var(--on-dark); font-size: 1.1rem; margin: 0; }
.report-warning { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(217, 119, 6, 0.14); color: #fde68a; font-size: 0.92rem; }
@media (max-width: 720px) { .report-head { grid-template-columns: 1fr; justify-items: start; } }
.gauge { position: relative; width: 168px; display: grid; justify-items: center; }
.gauge-svg { width: 168px; height: 168px; }
.gauge-track { fill: none; stroke: rgba(148, 163, 184, 0.22); stroke-width: 10; }
.gauge-arc { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray 1s var(--ease); }
.tone-good .gauge-arc, .gauge-svg.tone-good .gauge-arc { stroke: #34d399; }
.gauge-svg.tone-medium .gauge-arc { stroke: #fbbf24; }
.gauge-svg.tone-bad .gauge-arc { stroke: #f87171; }
.gauge-center { position: absolute; top: 0; height: 168px; display: grid; place-content: center; text-align: center; color: #fff; }
.gauge-center strong { font-family: var(--font-display); font-size: 2.8rem; line-height: 1; }
.gauge-center span { font-size: 0.9rem; color: var(--on-dark-muted); }
.gauge-label { margin: 6px 0 0; font-weight: 700; color: #fff; }
.report-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); }
.report-block h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin-top: 0; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.cat-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; background: var(--gray); }
.cat-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.cat-top h3 { font-size: 1.05rem; margin: 0; }
.cat-score { font-family: var(--font-display); color: var(--navy); white-space: nowrap; }
.cat-short, .cat-count { font-size: 0.88rem; color: var(--muted); margin: 8px 0 0; }
.bar { height: 10px; border-radius: 99px; background: #e2e8f0; overflow: hidden; margin-top: 12px; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--blue-strong); }
.bar.tone-good span { background: var(--success); }
.bar.tone-medium span { background: #d97706; }
.bar.tone-bad span { background: var(--danger); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 0.78rem; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.status-ok { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.status-warn { background: rgba(251, 191, 36, 0.16); color: #fde68a; }
.status-bad { background: rgba(248, 113, 113, 0.16); color: #fecaca; }
.prio-haute.badge { background: #fee2e2; color: #991b1b; }
.prio-moyenne.badge { background: #fef3c7; color: #92400e; }
.prio-basse.badge { background: #e0f2fe; color: #075985; }
.kind-mesure { background: #dcfce7; color: #166534; }
.kind-heuristique { background: #ede9fe; color: #5b21b6; }
.badge.cat { background: var(--gray); color: var(--muted); }
.reco-list { margin: 0; padding-left: 1.3em; display: grid; gap: 14px; }
.reco-list li::marker { font-family: var(--font-display); font-weight: 800; color: var(--blue-ink); }
.reco-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reco-list p { margin: 4px 0 0; color: var(--muted); }
.issue-list { display: grid; gap: 14px; }
.issue { border: 1px solid var(--line); border-left: 4px solid #cbd5e1; border-radius: var(--radius-sm); padding: 16px 18px; }
.issue.prio-haute { border-left-color: var(--danger); }
.issue.prio-moyenne { border-left-color: #d97706; }
.issue.prio-basse { border-left-color: var(--blue-strong); }
.issue-head { cursor: pointer; list-style: none; }
.issue-head::-webkit-details-marker { display: none; }
.issue:not([open]) .issue-head h4::after { content: " +"; color: var(--blue-ink); }
.issue-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.issue-head h4 { margin: 0; font-size: 1.05rem; }
.issue-body { margin: 12px 0 0; display: grid; gap: 4px; }
.issue-body dt { font-weight: 700; font-size: 0.85rem; color: var(--navy); margin-top: 6px; }
.issue-body dd { margin: 0; color: var(--text); font-size: 0.95rem; }
.evidence { margin-top: 10px; font-size: 0.88rem; }
.evidence summary { cursor: pointer; color: var(--blue-ink); font-weight: 600; }
.evidence p { margin: 6px 0 0; padding: 10px 12px; background: var(--gray); border-radius: 8px; color: var(--muted); overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }
.positive-list, .unknown-list, .tech-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.positive-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.positive-list li { padding: 10px 12px 10px 36px !important; }
.positive-list li span { font-size: 0.85rem; }
.positive-list li, .unknown-list li { display: grid; gap: 2px; padding: 12px 14px 12px 40px; border-radius: var(--radius-sm); background: #f0fdf4; position: relative; }
.positive-list li::before { content: "✓"; position: absolute; left: 14px; top: 11px; color: var(--success); font-weight: 800; }
.unknown-list li { background: var(--gray); }
.unknown-list li::before { content: "?"; position: absolute; left: 15px; top: 11px; color: var(--muted); font-weight: 800; }
.positive-list span, .unknown-list span { color: var(--muted); font-size: 0.92rem; overflow-wrap: anywhere; }
.psi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.psi-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; }
.psi-card h3 { font-size: 1.05rem; margin-top: 0; }
.psi-card ul { padding-left: 1.1em; margin: 0; }
.small { font-size: 0.85rem; }
.method p { color: var(--muted); font-size: 0.95rem; }
.tech-list li { font-size: 0.88rem; color: var(--muted); overflow-wrap: anywhere; }
.report-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 24px; }
.report-tools p { flex-basis: 100%; margin: 0; }
.audit-cta p { color: var(--on-dark-muted); font-size: 1.1rem; }
.audit-cta h2 { color: #fff; }

/* Administration */
.admin-section { padding-top: 32px; min-height: 70vh; }
.admin-login { max-width: 440px; margin: 0 auto; display: grid; gap: 16px; }
.admin-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.admin-title { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--blue-ink); margin: 0 0 16px; }
.admin-top h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--navy); color: var(--on-dark-muted); border-radius: var(--radius-sm); padding: 16px; display: grid; gap: 2px; }
.stat-card strong { color: #fff; font-family: var(--font-display); font-size: 1.7rem; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.admin-filters input, .admin-filters select, .admin-card select, .admin-card textarea { font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; min-height: 44px; }
.admin-filters input { flex: 1 1 260px; }
.admin-card textarea { width: 100%; margin-bottom: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { background: var(--gray); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.admin-table tr.is-anon { opacity: 0.55; }
.score-pill { display: inline-block; min-width: 38px; text-align: center; padding: 2px 8px; border-radius: 99px; font-weight: 700; background: var(--gray); }
.score-pill.tone-good { background: #dcfce7; color: #166534; }
.score-pill.tone-medium { background: #fef3c7; color: #92400e; }
.score-pill.tone-bad { background: #fee2e2; color: #991b1b; }
.status-pill { font-size: 0.82rem; background: var(--blue-soft); color: #075985; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
@media (max-width: 760px) {
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { border-bottom: 1px solid var(--line); padding: 8px 4px; }
  .admin-table td { border: 0; padding: 4px 8px; display: flex; justify-content: space-between; gap: 12px; overflow-wrap: anywhere; }
  .admin-table td::before { content: attr(data-label); font-weight: 600; color: var(--muted); flex-shrink: 0; }
}
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); margin-bottom: 16px; }
.admin-card .prospect-name { margin: 0 0 4px; font-size: clamp(1.5rem, 3vw, 2rem); overflow-wrap: anywhere; }
.admin-card h2 { font-size: 1.25rem; margin-top: 0; }
.lead-company { margin: 0 0 12px; color: var(--muted); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.admin-facts { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 4px; font-size: 0.95rem; overflow-wrap: anywhere; }
.note-list, .history-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.note-list li { background: var(--gray); border-radius: 10px; padding: 10px 12px; }
.note-list p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-list time, .history-list time { font-size: 0.8rem; color: var(--muted); }
.history-list li { font-size: 0.92rem; }
.admin-audit { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; }
.admin-audit summary { cursor: pointer; font-weight: 600; }
.admin-audit .report { margin-top: 14px; }
.btn-danger { color: var(--danger) !important; box-shadow: inset 0 0 0 1.5px rgba(185, 28, 28, 0.4) !important; }

/* Impression : le rapport seul, sur fond blanc */
@media print {
  .site-header, .site-footer, .mobile-cta, .cookie-banner, .report-tools, .audit-cta .btn-row, .skip-link, .evidence summary { display: none !important; }
  body { background: #fff; }
  .report-head { background: #fff !important; color: #000; border: 1px solid #ccc; }
  .report-site, .gauge-center, .gauge-center strong, .gauge-label, .report-message { color: #000 !important; }
  .report-block, .issue { break-inside: avoid; }
  .evidence[open] p, .evidence p { display: block; }
  .audit-cta { background: #fff !important; color: #000; }
  .audit-cta h2, .audit-cta p { color: #000 !important; }
}
