/* Quiz couple (template/quiz/quiz.php, static/js/quiz/quiz.js). Same evening mood as the kit page. */
.quiz-page {
  --qz-ink: #2a142d;
  --qz-muted: #6f5a71;
  --qz-pink: #e91e75;
  --qz-hot: #f72585;
  --qz-violet: #8b2cf6;
  --qz-lamp: #ffb070;
  --qz-line: #f0e3ef;
  --qz-soft: #fbf6fc;
  --qz-shadow: 0 30px 80px rgba(16, 4, 24, .42);
  --qz-ease: cubic-bezier(.2, .8, .2, 1);
  --qz-douceur: #ff8fab;
  --qz-rire: #ffb938;
  --qz-parler: #6f7dff;
  --qz-audace: #e91e75;
  color: var(--qz-ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body.lc-quiz-page {
  background: #fff7fb;
}

.quiz-page *,
.quiz-page *::before,
.quiz-page *::after {
  box-sizing: border-box;
}

.quiz-container {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
}

/* Evening sky behind the quiz, with the lamp breathing and warm lights drifting up. */
.quiz-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(24px, 5vw, 60px) 0 clamp(40px, 6vw, 80px);
  background:
    radial-gradient(70% 60% at 8% 6%, rgba(247, 37, 133, .30), transparent 70%),
    radial-gradient(60% 70% at 100% 100%, rgba(139, 44, 246, .32), transparent 70%),
    linear-gradient(160deg, #2a0f33 0%, #3b163f 48%, #4a1d6e 100%);
}

.quiz-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -14%;
  left: 50%;
  width: min(820px, 130vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 176, 120, .34) 0%, rgba(247, 37, 133, .16) 45%, transparent 70%);
  translate: -50% 0;
  animation: quiz-breathe 7s ease-in-out infinite;
}

.quiz-lights {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.quiz-lights span {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0%, transparent 72%);
  box-shadow: 0 0 calc(var(--s) * 1.6) var(--c);
  opacity: 0;
  animation: quiz-drift var(--d) ease-in-out var(--delay) infinite;
}

.quiz-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  color: rgba(255, 255, 255, .72);
  font-size: .85rem;
  font-weight: 700;
}

.quiz-breadcrumb a {
  color: #ffd1e3;
}

.quiz-panel {
  background: #fff;
  border-radius: 28px;
  box-shadow: var(--qz-shadow);
  padding: clamp(22px, 4.5vw, 44px);
  scroll-margin-top: 16px;
}

/* One panel at a time: the old one fades out, the new one rises in (static/js/quiz/quiz.js). */
.quiz-intro,
.quiz-stage,
.quiz-result {
  transition: opacity .3s ease, transform .36s var(--qz-ease);
}

.quiz-page .is-hiding {
  opacity: 0;
  transform: translateY(-12px) scale(.985);
}

.quiz-page .is-showing {
  opacity: 0;
  transform: translateY(18px);
  transition: none;
}

/* Intro */
.quiz-intro {
  text-align: center;
  animation: quiz-rise .8s var(--qz-ease) backwards;
}

.quiz-intro > * {
  animation: quiz-rise .7s var(--qz-ease) backwards;
}

.quiz-intro > :nth-child(1) { animation-delay: .12s; }
.quiz-intro > :nth-child(2) { animation-delay: .2s; }
.quiz-intro > :nth-child(3) { animation-delay: .28s; }
.quiz-intro > :nth-child(4) { animation-delay: .36s; }
.quiz-intro > :nth-child(5) { animation-delay: .44s; }
.quiz-intro > :nth-child(6) { animation-delay: .52s; }

