/* === Dr. Promptshake v8.0.0 — Questionnaire === */

/* ============================================
   OVERLAY — fullscreen, above chat, under header
   ============================================ */

.questionnaire-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 10090;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn 0.4s var(--ease-out);
}

/* ============================================
   CARD — centered container
   ============================================ */

.questionnaire-card {
  width: 100%;
  max-width: 560px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  position: relative;
  animation: slideUp 0.4s var(--ease-out);
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.questionnaire-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.questionnaire-progress-bar {
  flex: 1;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.questionnaire-progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.4s var(--ease-out);
}

.questionnaire-progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}

/* ============================================
   QUESTION TEXT
   ============================================ */

.questionnaire-question {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.55;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.questionnaire-question-sub {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 300;
  margin-top: 8px;
  line-height: 1.5;
}

/* ============================================
   ANSWER OPTIONS — single choice / multi-select
   ============================================ */

.answer-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-med);
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.5;
  font-weight: 300;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.answer-option:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
}

.answer-option:active {
  transform: scale(0.98);
}

.answer-option.selected {
  border-color: var(--gold);
  background: var(--gold-subtle);
}

.answer-option.selected .answer-option-indicator {
  border-color: var(--gold);
  background: var(--gold);
}

.answer-option.selected .answer-option-indicator::after {
  opacity: 1;
}

/* Radio / checkbox indicator */
.answer-option-indicator {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-med);
  margin-top: 1px;
}

.answer-option-indicator::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-primary);
  opacity: 0;
  transition: opacity var(--transition-med);
}

/* Multi-select: square indicator */
.answer-option.multi .answer-option-indicator {
  border-radius: 5px;
}

.answer-option.multi .answer-option-indicator::after {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.answer-option-text {
  flex: 1;
}

.answer-option-label {
  font-weight: 400;
  color: var(--text-primary);
}

/* ============================================
   LIKERT SCALE — 5 circles in a row
   ============================================ */

.likert-container {
  margin-bottom: 28px;
}

.likert-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.likert-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.likert-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  transition: all var(--transition-med);
}

.likert-option:hover .likert-circle {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.04);
}

.likert-option:active .likert-circle {
  transform: scale(0.92);
}

.likert-option.selected .likert-circle {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--bg-primary);
  font-weight: 500;
}

.likert-labels {
  display: flex;
  justify-content: space-between;
}

.likert-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 300;
  max-width: 80px;
  line-height: 1.35;
}

.likert-label:last-child {
  text-align: right;
}

/* ============================================
   OPEN TEXT — textarea with char counter
   ============================================ */

.questionnaire-textarea-wrap {
  position: relative;
  margin-bottom: 28px;
}

.questionnaire-textarea {
  width: 100%;
  min-height: 100px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  font-weight: 300;
  line-height: 1.6;
  resize: vertical;
  transition: border-color var(--transition-med);
}

.questionnaire-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-subtle);
}

.questionnaire-textarea::placeholder {
  color: var(--text-secondary);
}

.questionnaire-char-count {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 300;
  pointer-events: none;
}

.questionnaire-char-count.near-limit {
  color: var(--gold);
}

.questionnaire-char-count.at-limit {
  color: #e5533d;
}

/* ============================================
   NAVIGATION BUTTONS
   ============================================ */

.questionnaire-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.questionnaire-btn-back {
  padding: 14px 20px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition-med);
}

.questionnaire-btn-back:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.questionnaire-btn-next {
  flex: 1;
  padding: 14px 24px;
  background: var(--gold);
  color: var(--bg-primary);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-med);
}

