/* MaN Digital — questionnaire /maquette : une question par écran, mobile d'abord.
   Charte : texte encre #0A1A2B, liens bleu encre #176AAF, bleu MaN #51AFF7 seulement derrière du texte bleu nuit,
   boutons arrondis. La barre du haut et le pied de page gardent l'ambiance sombre du site. */

/* ---- Barre du haut : verre bleu nuit dès qu'on défile (logo clair lisible sur la zone blanche) ---- */
body.page-light .topbar.is-scrolled::before {
  opacity: 1; background: rgba(8, 17, 29, 0.88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}

/* ---- Cadre de la page : bandeau sombre sous la barre, puis zone claire ---- */
.mq {
  --mq-ink: #0a1a2b;
  --mq-link: #176aaf;
  --mq-err: #b3261e;
  position: relative;
  padding: 92px 16px 150px;
  overflow-x: clip; /* la transition latérale des écrans ne crée jamais de défilement horizontal */
  background: linear-gradient(180deg, #060b16 0, #08101f 170px, #f4f4f0 170px);
  min-height: calc(100vh - 80px);
}
.mq__wrap { width: 100%; max-width: 680px; margin-inline: auto; }
.mq__card {
  position: relative;
  background: #fff; color: var(--mq-ink);
  border: 1px solid rgba(7, 24, 43, 0.1);
  border-radius: 26px;
  padding: 22px 20px 20px;
  box-shadow: 0 34px 70px -38px rgba(4, 14, 30, 0.55);
}
@media (min-width: 640px) {
  .mq { padding-top: 112px; }
  .mq__card { padding: 34px 40px 30px; }
}

/* ---- Progression ---- */
.mq__progress { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.mq__progress[hidden] { display: none; }
.mq__bar { flex: 1; height: 8px; border-radius: 999px; background: #e3e3dc; overflow: hidden; }
.mq__bar > span { display: block; height: 100%; width: 100%; border-radius: inherit; background: #51aff7; transform: scaleX(0); transform-origin: left center; transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
.mq__count { font-weight: 800; font-size: 0.95rem; color: #3a516e; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Écrans ---- */
.mq__stage { min-height: 280px; }
.mq__screen { animation: mq-in-fwd 0.34s cubic-bezier(0.22, 1, 0.36, 1) both; }
.mq__stage[data-dir="back"] .mq__screen { animation-name: mq-in-back; }
@keyframes mq-in-fwd { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes mq-in-back { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .mq__screen, .mq__stage[data-dir="back"] .mq__screen { animation: none; }
  .mq__bar > span { transition: none; }
}

.mq__title {
  font-family: var(--font-display); font-weight: 800; color: var(--mq-ink);
  font-size: clamp(1.55rem, 1.25rem + 1.5vw, 2.15rem); line-height: 1.12; letter-spacing: -0.02em;
  margin: 0 0 10px; outline: none; text-wrap: balance;
}
.mq__title:focus-visible { outline: none; }
.mq__title--xl { font-size: clamp(1.9rem, 1.4rem + 2.6vw, 2.9rem); line-height: 1.06; }
.mq__help { color: #3a516e; font-size: 1.02rem; line-height: 1.55; margin: 0 0 20px; }
.mq__help a, .mq a.mq__link { color: var(--mq-link); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.mq__help a:hover, .mq a.mq__link:hover { color: var(--mq-ink); }
.mq__opt { font-weight: 700; color: #5b6f88; font-size: 0.9rem; margin-left: 6px; }

/* ---- Champs ---- */
.mq__fields { display: grid; gap: 16px; margin: 18px 0 4px; }
@media (min-width: 560px) { .mq__fields--2 { grid-template-columns: 1fr 1fr; } }
.mq-field { display: block; }
.mq-field > label, .mq-label {
  display: block; font-weight: 800; font-size: 0.96rem; color: var(--mq-ink); margin-bottom: 7px;
}
.mq-field input[type="text"], .mq-field input[type="email"], .mq-field input[type="tel"], .mq-field input[type="url"], .mq-field textarea {
  width: 100%; min-height: 56px; padding: 14px 16px;
  font-size: 1.06rem; /* 16 px minimum : pas de zoom automatique sur iPhone */
  font-weight: 500; color: var(--mq-ink); background: #fff;
  border: 1.5px solid rgba(7, 24, 43, 0.28); border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mq-field textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.mq-field input::placeholder, .mq-field textarea::placeholder { color: #6b7f96; }
.mq-field input:focus, .mq-field textarea:focus { outline: none; border-color: var(--mq-link); box-shadow: 0 0 0 4px rgba(23, 106, 175, 0.18); }
.mq-field [aria-invalid="true"] { border-color: var(--mq-err); }
.mq-field [aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(179, 38, 30, 0.16); }
.mq-err { color: var(--mq-err); font-weight: 700; font-size: 0.95rem; line-height: 1.4; margin: 8px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.mq-err::before { content: "!"; flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--mq-err); color: #fff; font-size: 0.78rem; font-weight: 900; display: grid; place-items: center; }
.mq-err:empty { display: none; }
.mq__screen-err { margin: 14px 0 0; }

/* ---- Pastilles (choix multiples ou unique) ---- */
.mq-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 4px; }
.mq-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 50px; padding: 11px 18px;
  border-radius: 999px; border: 1.5px solid rgba(7, 24, 43, 0.28); background: #fff; color: var(--mq-ink);
  font-weight: 700; font-size: 1rem; line-height: 1.2; text-align: left; cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.mq-chip:hover { border-color: var(--mq-link); }
.mq-chip:active { transform: scale(0.98); }
.mq-chip::before { content: ""; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(7, 24, 43, 0.35); background: #fff; }
.mq-chip[aria-pressed="true"] { background: #51aff7; border-color: #51aff7; color: #0a1a2b; }
.mq-chip[aria-pressed="true"]::before {
  border-color: #0a1a2b; background: #0a1a2b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.mq-chips--single .mq-chip::before { display: none; }
.mq-chips--single .mq-chip[aria-pressed="true"] { box-shadow: 0 0 0 3px rgba(23, 106, 175, 0.28); }

/* Cartes de style */
.mq-cards { display: grid; gap: 12px; margin: 18px 0 4px; }
@media (min-width: 560px) { .mq-cards { grid-template-columns: 1fr 1fr; } }
.mq-card {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; min-height: 84px; text-align: left; cursor: pointer;
  border: 1.5px solid rgba(7, 24, 43, 0.28); border-radius: 18px; background: #fff; color: var(--mq-ink);
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.mq-card:hover { border-color: var(--mq-link); }
.mq-card:active { transform: scale(0.99); }
.mq-card b { font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; letter-spacing: -0.01em; }
.mq-card span { font-size: 0.95rem; color: #3a516e; font-weight: 500; }
.mq-card[aria-pressed="true"] { background: #51aff7; border-color: #51aff7; }
.mq-card[aria-pressed="true"] span { color: #0a1a2b; }

.mq-other { margin-top: 14px; }
.mq-sub { margin-top: 20px; padding-top: 18px; border-top: 1px dashed rgba(7, 24, 43, 0.2); }
.mq-sub .mq-label { margin-bottom: 0; }

/* ---- Actions ---- */
.mq__actions { margin-top: 26px; display: grid; gap: 6px; }
.mq-next {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 60px; padding: 16px 26px; border-radius: 999px;
  background: #51aff7; color: #0a1a2b; font-weight: 800; font-size: 1.15rem; line-height: 1;
  box-shadow: 0 18px 36px -18px rgba(46, 151, 230, 0.8);
  transition: background 0.2s, transform 0.2s;
}
.mq-next:hover { background: #7cc3fa; transform: translateY(-2px); }
.mq-next:active { transform: translateY(1px); }
.mq-next[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.mq-next svg { width: 20px; height: 20px; }
.mq__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mq-text {
  min-height: 48px; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 1rem; color: var(--mq-link);
  text-decoration: underline; text-underline-offset: 3px;
}
.mq-text:hover { color: var(--mq-ink); }
.mq-text--muted { color: #3a516e; }
.mq__row .mq-text:first-child { margin-left: -14px; }
.mq__row .mq-text:last-child { margin-right: -14px; }
.mq-hint { margin-top: 10px; text-align: center; font-size: 0.9rem; color: #5b6f88; }

:where(.mq a, .mq button, .mq input, .mq textarea):focus-visible { outline: 3px solid var(--mq-link); outline-offset: 3px; border-radius: 12px; }
.mq-chip:focus-visible, .mq-card:focus-visible { outline-offset: 2px; }
.mq-next:focus-visible { border-radius: 999px; }

/* ---- Accueil ---- */
.mq__points { display: grid; gap: 10px; margin: 6px 0 24px; padding: 0; list-style: none; }
.mq__points li { display: flex; gap: 12px; align-items: flex-start; color: #1c3149; font-weight: 600; line-height: 1.45; }
.mq__points svg { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; padding: 4px; border-radius: 50%; background: #51aff7; color: #0a1a2b; }

/* ---- Consentements ---- */
.mq-notice {
  margin: 14px 0 18px; padding: 16px 18px; border-radius: 16px; background: #f4f4f0; border: 1px solid rgba(7, 24, 43, 0.1);
  font-size: 0.95rem; line-height: 1.55; color: #1c3149;
}
.mq-notice h2 { font-family: var(--font-sans); font-size: 0.82rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #3a516e; margin: 0 0 8px; }
.mq-notice dl { margin: 0; display: grid; gap: 8px; }
.mq-notice dt { font-weight: 800; color: var(--mq-ink); }
.mq-notice dd { margin: 0; }
.mq-notice a { color: var(--mq-link); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.mq-check { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; padding: 14px 0; cursor: pointer; }
.mq-check + .mq-check { border-top: 1px solid rgba(7, 24, 43, 0.1); }
.mq-check input { appearance: none; -webkit-appearance: none; width: 28px; height: 28px; margin: 0; border-radius: 8px; border: 2px solid rgba(7, 24, 43, 0.5); background: #fff; cursor: pointer; display: grid; place-items: center; }
.mq-check input:checked { background: #0a1a2b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 18px no-repeat; border-color: #0a1a2b; }
.mq-check input[aria-invalid="true"] { border-color: var(--mq-err); box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.16); }
.mq-check span.mq-check__txt { font-weight: 600; line-height: 1.5; color: var(--mq-ink); }
.mq-check .mq-err { grid-column: 2; margin-top: 0; }
.mq-check__txt a { color: var(--mq-link); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Récapitulatif ---- */
.mq-recap { margin: 18px 0 0; padding: 0; list-style: none; border-top: 1px solid rgba(7, 24, 43, 0.1); }
.mq-recap li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: start; padding: 13px 0; border-bottom: 1px solid rgba(7, 24, 43, 0.1); }
.mq-recap__k { grid-column: 1 / -1; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #3a516e; }
.mq-recap__v { font-weight: 600; color: var(--mq-ink); line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.mq-recap__v.is-empty { color: #6b7f96; font-weight: 500; font-style: italic; }
.mq-recap .mq-text { min-height: 44px; margin: -8px -10px -8px 0; padding-inline: 10px; }
.mq-fail { margin-top: 18px; padding: 16px 18px; border-radius: 16px; background: #fdecea; border: 1.5px solid #e9b7b2; color: #5c1410; font-weight: 600; line-height: 1.5; }
.mq-fail a { color: #8a1a12; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.mq-fail p + p { margin-top: 8px; }

/* ---- Remerciement ---- */
.mq-done__list { margin: 8px 0 24px; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: mqs; }
.mq-done__list li { counter-increment: mqs; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; color: #1c3149; font-weight: 600; line-height: 1.45; }
.mq-done__list li::before { content: counter(mqs); width: 32px; height: 32px; border-radius: 50%; background: #51aff7; color: #0a1a2b; font-weight: 800; display: grid; place-items: center; }
.mq-btn-link { text-decoration: none; }

/* ---- Piège à robots : hors écran, jamais affiché ---- */
.mq__hp { position: absolute !important; left: -10000px !important; top: auto !important; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 420px) {
  .mq { padding-inline: 12px; }
  .mq__card { padding-inline: 16px; border-radius: 22px; }
}

/* ---- Variante intégrée (page contact) : pas de bandeau ni de hauteur d'écran, la carte suit la page ---- */
.mq.mq--embed { padding: 0; background: none; min-height: 0; }
.mq--embed .mq__wrap { max-width: none; }
