/* Questionnaire identité visuelle : une planche par thème, champs soulignés comme sur une maquette,
   les trois encres aux accents. S'appuie sur style.css (papier, encres, polices, en-tête, boutons). */
html { scroll-padding-top: 110px; scroll-behavior: smooth; }
.qmain { padding-top: calc(104px + env(safe-area-inset-top, 0px)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* avancement, fin trait d'encre en haut */
.bar { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 80; background: var(--cobalt); transform-origin: left; transform: scaleX(0); }

/* ---------- en-tête de page ---------- */
.qhero { padding-bottom: clamp(40px, 6vw, 88px); }
.qhero__top { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.qhero__title {
  margin-top: clamp(28px, 5vw, 64px);
  font-family: var(--display); font-weight: 820; font-stretch: 115%;
  font-size: clamp(40px, 7.6vw, 124px); line-height: .94; letter-spacing: -.03em;
}
.qhero__title em { display: block; font-style: italic; font-weight: 600; font-stretch: 100%; color: var(--coral); }
.qhero__title .riso__y { transform: translate(.045em, -.035em); }
.qhero__title .riso__m { transform: translate(-.04em, .035em); }
.qhero__grid { margin-top: clamp(28px, 4vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px clamp(32px, 6vw, 96px); align-items: end; }
.qhero__intro { margin: 0; max-width: 44ch; font-size: clamp(19px, 1.1vw + 11px, 26px); line-height: 1.3; font-variation-settings: 'opsz' 36; text-wrap: pretty; }
.qhero__facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; max-width: 30ch; color: var(--mute); }
.qhero__facts b { font-weight: 500; color: var(--cobalt); }
@media (max-width: 760px) { .qhero__grid { grid-template-columns: 1fr; } }

/* ---------- corps : rail + formulaire ---------- */
.qbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-bottom: clamp(48px, 8vw, 96px); }
@media (min-width: 980px) {
  .qbody { grid-template-columns: 220px minmax(0, 720px); column-gap: clamp(48px, 7vw, 120px); }
}

.rail { display: none; }
@media (min-width: 980px) { .rail { display: block; position: sticky; top: 110px; align-self: start; } }
.rail__list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.rail__list a {
  display: grid; grid-template-columns: 2.4ch 1fr; gap: 10px; align-items: baseline;
  padding: 5px 0; text-decoration: none;
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; line-height: 1.35;
  color: var(--mute); transition: color .3s;
}
.rail__list a b { font-weight: 500; color: var(--line); transition: color .3s; }
.rail__list a:hover { color: var(--ink); }
.rail__list a.is-on { color: var(--ink); }
.rail__list a.is-on b { color: var(--coral); }
.rail__list a.is-done b { color: var(--cobalt); }
.rail__count { margin-top: 22px; color: var(--mute); }

.form { display: grid; }
.draft { margin: 0 0 8px; color: var(--mute); }
.draft button { font: inherit; letter-spacing: inherit; text-transform: inherit; text-decoration: underline; color: var(--cobalt); }

/* ---------- planches ---------- */
.sheet { padding: clamp(28px, 4vw, 48px) 0 clamp(36px, 5vw, 64px); border-top: 1px solid var(--line); }
.sheet--vous { border-top: 0; padding-top: 0; }
.sheet__head { display: grid; gap: 12px; margin-bottom: clamp(22px, 3vw, 32px); }
.sheet__num { color: var(--coral); }
.sheet__title {
  font-family: var(--display); font-weight: 800; font-stretch: 115%;
  font-size: clamp(28px, 3.2vw, 46px); line-height: 1; letter-spacing: -.02em;
}
.sheet__intro { margin: 2px 0 0; max-width: 56ch; color: var(--mute); }
.sheet__grid { display: grid; gap: clamp(26px, 3vw, 34px); }
@media (min-width: 640px) { .sheet__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; } }

.sheet { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.sheet.is-in { opacity: 1; transform: none; }

/* ---------- champs ---------- */
.q { display: grid; gap: 8px; align-content: start; }
.q__label { margin: 0; font-family: var(--display); font-weight: 600; font-stretch: 105%; font-size: clamp(18px, .8vw + 13px, 21px); line-height: 1.25; letter-spacing: -.01em; text-wrap: pretty; }
.q__req { color: var(--coral); }
.q__hint { margin: -3px 0 0; font-size: 15.5px; line-height: 1.4; color: var(--mute); text-wrap: pretty; }
.q__in {
  width: 100%; padding: 10px 0 12px;
  border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: clamp(17px, .5vw + 14px, 20px); line-height: 1.45;
  transition: border-color .3s, box-shadow .3s;
}
.q--short .q__in { max-width: 18ch; }
textarea.q__in { resize: none; min-height: 2.5em; overflow: hidden; display: block; }
.q__in:focus { outline: none; border-bottom-color: var(--cobalt); box-shadow: 0 1px 0 0 var(--cobalt); }
.q__err { margin: 0; display: none; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--coral); }
.q.is-error .q__in { border-bottom-color: var(--coral); box-shadow: 0 1px 0 0 var(--coral); }
.q.is-error .q__err { display: block; }

/* ---------- échelles 1 → 5 ---------- */
.scale {
  margin: 0; padding: 14px 0 16px; border: 0; border-bottom: 1px solid var(--line); min-width: 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px 16px;
}
.scale__word { font-family: var(--display); font-weight: 600; font-stretch: 105%; font-size: 17px; }
.scale__word--r { text-align: right; }
.scale__dots { display: flex; gap: clamp(6px, 1.5vw, 16px); }
.scale__dot { position: relative; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; }
.scale__dot input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.scale__dot i { width: 18px; height: 18px; border: 1.5px solid var(--ink); border-radius: 50%; transition: transform .25s var(--ease-out), background .25s, box-shadow .25s; }
.scale__dot:hover i { transform: scale(1.15); }
.scale__dot input:checked + i { background: var(--cobalt); border-color: var(--cobalt); transform: scale(1.12); box-shadow: 2px -2px 0 0 var(--sun), -2px 2px 0 0 var(--coral); }
.scale__dot input:focus-visible + i { outline: 2px solid var(--coral); outline-offset: 3px; }
.scale__clear { grid-column: 1 / -1; justify-self: end; display: none; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); text-decoration: underline; }
.scale.is-set .scale__clear { display: inline; }
@media (max-width: 560px) {
  .scale { grid-template-columns: 1fr 1fr; }
  .scale__dots { grid-column: 1 / -1; order: 3; justify-content: space-between; }
}

