/* Questionnaire : une question par écran, cartes de choix, avis révélé après la réponse */
body { background: var(--lilas); min-height: 100vh; }
.haut { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px clamp(16px, 4vw, 32px); background: rgba(248, 244, 254, .92); backdrop-filter: blur(8px); }
.marque img { height: 32px; display: block; }
.etat { font-size: 13px; color: var(--texte-3); text-align: right; }
.etat.ok { color: var(--ok); }
.jauge { position: sticky; top: 60px; z-index: 5; height: 4px; background: #e7dcfa; }
.jauge div { height: 100%; width: 0; background: var(--grad); transition: width .5s ease; }

.app { max-width: 880px; margin: 0 auto; padding: 28px 16px 120px; outline: none; }
.ecran { display: grid; gap: 22px; animation: entree .45s cubic-bezier(.2, .7, .2, 1); }
.ecran.retour { animation-name: entree-retour; }
@keyframes entree { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes entree-retour { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

.carte { background: #fff; border-radius: 24px; padding: clamp(22px, 4vw, 40px); box-shadow: 0 24px 60px -36px rgba(14, 0, 36, .35); display: grid; gap: 20px; }
.sombre-carte { background: var(--nuit); color: #fff; position: relative; overflow: hidden; }
.sombre-carte::before { content: ""; position: absolute; width: 420px; height: 420px; right: -160px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 0, 251, .45), rgba(128, 43, 255, .2) 50%, transparent 70%); }
.sombre-carte > * { position: relative; }
.sombre-carte .surtitre { color: var(--accent-sombre); }

h1.q { font-size: clamp(26px, 3.6vw, 40px); font-weight: 800; }
h2.q { font-size: clamp(22px, 3vw, 32px); font-weight: 800; }
.chapo { font-size: 17px; color: var(--texte-2); }
.sombre-carte .chapo { color: #e0d7f3; }
.infos { display: flex; gap: 10px; flex-wrap: wrap; }
.infos span { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); font-size: 14px; color: #f1ebff; }

.champs { display: grid; gap: 16px; }
.champ { display: grid; gap: 6px; }
.champ label, .champ .lbl { font-weight: 700; font-size: 14px; }
.champ small { color: var(--texte-3); font-size: 13px; }
.champ input, textarea { width: 100%; font: inherit; font-size: 16px; padding: 13px 15px; border-radius: 14px; border: 1.5px solid var(--trait); background: #fff; color: var(--texte); transition: border-color .2s ease, box-shadow .2s ease; }
.champ input:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(128, 43, 255, .14); }
textarea { min-height: 96px; resize: vertical; }
.roles { display: flex; flex-wrap: wrap; gap: 8px; }
.roles button { padding: 10px 16px; border-radius: 99px; border: 1.5px solid var(--trait); background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; transition: all .2s ease; }
.roles button[aria-pressed="true"] { background: var(--nuit); border-color: var(--nuit); color: #fff; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.entete-q { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--lilas-2); color: var(--violet); font-size: 13px; font-weight: 700; }
.num-q { font-size: 13px; color: var(--texte-3); font-variant-numeric: tabular-nums; }
.section-intro { font-size: 14px; color: var(--texte-2); margin-top: -8px; }

.enjeu { display: grid; grid-template-columns: 38px 1fr; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--lilas); }
.enjeu .pic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); }
.enjeu .pic svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.enjeu b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--violet); margin-bottom: 3px; }
.enjeu p { font-size: 15.5px; color: var(--texte-2); }

