/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Quiz step transitions */
.quiz-step {
  animation: quizFadeIn 0.3s ease-out;
}

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

.quiz-step.hidden {
  display: none;
}

/* Quiz checkbox/radio selected state */
.quiz-checkbox:has(input:checked),
.quiz-radio:has(input:checked) {
  border-color: #2563eb;
  background-color: #eff6ff;
}

/* Fallback for browsers without :has() */
.quiz-selected {
  border-color: #2563eb !important;
  background-color: #eff6ff !important;
}

/* Star rating */
.star-rating {
  letter-spacing: 1px;
  line-height: 1;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2563eb;
}

/* Smooth transitions for interactive elements */
a,
button {
  transition-property: color, background-color, border-color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading spinner for submit button */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}

@keyframes btnSpin {
  to {
    transform: rotate(360deg);
  }
}
