/* ────────────────────────────────────────────────────────────────────
   Ctrl-Data — Entretien de découverte (page prospect)
   Thème sombre premium hérité du site vitrine 2026-07.
   Aucune dépendance externe : polices système uniquement.
──────────────────────────────────────────────────────────────────── */
:root {
  --bg:          #0b1118;
  --bg-2:        #0f1720;
  --panel:       #141c26;
  --panel-2:     #182230;
  --text:        #e8edf4;
  --text-2:      #9aa3b5;
  --text-3:      #5d6b7e;
  --border:      #243140;
  --border-h:    #33445a;
  --accent:      #4ad0b3;
  --accent-h:    #63dfc4;
  --accent-line: rgba(74, 208, 179, .35);
  --danger:      #ef4444;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow-md:   0 8px 32px rgba(0, 0, 0, .35);
  --t:           .15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: -apple-system, 'Segoe UI', 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--accent); color: #08110e; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; width: 100%; }

/* ─── Barre supérieure ─── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { display: block; border-radius: 6px; }
.brand-name { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.topbar-label { font-size: 13px; color: var(--text-2); }

/* ─── Progression par sections ─── */
.progress-strip { border-bottom: 1px solid var(--border); background: var(--bg-2); }
.progress-inner { display: flex; align-items: center; gap: 16px; min-height: 46px; padding-top: 7px; padding-bottom: 7px; }
.progress-steps {
  display: flex; align-items: center; flex-wrap: wrap;
  list-style: none; flex: 1; min-width: 0;
}
.progress-steps li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-3);
  white-space: nowrap;
}
.progress-steps li + li::before { content: "·"; margin: 0 10px; color: var(--text-3); }
.progress-steps li svg { width: 11px; height: 11px; flex-shrink: 0; }
.progress-steps li.done { color: var(--text-2); }
.progress-steps li.done svg { color: var(--accent); }
.progress-steps li.current { color: var(--text); font-weight: 600; }
.progress-count { font-size: 12px; color: var(--text-2); white-space: nowrap; opacity: .8; }

/* ─── Écrans ─── */
.screen[hidden] { display: none; }
.screen-center { display: flex; align-items: center; justify-content: center; min-height: 62dvh; padding: 40px 24px; }

/* ─── Lien invalide ─── */
.invalid-box { max-width: 480px; width: 100%; }
.invalid-icon { color: var(--text-3); margin-bottom: 20px; }
.invalid-box h1 { font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.invalid-box p { margin-top: 12px; color: var(--text-2); font-size: 15px; }

/* ─── Layout entretien : question à gauche, cahier des charges à droite ─── */
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 350px;
  gap: 44px; align-items: start;
  padding-top: 40px; padding-bottom: 90px;
}
.flow { min-width: 0; }

/* ─── Cartes bénéfice (nouvelles au dernier tour) ─── */
.benefits-new { display: grid; gap: 12px; }
.benefits-new:not(:empty) { margin-bottom: 24px; }
.benefit-card {
  border: 1px solid var(--border); border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm); background: var(--panel);
  padding: 16px 18px;
  animation: benefit-in .25s ease both;
}
@keyframes benefit-in { from { opacity: 0; } to { opacity: 1; } }
.benefit-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.benefit-computation {
  margin-top: 6px; font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  line-height: 1.35; color: var(--text);
}
.benefit-computation strong { color: var(--text); font-weight: 650; }
.benefit-detail { margin-top: 6px; font-size: 13.5px; color: var(--text-2); }
.benefit-module { margin-top: 6px; font-size: 12px; color: var(--text-3); }

/* ─── Carte question ─── */
.qcard {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow-md);
  padding: 30px 32px 26px;
}
.qcard[hidden] { display: none; }
.qcard:focus { outline: none; } /* focus programmatique (lecteurs d'écran), pas d'anneau visuel */
.q-section { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 12px; }
.q-title { font-size: 22px; font-weight: 650; letter-spacing: -.018em; line-height: 1.3; }
.q-why { margin-top: 10px; font-size: 13px; color: var(--text-3); }
.q-body { margin-top: 22px; }

/* Options (kind choice / multi) */
.q-options { display: grid; gap: 9px; list-style: none; }
.q-option {
  display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: left; font-size: 14.5px; font-weight: 500; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 16px;
  transition: border-color var(--t), background var(--t);
}
.q-option:hover { border-color: var(--accent-line); background: var(--panel-2); }
.q-option:focus-visible, .q-check:focus-within,
.q-input:focus, .q-textarea:focus, .q-free textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.q-option svg { width: 14px; height: 14px; color: var(--text-3); flex-shrink: 0; margin-left: auto; }
.q-option:hover svg { color: var(--accent); }

