/* ============================================
   tchadiaPdf : Design system
   Deux couleurs : blanc + bleu
   ============================================ */
:root {
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --blue-50: #EFF6FF;
  --white: #FFFFFF;
  --ink: #1E293B;
  --slate: #64748B;
  --border: #E2E8F0;
  --radius-card: 12px;
  --radius-btn: 8px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--white);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.logo span { color: var(--blue); }
.logo:hover { text-decoration: none; }
.nav-tools {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Hero (accueil) ---------- */
.hero {
  text-align: center;
  padding: 56px 20px 40px;
}
.hero h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.hero h1 em {
  font-style: normal;
  color: var(--blue);
}
.hero p {
  margin-top: 14px;
  color: var(--slate);
  font-size: 1.05rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.badge-prive {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 8px 16px;
  background: var(--blue-50);
  color: var(--blue);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------- Catégories de la page d'accueil ---------- */
.tool-category { margin-bottom: 8px; }
.tool-category > h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 40px 0 4px;
}
.tool-category:first-of-type > h2 { margin-top: 8px; }
.tool-category > .cat-sub { color: var(--slate); margin-bottom: 20px; font-size: 0.95rem; }
.tool-subgroup > h3 {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--blue-dark);
  margin: 28px 0 12px;
}
.tool-subgroup:first-of-type > h3 { margin-top: 4px; }
.cat-hub-link { text-align: center; margin: 24px 0 8px; }
.cat-hub-link a { font-weight: 600; font-size: 0.95rem; }

/* ---------- Grille d'outils ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  padding-bottom: 56px;
}
.tool-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px;
  transition: box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}
.tool-card:hover {
  text-decoration: none;
  border-color: var(--blue);
  background: var(--blue-50);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}
.tool-card .tool-icon {
  width: 42px;
  height: 42px;
  color: var(--blue);
  margin-bottom: 14px;
}
.tool-card h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.tool-card p {
  font-size: 0.875rem;
  color: var(--slate);
  line-height: 1.5;
}
.tool-card.soon { opacity: 0.5; pointer-events: none; }
.tool-card.soon h2::after {
  content: " · bientôt";
  font-size: 0.75rem;
  color: var(--blue);
  font-weight: 600;
}

/* ---------- Page outil ---------- */
.tool-page { padding: 40px 20px 64px; max-width: 760px; margin: 0 auto; }
.tool-page > h1 {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}
.tool-page > .tool-sub {
  text-align: center;
  color: var(--slate);
  margin-top: 8px;
  margin-bottom: 32px;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--blue);
  border-radius: var(--radius-card);
  background: var(--white);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: background 150ms ease;
}
.dropzone:hover, .dropzone.dragover { background: var(--blue-50); }
.dropzone .dz-icon { width: 48px; height: 48px; color: var(--blue); margin-bottom: 12px; }
.dropzone strong { display: block; font-size: 1.05rem; font-weight: 600; }
.dropzone span { color: var(--slate); font-size: 0.9rem; }
.dropzone input[type="file"] { display: none; }

/* Liste de fichiers */
.file-list { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 10px 14px;
  background: var(--white);
}
.file-item .f-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-item .f-meta { font-size: 0.8rem; color: var(--slate); white-space: nowrap; }
.icon-btn {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--blue);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, border-color 150ms ease;
}
.icon-btn:hover { background: var(--blue-50); border-color: var(--blue); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }

/* Miniatures de pages */
.thumbs-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.thumb {
  border: 2px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 8px;
  text-align: center;
  cursor: pointer;
  background: var(--white);
  transition: border-color 150ms ease, background 150ms ease;
}
.thumb canvas, .thumb img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.thumb .t-num { font-size: 0.8rem; color: var(--slate); margin-top: 6px; font-weight: 500; }
.thumb.selected { border-color: var(--blue); background: var(--blue-50); }
.thumb.selected .t-num { color: var(--blue); font-weight: 600; }

/* Options */
.options {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}
.options label { font-size: 0.9rem; font-weight: 600; }
.options select, .options input[type="text"] {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  color: var(--ink);
  background: var(--white);
}
.options select:focus, .options input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

