@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,800;0,900;1,900&family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  --black: #0D0D0D;
  --white: #FFFFFF;
  --cream: #F5F0E8;
  --orange: #FF5C00;
  --orange-light: #FFF0E8;
  --orange-border: #FFD5B8;
  --gray: #6B6B6B;
  --gray-light: #888;
  --gray-dark: #3a3a3a;
  --border: #E0E0E0;
  --bg-alt: #FAFAFA;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--white);
  color: var(--black);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: 'Inter', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--gray);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  line-height: 1;
}

/* ================= PROGRESS ================= */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: transparent;
  z-index: 100;
  pointer-events: none;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--orange);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= COUNTER ================= */
.counter {
  position: fixed;
  top: 24px;
  right: 32px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.3s, color 0.3s;
}
.counter.visible { opacity: 1; }
.counter.on-dark { color: var(--gray-light); }

/* ================= STAGE (fullscreen) ================= */
.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 48px;
  overflow-y: auto;
}

/* Variantes de fond */
.screen--dark  { background: var(--black); color: var(--white); }
.screen--cream { background: var(--cream); color: var(--black); }
.screen--white { background: var(--white); color: var(--black); }

/* ================= WELCOME (accueil) ================= */
.welcome {
  width: 100%;
  max-width: 640px;
  text-align: left;
}
.welcome .brand-logo,
.final .brand-logo {
  display: block;
  height: 40px;
  width: auto;
  margin-bottom: 24px;
  opacity: 0.95;
}

.welcome .studio,
.final .studio {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  font-size: 20px;
  color: var(--white);
  margin-bottom: 8px;
}
.welcome .tagline {
  font-size: 11px;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 80px;
}
.welcome h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -1.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.welcome h1 em {
  color: var(--orange);
  font-style: italic;
}
.welcome .intro {
  font-size: 16px;
  color: var(--gray-light);
  max-width: 520px;
  margin-bottom: 48px;
  line-height: 1.6;
}
.welcome .meta {
  display: flex;
  gap: 24px;
  margin-bottom: 56px;
  font-size: 12px;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.welcome .meta span { position: relative; padding-right: 24px; }
.welcome .meta span:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0; top: 50%;
  width: 4px; height: 4px;
  background: var(--gray);
  border-radius: 50%;
  transform: translateY(-50%);
}

/* Inputs accueil */
.welcome-form { display: flex; flex-direction: column; gap: 20px; max-width: 440px; }
.welcome-form .field { display: flex; flex-direction: column; gap: 8px; }
.welcome-form label {
  font-size: 11px;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
}
.welcome-form input {
  width: 100%;
  padding: 14px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--white);
  background: transparent;
  border: 1px solid var(--gray-dark);
  border-radius: 0;
  transition: border-color 0.2s;
  outline: none;
}
.welcome-form input::placeholder { color: var(--gray); }
.welcome-form input:focus { border-color: var(--orange); }
.welcome-form input.invalid { border-color: #C43D3D; }

.error-msg {
  font-size: 12px;
  color: #FF7A5C;
  margin-top: 4px;
  min-height: 16px;
}

/* ================= CTA orange ================= */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  background: var(--orange);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: transform 0.15s, background 0.15s;
  margin-top: 32px;
  align-self: flex-start;
}
.cta:hover { background: #E65200; transform: translateX(4px); }
.cta:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.cta .arrow { transition: transform 0.2s; }
.cta:hover .arrow { transform: translateX(4px); }

.cta--dark { background: var(--black); }
.cta--dark:hover { background: #1a1a1a; }

/* ================= CHAPTER TRANSITION ================= */
.chapter {
  width: 100%;
  max-width: 900px;
  text-align: left;
}
.chapter .chapter-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 32px;
}
.chapter h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(56px, 9vw, 128px);
  line-height: 0.95;
  letter-spacing: -2px;
  text-transform: uppercase;
  margin-bottom: 24px;
  overflow: hidden;
}
.chapter .letter { display: inline-block; }
.chapter .subtitle {
  font-size: 18px;
  color: var(--gray);
  max-width: 600px;
  margin-bottom: 56px;
}

/* ================= QUESTION ================= */
.question {
  width: 100%;
  max-width: 760px;
  text-align: left;
}
.question .q-chapter {
  font-size: 11px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
  margin-bottom: 24px;
}
.question .q-chapter .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--orange);
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
}
.question h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.question .sublabel {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 40px;
}

/* ---- Options radio/checkbox ---- */
.options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }

.option {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px 22px;
  background: var(--white);
  border: 1px solid var(--border);
  text-align: left;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
  cursor: pointer;
  font-size: 15px;
  color: var(--black);
}
.option:hover { border-color: var(--black); transform: translateX(4px); }
.option.selected {
  border-color: var(--orange);
  background: var(--orange-light);
}
.option.selected .option-marker {
  background: var(--orange);
  border-color: var(--orange);
}
.option.selected .option-marker::after { opacity: 1; transform: scale(1); }