/* Cases à cocher (kind multi) */
.q-check {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  font-size: 14.5px; font-weight: 500;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: border-color var(--t), background var(--t);
}
.q-check:hover { border-color: var(--border-h); }
.q-check input { position: absolute; opacity: 0; pointer-events: none; }
.q-check .box {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 1.5px solid var(--border-h); border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent; transition: border-color var(--t), background var(--t);
}
.q-check .box svg { width: 11px; height: 11px; }
.q-check input:checked + .box { background: var(--accent); border-color: var(--accent); color: #08110e; }
.q-check:has(input:checked) { border-color: var(--accent-line); }

/* Champs (number / text) */
.q-input {
  font: inherit; font-size: 15px; color: var(--text); width: 100%; max-width: 260px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 15px; transition: border-color var(--t);
}
.q-textarea, .q-free textarea {
  font: inherit; font-size: 14.5px; color: var(--text); width: 100%;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 15px; min-height: 110px; resize: none; overflow-y: auto;
  transition: border-color var(--t);
}
.q-input::placeholder, .q-textarea::placeholder, .q-free textarea::placeholder { color: var(--text-3); }

/* Ligne de saisie texte : textarea + micro */
.q-text-row { display: flex; gap: 10px; align-items: flex-start; }
.q-mic {
  flex-shrink: 0; width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-2); transition: border-color var(--t), color var(--t);
}
.q-mic:hover { border-color: var(--accent-line); color: var(--accent); }
.q-mic.recording { border-color: var(--danger); color: var(--danger); animation: mic-pulse 1.2s ease infinite; }
.q-mic.busy { opacity: .55; pointer-events: none; }
@keyframes mic-pulse { 50% { background: rgba(239, 68, 68, .1); } }
.q-mic svg { width: 18px; height: 18px; }
.q-mic-status { margin-top: 8px; font-size: 12.5px; color: var(--text-2); min-height: 18px; }
.q-mic-status.err { color: var(--danger); }
.q-mic-status.rec { color: var(--danger); font-variant-numeric: tabular-nums; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; line-height: 1.3;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  transition: border-color var(--t), background var(--t), color var(--t), opacity var(--t);
  white-space: nowrap;
}
.btn:hover { border-color: var(--border-h); background: rgba(255, 255, 255, .03); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #08110e; }
.btn--primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.q-actions { margin-top: 18px; display: flex; align-items: center; gap: 16px; }

/* Liens discrets : je ne sais pas / pas concerné / autre réponse */
.q-alt { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; gap: 22px; flex-wrap: wrap; }
.q-alt-link {
  background: none; border: none; padding: 0;
  font-size: 13px; color: var(--text-3); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--border-h);
  transition: color var(--t);
}
.q-alt-link:hover { color: var(--text-2); }
.q-free { margin-top: 16px; }
.q-free[hidden] { display: none; }
.q-free .q-actions { margin-top: 12px; }

