/* ============================================
   GEO Scanner — Charte sobre, premium, humaine
   Palette + typo alignées sur le mockup de Charlotte
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Fonds & texte */
  --bg: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-soft: #F4F0E8;
  --ink: #1A1A1A;
  --ink-soft: #6B6B6B;
  --ink-muted: #A8A39B;
  --border: #E8E2D8;
  --border-strong: #D4CCC0;

  /* Accents (sobres, naturels) */
  --accent-good: #4A7C59;
  --accent-good-bg: #E8F1EB;
  --accent-mid: #B8945F;
  --accent-mid-bg: #F4ECDC;
  --accent-low: #A85A47;
  --accent-low-bg: #F4E2DD;

  /* Layout */
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.03);
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================
   HERO PHOTO (en attendant l'image de Charlotte)
   ============================================ */
/* Hero photo : bannière pleine largeur en haut de page, AUCUN texte par-dessus */
.hero-photo {
  display: block;
  width: 100%;
  height: 380px;
  background-image: url('hero.jpg');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  background-color: var(--bg-soft);
}

@media (max-width: 720px) {
  .hero-photo { height: 220px; }
}

/* ============================================
   LAYOUT GÉNÉRAL
   ============================================ */
.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  position: relative;
  z-index: 2;
}

.brand-on-hero {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 28px;
  letter-spacing: 0.3px;
}
.brand-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--ink);
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
}

/* ============================================
   TABS / NAVIGATION ÉCRANS
   ============================================ */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding-top: 8px;
  overflow-x: auto;
}
.tab {
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: default;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.tab.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.tab.done {
  color: var(--accent-good);
}
.tab-num {
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  margin-right: 6px;
  font-weight: 400;
}
.tab.active .tab-num { color: var(--ink); }

/* ============================================
   ÉCRANS
   ============================================ */
.screen {
  display: none;
  animation: fade 0.3s ease;
}
.screen.active { display: block; }
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 16px;
}
.h1 {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  color: var(--ink);
}
.sub {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 32px;
  max-width: 600px;
}

@media (max-width: 720px) {
  .h1 { font-size: 28px; }
  .hero-photo { height: 260px; }
  .wrap { padding: 32px 18px 60px; }
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr; }
  .card { padding: 20px; }
}

/* ============================================
   FORM FIELDS
   ============================================ */
.field { margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.field-hint {
  font-weight: 400;
  color: var(--ink-muted);
  font-size: 12px;
}
.req { color: var(--accent-low); }
.field-helper {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 6px;
  min-height: 16px;
}

input[type="text"],
input[type="search"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--ink);
}
input::placeholder, textarea::placeholder { color: var(--ink-muted); }
select { cursor: pointer; }

textarea { min-height: 80px; resize: vertical; line-height: 1.5; }

/* ============================================
   TAG INPUT (marques, concurrents)
   ============================================ */
.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  min-height: 40px;
  align-items: center;
}
.tag-input:focus-within { border-color: var(--ink); }