.option-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--gray);
  font-family: 'Inter', monospace;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.option.selected .option-shortcut {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}

.option-label { flex: 1; }

.option-marker {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s;
}
.option[data-multi="true"] .option-marker { border-radius: 2px; }
.option-marker::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  background: var(--white);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: all 0.2s;
}
.option[data-multi="true"] .option-marker::after {
  width: 10px; height: 5px;
  background: transparent;
  border-left: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  border-radius: 0;
  transform: translate(-50%, -70%) rotate(-45deg) scale(0);
}
.option[data-multi="true"].selected .option-marker::after {
  transform: translate(-50%, -70%) rotate(-45deg) scale(1);
}

/* ---- Champ "autre" ---- */
.other-input {
  margin-top: 12px;
  margin-bottom: 12px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.25s, max-height 0.25s;
}
.other-input.visible {
  opacity: 1;
  max-height: 120px;
}
.other-input input {
  width: 100%;
  padding: 14px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--orange);
  outline: none;
}
.other-input input:focus { border-color: var(--black); }

/* ---- Textarea ---- */
.textarea-wrapper { margin-bottom: 24px; }
.textarea-wrapper textarea {
  width: 100%;
  min-height: 160px;
  padding: 20px 22px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--border);
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}
.textarea-wrapper textarea:focus { border-color: var(--black); }
.textarea-wrapper .char-count {
  margin-top: 8px;
  font-size: 11px;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: right;
}

/* ---- Examples (pour projections) ---- */
.examples {
  background: var(--bg-alt);
  border-left: 3px solid var(--orange);
  padding: 20px 24px;
  margin-bottom: 32px;
}
.examples .ex-label {
  font-size: 10px;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 12px;
}
.examples .ex-item {
  font-size: 14px;
  color: var(--gray-dark);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 10px;
}
.examples .ex-item:last-child { margin-bottom: 0; }
.examples .ex-item::before { content: "« "; color: var(--orange); }
.examples .ex-item::after { content: " »"; color: var(--orange); }

/* ---- Actions (boutons nav) ---- */
.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}
.btn-back {
  font-size: 12px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
  padding: 12px 0;
  transition: color 0.15s;
}
.btn-back:hover { color: var(--black); }

/* ================= FINAL SCREEN ================= */
.final {
  width: 100%;
  max-width: 720px;
  text-align: left;
}
.final .studio {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  font-size: 20px;
  color: var(--white);
  margin-bottom: 64px;
}
.final .badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  margin-bottom: 24px;
  padding: 6px 12px;
  border: 1px solid var(--orange);
}
.final h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.98;
  letter-spacing: -1.5px;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 32px;
}
.final h2 em { color: var(--orange); }
.final .message {
  font-size: 17px;
  color: var(--gray-light);
  line-height: 1.65;
  max-width: 580px;
}
.final .signature {
  margin-top: 56px;
  font-size: 13px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.final .signature strong { color: var(--white); font-weight: 600; }

/* ================= LOADER ================= */
.loader {
  position: fixed;
  inset: 0;
  background: var(--black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.loader.visible { opacity: 1; pointer-events: all; }
.loader .spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--gray-dark);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader .txt {
  font-size: 11px;
  color: var(--gray-light);
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 500;
}

/* ================= FOOTER ================= */
.footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  font-size: 10px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
  background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}
.footer.on-dark { color: var(--gray-light); background: linear-gradient(to top, rgba(13,13,13,0.95) 0%, rgba(13,13,13,0) 100%); }
.footer.on-dark kbd { background: var(--gray-dark); color: var(--gray-light); border-color: #444; }
.footer .hint { display: flex; gap: 12px; align-items: center; }

/* ================= ERROR TOAST ================= */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 14px 22px;
  background: var(--black);
  color: var(--white);
  font-size: 13px;
  border-left: 3px solid var(--orange);
  opacity: 0;
  transition: all 0.3s;
  z-index: 300;
  pointer-events: none;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 720px) {
  .screen { padding: 64px 24px 96px; }
  .welcome .tagline { margin-bottom: 48px; }
  .welcome h1 { font-size: 40px; letter-spacing: -1px; }
  .welcome .meta { flex-wrap: wrap; gap: 16px; }
  .chapter h2 { font-size: 56px; letter-spacing: -1px; }
  .question h2 { font-size: 30px; letter-spacing: -0.5px; }
  .option { padding: 16px 18px; font-size: 14px; gap: 12px; }
  .option-shortcut { display: none; }
  .final h2 { font-size: 48px; }
  .counter { right: 16px; top: 18px; }
  .footer { padding: 12px 16px; font-size: 9px; }
  .footer .hint { display: none; }
}