.quiz-badge {
  display: inline-block;
  margin: 0 0 14px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff0f6;
  color: var(--qz-pink);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.quiz-intro h1 {
  margin: 0 0 14px;
  color: var(--qz-ink);
  font-size: clamp(2.1rem, 6.5vw, 3.3rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -.03em;
}

.quiz-lead {
  max-width: 34em;
  margin: 0 auto 20px;
  color: var(--qz-muted);
  font-size: clamp(1.02rem, 2.2vw, 1.18rem);
  font-weight: 600;
  line-height: 1.55;
}

.quiz-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 26px;
  padding: 0;
}

.quiz-points li {
  padding: 8px 14px;
  border-radius: 999px;
  background: #f7f1fb;
  color: #4b2a55;
  font-size: .9rem;
  font-weight: 800;
}

/* Number of revealed duos, once switched on in /admin/quiz/. */
.quiz-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: fit-content;
  margin: 18px auto 0;
  padding: 6px 16px 6px 8px;
  border-radius: 999px;
  background: #fbf4fd;
  color: var(--qz-muted);
  font-size: .92rem;
  font-weight: 700;
}

.quiz-social strong {
  color: var(--qz-ink);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.quiz-social__faces {
  display: inline-flex;
}

.quiz-social__faces span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: -8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px #fbf4fd, 0 4px 10px rgba(72, 22, 64, .14);
  font-size: .9rem;
}

.quiz-social__faces span:first-child {
  margin-left: 0;
}

.quiz-noscript {
  margin-top: 14px;
  color: var(--qz-pink);
  font-weight: 800;
}

/* Buttons, with the light sweep of the kit page on the main ones. */
.quiz-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 30px;
  border-radius: 999px;
  overflow: hidden;
  font-size: 1.05rem;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  transition: transform .2s var(--qz-ease), box-shadow .2s ease, background .2s ease;
}

.quiz-btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #e91e75, #8b2cf6);
  box-shadow: 0 14px 30px rgba(233, 30, 117, .32);
}

.quiz-btn--primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .42), transparent);
  transform: skewX(-18deg);
  animation: quiz-shine 6.5s ease-in-out 1.5s infinite;
  pointer-events: none;
}

.quiz-btn--primary:hover,
.quiz-btn--primary:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(233, 30, 117, .42);
}

.quiz-btn:disabled {
  opacity: .55;
  cursor: default;
  transform: none;
}

.quiz-btn--ghost {
  color: #fff;
  border: 2px solid rgba(255, 255, 255, .55);
}

.quiz-btn--ghost:hover,
.quiz-btn--ghost:focus-visible {
  background: rgba(255, 255, 255, .12);
}

.quiz-btn:focus-visible,
.quiz-answer:focus-visible,
.quiz-back:focus-visible {
  outline: 3px solid rgba(255, 185, 56, .9);
  outline-offset: 3px;
}

/* The question card: its head stays, its body slides from one question to the next. */
.quiz-stage__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.quiz-back {
  padding: 6px 2px;
  color: var(--qz-muted);
  font-size: .95rem;
  font-weight: 800;
  transition: color .2s ease;
}

.quiz-back::before {
  content: "←";
  display: inline-block;
  margin-right: 6px;
  transition: transform .2s var(--qz-ease);
}

.quiz-back:hover {
  color: var(--qz-pink);
}

.quiz-back:hover::before {
  transform: translateX(-3px);
}

