body {
  font-family: "Manrope", sans-serif;
}

.q-overlay {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  box-sizing: border-box !important;
  background: rgba(0, 0, 0, 0);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  pointer-events: none;
  z-index: 99999;
}

.q-modal {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: none !important;
  box-sizing: border-box !important;
  display: flex;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.07);
  transform-origin: center center;
  border-radius: 28px;
}

.q-content {
  width: 100vw;
  height: 100%;
  padding: 30px;
  background: linear-gradient(180deg, #f2f2f2 0%, #f9f4ec 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  min-height: 0;
  position: absolute;
}

.q-header {
  width: 100%;
  max-width: 865px;
  justify-content: space-between;
  align-items: center;
  display: inline-flex;
  box-sizing: border-box;
  color: #d8bb8d;
  flex-shrink: 0;
}

.q-header > div:first-child {
  font-size: 16px;
  font-weight: 800;
}

.q-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: q-spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes q-spin {
  to {
    transform: rotate(360deg);
  }
}

.q-header > div:last-child {
  font-size: 16px;
  font-weight: 800;
}

.q-answers {
  justify-content: center;
  align-items: center;
  gap: 16px;
  display: inline-flex;
  flex-wrap: wrap;
  opacity: 1;
  max-height: 350px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
}

.q-answers-vertical {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  width: 100%;
  opacity: 1 !important;
  max-height: none !important;
  overflow-y: visible !important;
}

.q-answers-vertical textarea {
  background-color: #faf9f6;
  border: 1px solid #d6b787;
  border-radius: 12px;
}

.q-answers-vertical > div {
  width: 100%;
}

.q-single-answer,
.q-submit {
  width: clamp(120px, 20vw, 160px);
  min-height: 50px;
  padding: 14px 20px;
  cursor: pointer;
  border-radius: 6px;
  outline: 1px solid #d8bb8d;
  display: flex;
  justify-content: center;
  align-items: center;
}

.q-submit {
  background: none !important;
  width: 150px;
  height: 50px;
  border: none !important;
  outline: 1px solid #d8bb8d !important;
  color: #d8bb8d !important;
  font-size: clamp(18px, 2.5vw, 24px) !important;
  font-weight: 500 !important;
  cursor: pointer;
}

.q-single-answer > div,
.q-submit {
  color: #d8bb8d;
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 500;
}

.q-question-container {
  align-self: stretch;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  display: flex;
  max-width: 75%;
  margin: auto;
  gap: 10px;
}

.q-question {
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 24px;
  display: flex;
}

.q-question-text {
  width: 100%;
  max-width: 900px;
  text-align: center;
  color: #130e07;
  font-size: 45px;
  font-weight: bold;
  line-height: 1.15;
  word-break: break-word;
}

.questionnaire-wrapper {
  text-align: center;
}

.questionnaire-wrapper > div:first-child {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9998;
}

.q-close {
  position: absolute;
  top: 17px;
  right: 40px;
  font-size: 38px;
  background: none;
  border: none;
  cursor: pointer;
  color: #130e07;
  z-index: 10;
}

.q-close:focus {
  outline: none;
}

.footer-tips {
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  display: flex;
  flex-shrink: 0;
  overflow: visible;
  width: 100%;
  margin-bottom: 8px;
}

.footer-tips > div:first-child {
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  display: inline-flex;
}

.footer-tips > div:last-child {
  color: #130e07;
  font-size: 16px;
  font-weight: 300;
  text-align: center;
  display: block;
  overflow: visible;
  height: auto;
  max-height: none;
  white-space: normal;
}

.q-open-btn {
  padding: 15px 30px !important;
  font-size: 18px !important;
  cursor: pointer;
  border: none !important;
  border-radius: 0 !important;
  background-color: var(--q-btn-color, #d8bb8d) !important;
  color: #ffffff !important;
  min-height: unset !important;
  text-transform: none !important;
  font-weight: 400 !important;
  box-shadow: none !important;
}

/* ── 1024px ── */
@media (max-width: 1024px) {
  .q-content {
    padding: 40px 60px;
  }

  .q-question-container {
    max-width: 80%;
  }
}

/* ── 768px ── */
@media (max-width: 768px) {
  .q-close {
    right: 16px;
    top: 16px;
    font-size: 30px;
  }

  .q-content > div:first-child {
    width: 100% !important;
  }

  .q-content > div:nth-child(2) {
    height: auto !important;
    gap: 40px !important;
  }

  .q-content > div:nth-child(2) > div:last-child {
    flex-direction: column !important;
    width: 100%;
    align-items: center !important;
  }

  .q-question-container {
    max-width: 100%;
    height: auto !important;
    flex: 0 1 auto;
    gap: 48px;
    padding: 16px 0;
  }

  .q-question-text {
    font-size: 28px;
  }

  /* grid answers (multi-option) go full width */
  .q-answers[style*="grid"] > div {
    min-width: 0 !important;
    width: 100%;
  }

  .q-answers[style*="grid"] {
    grid-template-columns: 1fr !important;
  }

  /* boolean Yes/No: stack vertically, centered, fixed width */
  .q-answers:not([style*="grid"]) {
    flex-direction: column !important;
    align-items: center !important;
  }

  .q-single-answer {
    width: 200px !important;
  }

  .footer-tips {
    margin-bottom: 30px;
  }

  .q-single-answer {
    padding: 8px 12px;
    width: 120px !important;
    min-height: 40px;
    font-size: 14px;
  }
}

/* ── 480px ── */
@media (max-width: 480px) {
  .q-content {
    padding: 20px 16px;
  }

  .q-content > div:nth-child(2) {
    height: auto !important;
    gap: 20px !important;
    width: 100% !important;
  }

  .q-question-container {
    gap: 32px;
    padding: 0;
    margin: auto;
    flex: 0 1 auto;
  }

  .footer-tips {
    padding-bottom: 12px;
  }

  .footer-tips > div:last-child {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    white-space: normal;
  }

  .q-question-text {
    font-size: 22px;
  }

  .q-answers > div {
    min-width: 0 !important;
  }

  /* All grid answers single column on small screens */
  .q-answers[style*="grid"] {
    grid-template-columns: 1fr !important;
  }

  .q-submit {
    font-size: 18px;
  }

  .footer-tips > div:last-child {
    font-size: 14px;
  }
}