/* ---------- images ---------- */
.drop {
  position: relative; display: grid; justify-items: center; gap: 10px;
  padding: clamp(28px, 4vw, 44px) 20px; margin-top: 4px;
  border: 1.5px dashed var(--ink); border-radius: 18px; text-align: center;
  transition: background .3s, border-color .3s, transform .3s var(--ease-out);
}
.drop:hover, .drop.is-over, .drop:focus-within { background: #fff; border-color: var(--cobalt); }
.drop.is-over { transform: scale(1.01); }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop__ico { width: 46px; height: 46px; stroke: var(--cobalt); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.drop__t { font-family: var(--display); font-weight: 600; font-stretch: 105%; font-size: 19px; line-height: 1.25; }
.drop__s { margin: 0; max-width: 40ch; font-size: 15px; color: var(--mute); }
.thumbs { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.thumbs:empty { display: none; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--paper-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb__n { position: absolute; left: 8px; bottom: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.thumb__x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; transition: background .3s; }
.thumb__x:hover { background: var(--coral); }
.thumb__x svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.thumb.is-busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border: 2px solid var(--cobalt); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.images__meta { margin: 10px 0 0; display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; color: var(--mute); }
.images__meta .is-warn { color: var(--coral); }

/* ---------- envoi ---------- */
.send { padding-top: clamp(28px, 4vw, 44px); border-top: 1px solid var(--line); display: grid; gap: 20px; justify-items: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.send__note { margin: 0; max-width: 52ch; color: var(--mute); text-wrap: pretty; }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--cobalt); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.send__status { min-height: 1.5em; color: var(--mute); max-width: 56ch; text-transform: none; font-size: 12.5px; letter-spacing: .04em; }
.send__status a { color: var(--cobalt); }
.send__status.is-error { color: var(--coral); }

/* ---------- bien reçu ---------- */
.done { display: grid; gap: 18px; justify-items: start; padding: 8px 0 40px; }
.done .stamp { margin-bottom: 8px; }
.done__title { font-family: var(--display); font-weight: 820; font-stretch: 115%; font-size: clamp(36px, 5vw, 72px); line-height: .95; letter-spacing: -.03em; }
.done__text { margin: 0; max-width: 48ch; font-size: clamp(18px, .6vw + 14px, 22px); line-height: 1.4; text-wrap: pretty; }

/* ---------- pied ---------- */
.qftr { padding-top: 24px; padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.qftr__back { text-decoration: none; }
.qftr__back:hover { color: var(--cobalt); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sheet { opacity: 1; transform: none; transition: none; }
  .drop, .scale__dot i, .thumb__x { transition: none; }
}

/* l'attribut hidden gagne toujours sur les display: des classes */
[hidden] { display: none !important; }