.questionnaire-btn-next:hover:not(:disabled) {
  background: var(--gold-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 20px var(--gold-glow);
}

.questionnaire-btn-next:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.questionnaire-btn-next:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ============================================
   LEVEL SCREEN — two big buttons
   ============================================ */

.level-screen {
  text-align: center;
}

.level-screen h2 {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.level-screen p {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 28px;
  line-height: 1.5;
}

.level-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.level-btn {
  padding: 20px 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all var(--transition-med);
  text-align: left;
}

.level-btn:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.level-btn:active {
  transform: translateY(0);
}

.level-btn-title {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.level-btn-desc {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.4;
}

.level-btn.l2 {
  border-color: var(--gold-glow);
}

.level-btn.l2:hover {
  border-color: var(--gold);
  box-shadow: 0 0 20px var(--gold-glow);
}

/* ============================================
   SAFETY GATE MODAL (L2 confirmation)
   ============================================ */

.safety-gate {
  text-align: center;
  padding: 8px 0;
}

.safety-gate p {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 24px;
}

.safety-gate .questionnaire-nav {
  justify-content: center;
}

/* ============================================
   ZEIGARNIK INTERRUPT SCREEN
   ============================================ */

.zeigarnik-screen {
  text-align: center;
  padding: 20px 0;
}

.zeigarnik-screen p {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 300;
  line-height: 1.65;
  margin-bottom: 32px;
}

.zeigarnik-screen .accent-text {
  color: var(--gold);
  font-weight: 400;
}

/* ============================================
   INSIGHT PREVIEW — styled like banger card
   ============================================ */

.insight-preview-card {
  background: var(--bg-secondary);
  border: 1px solid var(--gold-glow);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
  animation: slideUp 0.4s var(--ease-out);
}

.insight-preview-label {
  font-size: 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-bottom: 12px;
}

.insight-preview-text {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 300;
  line-height: 1.65;
}

.insight-preview-text .loading {
  color: var(--text-secondary);
  animation: pulse 1.5s ease-in-out infinite;
}

.questionnaire-btn-start-chat {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-med);
}

.questionnaire-btn-start-chat:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 20px var(--accent-glow);
}

.questionnaire-btn-start-chat:active {
  transform: translateY(0) scale(0.98);
}

.questionnaire-btn-start-chat:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ============================================
   SKIP BUTTON — subtle, bottom-right
   ============================================ */

.questionnaire-skip {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
  padding: 8px 0;
  transition: color var(--transition-fast);
}

.questionnaire-skip:hover {
  color: var(--text-primary);
}

/* ============================================
   RESPONSIVE — mobile
   ============================================ */

@media (max-width: 600px) {
  .questionnaire-overlay {
    padding: 0;
    align-items: stretch;
  }

  .questionnaire-card {
    max-width: none;
    border-radius: 0;
    border: none;
    padding: 24px 20px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .questionnaire-question {
    font-size: 16px;
  }

  .likert-circle {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .likert-label {
    font-size: 10px;
    max-width: 60px;
  }

  .answer-option {
    padding: 12px 16px;
    font-size: 14px;
  }

  .level-btn {
    padding: 18px 20px;
  }
}
/* === PsyQuest v2.0 — New question types === */

/* ============================================
   SCENARIO PREFIX — slow fade-in, italic
   ============================================ */

.scenario-prefix {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  font-weight: 300;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeInSlow 1.2s var(--ease-out) forwards;
}

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

/* ============================================
   BRANCH QUESTION — ericksonowska
   ============================================ */

.branch-question .questionnaire-question {
  text-align: center;
  margin-bottom: 28px;
}

.branch-question .level-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================
   SAFETY DISCLAIMER — checkbox + box
   ============================================ */

.safety-disclaimer {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 4px;
}

.safety-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 300;
  line-height: 1.5;
  user-select: none;
}

.safety-checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-top: 2px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* ============================================
   SOMATIC GATE — breathing instruction (L2)
   ============================================ */

.somatic-gate .somatic-instruction {
  text-align: center;
  padding: 20px 0;
}

.somatic-gate .somatic-instruction .questionnaire-question {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-primary);
  font-weight: 300;
}

.somatic-ready-btn {
  width: 100%;
  padding: 16px;
  background: var(--gold);
  color: var(--bg-primary);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-med);
  margin-top: 16px;
}

.somatic-ready-btn:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
  box-shadow: 0 0 20px var(--gold-glow);
}

.somatic-ready-btn:active {
  transform: translateY(0) scale(0.98);
}

/* ============================================
   MULTI-SELECT BLOCKED — visual feedback
   ============================================ */

.answer-option.blocked {
  opacity: 0.3;
  pointer-events: none;
  border-color: var(--border);
}

.answer-option.blocked .answer-option-indicator {
  border-color: rgba(255, 255, 255, 0.08);
}