.tag {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tag-close {
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.tag-close:hover { color: var(--ink); }

.tag-add {
  background: transparent !important;
  border: none !important;
  color: var(--ink) !important;
  font-size: 13px !important;
  flex: 1;
  min-width: 100px;
  outline: none;
  padding: 4px !important;
}
.tag-add:disabled { color: var(--ink-muted) !important; cursor: not-allowed; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-soft); opacity: 1; }

.btn-small { font-size: 13px; padding: 8px 14px; }

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============================================
   PROMPTS SCREEN (écran 2)
   ============================================ */
.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 16px;
  padding: 14px 20px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.cat-header:first-child {
  margin-top: 0;
}
.cat-name {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.cat-count {
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.prompt-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.prompt-row:last-child { border-bottom: none; }

.prompt-checkbox {
  margin-top: 3px;
  cursor: pointer;
  accent-color: var(--ink);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.prompt-text {
  font-size: 13.5px;
  color: var(--ink);
  flex: 1;
  line-height: 1.45;
}
.prompt-row.unchecked .prompt-text { color: var(--ink-muted); text-decoration: line-through; text-decoration-thickness: 1px; }

.prompt-brand-badge {
  display: inline-block;
  font-size: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 4px;
  margin-left: 6px;
  color: var(--ink-soft);
  letter-spacing: 0.3px;
}

.prompt-remove {
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
}
.prompt-remove:hover { color: var(--accent-low); }

.custom-prompt-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: flex-end;
}
.custom-prompt-form textarea { flex: 1; min-height: 38px; resize: none; }

/* ============================================
   BOTTOM BAR (pied de page récap + actions)
   ============================================ */
.bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0 8px;
  margin-top: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.bottom-info {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ============================================
   LOADER (écran 3) — animation par étapes
   ============================================ */
.loader {
  text-align: center;
  padding: 48px 20px;
  max-width: 560px;
  margin: 0 auto;
}
.loader-mark {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 16px;
  font-weight: 500;
}
.loader-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--ink);
}
.loader-eta {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 32px;
}

.loader-steps {
  list-style: none;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  margin: 0;
}
.step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.step + .step { border-top: 1px dashed var(--border); }

.step-bullet {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--bg-card);
  position: relative;
  transition: all 0.3s;
}

/* Étape en attente (avant) */
.step.pending .step-bullet { border-color: var(--border-strong); background: var(--bg-card); }

/* Étape en cours : cercle qui tourne */
.step.active .step-bullet {
  border-color: var(--accent-good);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Étape terminée : cercle plein vert avec check */
.step.done .step-bullet {
  background: var(--accent-good);
  border-color: var(--accent-good);
}
.step.done .step-bullet::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.step-body { flex: 1; }
.step-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 2px;
}
.step.pending .step-name { color: var(--ink-muted); }
.step.done .step-name { color: var(--accent-good); }

.step-progress {
  font-size: 12px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.step.pending .step-progress { color: var(--ink-muted); font-style: italic; }
.step.done .step-progress { color: var(--accent-good); font-weight: 500; }

/* ============================================
   RAPPORT (écran 4)
   ============================================ */
.score-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 28px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-soft);
}
.score-big {
  font-size: 80px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.score-small {
  font-size: 24px;
  color: var(--ink-muted);
  font-weight: 400;
  margin-left: 4px;
}
.score-status {
  font-size: 13px;
  font-weight: 600;
  margin-top: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.score-status.good { color: var(--accent-good); }
.score-status.mid  { color: var(--accent-mid); }
.score-status.low  { color: var(--accent-low); }

.score-meta {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 10px;
  line-height: 1.5;
}

.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}
.cat-card-label {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}
.cat-card-num {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 8px 0;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.cat-card-num .small { font-size: 16px; color: var(--ink-muted); font-weight: 400; }
.cat-card-bar {
  height: 3px;
  background: var(--border);
  border-radius: 50px;
  overflow: hidden;
}
.cat-card-bar-fill {
  height: 100%;
  border-radius: 50px;
  transition: width 0.8s ease;
}
.bar-good { background: var(--accent-good); }
.bar-mid  { background: var(--accent-mid); }
.bar-low  { background: var(--accent-low); }

.section-h {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 18px 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* Tables */
.tbl-wrap { overflow-x: auto; }
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.tbl td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tbody tr { cursor: pointer; transition: background 0.15s; }
.tbl tbody tr:hover { background: var(--bg-soft); }
.tbl tbody tr:last-child td { border-bottom: none; }

.bdg {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink-soft);
  text-transform: capitalize;
}

.pill {
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  display: inline-block;
}
.pill-good { background: var(--accent-good-bg); color: var(--accent-good); }
.pill-mid  { background: var(--accent-mid-bg); color: var(--accent-mid); }
.pill-low  { background: var(--accent-low-bg); color: var(--accent-low); }

.confusion-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--accent-mid-bg);
  border: 1px solid var(--accent-mid);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.confusion-icon { font-size: 20px; line-height: 1.2; flex-shrink: 0; }
.confusion-title {
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--accent-mid);
  margin-bottom: 4px;
}
.confusion-desc { font-size: 13px; color: var(--ink-soft); line-height: 1.55; }
.confusion-desc strong { color: var(--ink); }

