/* ─────────────────────────────────────────────────────────────
   Music Magic Myth — enquêtes 2026
   Pierre nocturne : fond photo des ruines, texte crème, accent olive.
   La palette prolonge celle des emails (ink / cream / olive) en
   l'inversant : l'email est diurne, le formulaire est nocturne.
   ───────────────────────────────────────────────────────────── */

:root {
  --ink:        #0E0E0C;
  --ink-soft:   #16161200;
  --panel:      rgba(24, 24, 20, 0.72);
  --panel-edge: rgba(184, 192, 126, 0.16);

  --cream:      #FBFAF4;
  --cream-dim:  #A6A499;
  --cream-mute: #6F6E65;

  --olive:      #B8C07E;
  --ember:      #C4622D;

  --font-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-body:    'Karla', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'Courier New', monospace;

  --measure: 34rem;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* La photo des ruines la nuit, fixée derrière tout le document.
   `background-attachment: fixed` casse sur iOS : on la pose donc dans
   un élément dédié en position: fixed. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url('img/hero-page-sm.jpg');
  background-size: cover;
  background-position: center 35%;
  opacity: 0.55;
}
@media (min-width: 900px) {
  .backdrop { background-image: url('img/hero-page.jpg'); }
}
/* Les ruines restent lisibles en haut, puis s'éteignent : le texte du
   questionnaire a besoin d'un fond franc pour rester confortable à lire. */
.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(14, 14, 12, 0.30) 0%,
    rgba(14, 14, 12, 0.72) 42%,
    rgba(14, 14, 12, 0.94) 70%,
    var(--ink) 92%
  );
}

/* Grain : casse l'aplat numérique, rappelle la pierre et la pellicule. */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* ── Progression ────────────────────────────────────────────── */

.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(251, 250, 244, 0.08);
  z-index: 10;
}
.progress__bar {
  height: 100%;
  width: 0;
  background: var(--olive);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Structure ──────────────────────────────────────────────── */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--olive);
}

.hero { padding: 5rem 0 3rem; }

.hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.75rem, 12vw, 4.25rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 1.75rem 0 1.5rem;
  color: var(--cream);
}
.hero__title em {
  font-style: italic;
  color: var(--olive);
}

.hero__lede {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--cream-dim);
  margin: 0 0 1rem;
  max-width: 30rem;
}
.hero__lede strong { color: var(--cream); font-weight: 500; }

.hero__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--cream-mute);
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(251, 250, 244, 0.1);
}

/* ── Blocs de questions ─────────────────────────────────────── */

.bloc { margin: 4rem 0 0; }

.bloc__head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 2.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(184, 192, 126, 0.22);
}
.bloc__num {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  color: var(--olive);
}
.bloc__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--cream);
}

.q { margin-bottom: 2.75rem; }

.q__label {
  display: block;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--cream);
  margin-bottom: 0.4rem;
}
.q__hint {
  display: block;
  font-size: 0.875rem;
  color: var(--cream-mute);
  margin-bottom: 1rem;
  font-style: italic;
}
.q__req {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--ember);
  text-transform: uppercase;
  vertical-align: 2px;
  margin-left: 0.4rem;
}

/* ── Échelles (1-10, 0-10, 1-5) ─────────────────────────────
   Boutons radio déguisés en jetons. Cible tactile ≥ 44px : c'est la
   question qui casse le plus souvent sur téléphone. */

.scale {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.scale input { position: absolute; opacity: 0; pointer-events: none; }

.scale label {
  flex: 1 1 auto;
  min-width: 2.75rem;
  min-height: 2.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--cream-dim);
  background: rgba(251, 250, 244, 0.04);
  border: 1px solid rgba(251, 250, 244, 0.14);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
  user-select: none;
}
.scale label:hover { border-color: var(--olive); color: var(--cream); }
.scale input:checked + label {
  background: var(--olive);
  border-color: var(--olive);
  color: var(--ink);
  font-weight: 500;
  transform: translateY(-2px);
}
.scale input:focus-visible + label {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

.scale__ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--cream-mute);
  margin-top: 0.6rem;
}

/* ── Grille d'aspects (Q4) ──────────────────────────────────
   Empilée sur tous les écrans plutôt qu'un tableau : un tableau
   8 × 5 est illisible sur mobile, et 70 % des réponses viendront
   d'un téléphone. */

.aspect {
  padding: 1.125rem 0;
  border-bottom: 1px solid rgba(251, 250, 244, 0.07);
}
.aspect:first-of-type { border-top: 1px solid rgba(251, 250, 244, 0.07); }
.aspect__name {
  display: block;
  font-size: 0.9375rem;
  color: var(--cream);
  margin-bottom: 0.7rem;
}

/* ── Choix simples / multiples ──────────────────────────────── */

.choices { display: flex; flex-direction: column; gap: 0.5rem; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }

