/* Global Styles & Variables */
*,
*::after,
*::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --body-background-color: #F3F2EE;
  --btn-text-color: #fff;
  --dropdown-background-color: #E3E1E5;
  --error-background-color: rgb(247, 230, 230);
  --error-text-color: rgb(175, 4, 4);
  --para-text-color: #564A98;
  --placeholder-color: #C4C0D4;
  --primary-color: #564A98;
  --primary-light-color: #6B5FA8;
  --primary-dark-color: #453A7E;
  --border-color: #564A98;
  --text-color: #564A98;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  background-color: var(--body-background-color);
  color: var(--text-color);
  font-size: 1.6rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  overflow: hidden;
}

.questrial-font {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* Header & Progress Bar */
.header {
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 10;
  padding: 18px 16px;
}

.header-logo {
  display: block;
  animation: slide-down-fade 1s ease-out 1 forwards;
}

.header-logo img {
  max-width: 100px;
  height: auto;
  width: auto;
}

@keyframes slide-down-fade {
  from {
    opacity: 0;
    transform: translateY(-90%);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#progress-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9;
}

.progress-bar__path {
  background-color: rgba(86, 74, 152, 0.3);
  height: 4px;
}

.progress-bar {
  background-color: var(--primary-color);
  height: 100%;
  transition: width 0.5s ease-in-out;
}

/* Main Content Layout */
.main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-width: 100vw;
}

.main>section {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#question-viewport {
  padding: 0 80px;
  width: 100%;
}

.question-box {
  margin: 0 auto;
  max-width: 72rem;
}

/* Question Content Styling */
.question-box__heading {
  color: var(--text-color);
  font-size: 24px;
  font-weight: 700;
}

h1 {
  font-size: 24px;
  font-weight: 700;
}

.question-num-heading {
  position: relative;
  font-size: 2.4rem;
  font-weight: unset;
  color: var(--text-color);
}

.question-num-heading h1 {
  font-weight: 400;
}

.question-num-heading>span {
  font-size: 1.6rem;
  margin-left: -50px;
  margin-top: 5px;
  position: absolute;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--para-text-color);
}

.question-num-heading>span>i {
  width: 16px;
  height: 16px;
}

.question-box__para {
  color: var(--para-text-color);
  font-size: 2rem;
  font-weight: unset;
  line-height: 1.4em;
  margin-top: 12px;
}

/* Input fields */
.question-input__text {
  background-color: transparent;
  border: none;
  border-bottom: thin solid var(--placeholder-color);
  color: var(--text-color);
  font-size: 3rem;
  margin-top: 36px;
  padding-bottom: 8px;
  width: 100%;
}

.question-input__text:focus-visible,
.question-input__text:focus {
  border-bottom: 2px solid var(--text-color);
  outline: none;
}

.question-input__text::placeholder {
  color: var(--placeholder-color);
  opacity: 1;
}

/* Buttons */
.btn-container {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12.5px;
  margin-top: 32px;
  width: 100%;
}

.btn-container.ok {
  margin-top: 28px;
}