.tbl-footer-note {
  font-size: 12px;
  color: var(--ink-muted);
  font-style: italic;
  margin-top: 10px;
  padding-left: 4px;
}

.discovered-tag {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--ink-muted);
  letter-spacing: 0.5px;
  margin-left: 6px;
  font-weight: 500;
  text-transform: uppercase;
}

.declared-tag {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--accent-good-bg);
  border: 1px solid var(--accent-good);
  border-radius: 6px;
  color: var(--accent-good);
  letter-spacing: 0.5px;
  margin-left: 6px;
  font-weight: 500;
  text-transform: uppercase;
}

/* Recos */
.reco {
  padding: 16px 18px;
  border-left: 3px solid var(--ink);
  background: var(--bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 10px;
}
.reco-haute   { border-left-color: var(--accent-low); }
.reco-moyenne { border-left-color: var(--accent-mid); }
.reco-bonus   { border-left-color: var(--accent-good); }

.reco-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.reco-prio {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}
.reco-prio-haute   { background: var(--accent-low-bg);  color: var(--accent-low); }
.reco-prio-moyenne { background: var(--accent-mid-bg);  color: var(--accent-mid); }
.reco-prio-bonus   { background: var(--accent-good-bg); color: var(--accent-good); }

.reco-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ============================================
   DRAWER (réponses brutes par requête)
   ============================================ */
.drawer[hidden], .drawer-overlay[hidden] { display: none !important; }

.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(26, 26, 26, 0.4);
  z-index: 50;
  animation: fade 0.2s ease;
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(720px, 92vw);
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.06);
  z-index: 51;
  display: flex;
  flex-direction: column;
  animation: slide 0.25s ease;
}
@keyframes slide { from { transform: translateX(100%); } to { transform: translateX(0); } }

.drawer-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-head h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.drawer-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-muted);
  padding: 0;
  font-family: inherit;
}
.drawer-close:hover { color: var(--ink); }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.drawer-prompt {
  background: var(--bg-soft);
  border-left: 2px solid var(--ink);
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--ink);
}

.prompt-diag {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
.prompt-diag-good { background: var(--accent-good-bg); color: var(--accent-good); }
.prompt-diag-mid  { background: var(--accent-mid-bg);  color: var(--accent-mid); }
.prompt-diag-low  { background: var(--accent-low-bg);  color: var(--accent-low); }

.drawer-info-block {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.drawer-info-block strong { color: var(--ink); }

.response-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
  font-size: 13px;
  background: var(--bg-card);
}
.response-meta {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-muted);
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.response-meta .llm-badge {
  font-weight: 600;
  color: var(--ink);
}
.response-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.55;
  color: var(--ink);
}
.response-text mark {
  background: var(--accent-mid-bg);
  color: var(--ink);
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 500;
}
.response-text mark.mark-self {
  background: var(--accent-good-bg);
  color: var(--accent-good);
  font-weight: 600;
}

/* ============================================
   Réduction des animations
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Impression / Export PDF
   Le bouton "Télécharger le rapport (PDF)" déclenche window.print() :
   l'utilisateur choisit "Enregistrer en PDF" dans la boîte d'impression.
   ============================================ */