.choices label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.875rem;
  padding: 0.7rem 1rem;
  background: rgba(251, 250, 244, 0.035);
  border: 1px solid rgba(251, 250, 244, 0.12);
  border-radius: 4px;
  font-size: 0.9375rem;
  color: var(--cream-dim);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.choices label::before {
  content: '';
  flex: 0 0 auto;
  width: 0.75rem;
  height: 0.75rem;
  border: 1px solid rgba(251, 250, 244, 0.35);
  border-radius: 50%;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.choices input[type="checkbox"] + label::before { border-radius: 2px; }
.choices label:hover { border-color: rgba(184, 192, 126, 0.5); color: var(--cream); }
.choices input:checked + label {
  border-color: var(--olive);
  background: rgba(184, 192, 126, 0.1);
  color: var(--cream);
}
.choices input:checked + label::before {
  background: var(--olive);
  border-color: var(--olive);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.choices input:focus-visible + label { outline: 2px solid var(--cream); outline-offset: 2px; }

/* ── Champs libres ──────────────────────────────────────────── */

textarea, input[type="text"], input[type="email"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--cream);
  background: rgba(251, 250, 244, 0.04);
  border: 1px solid rgba(251, 250, 244, 0.14);
  border-radius: 4px;
  padding: 0.8rem 0.9rem;
  transition: border-color 0.18s, background 0.18s;
}
textarea { min-height: 5.5rem; resize: vertical; line-height: 1.6; }
textarea::placeholder, input::placeholder { color: var(--cream-mute); }
textarea:focus, input:focus {
  outline: none;
  border-color: var(--olive);
  background: rgba(251, 250, 244, 0.06);
}

/* ── Le cercle (opt-in RGPD) ────────────────────────────────── */

.cercle {
  margin: 3.5rem 0 0;
  padding: 1.75rem;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 6px;
  backdrop-filter: blur(8px);
}
.cercle__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0.75rem 0 0.75rem;
  color: var(--cream);
}
.cercle__intro { font-size: 0.9375rem; color: var(--cream-dim); margin: 0 0 1.25rem; }

.cercle__list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  font-size: 0.9375rem;
  color: var(--cream-dim);
}
.cercle__list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.55rem;
  line-height: 1.5;
}
.cercle__list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--olive);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.optin {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem;
  background: rgba(184, 192, 126, 0.07);
  border: 1px solid rgba(184, 192, 126, 0.28);
  border-radius: 4px;
  cursor: pointer;
}
.optin input {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  accent-color: var(--olive);
  cursor: pointer;
}
/* Enfant direct uniquement : `.optin span` (0,1,1) l'emportait sur
   `.q__req` (0,1,0) et affichait le tag « requis » en corps de texte. */
.optin > span { font-size: 0.9375rem; line-height: 1.55; color: var(--cream); }

/* Champs email/prénom : révélés seulement si la case est cochée. */
.optin-fields {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  grid-template-columns: 1fr;
}
.optin-fields[hidden] { display: none; }
@media (min-width: 30rem) {
  .optin-fields { grid-template-columns: 1.4fr 1fr; }
}

.rgpd {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--cream-mute);
  margin-top: 1rem;
}
.rgpd a { color: var(--cream-dim); }

/* ── Envoi ──────────────────────────────────────────────────── */

.submit-zone { margin-top: 3rem; text-align: center; }

button[type="submit"] {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--cream);
  border: none;
  border-radius: 4px;
  padding: 1.15rem 2rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
}
button[type="submit"]:hover:not(:disabled) { background: var(--olive); transform: translateY(-1px); }
button[type="submit"]:disabled { opacity: 0.45; cursor: not-allowed; }

.form-error {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--ember);
  min-height: 1.3em;
}

.q--error .q__label,
.q--error .bloc__title,
.q--error .cercle__title { color: var(--ember); }
.q--error .scale label,
.q--error .choices label { border-color: rgba(196, 98, 45, 0.55); }
/* Le bloc « cercle » porte lui-même data-required sur l'enquête artistes :
   c'est l'encadré entier qui doit signaler l'oubli, pas un label perdu. */
.cercle.q--error { border-color: rgba(196, 98, 45, 0.6); }
.cercle.q--error .optin {
  border-color: var(--ember);
  background: rgba(196, 98, 45, 0.1);
}

/* Piège à bots : hors écran plutôt que display:none, que certains
   robots savent détecter. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Pied ───────────────────────────────────────────────────── */

.foot {
  margin-top: 4rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(251, 250, 244, 0.1);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-mute);
  line-height: 1.9;
}

/* ── Page de remerciement ───────────────────────────────────── */

.merci {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 1.5rem;
  max-width: var(--measure);
  margin: 0 auto;
}
.merci__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.5rem, 11vw, 3.75rem);
  line-height: 1;
  margin: 1.5rem 0;
}
.merci__title em { font-style: italic; color: var(--olive); }
.merci p { color: var(--cream-dim); font-size: 1.0625rem; max-width: 28rem; }

/* ── Entrée en scène ────────────────────────────────────────── */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.rise {
  opacity: 0;
  animation: rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.rise:nth-child(1) { animation-delay: 0.05s; }
.rise:nth-child(2) { animation-delay: 0.15s; }
.rise:nth-child(3) { animation-delay: 0.25s; }
.rise:nth-child(4) { animation-delay: 0.35s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .rise { opacity: 1; }
}