.quiz-kind {
  color: var(--qz-violet);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.quiz-kind.is-in {
  animation: quiz-fade .45s ease both;
}

/* The thread of the quiz, from the warm lamp to the night, one node per question. */
.quiz-thread {
  position: relative;
  height: 20px;
}

.quiz-thread::before,
.quiz-thread__fill {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 999px;
}

.quiz-thread::before {
  right: 6px;
  background: #f1e6f3;
}

.quiz-thread__fill {
  width: calc((100% - 12px) * var(--p, 0));
  background: linear-gradient(90deg, var(--qz-lamp), var(--qz-hot) 55%, var(--qz-violet));
  box-shadow: 0 0 12px rgba(247, 37, 133, .45);
  transition: width .55s var(--qz-ease);
}

.quiz-thread__nodes {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-thread__node {
  width: 12px;
  height: 12px;
  border: 2px solid #e8d9ec;
  border-radius: 50%;
  background: #fff;
  transition: background .3s ease, border-color .3s ease, transform .35s var(--qz-ease);
}

.quiz-thread__node.is-done {
  border-color: var(--qz-hot);
  background: var(--qz-hot);
}

.quiz-thread__node.is-current {
  border: 3px solid var(--qz-hot);
  transform: scale(1.35);
  animation: quiz-node 1.8s ease-in-out infinite;
}

.quiz-progress-text {
  margin-top: 6px;
  color: var(--qz-muted);
  font-size: .82rem;
  font-weight: 800;
}

/* Its own block formatting context, so that clipping it during a slide changes nothing in its height. */
.quiz-stage__viewport {
  position: relative;
  display: flow-root;
  margin: 0 -10px;
  padding: 0 10px 10px;
}

/* Invisible copy where every question is measured (lockHeight in static/js/quiz/quiz.js). */
.quiz-stage__probe {
  position: absolute;
  top: 0;
  right: 10px;
  left: 10px;
  visibility: hidden;
  pointer-events: none;
}

.quiz-stage__viewport.is-moving {
  overflow: hidden;
}

/* The space above the question is padding, not a margin that could slip outside the body. */
.quiz-stage__body {
  padding-top: 18px;
  transition: opacity .3s ease, transform .38s var(--qz-ease);
}

.quiz-stage__body.is-leaving,
.quiz-stage__body.is-leaving-back {
  opacity: 0;
  transition-duration: .2s;
}

.quiz-stage__body.is-leaving { transform: translateX(-28px); }
.quiz-stage__body.is-leaving-back { transform: translateX(28px); }

.quiz-stage__body.is-entering,
.quiz-stage__body.is-entering-back {
  opacity: 0;
  transition: none;
}

.quiz-stage__body.is-entering { transform: translateX(28px); }
.quiz-stage__body.is-entering-back { transform: translateX(-28px); }

.quiz-question {
  margin: 0 0 20px;
  color: var(--qz-ink);
  font-size: clamp(1.45rem, 4.2vw, 2rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -.02em;
  outline: none;
}

.quiz-answers {
  display: grid;
  gap: 12px;
}

.quiz-answer {
  position: relative;
  width: 100%;
  padding: 17px 54px 17px 20px;
  border: 2px solid var(--qz-line);
  border-radius: 18px;
  background: #fff;
  color: var(--qz-ink);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
  transition: border-color .2s ease, background .2s ease, transform .25s var(--qz-ease), box-shadow .25s ease, opacity .3s ease;
  animation: quiz-answer-in .45s var(--qz-ease) backwards;
  animation-delay: calc(var(--i, 0) * 55ms + 60ms);
}

.quiz-answer:hover {
  border-color: rgba(233, 30, 117, .45);
  background: #fff7fb;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(72, 22, 64, .1);
}

.quiz-answer[aria-pressed="true"] {
  border-color: var(--qz-pink);
  background: linear-gradient(135deg, #fff0f6, #f6efff);
}

/* The chosen answer gets a tick, the others step back. */
.quiz-answers.has-pick .quiz-answer:not(.is-picked) {
  opacity: .4;
  transform: none;
  box-shadow: none;
}

.quiz-answer.is-picked {
  transform: scale(1.015);
  box-shadow: 0 12px 28px rgba(233, 30, 117, .2);
}

.quiz-answer.is-picked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  right: 16px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: -13px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e91e75, #8b2cf6);
  color: #fff;
  font-size: .9rem;
  font-weight: 900;
  animation: quiz-check .32s cubic-bezier(.2, .8, .2, 1.4) both;
}

/* Result */
.quiz-result {
  display: grid;
  gap: 18px;
}

.quiz-result[hidden] {
  display: none;
}

.quiz-result.is-revealing .quiz-reveal {
  animation: quiz-rise .65s var(--qz-ease) backwards;
  animation-delay: calc(var(--d, 0) * 110ms + 140ms);
}

.quiz-result__main {
  text-align: center;
}

.quiz-result__kicker {
  color: var(--qz-violet);
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.quiz-result__emoji {
  position: relative;
  display: block;
  width: fit-content;
  margin: 12px auto 6px;
  font-size: 3.6rem;
  line-height: 1;
}

.quiz-result__emoji-face {
  position: relative;
  z-index: 1;
  display: block;
}

.quiz-result.is-revealing .quiz-result__emoji-face {
  animation: quiz-pop .85s cubic-bezier(.2, .8, .2, 1.3) .15s backwards;
}

.quiz-sparkles {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.quiz-sparkles span {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
  animation: quiz-spark var(--t) cubic-bezier(.15, .7, .3, 1) forwards;
}

.quiz-result__name {
  color: var(--qz-ink);
  background: linear-gradient(120deg, #2a142d 10%, #8b2cf6 65%, #e91e75 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(2.1rem, 6.8vw, 3rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -.03em;
  outline: none;
}

.quiz-result__nuance {
  margin-top: 6px;
  color: var(--qz-violet);
  font-size: 1.05rem;
  font-weight: 800;
}

.quiz-result__tagline {
  margin-top: 16px;
  color: var(--qz-pink);
  font-size: 1.1rem;
  font-weight: 800;
}

.quiz-result__text {
  max-width: 34em;
  margin: 10px auto 0;
  color: var(--qz-muted);
  font-size: 1.06rem;
  line-height: 1.6;
}

.quiz-energies {
  margin-top: 26px;
  padding: 20px;
  border-radius: 20px;
  background: var(--qz-soft);
  text-align: left;
}

.quiz-energies h3,
.quiz-insight h3 {
  margin-bottom: 10px;
  color: var(--qz-violet);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.quiz-energy {
  display: grid;
  grid-template-columns: 7.2em 1fr 3.2em;
  align-items: center;
  gap: 12px;
  margin: 9px 0;
  font-size: .95rem;
  font-weight: 800;
}

.quiz-energy__bar {
  height: 12px;
  border-radius: 999px;
  background: #efe4f1;
  overflow: hidden;
}

.quiz-energy__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width .9s var(--qz-ease);
}

.quiz-energy--douceur .quiz-energy__bar span { background: var(--qz-douceur); box-shadow: 0 0 10px rgba(255, 143, 171, .6); }
.quiz-energy--rire .quiz-energy__bar span { background: var(--qz-rire); box-shadow: 0 0 10px rgba(255, 185, 56, .6); }
.quiz-energy--parler .quiz-energy__bar span { background: var(--qz-parler); box-shadow: 0 0 10px rgba(111, 125, 255, .6); }
.quiz-energy--audace .quiz-energy__bar span { background: var(--qz-audace); box-shadow: 0 0 10px rgba(233, 30, 117, .6); }

.quiz-energy__value {
  color: var(--qz-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.quiz-insights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
  text-align: left;
}

.quiz-insight {
  padding: 18px;
  border: 1px solid var(--qz-line);
  border-radius: 20px;
  transition: transform .25s var(--qz-ease), box-shadow .25s ease;
}

.quiz-insight:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(72, 22, 64, .08);
}

.quiz-insight p {
  color: var(--qz-ink);
  font-weight: 700;
  line-height: 1.5;
}

.quiz-insight a {
  display: inline-block;
  margin-top: 10px;
  color: var(--qz-pink);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The kit's matching evening plan, under its own lamp. */
.quiz-kit {
  position: relative;
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .16);
  background:
    radial-gradient(80% 90% at 100% 0%, rgba(233, 30, 117, .35), transparent 70%),
    linear-gradient(150deg, #34123c, #4a1d6e);
}

.quiz-kit::before {
  content: "";
  position: absolute;
  top: -45%;
  right: -18%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 176, 120, .32), transparent 70%);
  animation: quiz-breathe 7s ease-in-out infinite;
  pointer-events: none;
}

.quiz-kit > * {
  position: relative;
  z-index: 1;
}

.quiz-kit h3 {
  margin-bottom: 10px;
  color: #fff;
  font-size: clamp(1.3rem, 3.5vw, 1.6rem);
  font-weight: 900;
}

.quiz-kit p {
  margin-bottom: 12px;
  color: rgba(255, 255, 255, .88);
  font-size: 1.02rem;
  line-height: 1.55;
}

.quiz-kit .quiz-btn {
  margin-top: 6px;
}

.quiz-result__end {
  color: rgba(255, 255, 255, .86);
  text-align: center;
}

.quiz-result__end p {
  max-width: 30em;
  margin: 0 auto 14px;
  font-weight: 700;
  line-height: 1.5;
}

/* Text for search engines and FAQ */
.quiz-seo {
  padding: clamp(40px, 6vw, 72px) 0;
}

.quiz-seo h2 {
  margin: 0 0 14px;
  color: var(--qz-ink);
  font-size: clamp(1.45rem, 3.5vw, 1.9rem);
  font-weight: 900;
  letter-spacing: -.02em;
}

.quiz-seo p {
  margin: 0 0 16px;
  color: var(--qz-muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.quiz-seo p + h2 {
  padding-top: 18px;
}

.quiz-faq details {
  margin-bottom: 10px;
  padding: 14px 18px;
  border: 1px solid var(--qz-line);
  border-radius: 16px;
  background: #fff;
  transition: box-shadow .25s ease, border-color .25s ease;
}

.quiz-faq details[open] {
  border-color: rgba(233, 30, 117, .3);
  box-shadow: 0 12px 26px rgba(72, 22, 64, .07);
}

.quiz-faq summary {
  color: var(--qz-ink);
  font-weight: 850;
  cursor: pointer;
}

.quiz-faq details p {
  margin: 10px 0 0;
  animation: quiz-fade .35s ease both;
}

@keyframes quiz-breathe {
  0%, 100% { opacity: .72; scale: .95; }
  50% { opacity: 1; scale: 1.05; }
}

@keyframes quiz-drift {
  0% { opacity: 0; transform: translate3d(0, 14px, 0) scale(.7); }
  25% { opacity: .95; }
  70% { opacity: .55; }
  100% { opacity: 0; transform: translate3d(16px, -80px, 0) scale(1.1); }
}

@keyframes quiz-shine {
  0%, 72% { left: -60%; }
  100% { left: 130%; }
}

@keyframes quiz-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes quiz-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes quiz-answer-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes quiz-check {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

@keyframes quiz-node {
  0%, 100% { box-shadow: 0 0 0 3px rgba(247, 37, 133, .14), 0 0 10px rgba(247, 37, 133, .45); }
  50% { box-shadow: 0 0 0 6px rgba(247, 37, 133, .07), 0 0 18px rgba(247, 37, 133, .7); }
}

@keyframes quiz-pop {
  0% { opacity: 0; transform: scale(.3) rotate(-18deg); }
  60% { opacity: 1; transform: scale(1.15) rotate(6deg); }
  100% { transform: none; }
}

@keyframes quiz-spark {
  0% { opacity: 1; transform: rotate(var(--a)) translateX(0) scale(.4); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(var(--r)) scale(1); }
}

/* Japanese lines break between word groups, not in the middle of one. */
.quiz-page:lang(ja) :is(h1, h2, h3, p, .quiz-answer) {
  word-break: auto-phrase;
}

@media (max-width: 600px) {
  .quiz-panel {
    border-radius: 22px;
  }

  .quiz-insights {
    grid-template-columns: 1fr;
  }

  .quiz-energy {
    grid-template-columns: 6.4em 1fr 2.9em;
    gap: 8px;
  }

  .quiz-btn {
    width: 100%;
  }

  .quiz-thread__node {
    width: 10px;
    height: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-hero::before,
  .quiz-kit::before,
  .quiz-lights span,
  .quiz-btn--primary::after,
  .quiz-thread__node.is-current,
  .quiz-intro,
  .quiz-intro > *,
  .quiz-answer,
  .quiz-kind.is-in,
  .quiz-result.is-revealing .quiz-reveal,
  .quiz-result.is-revealing .quiz-result__emoji-face,
  .quiz-faq details p {
    animation: none;
  }

  .quiz-lights span {
    opacity: .5;
  }

  .quiz-intro,
  .quiz-stage,
  .quiz-result,
  .quiz-stage__body,
  .quiz-thread__fill,
  .quiz-thread__node,
  .quiz-energy__bar span,
  .quiz-btn,
  .quiz-answer {
    transition: none;
  }
}
