/* =====================================================================
   Questionnaire de découverte – NumLo
   Couleurs : marine #16264D · turquoise #3EB8B3 · jaune #F5C518
   ===================================================================== */

:root {
  --navy: #16264D;
  --navy-soft: #2B3B63;
  --turquoise: #3EB8B3;
  --turquoise-dark: #2F9C97;
  --turquoise-light: #E9F7F6;
  --yellow: #F5C518;
  --yellow-light: #FEF7DA;
  --bg: #F5F8FA;
  --card: #FFFFFF;
  --text: #1F2A3C;
  --muted: #5B6575;          /* gris lisible : contraste ≥ 4.5:1 sur blanc */
  --border: #D5DCE4;
  --error: #B42318;
  --error-bg: #FEF3F2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 38, 77, .06), 0 8px 24px rgba(22, 38, 77, .06);
  --font-title: 'League Spartan', 'Trebuchet MS', Arial, sans-serif;
  --font-text: 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif;
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.55;
}

main { flex: 1; outline: none; }

a { color: var(--navy); text-underline-offset: 2px; }
a:hover { color: var(--turquoise-dark); }

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute; left: 16px; top: -60px;
  background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: 8px; z-index: 10;
  text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- En-tête ---------- */
.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--turquoise);
}
.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 88px;
}
.logo { display: block; height: 64px; width: auto; max-width: 180px; object-fit: contain; }
.logo-fallback {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -.01em;
  color: var(--navy);
}
.logo-fallback span { color: var(--turquoise-dark); }

.save-status {
  font-size: .875rem;
  color: var(--turquoise-dark);
  font-weight: 500;
  opacity: 0;
  transition: opacity .3s ease;
}
.save-status.visible { opacity: 1; }

/* ---------- Pied de page ---------- */
.site-footer {
  margin-top: 48px;
  padding: 24px 0 32px;
  background: var(--navy);
  color: #E4E9F2;
  font-size: .875rem;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--yellow); }
.footer-id { margin: 0 0 8px; font-weight: 700; letter-spacing: .02em; }
.footer-rgpd { margin: 0; color: #C9D2E3; line-height: 1.5; }

/* ---------- Cartes & écrans ---------- */
.screen { padding: 28px 0 8px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 20px;
}

h1, h2, h3 {
  font-family: var(--font-title);
  color: var(--navy);
  line-height: 1.15;
  margin: 0;
}
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 600; }
h1:focus, h2:focus { outline: none; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--turquoise-dark);
  margin-bottom: 8px;
}

.intro { color: var(--muted); margin: 8px 0 0; font-size: 1.0625rem; }

/* ---------- Accueil ---------- */
.welcome h1 { margin-bottom: 16px; }
.welcome-text p { margin: 0 0 14px; }
.signature {
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--navy);
  font-size: 1.125rem;
  margin-top: 4px !important;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 20px 0 24px;
}
.meta li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--turquoise-light);
  color: var(--navy);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .9375rem;
  font-weight: 500;
}
.resume {
  border-left: 5px solid var(--yellow);
  background: var(--yellow-light);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
}
.resume p { margin: 0 0 12px; }
.resume .actions { margin-top: 0; }

/* ---------- Étoile « obligatoire » ---------- */
.star {
  color: var(--yellow);
  -webkit-text-stroke: .6px var(--navy);
  paint-order: stroke fill;
  font-size: 1.1em;
  line-height: 1;
}