.btn-container>button[type="submit"] {
  background-color: var(--primary-color);
  border: thin solid transparent;
  border-radius: 5px;
  color: var(--btn-text-color);
  cursor: pointer;
  font-size: 2rem;
  font-weight: 700;
  padding: 10px 14px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-container>button[type="submit"]:hover {
  background-color: var(--primary-light-color);
}

.btn-container>button[type="submit"]>.icon-check {
  width: 24px;
  height: 24px;
}

.btn-container>span {
  color: var(--text-color);
  font-size: 1.25rem;
}

.btn-container>span strong {
  font-weight: bolder;
  letter-spacing: 0.04em;
}

/* Multiple Choice Options */
.dropdown-select-options {
  margin-top: 30px;
}

.dropdown-select__option {
  align-items: center;
  background-color: var(--dropdown-background-color);
  border: thin solid var(--border-color);
  border-radius: 4px;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  font-size: 2rem;
  margin-bottom: 8px;
  min-height: 50px;
  padding: 8px 12px;
  transition: background-color 0.3s, border-color 0.3s;
  width: 100%;
  max-width: 450px;
}

.dropdown-select__option:hover {
  background-color: var(--dropdown-background-color);
  border-color: var(--border-color);
}

.dropdown-select__option .choice-key {
  align-items: center;
  border: thin solid var(--border-color);
  border-radius: 4px;
  display: flex;
  font-size: 1.2rem;
  font-weight: 700;
  height: 24px;
  justify-content: center;
  margin-right: 12px;
  width: 24px;
  transition: background-color 0.3s, color 0.3s;
}

.dropdown-select__option .icon-check-small {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.3s;
}

input:checked+.choice-key {
  background-color: var(--primary-color);
  color: #fff;
}

input:checked~.icon-check-small {
  opacity: 1;
}

input:checked~span {
  font-weight: bold;
}

/* Blink animation for selection feedback */
.dropdown-select__option.blink {
  animation: blink 0.3s ease-in-out;
}

@keyframes blink {

  0%,
  100% {
    background-color: var(--dropdown-background-color);
  }

  50% {
    background-color: var(--primary-color);
    color: #fff;
  }
}

/* Likert Scale Styling */
.likert-scale-container {
  margin-top: 40px;
  width: 100%;
}

.likert-scale {
  display: grid;
  grid-template-columns: repeat(5, 140px);
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.likert-option {
  cursor: pointer;
  transition: all 0.2s ease;
}

.likert-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 60px;
  border-radius: 30px;
  border: 1px solid var(--primary-color);
  background-color: var(--dropdown-background-color);
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 400;
  transition: all 0.2s ease;
}

.likert-option:hover .likert-number {
  transform: scale(1.02);
  border-width: 2px;
}

input[type="radio"]:checked~.likert-number {
  background-color: var(--primary-color);
  color: #fff;
}

.likert-option.blink .likert-number {
  animation: likert-blink 0.3s ease-in-out;
}

@keyframes likert-blink {

  0%,
  100% {
    background-color: var(--dropdown-background-color);
    color: var(--primary-color);
  }

  50% {
    background-color: var(--primary-color);
    color: #fff;
  }
}

.likert-labels {
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 100%;
  padding: 0 20px;
}

.likert-label-left,
.likert-label-right {
  font-size: 14px;
  color: var(--primary-color);
  max-width: 140px;
  text-align: center;
}

/* Error Message */
.error {
  align-items: flex-end;
  animation: slide-up-in 0.35s linear 1 forwards;
  background-color: var(--error-background-color);
  border-radius: 3px;
  color: var(--error-text-color);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  margin-top: 15px;
  padding: 8px 12px;
  width: max-content;
}

.error .icon-error {
  width: 18px;
  height: 18px;
}

@keyframes slide-up-in {
  from {
    opacity: 0;
    transform: translateY(100%);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animations */
.slide-in-up,
.slide-in-down,
.slide-out-up,
.slide-out-down {
  animation-duration: 0.5s;
  animation-fill-mode: forwards;
  animation-timing-function: ease-out;
}

.slide-in-up {
  animation-name: in-up;
}

.slide-in-down {
  animation-name: in-down;
}

@keyframes in-up {
  from {
    transform: translateY(50vh);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes in-down {
  from {
    transform: translateY(-50vh);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}


/* Item feedback (inline in btn-container) */
.item-feedback__toggle {
  background: none;
  border: 1px solid var(--para-text-color);
  border-radius: 4px;
  color: var(--para-text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  margin-left: auto;
  transition: color 0.2s, border-color 0.2s;
}

.item-feedback__label {
  font-size: 1.2rem;
  font-weight: 400;
  white-space: nowrap;
}

.item-feedback__toggle:hover,
.item-feedback__toggle.active {
  color: var(--text-color);
  border-color: var(--text-color);
}

.item-feedback__icon {
  width: 18px;
  height: 18px;
}

.item-feedback__body {
  flex-basis: 100%;
  margin-top: 4px;
  display: flex;
  justify-content: flex-end;
}

.item-feedback__textarea {
  background-color: transparent;
  border: thin solid var(--para-text-color);
  border-radius: 4px;
  color: var(--text-color);
  font-size: 1.5rem;
  padding: 10px;
  width: 100%;
  max-width: 500px;
  resize: vertical;
  font-family: inherit;
}

.item-feedback__textarea:focus {
  border-color: var(--text-color);
  outline: none;
}

.item-feedback__textarea::placeholder {
  color: var(--placeholder-color);
}

.item-feedback--standalone {
  margin-top: 15px;
}

[x-cloak] {
  display: none !important;
}

/* Media Queries */
@media screen and (max-width: 599px) {
  html {
    font-size: 52%;
  }

  #question-viewport {
    padding: 0 44px;
  }

  .question-box__heading,
  .question-num-heading {
    line-height: 1.35em;
  }

  .question-num-heading>span {
    font-size: 1.2rem;
    margin-left: -38px;
    margin-top: 0;
  }

  .question-num-heading>span>i {
    width: 14px;
    height: 14px;
  }

  .question-input__text {
    font-size: 2.9rem;
  }

  .btn-container {
    align-items: flex-start;
    flex-direction: column;
    gap: 17.5px;
  }

  .btn-container>span {
    font-size: 1.5rem;
  }

  .error {
    width: 100%;
  }
}