.consigne { font-size: 14px; color: var(--texte-3); font-weight: 600; }
.choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.option { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; text-align: left; padding: 16px 16px 16px 14px; border-radius: 16px; border: 2px solid var(--trait); background: #fff; cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .15s ease, box-shadow .2s ease; min-width: 0; }
.option:hover { border-color: var(--violet-clair); }
.option:active { transform: scale(.99); }
.option[aria-checked="true"], .option[aria-pressed="true"] { border-color: var(--violet); background: var(--lilas); box-shadow: 0 10px 26px -18px rgba(128, 43, 255, .8); }
.option .marq { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #cbbfe6; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; transition: all .2s ease; }
.option.carre .marq { border-radius: 8px; }
.option[aria-checked="true"] .marq, .option[aria-pressed="true"] .marq { background: var(--grad); border-color: transparent; }
.option[aria-checked="true"] .marq::after, .option.carre[aria-pressed="true"] .marq::after { content: "✓"; }
.option.rang .marq { border-radius: 9px; width: 30px; height: 30px; }
.option .txt { display: grid; gap: 4px; min-width: 0; }
.option .txt b { font-size: 16px; line-height: 1.3; }
.option .txt span { font-size: 14px; color: var(--texte-2); }
.option .voir { font-size: 13px; font-weight: 700; color: var(--violet); text-decoration: none; justify-self: start; margin-top: 4px; }
.option .voir:hover { text-decoration: underline; }
.option.desactive { opacity: .45; }
.raz { justify-self: start; background: none; border: 0; color: var(--violet); font-weight: 600; font-size: 14px; cursor: pointer; padding: 0; }

.echelle { display: grid; gap: 10px; }
.echelle .pas { display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); gap: 8px; }
.echelle button { aspect-ratio: 1.6; border-radius: 16px; border: 2px solid var(--trait); background: #fff; font-size: 22px; font-weight: 800; cursor: pointer; transition: all .2s ease; }
.echelle button[aria-checked="true"] { background: var(--grad); color: #fff; border-color: transparent; transform: translateY(-2px); }
.echelle .bornes { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--texte-3); }

.commentaire summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--violet); list-style: none; }
.commentaire summary::-webkit-details-marker { display: none; }
.commentaire summary::before { content: "+ "; }
.commentaire[open] summary::before { content: "– "; }
.commentaire textarea { margin-top: 10px; }

.avis { display: grid; gap: 8px; padding: 18px 20px; border-radius: 18px; background: var(--nuit); color: #fff; animation: avis .5s cubic-bezier(.2, .7, .2, 1); }
@keyframes avis { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.avis .t { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--accent-sombre); }
.avis p { font-size: 15px; color: #e8e0f7; }
.avis .accord { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #fff; padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); justify-self: start; }
.avis .accord.oui { background: rgba(23, 132, 90, .35); }
.voir-avis { justify-self: start; background: none; border: 1.5px dashed var(--violet-clair); color: var(--violet); padding: 10px 16px; border-radius: 12px; font-weight: 600; cursor: pointer; }

.pied-q { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, rgba(248, 244, 254, .96) 30%); }
.pied-q .in { width: 100%; max-width: 880px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bt-sec { background: #fff; border: 1.5px solid var(--trait); padding: 12px 18px; border-radius: 99px; font-weight: 600; cursor: pointer; }
.bt-sec:disabled { opacity: .4; cursor: default; }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.passer { background: none; border: 0; color: var(--texte-3); font-weight: 600; cursor: pointer; font-size: 14px; }

.recap { display: grid; gap: 10px; }
.recap .l { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 14px 16px; border-radius: 14px; background: var(--lilas); align-items: start; }
.recap .l b { font-size: 14.5px; }
.recap .l span { grid-column: 1; font-size: 14px; color: var(--texte-2); }
.recap .l button { grid-row: 1 / span 2; grid-column: 2; background: none; border: 0; color: var(--violet); font-weight: 700; cursor: pointer; font-size: 13px; }
.recap .l.vide span { color: #b0006e; }
.alerte { padding: 14px 16px; border-radius: 14px; background: #fff0f6; color: #8a0052; font-size: 14.5px; }
.secours textarea { min-height: 140px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

.merci { text-align: center; justify-items: center; }
.merci .rond { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 40px; animation: pop .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: tombe 2.6s ease-in forwards; }
@keyframes tombe { to { transform: translateY(105vh) rotate(540deg); opacity: .7; } }

@media (max-width: 640px) {
  .app { padding-top: 18px; }
  .choix { grid-template-columns: 1fr; }
  .echelle button { font-size: 18px; aspect-ratio: 1.1; }
}
