html.quiz-open { overflow: hidden; scrollbar-gutter: stable; }

.quiz {
  position: fixed; inset: 0;
  width: min(1060px, calc(100vw - 32px));
  height: min(690px, calc(100dvh - 32px));
  max-width: none; max-height: none;
  margin: auto; padding: 0; border: 0;
  background: transparent; color: var(--ink);
  overflow: visible;
}
.quiz::backdrop {
  background: rgba(24, 10, 40, .6);
  backdrop-filter: blur(7px);
  opacity: 0; transition: opacity .32s ease;
}
.quiz.is-visible::backdrop { opacity: 1; }

.quiz__shell {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr);
  height: 100%; overflow: hidden;
  border-radius: 28px; background: var(--white);
  box-shadow: 0 50px 120px -30px rgba(18, 8, 30, .75);
}
.quiz__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.quiz__top { display: flex; align-items: center; gap: 12px; padding: 18px 22px 8px; }
.quiz__icon {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; padding: 0;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--white); color: var(--plum); cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}
.quiz__icon svg { width: 20px; height: 20px; }
#quizBack svg { transform: rotate(180deg); }
.quiz__icon:hover { background: var(--mist-50); transform: translateY(-1px); }
.quiz__icon[hidden] { visibility: hidden; display: grid; }
.quiz__progress { flex: 1; display: flex; justify-content: center; gap: 7px; }
.quiz__progress li { width: 30px; height: 9px; background: var(--mist); transition: background-color .25s ease; }
.quiz__progress li.is-on { background: var(--violet); }

.quiz__body {
  position: relative; flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  padding: 12px 30px 16px; overscroll-behavior: contain;
}
.quiz__body > .q { margin-block: auto; width: 100%; }
.quiz__foot {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 1rem;
}
.quiz__foot a { color: var(--violet); font-family: var(--head); font-weight: 700; text-decoration: none; }
.quiz__foot a:hover { text-decoration: underline; }

