/* Questionnaire des bêta-testeurs d'IA-ORA : mêmes couleurs et même police que le site vitrine.
   Aucune dépendance, aucune police ni image chargée depuis Internet. */

@font-face { font-family: "Rajdhani"; font-weight: 500; font-display: swap; src: url("../fonts/rajdhani-500.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 600; font-display: swap; src: url("../fonts/rajdhani-600.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-weight: 700; font-display: swap; src: url("../fonts/rajdhani-700.woff2") format("woff2"); }

:root {
  /* Couleurs du logo : bleu nuit, cyan, orange de l'anneau. */
  --bg: #050a18;
  --surface: #0c1631;
  --surface-2: #101d40;
  --line: #1d2e57;
  --text: #e8f0fc;
  --muted: #94a7c7;
  --cyan: #2fd3f5;
  --orange: #ff8a1f;
  --ok: #3ddc97;
  --danger: #ff6b6b;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Ubuntu, Cantarell, "Noto Sans", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --hud: "Rajdhani", var(--font);
  --top: 60px;
  --page: 860px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 20px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
/* Fond fixe : halo cyan en haut, halo orange en bas, semis de points comme la sphère. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 82% 6%, rgba(47, 211, 245, .12), transparent 44%),
    radial-gradient(circle at 6% 94%, rgba(255, 138, 31, .06), transparent 40%),
    radial-gradient(rgba(148, 167, 199, .14) 1px, transparent 1.6px) 0 0 / 30px 30px,
    var(--bg);
}
img, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--cyan); }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 30; padding: 8px 14px; background: var(--cyan); color: #04121c; font: 700 15px var(--hud); }
.skip:focus { left: 8px; }
/* Lu par les lecteurs d'écran seulement */
.skip-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- Barre du haut : logo et progression ---- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 max(16px, calc((100vw - var(--page)) / 2));
  background: rgba(5, 10, 24, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.brand { width: 112px; height: auto; }
.progress { display: flex; align-items: center; gap: 14px; margin-left: auto; min-width: 0; }
.progress-text { color: var(--muted); font: 600 14px/1 var(--hud); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
.progress-text b { color: var(--cyan); font-weight: 700; }
.progress-bar { position: relative; width: clamp(80px, 22vw, 220px); height: 4px; background: var(--line); overflow: hidden; }
.progress-bar span { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--cyan), #7fe6ff); transition: width .4s var(--ease); }
.progress.complete .progress-bar span { background: var(--ok); }

main { max-width: var(--page); margin: 0 auto; padding: 0 16px; }

/* ---- Cadre HUD : coins en équerre, comme les tuiles du cockpit ---- */
.frame {
  position: relative;
  background: linear-gradient(160deg, rgba(16, 29, 64, .78), rgba(10, 19, 48, .78));
  border: 1px solid var(--line);
}
.frame::before, .frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.frame::before { top: -1px; left: -1px; border-top: 2px solid var(--cyan); border-left: 2px solid var(--cyan); }
.frame::after { right: -1px; bottom: -1px; border-right: 2px solid var(--cyan); border-bottom: 2px solid var(--cyan); }

/* ---- Titres ---- */
.label { color: var(--orange); font: 700 14px/1 var(--hud); letter-spacing: .32em; text-transform: uppercase; }
.label::before { content: ""; display: inline-block; width: 26px; height: 2px; margin: 0 12px 4px 0; background: var(--orange); }
h2 { font: 700 clamp(28px, 4vw, 40px)/1.08 var(--hud); }
.req { color: var(--orange); font-weight: 700; }

/* ---- Ouverture ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 24px; padding: clamp(36px, 7vw, 72px) 0 clamp(28px, 5vw, 48px); }
.hero h1 { margin: 16px 0 16px; font: 700 clamp(40px, 7vw, 68px)/1 var(--hud); }
.lead { color: #c3d2ea; font-size: clamp(17px, 1.6vw, 19px); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 22px; }
.facts li { padding: 5px 12px; border: 1px solid var(--line); background: rgba(12, 22, 49, .7); color: var(--muted); font: 600 14px/1.3 var(--hud); letter-spacing: .06em; }
.hero-orb { position: relative; width: 220px; aspect-ratio: 1; }
.hero-orb::before { content: ""; position: absolute; inset: 10%; border-radius: 50%; background: radial-gradient(circle, rgba(47, 211, 245, .18), transparent 66%); }
.hero-orb canvas { position: relative; width: 100%; height: 100%; }

.noscript { padding: 20px 22px; margin-bottom: 30px; }

/* ---- Sections du questionnaire ---- */
.questions { display: grid; gap: clamp(40px, 7vw, 64px); }
.section-head { margin-bottom: 18px; }
.section-head h2 { margin: 12px 0 8px; }
.section-head p:last-child { color: var(--muted); }
.qlist { display: grid; gap: 14px; }

.q { padding: 20px 22px 22px; border: 0; margin: 0; min-width: 0; transition: border-color .25s, box-shadow .25s; }
.q.answered::before, .q.answered::after { border-color: var(--ok); }
.q.invalid { border-color: rgba(255, 107, 107, .7); box-shadow: 0 0 0 1px rgba(255, 107, 107, .35); }
.q.invalid::before, .q.invalid::after { border-color: var(--danger); }
.q.appear { animation: appear .45s var(--ease); }
@keyframes appear { from { opacity: 0; transform: translateY(-6px); } }
.q-title { display: flex; gap: 10px; align-items: baseline; padding: 0; margin: 0 0 4px; font: 700 20px/1.25 var(--hud); letter-spacing: .02em; }
.q-num { flex: none; min-width: 2.1em; color: var(--cyan); font: 700 15px/1 var(--hud); letter-spacing: .1em; }
.q-help { margin: 2px 0 0 calc(2.1em * 15 / 20 + 10px); color: var(--muted); font-size: 15px; line-height: 1.45; }
.q-body { margin-top: 14px; }
.q-error { margin-top: 10px; color: var(--danger); font: 600 14px/1.3 var(--hud); letter-spacing: .06em; }

/* Champs texte */
.field {
  width: 100%;
  padding: 11px 14px;
  background: rgba(5, 10, 24, .7);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  transition: border-color .2s, background .2s;
}
.field::placeholder { color: #5f7397; }
.field:focus { outline: none; border-color: var(--cyan); background: rgba(5, 10, 24, .95); }
textarea.field { min-height: 96px; resize: vertical; line-height: 1.5; }

/* Choix en pastilles (vrais boutons radio et cases à cocher, cachés sous l'étiquette) */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.choice span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  background: rgba(5, 10, 24, .6);
  border: 1px solid var(--line);
  color: #c3d2ea;
  font-size: 15px;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
  user-select: none;
}
.choice span::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border: 1.5px solid #5f7397;
  border-radius: 50%;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.choice input[type="checkbox"] + span::before { border-radius: 2px; }
.choice span:hover { border-color: rgba(47, 211, 245, .6); color: var(--text); }
.choice input:checked + span { background: rgba(47, 211, 245, .14); border-color: var(--cyan); color: var(--text); }
.choice input:checked + span::before { background: var(--cyan); border-color: var(--cyan); box-shadow: inset 0 0 0 2px #0a1330; }
.choice input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }

/* Échelles : une rangée de cases numérotées, avec les libellés des deux bouts */
.scale .choices { flex-wrap: nowrap; gap: 6px; }
.scale .choice { flex: 1 1 0; min-width: 0; }
.scale .choice span { justify-content: center; width: 100%; padding: 8px 0; font: 700 18px/1 var(--hud); }
.scale .choice span::before { display: none; }
.scale-ends { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; color: var(--muted); font: 600 13px/1.3 var(--hud); letter-spacing: .08em; text-transform: uppercase; }
.scale-ends span:last-child { text-align: right; }
.clear { margin-top: 10px; padding: 0; background: none; border: 0; color: var(--muted); font: 600 13px/1 var(--hud); letter-spacing: .1em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.clear:hover { color: var(--cyan); }

/* ---- Boutons : coins coupés, comme sur le site ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  background: var(--cyan);
  border: 0;
  color: #04121c;
  font: 700 17px/1 var(--hud);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: background .2s, transform .2s, opacity .2s;
}
.btn:hover { background: #7fe6ff; transform: translateY(-2px); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn-ghost { background: rgba(47, 211, 245, .09); color: var(--cyan); }
.btn-ghost:hover { background: rgba(47, 211, 245, .2); }
.btn-small { min-height: 38px; padding: 0 16px; font-size: 14px; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.btn-danger { background: rgba(255, 107, 107, .08); color: #ff9c9c; }
.btn-danger:hover { background: rgba(255, 107, 107, .18); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- Synthèse ---- */
.recap { margin-top: clamp(48px, 8vw, 80px); }
.recap h2 { margin: 12px 0 6px; }
.recap-text {
  max-height: 420px;
  overflow: auto;
  margin: 16px 0;
  padding: 18px 20px;
  color: #c3d2ea;
  font: 13px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---- Envoi et remerciement ---- */
.send, .done { margin-top: 28px; padding: clamp(22px, 4vw, 34px); }
.send h2, .done h2 { margin-bottom: 12px; }
.done h2 { margin-top: 12px; }
.send > p, .done > p { color: #c3d2ea; }
.send .actions, .done .actions { margin-top: 20px; }
.missing { margin-top: 16px; padding: 12px 14px; border-left: 3px solid var(--orange); background: rgba(255, 138, 31, .08); color: #ffd2a8; font-size: 15px; }
.missing a { color: inherit; }
.missing ul { margin-top: 6px; padding-left: 20px; list-style: disc; }
.error { margin-top: 16px; padding: 12px 14px; border-left: 3px solid var(--danger); background: rgba(255, 107, 107, .08); color: #ffc4c4; font-size: 15px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; max-width: var(--page); margin: clamp(48px, 8vw, 80px) auto 0; padding: 22px 16px 28px; border-top: 1px solid var(--line); color: var(--muted); font: 600 13px/1.4 var(--hud); letter-spacing: .14em; text-transform: uppercase; }
.credit { display: flex; align-items: center; gap: 8px; }
.credit img { width: 16px; height: auto; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 40;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  background: var(--surface-2);
  border: 1px solid var(--cyan);
  color: var(--text);
  font: 600 15px/1.3 var(--hud);
  letter-spacing: .06em;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- Téléphone ---- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; }
  .hero-orb { order: -1; width: 140px; margin: 0 auto -8px; }
  .progress-text { font-size: 13px; letter-spacing: .06em; }
  .q { padding: 16px 16px 18px; }
  .q-title { font-size: 18px; }
  .q-help { margin-left: 0; }
  .scale .choices { gap: 4px; }
  .scale .choice span { min-height: 38px; font-size: 16px; }
  /* Échelle de 0 à 10 : deux rangées, pour des cases assez grandes au doigt. */
  .scale-wide .choices { flex-wrap: wrap; }
  .scale-wide .choice { flex: 0 0 calc((100% - 5 * 4px) / 6); }
  .foot { justify-content: center; text-align: center; }
}
@media (max-width: 380px) {
  .progress-bar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Impression : seulement la synthèse, en noir sur blanc ---- */
@media print {
  body { background: #fff; color: #000; }
  body::before, .top, .hero, .questions, .send, .done, .foot, .toast, .recap .actions, .recap .muted { display: none !important; }
  main { max-width: none; padding: 0; }
  .recap { margin: 0; }
  .recap .label { color: #000; }
  .recap .label::before { background: #000; }
  .recap-text { max-height: none; overflow: visible; border: 0; background: none; color: #000; font-size: 11pt; }
  .frame::before, .frame::after { display: none; }
}
