/* Carlivanta — style professionnel type 16personalities, accessible neurodiversité */

:root {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --accent-teal: #14b8a6;
  --accent-purple: #a855f7;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --tdah: #6366f1;
  --tsa: #14b8a6;
  --hpi: #a855f7;
  --mix: #f59e0b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 48px rgba(15, 23, 42, 0.1);
  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --surface: #f1f5f9;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --surface: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --primary-light: rgba(99, 102, 241, 0.15);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .demo-field input,
[data-theme="dark"] .demo-field select,
[data-theme="dark"] .gender-option,
[data-theme="dark"] .age-card {
  background: #0f172a;
}

[data-theme="dark"] .disclaimer-box {
  background: rgba(99, 102, 241, 0.08);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

body.high-contrast {
  --bg: #fff;
  --text: #000;
  --border: #000;
  --text-muted: #333;
}

body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}

#app { min-height: 100vh; }

.view { display: none; min-height: 100vh; animation: viewIn 0.4s ease; }
.view.active { display: block; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Nav & Hero ─── */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
}

.brand-mascot { width: 36px; height: 44px; }

.nav-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.nav-link:hover { background: var(--primary-light); color: var(--primary); }

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent-teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  max-width: 520px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }

.hero-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 480px;
}

.mascot-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  border: 1px solid var(--border);
}

.mascot-echo { width: 160px; height: auto; }
.mascot-echo.small { width: 100px; }

.mascot-quote {
  margin-top: 1rem;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.stat-cards {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  text-align: center;
  min-width: 80px;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-card span:last-child { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Features ─── */
.features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.features h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: 2rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.feature-icon.tdah { background: #eef2ff; }
.feature-icon.tsa { background: #ccfbf1; }
.feature-icon.hpi { background: #f3e8ff; }

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature-card p { font-size: 0.9rem; color: var(--text-muted); }

.disclaimer-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 1.5rem;
}
.disclaimer-box h4 { font-size: 0.95rem; margin-bottom: 0.5rem; color: #92400e; }
.disclaimer-box p { font-size: 0.85rem; color: #78350f; line-height: 1.65; }

/* ─── Buttons ─── */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 2px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }

.btn-patient-export {
  border-color: var(--tsa);
  color: var(--tsa);
}
.btn-patient-export:hover:not(:disabled) {
  border-color: var(--tsa);
  background: rgba(20, 184, 166, 0.08);
  color: #0d9488;
}

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); }

.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--primary); background: var(--primary-light); }

/* ─── Assessment header ─── */
.assess-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.assess-progress-global { flex: 1; display: flex; align-items: center; gap: 0.75rem; }

.progress-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent-teal));
  border-radius: 99px;
  transition: width 0.5s ease;
}

#global-progress-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); min-width: 36px; }

.xp-badge {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
}

.module-indicator {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}
#module-tag { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary); font-weight: 700; }
#item-counter { font-size: 0.85rem; color: var(--text-muted); }