/* ---------- Progression ---------- */
.progress { margin-bottom: 20px; }
.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: .9375rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.progress-top strong { color: var(--navy); font-weight: 700; }
.progress-track {
  height: 10px;
  background: #E3E9EF;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--turquoise);
  border-radius: 999px;
  transition: width .5s ease;
}
.progress-steps {
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
.progress-steps li {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: .8125rem; font-weight: 700;
  background: #E3E9EF; color: var(--muted);
}
.progress-steps li.done { background: var(--turquoise); color: var(--navy); }
.progress-steps li.current { background: var(--navy); color: #fff; }

/* ---------- Champs ---------- */
.legend-hint {
  font-size: .9375rem;
  color: var(--muted);
  margin: 14px 0 0;
}

.field {
  border: 0;
  margin: 0;
  padding: 20px 0;
  border-top: 1px solid #EDF1F5;
  min-width: 0;
}
.field:first-child { border-top: 0; padding-top: 8px; }

.q-label {
  display: block;
  font-weight: 700;
  color: var(--navy);
  font-size: 1.0625rem;
  line-height: 1.4;
  margin-bottom: 10px;
  padding: 0;
}
/* La légende d'un fieldset se place normalement sur sa bordure : on l'en sort */
legend.q-label { float: left; width: 100%; }
legend.q-label + * { clear: both; }

.q-num {
  display: inline-block;
  min-width: 2.2em;
  color: var(--turquoise-dark);
  font-family: var(--font-title);
  font-weight: 600;
}

input[type="text"], input[type="email"], textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 112px; resize: vertical; line-height: 1.5; overflow: hidden; }
input::placeholder, textarea::placeholder { color: #8A93A2; }
input[type="text"]:hover, input[type="email"]:hover, textarea:hover { border-color: #AEB9C6; }
input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
  outline: none;
  border-color: var(--turquoise-dark);
  box-shadow: 0 0 0 3px rgba(62, 184, 179, .35);
}

.help {
  margin: 6px 0 0;
  font-size: .9375rem;
  color: var(--muted);
}
.echo {
  margin: 0 0 8px;
  font-size: .9375rem;
  color: var(--navy);
  background: var(--turquoise-light);
  border-radius: 8px;
  padding: 6px 10px;
  display: inline-block;
}

/* Choix (radio / cases à cocher) en « pastilles » */
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  line-height: 1.25;
  transition: border-color .15s ease, background .15s ease;
}
.choice:hover { border-color: #AEB9C6; }
.choice input {
  width: 20px; height: 20px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--navy);
  cursor: pointer;
}
.choice:has(input:checked) {
  border-color: var(--turquoise);
  background: var(--turquoise-light);
  font-weight: 500;
}
.choice:has(input:focus-visible) {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}
.choice input:focus-visible { outline: none; }
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.choice input:disabled { cursor: not-allowed; }

.counter { font-size: .9375rem; color: var(--muted); margin: -4px 0 10px; }
.counter strong { color: var(--navy); }

.other-field { margin-top: 12px; }
.other-field label { display: block; font-size: .9375rem; color: var(--navy); font-weight: 500; margin-bottom: 4px; }

/* Erreurs */
.field-error {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  margin: 8px 0 0;
  color: var(--error);
  font-size: .9375rem;
  font-weight: 500;
}
.field-error::before { content: "↑"; font-weight: 700; }
.has-error input[type="text"], .has-error input[type="email"], .has-error textarea { border-color: var(--error); }
.has-error .choice { border-color: #E9B7B1; }

.error-summary {
  background: var(--error-bg);
  border: 1.5px solid #F4C7C2;
  border-left: 5px solid var(--error);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0 4px;
  color: var(--text);
}
.error-summary p { margin: 0 0 6px; }
.error-summary ul { margin: 0; padding-left: 20px; }
.error-summary a { color: var(--error); font-weight: 500; }

/* ---------- Boutons ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #EDF1F5;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: .01em;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--turquoise);
  color: var(--navy);            /* marine sur turquoise : contraste 6:1 */
  box-shadow: 0 4px 12px rgba(62, 184, 179, .35);
}
.btn-primary:hover { background: #52C4BF; color: var(--navy); }
.btn-secondary {
  background: #fff;
  color: var(--navy);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--navy); color: var(--navy); }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn-grow { flex: 1; }
.nav .btn-primary { flex: 1; max-width: 320px; margin-left: auto; }

.btn-link {
  background: none;
  border: 0;
  padding: 6px 2px;
  font: inherit;
  font-weight: 700;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-link:hover { color: var(--turquoise-dark); }
.back-to-recap { margin-top: 12px; text-align: center; }

.spinner {
  width: 18px; height: 18px;
  border: 3px solid rgba(22, 38, 77, .25);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Récapitulatif ---------- */
.recap-step { margin-top: 20px; }
.recap-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.recap-head h2 { font-size: 1.1875rem; }
.recap-list { margin: 0; }
.recap-item { padding: 12px 0; border-top: 1px solid #EDF1F5; }
.recap-item:first-child { border-top: 0; }
.recap-item dt { font-weight: 700; color: var(--navy); font-size: .9375rem; }
.recap-item dd { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.recap-item dd.empty { color: var(--muted); }

.privacy-note {
  font-size: .9375rem;
  color: var(--muted);
  margin: 20px 0 0;
}
.send-error {
  background: var(--error-bg);
  border-left: 5px solid var(--error);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 16px;
}
.send-error p { margin: 0; }

/* Champ piège anti-spam : invisible pour les humains */
.hp {
  position: absolute !important;
  left: -10000px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- Remerciement ---------- */
.thanks { text-align: center; padding: 40px 20px; }
.thanks svg { width: 88px; height: 88px; margin: 0 auto 16px; display: block; }
.thanks h1 { font-size: 2.5rem; margin-bottom: 12px; }
.thanks .lead { font-size: 1.25rem; color: var(--navy); margin: 0 auto 16px; max-width: 30ch; }
.thanks .small { color: var(--muted); font-size: .9375rem; margin: 0 auto; max-width: 46ch; }

/* ---------- Écrans plus larges ---------- */
@media (min-width: 640px) {
  .screen { padding-top: 40px; }
  .card { padding: 36px 40px; }
  h1 { font-size: 2.375rem; }
  .choices { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 340px) {
  .choices { grid-template-columns: 1fr; }
  .nav .btn { padding: 12px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; }
}
