/**
 * FladeX quiz styles. Content-agnostic — works for any quiz built with inc/quiz.php.
 * Reuses theme tokens (yellow accent #fee500, dd-button / dd-input controls).
 */

.fx-quiz-section {
  padding-top: 32px;
  padding-bottom: 32px;
}

.fx-quiz {
  max-width: 960px;
  margin: 0 auto;
  background: #fff;
  border-radius: 18px;
  padding: 28px 40px;
  box-shadow: 0 18px 50px rgba(20, 27, 34, 0.08);
}

.fx-quiz__intro {
  text-align: center;
  margin-bottom: 18px;
}

.fx-quiz__title {
  margin: 0 0 8px;
}

.fx-quiz__subtitle {
  margin: 0;
  color: #6b7683;
}

/* Progress bar */
.fx-quiz__progress {
  margin-bottom: 20px;
}

.fx-quiz__progress-bar {
  height: 6px;
  border-radius: 6px;
  background: #eef1f4;
  overflow: hidden;
}

.fx-quiz__progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: #fee500;
  transition: width 0.35s ease;
}

.fx-quiz__progress-label {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #8a94a0;
  text-align: right;
}

/* Steps: only the active step is shown */
.fx-quiz__step {
  display: none;
  animation: fxQuizFade 0.28s ease;
}

.fx-quiz__step.is-active {
  display: block;
}

@keyframes fxQuizFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fx-quiz__question {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 18px;
  text-align: center;
}

/* Options — flow horizontally so the block stays short and fills the width */
.fx-quiz__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.fx-quiz__option {
  appearance: none;
  border: 2px solid #e6e9ee;
  background: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.02rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.fx-quiz__option:hover {
  border-color: #fee500;
  background: #fffdf0;
}

.fx-quiz__option:active {
  transform: scale(0.99);
}

.fx-quiz__option.is-selected {
  border-color: #fee500;
  background: #fee500;
}

/* Phone step */
.fx-quiz__phone {
  max-width: 420px;
  margin: 0 auto;
}

.fx-quiz__phone .dd-input-wrap {
  margin-bottom: 14px;
}

.fx-quiz__phone-input.is-error {
  border-color: #e5484d !important;
  box-shadow: 0 0 0 2px rgba(229, 72, 77, 0.15);
}

.fx-quiz__submit.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.fx-quiz__note {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: #8a94a0;
  text-align: center;
}

/* Back link */
.fx-quiz__back {
  display: inline-block;
  margin-top: 16px;
  border: none;
  background: none;
  color: #8a94a0;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px 0;
}

.fx-quiz__back:hover {
  color: #141b22;
}

/* Desktop: question on the left, answers stacked on the right (50/50) */
@media (min-width: 768px) {
  .fx-quiz__step.is-active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
    align-items: center;
  }
  .fx-quiz__question {
    text-align: left;
    margin-bottom: 0;
    align-self: center;
  }
  /* Answers always one under another in their column */
  .fx-quiz__options {
    grid-template-columns: 1fr;
  }
  .fx-quiz__option {
    justify-content: flex-start;
    text-align: left;
  }
  .fx-quiz__phone {
    max-width: none;
    margin: 0;
  }
  /* Back link spans full width below both columns */
  .fx-quiz__back {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 575px) {
  .fx-quiz {
    padding: 22px 16px;
  }
  .fx-quiz__question {
    font-size: 1.15rem;
  }
  /* On phones a single column reads better than cramped cards */
  .fx-quiz__options {
    grid-template-columns: 1fr;
  }
  .fx-quiz__option {
    min-height: 52px;
  }
}
