/* ------------------------------------------- */
/* ------------------------------------------- */
:root {
  font-size: 62.5%;
}

/* ------------------------------------------- */
/* ------------------------------------------- */
.block-quiz {
  margin-bottom: 2rem;
}

.block-quiz.backend a {
  pointer-events: none !important;
}

.quiz {
  max-width: 102rem;
  margin: 0 auto;
}

.quiz [hidden] {
  display: none !important;
}

.quiz__viewport {
  overflow: hidden;
}

.quiz__track {
  display: flex;
  align-items: stretch;
  transition: transform 0.45s ease;
  will-change: transform;
}

.quiz__slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: clamp(2rem, calc(0.0313725 * (100vmin + 100vmax) / 2), 3.2rem);
}

/* ------------------------------------------- */
/* ------------------------------------------- */
.quiz__card {
  height: 100%;
  border-radius: 0.5rem;
  box-sizing: border-box;
}

.quiz__card--question {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
  padding: clamp(2.4rem, calc(0.0392157 * (100vmin + 100vmax) / 2), 4rem);
  background: #ffffff;
  border: 0.8rem solid #e18dd2;
  box-shadow: 0 0 0.8rem 0.8rem #e18dd2, 0 0 0.8rem 0.8rem #e18dd2 inset;
  color: #1a1a1a;
}

.quiz__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.quiz__question {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.8rem, calc(0.0235294 * (100vmin + 100vmax) / 2), 2.4rem);
  line-height: 1.25;
}

.quiz__num {
  margin-right: 0.4rem;
}

.quiz__counter {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: clamp(1.8rem, calc(0.0235294 * (100vmin + 100vmax) / 2), 2.4rem);
  color: #e18dd2;
  white-space: nowrap;
}

/* ------------------------------------------- */
/* ------------------------------------------- */
@keyframes quiz-fade-in {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quiz.is-ready .quiz__card--question .quiz__head,
.quiz.is-ready .quiz__card--question .quiz__answer,
.quiz.is-ready .quiz__card--question .quiz__actions {
  opacity: 0;
}

.quiz.is-ready .quiz__slide.is-active .quiz__card--question .quiz__head {
  animation: quiz-fade-in 0.5s ease both;
}

.quiz.is-ready .quiz__slide.is-active .quiz__card--question .quiz__answer {
  animation: quiz-fade-in 0.6s ease both;
  animation-delay: calc(1s + var(--i, 0) * 0.35s);
}

.quiz.is-ready .quiz__slide.is-active .quiz__card--question .quiz__actions {
  animation: quiz-fade-in 0.6s ease both;
  animation-delay: 2.6s;
}

@media (prefers-reduced-motion: reduce) {
  .quiz.is-ready .quiz__card--question .quiz__head,
  .quiz.is-ready .quiz__card--question .quiz__answer,
  .quiz.is-ready .quiz__card--question .quiz__actions {
    opacity: 1;
    animation: none;
  }
}

/* ------------------------------------------- */
/* ------------------------------------------- */
.quiz__answers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.quiz__answer {
  margin: 0;
}

.quiz__choice {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.quiz__label {
  display: block;
  width: fit-content;
  padding: 1.1rem 1.8rem;
  border-radius: 1rem;
  background: #f1f1f1;
  color: #1a1a1a;
  cursor: pointer;
  font-size: clamp(1.5rem, calc(0.0176471 * (100vmin + 100vmax) / 2), 1.8rem);
  line-height: 1.3;
  transition: background 0.2s ease, color 0.2s ease;
}

.quiz__choice:checked + .quiz__label {
  background: #e18dd2;
  color: #ffffff;
}

.quiz__choice:focus-visible + .quiz__label {
  outline: 2px solid #e18dd2;
  outline-offset: 2px;
}

/* ------------------------------------------- */
/* ------------------------------------------- */
.quiz__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}

.quiz__btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  border-radius: 999px;
  background: transparent;
  font-size: clamp(1.5rem, calc(0.0166667 * (100vmin + 100vmax) / 2), 1.7rem);
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease-in-out;
}

.quiz__btn:hover {
  border-color: #e18dd2;
}

.quiz__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quiz__btn--validate {
  border: 1px solid #e18dd2;
  color: #e18dd2;
}

.quiz__btn--validate:hover:not(:disabled) {
  background: #e18dd2;
  color: #ffffff;
}

.quiz__btn--next {
  border: 1px solid #ffffff;
  color: #ffffff;
}

.quiz__btn--next:hover {
  background: #ffffff;
  color: #e18dd2;
}

/* ------------------------------------------- */
/* ------------------------------------------- */
.quiz__card--reponse,
.quiz__card--fin {
  padding: clamp(2.4rem, calc(0.0392157 * (100vmin + 100vmax) / 2), 4rem);
  background: #e18dd2;
  box-shadow: 0 0 0.8rem 0.8rem #e18dd2, 0 0 0.8rem 0.8rem #e18dd2 inset;
  color: #ffffff;
}

.quiz__card--reponse {
  display: flex;
  align-items: stretch;
  gap: clamp(2.4rem, calc(0.0392157 * (100vmin + 100vmax) / 2), 4rem);
}

@media screen and (max-width: 781px) {
  .quiz__card--reponse {
    flex-direction: column;
  }
}

.quiz__card--fin {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.quiz__reponse-media {
  flex: 0 0 48%;
  align-self: center;
  aspect-ratio: 1 / 1;
  padding: 0.5rem;
  box-sizing: border-box;
}

@media screen and (max-width: 781px) {
  .quiz__reponse-media {
    flex-basis: auto;
    width: 100%;
    max-width: 32rem;
  }
}

.quiz__reponse-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.quiz__reponse-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.quiz__reponse-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.8rem, calc(0.0215686 * (100vmin + 100vmax) / 2), 2.2rem);
  line-height: 1.25;
}

.quiz__reponse-text {
  font-size: clamp(1.6rem, calc(0.0196078 * (100vmin + 100vmax) / 2), 2rem);
  line-height: 1.35;
}

.quiz__reponse-text p {
  margin: 0 0 1rem;
}

.quiz__reponse-text p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------- */
/* ------------------------------------------- */
.quiz__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.4rem;
}
@media screen and (max-width: 420px) {
  .quiz__dots {
    gap: 0.5rem;
  }
}

.quiz__dot {
  display: block;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #e18dd2;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease;
}
.quiz__dot:hover:not(.is-active) {
  background: rgba(225, 141, 210, 0.4);
}
.quiz__dot:focus-visible {
  outline: 2px solid #e18dd2;
  outline-offset: 2px;
}
@media screen and (max-width: 420px) {
  .quiz__dot {
    width: 1rem;
    height: 1rem;
  }
}

.quiz__dot.is-active {
  background: #e18dd2;
}

.quiz__empty {
  padding: 2rem;
  text-align: center;
  color: #e18dd2;
}