/* Choix segmenté (rotation, orientation…) */
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  overflow: hidden;
}
.seg button {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border: none;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button.active { background: var(--blue); color: var(--white); }
.seg button:not(.active):hover { background: var(--blue-50); }

/* Boutons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-btn);
  padding: 14px 32px;
  cursor: pointer;
  transition: background 150ms ease;
  width: 100%;
  margin-top: 24px;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { opacity: 0.4; cursor: default; }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--white);
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: var(--radius-btn);
  padding: 9px 18px;
  cursor: pointer;
  transition: background 150ms ease;
}
.btn-secondary:hover { background: var(--blue-50); }

/* Progression */
.progress-wrap { margin-top: 24px; display: none; }
.progress-wrap.visible { display: block; }
.progress-label { font-size: 0.85rem; color: var(--slate); margin-bottom: 8px; }
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar > div {
  height: 100%;
  width: 0%;
  background: var(--blue);
  border-radius: 999px;
  transition: width 200ms ease;
}

/* Résultat */
.result {
  margin-top: 24px;
  border: 1px solid var(--blue);
  background: var(--blue-50);
  border-radius: var(--radius-card);
  padding: 24px;
  text-align: center;
  display: none;
}
.result.visible { display: block; }
.result p { font-weight: 600; margin-bottom: 14px; }
.result .btn-primary { width: auto; margin-top: 0; }

/* Message (erreur / info) : icône + texte, jamais de couleur dédiée */
.msg {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 12px 16px;
  display: none;
}
.msg.visible { display: block; }

/* Emplacements publicitaires */
.ad-slot {
  margin: 32px auto;
  max-width: 728px;
  min-height: 90px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 20px;
  text-align: center;
  color: var(--slate);
  font-size: 0.85rem;
}
.site-footer nav { margin-bottom: 10px; display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.consent-banner-reopen-link {
  font-family: inherit;
  font-size: inherit;
  color: var(--slate);
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}
.consent-banner-reopen-link:hover { color: var(--blue); }

/* Bandeau de consentement (publicite / analytics) */
.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(30, 41, 59, 0.08);
  padding: 16px 20px;
}
.consent-banner-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.consent-banner-text {
  color: var(--ink);
  font-size: 0.9rem;
  margin: 0;
  flex: 1 1 320px;
}
.consent-banner-text a { font-weight: 600; }
.consent-banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.consent-banner-actions .btn-primary,
.consent-banner-actions .btn-secondary {
  width: auto;
  margin-top: 0;
  padding: 10px 20px;
}
@media (max-width: 520px) {
  .consent-banner-inner { flex-direction: column; align-items: stretch; }
  .consent-banner-actions { justify-content: stretch; }
  .consent-banner-actions .btn-primary,
  .consent-banner-actions .btn-secondary { flex: 1; }
}

/* Page de contenu (à propos, confidentialité) */
.content-page { max-width: 720px; margin: 0 auto; padding: 48px 20px 64px; }
.content-page h1 { font-size: 1.8rem; margin-bottom: 20px; letter-spacing: -0.02em; }
.content-page h2 { font-size: 1.2rem; margin: 28px 0 10px; }
.content-page p { color: var(--slate); margin-bottom: 12px; }

/* Encadré "Fidélité de conversion" : honnêteté sur les pages de conversion */
.fidelity-box {
  margin-top: 28px;
  background: var(--blue-50);
  border: 1px solid var(--blue);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  font-size: 0.9rem;
}
.fidelity-box h3 {
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: var(--blue-dark);
}
.fidelity-box ul { margin: 6px 0 0 20px; color: var(--ink); }
.fidelity-box li { margin-bottom: 4px; }
.fidelity-box p { color: var(--ink); margin-bottom: 6px; }

/* FAQ SEO, sur chaque page de conversion */
.faq { margin-top: 40px; }
.faq h2 { font-size: 1.2rem; margin-bottom: 14px; }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.faq summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+ "; color: var(--blue); font-weight: 700; }
.faq details[open] summary::before { content: "\2212 "; }
.faq details p { color: var(--slate); margin-top: 10px; }

/* Bandeau d'information avec action (proposition OCR, alternative d'outil…) */
.banner {
  display: none;
  margin-bottom: 20px;
  background: var(--blue-50);
  border: 1px solid var(--blue);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  font-size: 0.9rem;
  color: var(--ink);
}
.banner.visible { display: block; }
.banner a { font-weight: 600; }
.banner-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.banner-actions .btn-primary, .banner-actions .btn-secondary { width: auto; margin-top: 0; }

/* Matrice de conversions (page pivot conversions.html) */
.conv-matrix { margin-top: 24px; }
.conv-group { margin-bottom: 32px; }
.conv-group h2 { font-size: 1.1rem; margin-bottom: 14px; }
.conv-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.conv-links a {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color 150ms ease, background 150ms ease;
}
.conv-links a:hover { border-color: var(--blue); background: var(--blue-50); text-decoration: none; color: var(--blue-dark); }

/* Accessibilité */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 520px) {
  .hero { padding: 40px 16px 28px; }
  .options { flex-direction: column; align-items: stretch; }
}
