.qb-quiz,
.qb-quiz * {
  box-sizing: border-box;
}

.qb-quiz {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  padding: 40px;
  border: 1px solid var(--qb-border, #e5e7eb);
  border-radius: 16px;
  color: var(--qb-text, #111827);
  background:
    radial-gradient(ellipse 70% 60% at 90% 10%, rgba(var(--qb-primary-rgb, 249, 115, 22), 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 10% 90%, rgba(var(--qb-primary-rgb, 249, 115, 22), 0.08) 0%, transparent 65%),
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(var(--qb-primary-rgb, 249, 115, 22), 0.10) 0%, transparent 60%),
    var(--qb-background, #ffffff);
  box-shadow: 0 24px 70px rgba(var(--qb-primary-rgb, 249, 115, 22), 0.10), 0 8px 28px rgba(17, 24, 39, 0.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: var(--qb-align, left);
  overflow: hidden;
}

.qb-progress-wrapper {
  display: none;
  width: 100%;
  height: 6px;
  margin-bottom: 28px;
  overflow: hidden;
  border-radius: 999px;
  background: #f3f4f6;
}

.qb-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--qb-primary, #fb923c) 0%, var(--qb-primary, #ea580c) 100%);
  transition: width 0.35s ease;
}

.qb-form {
  display: block;
}

.qb-screen {
  display: none;
  animation: qbFadeIn 0.35s ease both;
  text-align: var(--qb-align, left);
}

.qb-screen.active {
  display: block;
}

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

.qb-title {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -0.03em;
  color: var(--qb-text, #111827);
}

.qb-subtitle {
  margin: 0 0 30px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--qb-muted, #4b5563);
}

.qb-question-label {
  display: block;
  margin: 0 0 24px;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.qb-help-text {
  margin: -4px 0 14px;
  color: var(--qb-muted, #6b7280);
  font-size: 14px;
  line-height: 1.55;
}

.qb-input {
  width: 100%;
  display: block;
  margin-bottom: 8px;
  padding: 16px 18px;
  border: 2px solid var(--qb-border, #e5e7eb);
  border-radius: 14px;
  background: var(--qb-surface, #f9fafb);
  color: var(--qb-text, #111827);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.qb-input:focus {
  outline: none;
  border-color: var(--qb-primary, #f97316);
  background: var(--qb-surface, #ffffff);
  box-shadow: 0 0 0 4px rgba(var(--qb-primary-rgb, 249, 115, 22), 0.12);
}

.qb-textarea {
  min-height: 150px;
  resize: vertical;
}

.qb-char-count {
  margin: 0 0 18px;
  color: #6b7280;
  font-size: 13px;
  text-align: right;
}

.qb-options {
  display: grid;
  gap: 12px;
  margin-bottom: 30px;
}

.qb-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 2px solid var(--qb-border, #e5e7eb);
  border-radius: 14px;
  background: var(--qb-surface, #f9fafb);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.qb-option:hover {
  border-color: var(--qb-primary, #f97316);
  background: var(--qb-surface, #fff7ed);
}

.qb-option input {
  margin: 0;
  accent-color: var(--qb-primary, #f97316);
  flex: 0 0 auto;
}

.qb-option span {
  flex: 1 1 auto;
  font-size: 16px;
  line-height: 1.45;
}

.qb-options-radio .qb-option input {
  transform: translateY(-1px);
}

.qb-question-footer {
  margin-top: 20px;
  display: block;
}

.qb-btn {
  width: 100%;
  display: block;
  text-align: center;
  gap: 8px;
  padding: 18px 24px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--qb-primary, #fb923c) 0%, var(--qb-primary, #ea580c) 100%);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
}

.qb-btn:hover {
  filter: brightness(0.97);
}

.qb-btn:active {
  transform: scale(0.99);
}

.qb-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.qb-btn-back {
  display: inline-flex;
  width: auto;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--qb-muted, #4b5563);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}

.qb-btn-back:active {
  transform: none;
}

.qb-inline-error {
  min-height: 20px;
  margin-top: 8px;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.5;
}

.qb-completion-screen {
  display: none !important;
  text-align: center;
}

.qb-quiz.qb-is-complete .qb-form > .qb-screen:not(.qb-completion-screen) {
  display: none !important;
}

.qb-quiz.qb-is-complete .qb-completion-screen {
  display: block !important;
  animation: qbFadeIn 0.35s ease both;
}

.qb-quiz.qb-is-complete .qb-progress-wrapper {
  display: block;
}

.qb-quiz.qb-is-complete .qb-progress-bar {
  width: 100% !important;
}

.qb-completion-accent {
  width: 100%;
  height: 8px;
  margin: 0 0 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--qb-primary, #fb923c) 0%, var(--qb-primary, #ea580c) 100%);
}

.qb-completion-body {
  padding: 8px 0 4px;
}

.qb-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 22px;
  border-radius: 999px;
  background: rgba(var(--qb-primary-rgb, 249, 115, 22), 0.12);
  color: var(--qb-primary, #f97316);
  font-size: 38px;
  font-weight: 800;
}

.qb-completion-title {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -0.03em;
  color: var(--qb-text, #111827);
  text-align: center;
}

.qb-completion-subtitle {
  margin: 0 auto 24px;
  max-width: 520px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--qb-muted, #4b5563);
  text-align: center;
}

.qb-completion-cta {
  margin-top: 8px;
}

.qb-completion-button {
  display: inline-flex;
  min-width: 220px;
  justify-content: center;
}

.qb-quiz-error {
  padding: 20px;
  border-radius: 14px;
  background: var(--qb-background, #fff7ed);
  border: 1px solid var(--qb-border, #fdba74);
  color: var(--qb-text, #9a3412);
}

@media (max-width: 768px) {
  .qb-quiz {
    padding: 25px 20px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .qb-title {
    font-size: 24px;
  }

  .qb-question-label {
    font-size: 19px;
  }
}

@media (max-width: 480px) {
  .qb-quiz {
    padding: 25px 20px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .qb-options {
    gap: 10px;
  }

  .qb-option {
    padding: 14px 15px;
  }

  .qb-btn {
    width: 100%;
  }
}