/* ─── Modules layout ─── */
.modules-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.echo-mini {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* ─── Echo mascotte (bulles) ─── */
.echo-bubble {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: linear-gradient(135deg, #f0fdfa 0%, var(--primary-light) 100%);
  border: 1px solid rgba(20, 184, 166, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  text-align: left;
  line-height: 1.5;
}

.echo-bubble-avatar {
  flex-shrink: 0;
  line-height: 0;
}

.echo-bubble--sm .echo-bubble-avatar .mascot-echo { width: 52px; height: auto; }
.echo-bubble--md .echo-bubble-avatar .mascot-echo { width: 88px; height: auto; }
.echo-bubble--xs .echo-bubble-avatar .brand-mascot { width: 36px; height: auto; }

.echo-bubble-name {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0d9488;
  margin-bottom: 0.15rem;
}

.echo-bubble-text {
  font-size: 0.88rem;
  color: var(--text);
  margin: 0;
}

.echo-bubble-host {
  margin-bottom: 1.25rem;
}

.echo-bubble-host--center {
  display: flex;
  justify-content: center;
}

.echo-bubble-host--center .echo-bubble {
  max-width: 440px;
  width: 100%;
}

.echo-results-intro {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.echo-task-host {
  margin-bottom: 1rem;
}

.modal-echo-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1rem;
}

.echo-tip {
  margin-bottom: 1rem;
  display: none;
}

.echo-tip.visible {
  display: block;
}

.echo-tip .echo-bubble {
  margin: 0;
}

.module-list { list-style: none; }

.module-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition);
}

.module-item:hover:not(.locked) { border-color: var(--primary); background: var(--primary-light); }
.module-item.done { border-color: var(--accent-teal); background: #f0fdfa; }
.module-item.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.module-item.locked { opacity: 0.5; cursor: not-allowed; }

.module-icon { font-size: 1.5rem; }
.module-info { flex: 1; }
.module-info strong { display: block; font-size: 0.9rem; }
.module-info span { font-size: 0.75rem; color: var(--text-muted); }
.module-check { color: var(--accent-teal); font-weight: 700; }

.modules-main h2 { font-family: var(--font-display); margin-bottom: 0.5rem; }
.modules-desc { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ─── Question card ─── */
.assess-body {
  max-width: 680px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.question-card, .task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.question-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.question-sub { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; }

.answer-options { display: flex; flex-direction: column; gap: 0.65rem; }

.answer-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  transition: all var(--transition);
}

.answer-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.answer-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.answer-btn .answer-key {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.answer-btn.selected .answer-key { background: var(--primary); color: white; }

/* Likert scale horizontal */
.likert-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.likert-btn {
  flex: 1;
  min-width: 72px;
  padding: 0.85rem 0.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 0.8rem;
  text-align: center;
  transition: all var(--transition);
}
.likert-btn:hover { border-color: var(--primary); }
.likert-btn.selected { border-color: var(--primary); background: var(--primary-light); font-weight: 600; }

/* ─── Tasks ─── */
.task-instructions {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.task-instructions strong { color: var(--primary); }

.task-area {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.task-timer {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.task-stimulus {
  font-size: 3rem;
  font-weight: 800;
  padding: 2rem;
  border-radius: var(--radius);
  background: var(--bg);
  min-width: 120px;
  text-align: center;
}

.stroop-word { font-size: 2.5rem; font-weight: 800; }

.trail-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 320px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.trail-node {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  transform: translate(-50%, -50%);
}
.trail-node.done { background: var(--accent-teal); color: white; border-color: var(--accent-teal); }
.trail-node.next { box-shadow: 0 0 0 4px rgba(99,102,241,0.3); animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(99,102,241,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(99,102,241,0.15); }
}

.digit-display {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: 0.3em;
  font-weight: 800;
}

.digit-input {
  font-size: 1.5rem;
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  width: 100%;
  max-width: 280px;
  letter-spacing: 0.2em;
}
.digit-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }

.cpt-area {
  width: 200px;
  height: 200px;
  border-radius: var(--radius);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 800;
  transition: background 0.15s;
}
.cpt-area.active { background: var(--primary-light); }

.task-controls { margin-top: 1.5rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.assess-footer {
  display: flex;
  justify-content: space-between;
  max-width: 680px;
  margin: 1.5rem auto 2rem;
  padding: 0 1.5rem;
}

/* ─── Break ─── */
#view-break {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}
#view-break.active { display: flex; }

.break-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.break-card h2 { font-family: var(--font-display); margin: 1rem 0 0.5rem; }
.break-card p { color: var(--text-muted); margin-bottom: 1.5rem; }

.break-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* ─── Results ─── */
.results-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.results-header { text-align: center; margin-bottom: 2.5rem; }

.results-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 1rem;
  border-radius: 99px;
  margin-bottom: 0.75rem;
}

.results-header h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

#profile-subtitle { color: var(--text-muted); font-size: 1.05rem; }

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.results-chart-card, .results-scores-card, .results-profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.results-chart-card h3, .results-scores-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 1rem;
}

#radar-chart { max-width: 100%; margin: 0 auto; display: block; }

.dim-bar { margin-bottom: 1.25rem; }
.dim-bar-header { display: flex; justify-content: space-between; margin-bottom: 0.35rem; font-size: 0.9rem; }
.dim-bar-header strong { font-weight: 600; }
.dim-bar-track { height: 10px; background: var(--border); border-radius: 99px; overflow: hidden; }
.dim-bar-fill { height: 100%; border-radius: 99px; transition: width 1s ease; }

.results-profile-card { margin-bottom: 1.5rem; }
.results-profile-card h3 { font-family: var(--font-display); margin-bottom: 1rem; }
.results-profile-card p { color: var(--text-muted); margin-bottom: 0.75rem; line-height: 1.7; }

/* ─── Report shell (tabs + narrative) ─── */
.report-shell {
  padding: 0;
  overflow: hidden;
  position: relative;
}

.report-shell-header {
  padding: 1.25rem 1.75rem 0;
  background: linear-gradient(180deg, #fafbfd 0%, var(--bg-card) 100%);
  border-bottom: 1px solid var(--border);
}

.report-shell-body {
  padding: 1.5rem 1.75rem 1.75rem;
  position: relative;
}

.report-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  margin: 0;
}

.report-tab {
  padding: 0.55rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
}

.report-tab:hover { border-color: var(--primary); color: var(--primary-dark); }

.report-tab.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  box-shadow: 0 1px 0 rgba(99, 102, 241, 0.15);
}

.report-shell--patient .report-tab.active {
  border-color: var(--accent-teal);
  background: rgba(20, 184, 166, 0.1);
  color: #0f766e;
  box-shadow: 0 1px 0 rgba(20, 184, 166, 0.15);
}

/* ─── Report narrative ─── */
.report-disclaimer {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.55;
}

.report-disclaimer p { margin: 0; color: var(--text); }

.patient-disclaimer {
  background: rgba(20, 184, 166, 0.07);
  border-color: rgba(20, 184, 166, 0.22);
}

.report-view-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  padding: 0.35rem 0.65rem;
  background: var(--primary-light);
  border-radius: 99px;
}

.report-view-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.patient-badge {
  color: #0f766e;
  background: rgba(20, 184, 166, 0.12);
}

.patient-badge::before { background: var(--accent-teal); }

.report-body {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  --report-accent: var(--primary);
  --report-accent-soft: var(--primary-light);
}

.report-body--patient {
  --report-accent: var(--accent-teal);
  --report-accent-soft: rgba(20, 184, 166, 0.1);
}

.detail-block {
  margin: 0;
  padding: 1.15rem 1.25rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--report-accent);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.detail-block h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.85rem 0;
  color: var(--text);
  line-height: 1.35;
}

.detail-block p {
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.9rem;
  margin: 0 0 0.65rem 0;
}

.detail-block p:last-child { margin-bottom: 0; }

.detail-block ul,
.detail-block ol {
  margin: 0.35rem 0 0.65rem 0;
  padding-left: 1.35rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.detail-block li { margin-bottom: 0.4rem; }
.detail-block li:last-child { margin-bottom: 0; }

.detail-block--muted {
  background: var(--bg);
  border: 1px dashed #cbd5e1;
  border-left: 4px solid #94a3b8;
}

.participant-block .participant-name {
  font-size: 1.05rem;
  margin: 0 0 0.5rem 0;
}

.participant-block .participant-name--missing {
  color: var(--text-muted);
  font-style: italic;
}

.differential-block {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.diff-primary { font-size: 1.05rem !important; color: var(--text) !important; margin-bottom: 0.5rem !important; }

.diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.lit-block ul {
  margin: 0.5rem 0 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.report-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.score-trace,
.patient-score-item,
.cog-detail {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
}

.score-trace p,
.patient-score-item p,
.cog-detail p {
  padding-left: 0;
  margin-bottom: 0.35rem;
}

.score-trace:last-child,
.patient-score-item:last-child,
.cog-detail:last-child { margin-bottom: 0; }

.score-source { font-size: 0.8rem; color: var(--text-muted); font-style: italic; }

.hypothesis-summary { font-weight: 600; }

.validity-note { font-size: 0.88rem; color: var(--text-muted); }

.pct-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  margin-left: 0.5rem;
}

.norm-note { font-size: 0.8rem !important; font-style: italic; }

.subscale-row { font-size: 0.85rem !important; padding-left: 0.5rem; }

.clinical-summary-table {
  width: 100%;
  margin: 0.5rem 0 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.clinical-summary-table th,
.clinical-summary-table td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  text-align: left;
}

.clinical-summary-table th:last-child,
.clinical-summary-table td:last-child { border-right: none; }

.clinical-summary-table tr:last-child td { border-bottom: none; }

.clinical-summary-table th {
  background: var(--bg);
  font-weight: 700;
  color: var(--text);
  font-size: 0.82rem;
}

.patient-summary-table { margin-top: 0.5rem; }

.priority-list li { margin-bottom: 0.75rem; }
.priority-list span { font-size: 0.88rem; color: var(--text-muted); }

.matrix-table th,
.matrix-table td { font-size: 0.82rem; }

.validity-issues { color: #b45309; }

.cog-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.88rem;
  margin: 0.5rem 0;
}

.patient-note {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-style: italic;
}

.patient-positive { color: #059669; font-weight: 600; }

.patient-caution { color: #b45309; font-weight: 600; }

.patient-convergence-tag {
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.patient-score-detail {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.patient-priority-list li { margin-bottom: 0.85rem; }

.combined-tag {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0.25rem;
}

.cog-metric {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.cog-metric:last-child { border-bottom: none; }

.results-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.results-disclaimer { margin-top: 2rem; }

/* ─── Modal ─── */
.modal { border: none; border-radius: var(--radius); padding: 0; max-width: 400px; box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(15,23,42,0.4); backdrop-filter: blur(4px); }
.modal-inner { padding: 2rem; }
.modal-inner h3 { font-family: var(--font-display); margin-bottom: 0.75rem; }
.modal-inner p { color: var(--text-muted); margin-bottom: 1.25rem; }
.modal-inner .btn { width: 100%; margin-bottom: 0.5rem; }

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

/* ─── Toast ─── */
#toast-root {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--text);
  color: white;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  animation: toastIn 0.35s ease;
  max-width: 320px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

body.focus-mode .assess-body { max-width: 720px; }
body.focus-mode .question-card { padding: 2.5rem; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .feature-grid { grid-template-columns: 1fr; }
  .modules-layout { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topnav, .hero, .features { padding-left: 1rem; padding-right: 1rem; }
  .likert-btn { min-width: 56px; font-size: 0.7rem; }
}

/* ─── Age selection ─── */
.age-layout {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  text-align: center;
}

.age-back { margin-bottom: 1rem; }

.age-layout h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.age-intro {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.gender-block {
  margin-bottom: 2rem;
  text-align: left;
}

.gender-heading {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.gender-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.gender-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.demographics-block {
  margin-bottom: 2rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.identity-block {
  margin-bottom: 2rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.demographics-grid--identity {
  margin-bottom: 0;
}

.demographics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.demo-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.demo-field input,
.demo-field select {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: white;
}

.demo-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.required-mark {
  color: #e11d48;
  font-style: normal;
}

.anon-consent {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  cursor: pointer;
  padding: 0.75rem;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}

.anon-consent input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .demographics-grid { grid-template-columns: 1fr; }
  .gender-grid { grid-template-columns: repeat(2, 1fr); }
}

.gender-option {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text);
}

.gender-option:hover {
  border-color: var(--primary);
}

.gender-option.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.question-section {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--primary);
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.detail-block.gender-block {
  border-left: 3px solid var(--accent-teal);
}

.age-layout-select {
  max-width: 820px;
}

.age-continue-btn {
  margin-top: 1.5rem;
}

.parcours-callout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  text-align: left;
  background: linear-gradient(135deg, var(--primary-light), rgba(20, 184, 166, 0.08));
  border: 2px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.5rem;
  line-height: 1.55;
  font-size: 0.92rem;
  color: var(--text);
}

.parcours-callout-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
  animation: parcours-bounce 2s ease-in-out infinite;
}

.parcours-callout-body strong {
  color: var(--primary-dark);
}

.parcours-suggest-text {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

@keyframes parcours-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

body.reduced-motion .parcours-callout-icon {
  animation: none;
}

.age-grid-select {
  margin-top: 0.25rem;
}

.age-grid-select .age-card {
  min-height: 220px;
  position: relative;
  padding-top: 2rem;
}

.age-card-badge {
  position: absolute;
  top: 0.65rem;
  left: 50%;
  transform: translateX(-50%);
  background: #fde047;
  color: #713f12;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  white-space: nowrap;
  border: 1px solid #facc15;
  box-shadow: 0 1px 4px rgba(234, 179, 8, 0.35);
}

.age-card-cta {
  display: block;
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}

.age-card:hover .age-card-cta,
.age-card.age-card--suggested .age-card-cta {
  color: var(--primary-dark);
}

.age-card.age-card--suggested .age-card-badge {
  background: #facc15;
  color: #422006;
  border-color: #eab308;
}

.age-card--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(0.35);
}

.age-card--disabled .age-card-label,
.age-card--disabled .age-card-cta {
  color: var(--text-muted);
}

.age-card--disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

.age-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.age-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem 1.25rem;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  font: inherit;
  color: inherit;
}

.age-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
  transform: translateY(-4px);
}

.age-card-label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}

.age-card-duration {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.age-card-helper {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

@keyframes age-card-suggest {
  0%, 100% {
    border-color: var(--primary);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
  50% {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.14);
  }
}

.age-card.age-card--suggested {
  border-color: var(--primary);
  animation: age-card-suggest 2.8s ease-in-out infinite;
}

.age-card.age-card--suggested .age-card-label {
  color: var(--primary-dark);
}

body.reduced-motion .age-card.age-card--suggested {
  animation: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

@media (prefers-reduced-motion: reduce) {
  .age-card.age-card--suggested {
    animation: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  }
  .parcours-callout-icon {
    animation: none;
  }
}

.modules-age-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  margin-bottom: 0.5rem;
}

.norm-opt-in {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
}

.norm-opt-in input { margin-top: 0.2rem; flex-shrink: 0; }

@media (max-width: 700px) {
  .gender-grid { grid-template-columns: repeat(2, 1fr); }
  .age-grid { grid-template-columns: 1fr; }
  .age-grid-select .age-card { min-height: auto; }
  .diff-grid { grid-template-columns: 1fr; }
  .report-shell-header,
  .report-shell-body { padding-left: 1.15rem; padding-right: 1.15rem; }
  .clinical-summary-table { width: 100%; margin-left: 0; }
}

/* ─── Site chrome (langue + thème) ─── */
.global-chrome {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 9999;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.35rem;
  box-shadow: var(--shadow);
}

.pricing-notice {
  width: 100%;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.pricing-notice a { color: var(--primary); }

/* ─── Stripe paywall (résultats) ─── */
.report-shell--locked .report-shell-body {
  position: relative;
  min-height: 320px;
}

.report-shell--locked #profile-narrative {
  min-height: 120px;
}

.paywall-host {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.96) 50%);
}

[data-theme="dark"] .paywall-host {
  background: linear-gradient(180deg, rgba(15,23,42,0.82) 0%, rgba(15,23,42,0.97) 50%);
}

.results-actions #btn-stripe-unlock {
  margin-bottom: 0.75rem;
}

.paywall-card {
  max-width: 420px;
  width: 100%;
  text-align: center;
  padding: 1.5rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.paywall-icon { font-size: 2rem; margin-bottom: 0.5rem; }

.paywall-card h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.paywall-card > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
  line-height: 1.5;
}

.paywall-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  text-align: left;
  font-size: 0.88rem;
}

.paywall-features li {
  padding: 0.35rem 0 0.35rem 1.5rem;
  position: relative;
}

.paywall-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

.paywall-secure {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.75rem 0 0;
  line-height: 1.4;
}

.paywall-promo-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
  line-height: 1.4;
}

.paywall-test-badge {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

[data-theme="dark"] .paywall-test-badge {
  background: #422006;
  color: #fde68a;
  border-color: #b45309;
}

.site-chrome-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 1rem;
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  padding: 2rem;
  margin-top: auto;
}

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.site-footer-brand p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 1.25rem 0;
}

.site-footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.site-footer-nav a:hover { color: var(--primary); }

.site-footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.site-footer-compact {
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
}

.site-footer-compact a {
  color: var(--text-muted);
  margin: 0 0.5rem;
}

.i18n-notice {
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 1rem 0;
}

/* ─── Cookie banner (CNIL) ─── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  max-height: 90vh;
  overflow-y: auto;
}

.cookie-banner-body { flex: 1; min-width: 240px; max-width: 720px; }

.cookie-banner-body h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.cookie-banner-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cookie-banner-note { font-size: 0.78rem !important; margin-top: 0.35rem; }

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.cookie-banner-actions .btn { white-space: nowrap; }

.cookie-category {
  margin: 1rem 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
}

.cookie-category-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.cookie-tag--locked {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.cookie-prefs-intro { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.cookie-prefs-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

@media (max-width: 600px) {
  .cookie-banner-actions { width: 100%; }
  .cookie-banner-actions .btn { flex: 1; min-width: 0; }
}