/* ─── Loader entre les tours ─── */
.loader-box { text-align: center; max-width: 420px; }
.loader-inline {
  margin: 0 auto; padding: 56px 24px;
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.loader-inline[hidden] { display: none; }
.spinner {
  display: inline-block; width: 30px; height: 30px;
  border: 2.5px solid var(--border-h); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-msg { margin-top: 16px; font-size: 15px; font-weight: 550; color: var(--text); }
.loader-hint { margin-top: 6px; font-size: 12.5px; color: var(--text-3); }

/* ─── Erreurs ─── */
.error-box {
  border: 1px solid rgba(239, 68, 68, .4); border-radius: var(--radius);
  background: rgba(239, 68, 68, .06); padding: 20px 24px;
}
.error-box[hidden] { display: none; }
.error-box p { font-size: 14.5px; color: var(--text); }
.error-box .btn { margin-top: 14px; }

/* ─── Panneau cahier des charges ─── */
.spec-panel {
  position: sticky; top: 84px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-2);
  max-height: calc(100dvh - 110px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.spec-toggle {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 15px 18px; text-align: left;
  background: var(--panel); border: none; border-bottom: 1px solid var(--border);
  color: var(--text); font-size: 13.5px; font-weight: 650; letter-spacing: -.01em;
  cursor: default;
}
.spec-toggle > svg:first-child { color: var(--text-2); flex-shrink: 0; }
.spec-count { font-size: 12px; color: var(--text-3); }
.spec-count:empty { display: none; }
.spec-chevron { margin-left: auto; display: none; transition: transform .25s ease; }
.spec-body { overflow-y: auto; padding: 18px; }
.spec-empty { font-size: 13px; color: var(--text-3); }
.spec-sec + .spec-sec { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.spec-sec h3 { font-size: 12.5px; font-weight: 650; color: var(--text); margin-bottom: 8px; }
.spec-md { font-size: 13.5px; color: var(--text-2); }
.spec-md p + p, .spec-md p + ul, .spec-md ul + p { margin-top: 7px; }
.spec-md ul { list-style: none; display: grid; gap: 5px; }
.spec-md li { position: relative; padding-left: 15px; }
.spec-md li::before {
  content: ""; position: absolute; left: 0; top: .58em;
  width: 6px; height: 1.5px; background: var(--border-h);
}
.spec-md strong { color: var(--text); font-weight: 625; }

/* Gains dans le panneau */
.benefits-panel { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.benefits-panel[hidden] { display: none; }
.benefits-panel-title { font-size: 12.5px; font-weight: 650; color: var(--text); margin-bottom: 10px; }
.benefits-panel ul { list-style: none; display: grid; gap: 9px; }
.benefits-panel li { font-size: 13px; color: var(--text-2); }
.benefits-panel li b { display: block; color: var(--text); font-weight: 625; font-size: 13.5px; }

/* ─── Écran final ─── */
.done-wrap { max-width: 760px; margin: 0; padding-top: 70px; padding-bottom: 100px; }
.done-wrap h1 { font-size: clamp(28px, 4.5vw, 42px); font-weight: 650; letter-spacing: -.025em; line-height: 1.1; }
.done-recap {
  margin-top: 28px; font-size: 15.5px; color: var(--text-2);
  border-left: 2px solid var(--border); padding-left: 22px;
}
.done-recap p + p, .done-recap p + ul, .done-recap ul + p { margin-top: 10px; }
.done-recap ul { list-style: none; display: grid; gap: 6px; }
.done-recap li { position: relative; padding-left: 17px; }
.done-recap li::before {
  content: ""; position: absolute; left: 0; top: .58em;
  width: 7px; height: 1.5px; background: var(--border-h);
}
.done-recap strong { color: var(--text); }
.done-gains { margin-top: 34px; display: grid; grid-template-columns: 1fr; gap: 12px; max-width: 560px; }
.done-gains .benefit-card { animation: none; }
.done-thanks { margin-top: 36px; font-size: 15px; color: var(--text-2); max-width: 560px; }
.done-thanks strong { color: var(--text); }

/* ─── Pied de page ─── */
.footer { border-top: 1px solid var(--border); padding: 20px 0; }
.footer span { font-size: 12.5px; color: var(--text-3); }

/* ─── Responsive : le cahier des charges devient un tiroir en bas ─── */
@media (max-width: 960px) {
  .topbar-label { display: none; }
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 26px; padding-bottom: 120px; }
  .qcard { padding: 24px 20px 22px; }
  .q-title { font-size: 19px; }

  .spec-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 200;
    border-radius: 16px 16px 0 0; border-bottom: none;
    background: var(--panel); box-shadow: 0 -12px 40px rgba(0, 0, 0, .5);
    max-height: 74dvh;
    transform: translateY(calc(100% - 50px));
    transition: transform .3s cubic-bezier(.22,.61,.36,1);
  }
  .spec-panel.open { transform: none; }
  .spec-toggle { cursor: pointer; padding: 14px 18px; border-bottom-color: transparent; }
  .spec-panel.open .spec-toggle { border-bottom-color: var(--border); }
  .spec-chevron { display: block; }
  .spec-panel.open .spec-chevron { transform: rotate(180deg); }
  .spec-body { padding-bottom: 30px; }
  .done-wrap { padding-top: 46px; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 18px; }
  .progress-steps { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .progress-steps::-webkit-scrollbar { display: none; }
  .q-text-row { flex-direction: column; }
  .q-mic { width: 100%; }
}

/* ─── Mobile (téléphone) : formulaire pleine largeur, anti-zoom iOS ─── */
@media (max-width: 430px) {
  .wrap { padding: 0 16px; }
  .screen-center { min-height: 60dvh; padding: 24px 16px; }
  .qcard { padding: 18px 16px 16px; }
  .q-title { font-size: 18px; }
  /* Inputs >=16px : empeche le zoom automatique iOS au focus (etaient 15/14.5px) */
  .q-input { font-size: 16px; width: 100%; max-width: none; }
  .q-textarea, .q-free textarea { font-size: 16px; min-height: 88px; }
  .q-option, .q-check { font-size: 14px; padding: 12px 14px; }
  .btn { padding: 11px 18px; }
  .done-wrap { padding-top: 40px; padding-bottom: 60px; }
}

@media (max-width: 360px) {
  .wrap { padding: 0 14px; }
  .q-option, .q-check { font-size: 13.5px; }
  .progress-steps li { font-size: 11.5px; }
}

/* ─── Mouvement réduit : couper toutes les animations non essentielles
       (le spinner reste : indicateur de chargement fonctionnel).
       Bloc placé EN DERNIER pour gagner la cascade sur le tiroir mobile
       (le bloc max-width: 960px redéclare une transition sur .spec-panel). ─── */
@media (prefers-reduced-motion: reduce) {
  .benefit-card, .q-mic.recording { animation: none; }
  .spec-panel, .spec-chevron { transition: none !important; }
}