/* Question */
.q__title { font-size: clamp(1.5rem, 2.4vw, 1.875rem); font-weight: 800; color: var(--plum); line-height: 1.2; outline: 0; }
.q__sub { margin-top: 6px; color: var(--muted); }
.q__grid { display: grid; gap: 12px; margin-top: 18px; }
.q__grid--cities { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.q__grid--treatments { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.q__grid--list { grid-template-columns: minmax(0, 1fr); gap: 10px; }

.q-opt {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 0;
  padding: 0; overflow: hidden;
  border: 1.5px solid var(--line); border-radius: 16px;
  background: var(--white); color: var(--plum); cursor: pointer;
  font-family: var(--head); font-size: 1.0625rem; font-weight: 700; text-align: right;
  transition: transform .22s cubic-bezier(.2, .9, .25, 1.12), border-color .18s ease, box-shadow .22s ease;
}
.q-opt::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), rgba(226, 182, 255, .2), transparent 70%);
  transition: opacity .2s ease;
}
.q-opt:hover { transform: translateY(-3px); border-color: var(--lilac); box-shadow: 0 18px 34px -22px rgba(31, 15, 51, .55); }
.q-opt:hover::after { opacity: 1; }
.q-opt:active { transform: scale(.98); }
.q-opt[aria-pressed="true"] { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(110, 69, 146, .16); }
.q-opt__img { display: block; overflow: hidden; background: #1A0C2B; }
.q-opt__img img { display: block; width: 100%; height: auto; aspect-ratio: 42 / 26; object-fit: cover; transition: transform .5s cubic-bezier(.16, 1, .3, 1); }
.q-opt:hover .q-opt__img img { transform: scale(1.07); }
.q__grid--cities .q-opt__img img { aspect-ratio: 42 / 40; }
.q__grid--cities .q-opt__label { font-size: 1.1875rem; padding-block: 14px; }
.q-opt__label { display: block; padding: 11px 13px; line-height: 1.25; }
.q__grid--treatments .q-opt { font-size: 1rem; }
.q__grid--list .q-opt { flex-direction: row; align-items: center; min-height: 58px; padding-inline-end: 44px; }
.q__grid--list .q-opt__label { flex: 1; padding: 12px 16px; font-size: 1.125rem; }
.q-opt__teeth { display: flex; gap: 2px; padding-inline-start: 14px; color: var(--violet); }
.q-opt__teeth svg { width: 15px; height: 28px; fill: currentColor; }
.q-opt__tick {
  position: absolute; top: 9px; left: 9px; z-index: 1;
  display: grid; place-items: center; width: 26px; height: 26px;
  background: var(--violet); color: var(--white);
  opacity: 0; transform: scale(.4); transition: opacity .15s ease, transform .25s cubic-bezier(.2, .9, .25, 1.4);
}
.q-opt__tick svg { width: 16px; height: 16px; }
.q-opt[aria-pressed="true"] .q-opt__tick { opacity: 1; transform: none; }
.q__grid--list .q-opt__tick { top: 50%; margin-top: -13px; left: 12px; }

.q__other {
  display: block; margin: 14px auto 0; padding: 8px 12px;
  border: 0; background: none; color: var(--violet); cursor: pointer;
  font-family: var(--head); font-size: 1rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}

.q__wide { width: 100%; }

/* Urgent */
.q--urgent { margin-top: 12px; padding: 22px; border-right: 5px solid #B3431B; border-radius: 16px; background: #FFF4ED; }
.q--urgent .q__title { color: #8E3213; }
.q--urgent .q__sub { color: var(--ink); }
.q--urgent .btn { margin-top: 18px; }
.q--urgent .q__other { color: #8E3213; }

/* Contact */
.q__recap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.q__recap li { padding: 4px 11px; border-radius: 999px; background: var(--mist-50); color: var(--plum); font-size: .95rem; }
.q-field { position: relative; margin-top: 16px; }
.q-field input {
  width: 100%; height: 60px; padding: 22px 16px 6px;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--mist-50); color: var(--ink); font: inherit;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.q-field input[dir="ltr"] { text-align: right; }
.q-field label {
  position: absolute; top: 18px; right: 16px;
  color: var(--muted); pointer-events: none;
  transform-origin: top right; transition: transform .18s ease, color .18s ease;
}
.q-field input:focus { outline: 0; border-color: var(--violet); background: var(--white); box-shadow: 0 0 0 3px rgba(110, 69, 146, .18); }
.q-field input:focus + label, .q-field input:not(:placeholder-shown) + label { transform: translateY(-10px) scale(.78); color: var(--violet); }
.q-field input[aria-invalid="true"] { border-color: #B3261E; }
.q-field__error { margin-top: 4px; color: #B3261E; font-size: .95rem; }
.q-field__error:empty { display: none; }
.q__trap { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.q--contact .btn { margin-top: 16px; }
.q__note { margin-top: 10px; color: var(--muted); font-size: .9rem; line-height: 1.35; }
.q-consent { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin-top: 14px; align-items: start; }
.q-consent input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--violet); }
.q-consent label { font-size: .95rem; line-height: 1.35; }
.q-consent a { color: var(--violet); font-weight: 700; }
.q-consent .q-field__error { grid-column: 2; }
.q__status { margin-top: 8px; color: #8E3213; font-size: 1rem; text-align: center; }
.q__status:empty { display: none; }
.q__status a { color: var(--violet); font-weight: 700; }

/* Done */
.q--done { display: flex; flex-direction: column; align-items: center; padding-top: 4px; text-align: center; }
.q__figure { position: relative; width: 200px; height: 200px; }
.q__tooth { display: block; width: 200px; height: 200px; }
.q__check {
  position: absolute; bottom: 16px; left: 22px;
  display: grid; place-items: center; width: 46px; height: 46px;
  background: var(--glow); color: var(--plum-950);
  opacity: 0; transform: scale(.3) rotate(-14deg);
  transition: opacity .2s ease, transform .4s cubic-bezier(.2, .9, .25, 1.5);
}
.q__check svg { width: 26px; height: 26px; }
.q__check.is-in { opacity: 1; transform: none; }
.q__actions { display: flex; flex-direction: column; align-items: center; margin-top: 16px; }

/* Stage */
.quiz__stage {
  --px: 0; --py: 0;
  position: relative; isolation: isolate; overflow: hidden; min-width: 0;
  background: linear-gradient(200deg, var(--plum-950) 0%, var(--plum) 50%, var(--violet) 82%, var(--orchid) 100%);
}
.quiz__grid {
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 30px 30px;
  transform: translate(calc(var(--px) * -10px), calc(var(--py) * -10px));
}
.quiz__orbit {
  position: absolute; top: 44%; left: 50%; z-index: 0;
  width: 128%; max-width: none; height: auto;
  transform: translate(calc(-50% + var(--px) * 16px), calc(-50% + var(--py) * 16px));
  pointer-events: none;
}
.quiz__glint { stroke-dasharray: 26 974; animation: quizGlint 4.5s linear 1 forwards; filter: drop-shadow(0 0 7px #E2B6FF); }
@keyframes quizGlint { to { stroke-dashoffset: -1000; } }
.quiz__art {
  position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; padding: 24px;
  transform: translate(calc(var(--px) * 12px), calc(var(--py) * 12px));
}
.quiz__art .is-art { width: 100%; max-width: 330px; height: auto; border-radius: 22px; box-shadow: 0 30px 60px -26px rgba(0, 0, 0, .7); }
.quiz__art .is-doctor {
  position: absolute; bottom: 0; left: 50%; width: 108%; max-width: none; height: auto;
  translate: -50% 0;
  filter: drop-shadow(0 24px 34px rgba(24, 10, 40, .4));
}
.quiz__dissolve { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
.quiz__chips { position: absolute; inset: auto 14px 14px; z-index: 3; display: flex; flex-wrap: wrap; gap: 7px; }
.quiz__chips li {
  padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px;
  background: rgba(31, 15, 51, .74); backdrop-filter: blur(6px);
  color: var(--white); font-size: .95rem; line-height: 1.2;
}

.quiz-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.quiz-map__coast { filter: drop-shadow(0 0 5px rgba(226, 182, 255, .7)); }
.quiz-pin text { fill: var(--white); font-family: var(--head); font-size: 20px; font-weight: 700; transition: fill .2s ease; }
.quiz-pin__dot { fill: var(--glow); stroke: var(--white); stroke-width: 2; transform-box: fill-box; transform-origin: center; transition: transform .28s cubic-bezier(.2, .9, .25, 1.5); }
.quiz-pin__pulse { fill: none; stroke: var(--glow); stroke-width: 2; transform-box: fill-box; transform-origin: center; opacity: 0; animation: quizPing 1.5s ease-out 2 var(--d, 0s); }
.quiz-pin.is-on text { fill: var(--glow); }
.quiz-pin.is-on .quiz-pin__dot { transform: scale(1.5); }
.quiz-pin.is-on .quiz-pin__pulse { animation: quizPing 1.2s ease-out 3; }
.quiz-pin--near text { font-size: 15px; font-weight: 600; fill: var(--mist); }
.quiz-pin--near .quiz-pin__dot { fill: var(--lilac); stroke-width: 1.500; }
.quiz-pin--near.is-on text { fill: var(--glow); }
.quiz-pin--near.is-on .quiz-pin__dot { fill: var(--glow); transform: scale(1.35); }
.quiz-map__ring { transition: opacity .3s ease; }
.quiz-map.is-far .quiz-map__ring { opacity: .2; }
@keyframes quizPing { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(3.4); } }

.quiz__px { position: absolute; z-index: 5; width: 9px; height: 9px; background: var(--violet); pointer-events: none; }

@media (max-width: 820px) {
  .quiz { width: 100vw; height: 100dvh; }
  .quiz__shell { grid-template-columns: minmax(0, 1fr); border-radius: 0; }
  .quiz__stage { display: none; }
  .quiz__top { padding: 12px 14px 6px; }
  .quiz__body { padding: 8px 16px 14px; }
  .quiz__foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .q__title { font-size: 1.5rem; }
  .q__grid--cities { grid-template-columns: minmax(0, 1fr); }
  .q__grid--cities .q-opt { flex-direction: row; align-items: center; min-height: 104px; }
  .q__grid--cities .q-opt__img { flex: none; width: 46%; align-self: stretch; }
  .q__grid--cities .q-opt__img img { height: 100%; aspect-ratio: auto; }
  .q__grid--cities .q-opt__label { flex: 1; font-size: 1.25rem; }
  .q__grid--cities .q-opt__tick { left: auto; right: 9px; }
  .q__grid--treatments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q__grid--treatments .q-opt__label { padding: 9px 10px; font-size: .95rem; }
}

@media (max-width: 380px) {
  .q__grid--treatments .q-opt__img img { aspect-ratio: 42 / 22; }
}

@media (prefers-reduced-motion: reduce) {
  .quiz__glint, .quiz-pin__pulse { animation: none; }
  .quiz::backdrop { transition: none; }
}