@media print {
  @page {
    size: A4;
    margin: 14mm 12mm;
  }

  /* Fond clair, texte sombre pour tout le document */
  html, body {
    background: #ffffff !important;
    color: #1a1a1a !important;
  }

  /* On masque tout ce qui n'est pas le rapport */
  .hero-photo,
  .brand-on-hero,
  .tabs,
  #screen-1,
  #screen-2,
  #screen-3,
  .bottom-bar,
  .drawer-overlay,
  .drawer,
  .sr-only,
  #toast {
    display: none !important;
  }

  /* Le rapport est toujours visible à l'impression, même si .active manque */
  #screen-4 {
    display: block !important;
    position: static !important;
  }

  /* Conteneur pleine page, sans marge écran */
  .wrap {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Cartes : fond clair, bordure fine, pas de coupure interne */
  .card {
    background: #ffffff !important;
    border: 1px solid #d8d8d8 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
    padding: 14px 16px !important;
    margin-bottom: 12px !important;
  }

  /* Typographie imprimable */
  .eyebrow,
  .sub,
  .section-h,
  .tbl-footer-note {
    color: #555 !important;
  }
  .h1,
  .score-big,
  .score-small,
  .reco-title,
  .reco-desc,
  .confusion-desc {
    color: #1a1a1a !important;
  }

  /* Score héros : fond clair */
  .score-hero {
    background: #f7f7f7 !important;
    border: 1px solid #e2e2e2 !important;
    box-shadow: none !important;
    color: #1a1a1a !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Tableaux lisibles en print */
  .tbl {
    border-collapse: collapse !important;
    width: 100% !important;
  }
  .tbl th, .tbl td {
    border-bottom: 1px solid #e0e0e0 !important;
    padding: 6px 8px !important;
    color: #1a1a1a !important;
    background: transparent !important;
  }
  .tbl thead th {
    background: #f3f3f3 !important;
    color: #444 !important;
  }

  /* Pills : on garde la couleur sémantique en contour, fond transparent */
  .pill {
    border: 1px solid currentColor !important;
    background: transparent !important;
  }

  /* Recos : jamais coupées au milieu d'une page */
  .reco {
    page-break-inside: avoid;
    break-inside: avoid;
    background: #fafafa !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: none !important;
  }
  .reco-prio {
    border: 1px solid currentColor !important;
    background: transparent !important;
  }

  /* Liens visibles imprimés */
  a {
    color: #1a1a1a !important;
    text-decoration: underline;
  }

  /* Aucune animation à l'impression */
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================
   Lead gen — overlay au-dessus du detail du rapport
   Le wrapper #locked-content contient TOUT ce qui est apres le score
   (brand scores, tableau requetes, eshop, concurrents, sites marchands,
   recos). Quand .locked est applique, tout floute et le formulaire
   apparait centre au-dessus. A la soumission, .locked est retire.
   ============================================ */

.locked-content {
  position: relative;
}

.locked-content.locked {
  /* On limite la hauteur pendant le lock pour que le form reste visible
     sans avoir a scroller a travers le contenu floute */
  max-height: 720px;
  overflow: hidden;
}

.locked-content.locked > .card,
.locked-content.locked > #brand-confusion-banner {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
  opacity: 0.7;
}

.locked-content-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.98) 60%, rgba(255,255,255,1) 100%);
  padding: 30px 24px 60px;
  z-index: 10;
  overflow-y: auto;
}

.lead-form-wrapper {
  max-width: 480px;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 28px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.lead-form-title {
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 6px;
}

.lead-form-sub {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-bottom: 18px;
  line-height: 1.5;
}

#lead-form input[type="text"],
#lead-form input[type="email"],
#lead-form input[type="tel"] {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  background: #fafafa;
  margin-bottom: 10px;
  transition: border-color 0.15s, background-color 0.15s;
}

#lead-form input[type="text"]:focus,
#lead-form input[type="email"]:focus,
#lead-form input[type="tel"]:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
}

.lead-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.lead-form-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 10px 0;
  line-height: 1.45;
  cursor: pointer;
}

.lead-form-check input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

.lead-form-check .req {
  color: var(--accent);
  font-weight: 600;
}

.lead-form-rgpd {
  font-size: 11px;
  color: var(--ink-muted);
  margin: 14px 0 12px;
  line-height: 1.45;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

#lead-submit-btn {
  width: 100%;
  margin-top: 4px;
}

.lead-form-error {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--accent-low-bg, #fff5f0);
  color: var(--accent-low, #c84d2c);
  border-radius: 8px;
  font-size: 13px;
}

/* Quand on imprime un rapport, on cache l'overlay (au cas où l'utilisateur imprime sans avoir validé) */
@media print {
  .locked-content-overlay { display: none !important; }
  .locked-content.locked { max-height: none !important; overflow: visible !important; }
  .locked-content.locked > .card,
  .locked-content.locked > #brand-confusion-banner { filter: none !important; opacity: 1 !important; pointer-events: auto !important; }
}

/* Mobile : overlay un peu plus compact */
@media (max-width: 640px) {
  .lead-form-wrapper {
    padding: 20px 18px 18px;
  }
  .lead-form-row {
    grid-template-columns: 1fr;
  }
}
