:root {
  --qa-red: #b5122b;
  --qa-red-dark: #8f0d22;
  --qa-ink: #14161b;
  --qa-muted: #626773;
  --qa-paper: #f7f5f0;
  --qa-line: #ddd9d0;
  --qa-green: #25d366;
  --qa-danger: #b00020;
  --qa-shadow: 0 28px 80px rgba(16, 17, 20, .28);
}

.qa-launcher {
  position: fixed;
  right: 18px;
  bottom: 150px;
  z-index: 135;
  min-height: 54px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--qa-red), #df2545);
  color: #fff;
  font: 800 .94rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 16px 34px rgba(181, 18, 43, .34);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.qa-launcher:hover,
.qa-launcher:focus-visible { transform: translateY(-2px); box-shadow: 0 20px 42px rgba(181, 18, 43, .42); }
.qa-launcher:focus-visible { outline: 3px solid rgba(181,18,43,.24); outline-offset: 3px; }
.qa-launcher svg { width: 23px; height: 23px; flex: 0 0 auto; }
.qa-launcher small { display: block; margin-top: 2px; font-size: .66rem; font-weight: 700; opacity: .82; }

.qa-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 10, 14, .65);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}
.qa-overlay.is-open { opacity: 1; visibility: visible; }
.qa-dialog {
  width: min(760px, 100%);
  height: min(860px, calc(100dvh - 40px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--qa-shadow);
  transform: translateY(16px) scale(.985);
  transition: transform .22s ease;
}
.qa-overlay.is-open .qa-dialog { transform: translateY(0) scale(1); }
.qa-header {
  padding: 18px 20px 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--qa-line);
  background: rgba(255,255,255,.98);
}
.qa-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.qa-brand img { width: 44px; height: 44px; flex: 0 0 auto; }
.qa-brand strong { display: block; color: var(--qa-ink); font-size: 1rem; }
.qa-brand span { display: block; margin-top: 2px; color: var(--qa-muted); font-size: .75rem; }
.qa-close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--qa-line);
  border-radius: 50%;
  background: #fff;
  color: var(--qa-ink);
  cursor: pointer;
}
.qa-close:hover,
.qa-close:focus-visible { border-color: var(--qa-red); color: var(--qa-red); }
.qa-close:focus-visible { outline: 3px solid rgba(181,18,43,.15); }
.qa-close svg { width: 21px; height: 21px; }
.qa-progress-wrap { padding: 11px 20px 12px; border-bottom: 1px solid var(--qa-line); background: #fbfaf7; }
.qa-progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--qa-muted); font-size: .75rem; font-weight: 800; }
.qa-progress { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #e8e4dc; }
.qa-progress > span { display: block; width: 5%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--qa-red), #e94361); transition: width .32s ease; }
.qa-scroll {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  background:
    radial-gradient(circle at 95% 0, rgba(181,18,43,.08), transparent 28%),
    linear-gradient(#f8f6f2, #f4f2ed);
}
.qa-stage { min-height: 100%; padding: 30px 28px 90px; }
.qa-card {
  max-width: 650px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(31,34,41,.09);
  border-radius: 24px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 20px 46px rgba(16,17,20,.09);
  animation: qaCardIn .28s ease both;
}
.qa-card.is-exiting { animation: qaCardOut .17s ease both; }
.qa-card--danger { border-color: rgba(176,0,32,.35); background: linear-gradient(180deg,#fff,#fff5f6); }
.qa-card--pulse { animation: qaCardIn .28s ease both, qaPulse 1.8s ease-in-out 2 .35s; }
.qa-eyebrow { margin: 0 0 8px; color: var(--qa-red); font-size: .75rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.qa-card h2 { margin: 0; max-width: 620px; color: var(--qa-ink); font-size: clamp(1.65rem, 5vw, 2.35rem); line-height: 1.08; }
.qa-card h3 { margin: 18px 0 7px; color: var(--qa-ink); font-size: 1.08rem; }
.qa-card p { margin: 13px 0 0; color: var(--qa-muted); line-height: 1.62; }
.qa-card p strong { color: var(--qa-ink); }
.qa-ai-note {
  margin-top: 18px;
  padding: 14px 16px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  border-radius: 15px;
  background: #f3f0ea;
  color: #4f535d;
  font-size: .9rem;
}
.qa-ai-note::before { content: "✦"; color: var(--qa-red); font-weight: 900; }
.qa-choice-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.qa-choice-grid--single { grid-template-columns: 1fr; }
.qa-choice {
  position: relative;
  min-height: 62px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #d9d5cc;
  border-radius: 15px;
  background: #fff;
  color: var(--qa-ink);
  font: 800 .94rem/1.28 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.qa-choice:hover,
.qa-choice:focus-visible { border-color: var(--qa-red); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(16,17,20,.08); }
.qa-choice:focus-visible { outline: 3px solid rgba(181,18,43,.13); }
.qa-choice.is-selected { border-color: var(--qa-red); background: #fff5f6; box-shadow: inset 0 0 0 1px var(--qa-red); }
.qa-choice-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: #f2eee7; font-size: 1.25rem; }
.qa-service-choice { min-height: 118px; padding: 0; overflow: hidden; display: grid; grid-template-columns: 108px 1fr; }
.qa-service-choice img { width: 108px; height: 100%; object-fit: cover; }
.qa-service-choice span { padding: 14px; }
.qa-check-list { margin-top: 22px; display: grid; gap: 10px; }
.qa-check {
  padding: 14px 15px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  align-items: center;
  border: 1px solid #d9d5cc;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}
.qa-check:has(input:checked) { border-color: var(--qa-red); background: #fff5f6; }
.qa-check input { width: 21px; height: 21px; accent-color: var(--qa-red); }
.qa-fields { margin-top: 22px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.qa-field { display: grid; gap: 7px; color: var(--qa-ink); font-size: .84rem; font-weight: 850; }
.qa-field--full { grid-column: 1 / -1; }
.qa-field input,
.qa-field select,
.qa-field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 13px;
  border: 1px solid #cbc7bd;
  border-radius: 12px;
  background: #fff;
  color: var(--qa-ink);
  font: 500 1rem/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.qa-field textarea { min-height: 112px; resize: vertical; }
.qa-field input:focus,
.qa-field select:focus,
.qa-field textarea:focus { border-color: var(--qa-red); outline: 3px solid rgba(181,18,43,.12); }
.qa-field [aria-invalid="true"] { border-color: var(--qa-danger); }
.qa-required { color: var(--qa-danger); }
.qa-error {
  margin-top: 15px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: 12px;
  background: #fff0f2;
  color: #9f001d;
  font-size: .84rem;
  font-weight: 850;
  animation: qaErrorIn .2s ease both;
}
.qa-error::before { content: "!"; width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--qa-danger); color: #fff; font-size: .75rem; }
.qa-actions { margin-top: 25px; display: flex; flex-wrap: wrap; gap: 10px; }
.qa-button {
  min-height: 50px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--qa-red);
  color: #fff;
  font: 850 .92rem/1.15 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.qa-button:hover,
.qa-button:focus-visible { background: var(--qa-red-dark); }
.qa-button:focus-visible { outline: 3px solid rgba(181,18,43,.18); outline-offset: 2px; }
.qa-button--secondary { border-color: #ccc7bc; background: #fff; color: var(--qa-ink); }
.qa-button--secondary:hover,
.qa-button--secondary:focus-visible { border-color: var(--qa-red); background: #fff7f8; color: var(--qa-red); }
.qa-button--whatsapp { background: var(--qa-green); color: #073514; }
.qa-button--whatsapp:hover,
.qa-button--whatsapp:focus-visible { background: #1ebe59; }
.qa-button--danger { background: var(--qa-danger); }
.qa-button--danger:hover,
.qa-button--danger:focus-visible { background: #8f001a; }
.qa-button--sms { background: #2f63d3; }
.qa-button--mail { background: #323844; }
.qa-summary { margin-top: 22px; display: grid; gap: 12px; }
.qa-summary-row { padding: 13px 15px; border-radius: 13px; background: #f5f2ec; }
.qa-summary-row strong { display: block; margin-bottom: 4px; color: var(--qa-ink); font-size: .78rem; text-transform: uppercase; letter-spacing: .055em; }
.qa-summary-row span { color: #4f535d; white-space: pre-line; }
.qa-problem-card { padding: 14px 15px; border: 1px solid #ddd8ce; border-radius: 14px; background: #fff; }
.qa-problem-card + .qa-problem-card { margin-top: 10px; }
.qa-emergency-list { margin: 18px 0 0; padding: 0; display: grid; gap: 10px; list-style: none; }
.qa-emergency-list li { padding-left: 30px; position: relative; color: #3d414a; line-height: 1.48; }
.qa-emergency-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: #ffe3e8; color: var(--qa-danger); font-weight: 900; }
.qa-emergency-numbers { margin-top: 20px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.qa-emergency-numbers .qa-button { min-height: 58px; }
.qa-legal-note { margin-top: 18px !important; font-size: .78rem; color: #717680 !important; }
.qa-footer { min-height: 66px; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--qa-line); background: #fff; }
.qa-footer button { min-height: 44px; }
.qa-footer-status { color: var(--qa-muted); font-size: .76rem; font-weight: 750; text-align: right; }
.qa-scroll-hint {
  position: absolute;
  right: 22px;
  bottom: 18px;
  z-index: 4;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--qa-red);
  color: #fff;
  box-shadow: 0 12px 24px rgba(181,18,43,.28);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: .18s ease;
  animation: qaArrow 1.4s ease-in-out infinite;
}
.qa-scroll-hint.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.qa-scroll-hint svg { width: 22px; height: 22px; }
body.qa-open { overflow: hidden; }
body.qa-open .floating-actions,
body.qa-open .mobile-actions { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }

@keyframes qaCardIn { from { opacity: 0; transform: translateX(16px) translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes qaCardOut { to { opacity: 0; transform: translateX(-14px); } }
@keyframes qaErrorIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes qaPulse { 0%,100% { box-shadow: 0 20px 46px rgba(16,17,20,.09); } 50% { box-shadow: 0 20px 55px rgba(181,18,43,.28), 0 0 0 5px rgba(181,18,43,.08); } }
@keyframes qaArrow { 0%,100% { translate: 0 0; } 50% { translate: 0 5px; } }

@media (max-width: 900px) {
  .qa-launcher { right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); min-height: 48px; padding: 0 14px; }
  .qa-launcher small { display: none; }
  .qa-overlay { padding: 0; align-items: end; }
  .qa-dialog { width: 100%; height: 100dvh; border-radius: 0; }
  .qa-stage { padding: 24px 18px 92px; }
  .qa-header { padding-inline: 16px; }
  .qa-progress-wrap { padding-inline: 16px; }
}
@media (max-width: 600px) {
  .qa-choice-grid,
  .qa-fields,
  .qa-emergency-numbers { grid-template-columns: 1fr; }
  .qa-service-choice { min-height: 94px; grid-template-columns: 94px 1fr; }
  .qa-service-choice img { width: 94px; }
  .qa-card { padding: 23px 18px; border-radius: 20px; }
  .qa-card h2 { font-size: clamp(1.55rem, 8vw, 2.05rem); }
  .qa-footer { padding-inline: 14px; }
  .qa-footer-status { max-width: 48%; }
}
@media (max-width: 380px) {
  .qa-launcher { right: 8px; padding-inline: 12px; }
  .qa-launcher span { font-size: .82rem; }
  .qa-stage { padding-inline: 12px; }
  .qa-card { padding-inline: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .qa-launcher,
  .qa-overlay,
  .qa-dialog,
  .qa-progress > span,
  .qa-choice,
  .qa-scroll-hint { transition: none !important; }
  .qa-card,
  .qa-card--pulse,
  .qa-error,
  .qa-scroll-hint { animation: none !important; }
  .qa-scroll { scroll-behavior: auto; }
}

/* Correctif visibilité : les pages de sélection de langue utilisent un texte global blanc. */
.qa-check,
.qa-check span {
  color: var(--qa-ink);
}
.qa-check span {
  font-weight: 800;
  line-height: 1.35;
}
.qa-check:has(input:checked) span {
  color: var(--qa-ink);
}
