/* ===== Test Shell - Shared Styles ===== */

.test-page-shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 112px 20px 24px;
}

/* ---- Hero ---- */
.test-hero {
  text-align: center;
  padding-bottom: 40px;
}

.test-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(212, 168, 83, 0.35);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: rgba(212, 168, 83, 0.08);
  margin-bottom: 20px;
}

.test-hero h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.12;
  font-weight: 800;
}

.test-hero-subtitle {
  margin-top: 16px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 15px;
}

.test-hero-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.test-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 14px 32px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: #d4a853;
  color: #080808;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.test-start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(212, 168, 83, 0.3);
}

/* ---- Disclaimer ---- */
.test-disclaimer {
  margin: 0 auto 32px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid rgba(212, 168, 83, 0.2);
  background: rgba(212, 168, 83, 0.05);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
}

/* ---- Quiz Section ---- */
.test-quiz {
  display: none;
}

.test-quiz.active {
  display: block;
}

/* Progress - Segmented Bar */
.test-progress {
  position: sticky;
  top: 60px;
  z-index: 10;
  background: var(--bg-primary);
  padding: 16px 0;
  margin-bottom: 24px;
}

.test-progress-section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 10px;
  text-align: center;
  transition: opacity 0.3s ease;
}

.test-progress-segments {
  display: flex;
  gap: 4px;
  width: 100%;
}

.test-progress-segment {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.test-progress-segment-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #d4a853, #f2d07a);
  transition: width 0.3s ease;
}

.test-progress-segment.completed .test-progress-segment-fill {
  width: 100%;
}

/* Keep legacy track hidden but functional for JS fallback */
.test-progress-track {
  display: none;
}

.test-progress-fill {
  height: 100%;
  width: 0;
}

.test-progress-text {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Section Intro Screens */
.test-section-intro {
  display: none;
  text-align: center;
  padding: 60px 20px;
  animation: testFadeIn 0.4s ease;
}

.test-section-intro.active {
  display: block;
}

.test-section-intro-title {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.test-section-intro-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

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

/* Question Cards */
.test-question {
  display: none;
  animation: testSlideIn 0.3s ease;
}

.test-question.active {
  display: block;
}

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

.test-question-text {
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 28px;
  color: var(--text-primary);
}

/* Scale Options - Stacked Card Layout */
.test-scale {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-scale-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-primary);
  font-family: inherit;
  width: 100%;
  text-align: left;
  position: relative;
}

.test-scale-btn:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-tertiary);
}

.test-scale-btn.selected {
  border-color: var(--accent-gold);
  background: rgba(212, 168, 83, 0.12);
}

.test-scale-btn.selected::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-gold);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23080808' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
  background-size: 14px;
  background-repeat: no-repeat;
  background-position: center;
}

.test-scale-emoji {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  color: var(--accent-gold);
}

.test-scale-value {
  display: none;
}

.test-scale-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

/* Nav Buttons */
.test-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
}

.test-nav-back,
.test-nav-next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.test-nav-back {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.test-nav-back:hover {
  border-color: var(--border-color-hover);
}

.test-nav-next {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  opacity: 0.5;
  pointer-events: none;
}

.test-nav-next.enabled {
  opacity: 1;
  pointer-events: auto;
  background: #d4a853;
  color: #080808;
  border-color: #d4a853;
}

.test-nav-next.enabled:hover {
  box-shadow: 0 2px 12px rgba(212, 168, 83, 0.3);
}

.test-nav svg {
  width: 16px;
  height: 16px;
}

/* ---- Results Section ---- */
.test-results {
  display: none;
}

.test-results.active {
  display: block;
}

.test-results-header {
  text-align: center;
  margin-bottom: 36px;
}

.test-score-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.test-score-number {
  font-size: clamp(56px, 12vw, 88px);
  font-weight: 800;
  color: var(--accent-gold);
  line-height: 1;
}

.test-score-max {
  font-size: 20px;
  color: var(--text-muted);
  font-weight: 400;
}

.test-result-band {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(212, 168, 83, 0.35);
  color: var(--accent-gold);
  background: rgba(212, 168, 83, 0.1);
}

/* Interpret Note */
.test-interpret-note {
  margin: 0 auto 28px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Profile Card */
.test-profile-card {
  margin-top: 24px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 24px;
}

.test-profile-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-gold);
}

.test-profile-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 14px;
}

.test-profile-field {
  margin-top: 20px;
}

.test-profile-field:first-child {
  margin-top: 0;
}

.test-profile-field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.test-profile-field-value {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 14px;
}

/* Wound Bars (Childhood Wound Map) */
.test-wound-bars {
  margin-top: 28px;
}

.test-wound-row {
  margin-bottom: 16px;
}

.test-wound-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.test-wound-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.test-wound-label.dominant {
  color: var(--accent-gold);
}

.test-wound-score {
  font-size: 13px;
  color: var(--text-muted);
}

.test-wound-bar-bg {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.test-wound-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.2);
  transition: width 0.6s ease;
  width: 0;
}

.test-wound-bar-fill.dominant {
  background: linear-gradient(90deg, #d4a853, #f2d07a);
}

/* ---- CTA Section ---- */
.test-ctas {
  margin-top: 36px;
}

.test-ctas h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px;
}

.test-cta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.test-cta-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-secondary);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.15s ease;
}

.test-cta-card:hover {
  border-color: var(--accent-gold);
}

.test-cta-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(212, 168, 83, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-size: 16px;
}

.test-cta-label {
  font-size: 14px;
  font-weight: 600;
}

.test-cta-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- Share ---- */
.test-share {
  margin-top: 28px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.test-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.test-share-btn:hover {
  border-color: var(--border-color-hover);
}

.test-share-btn.copied {
  border-color: #22c55e;
  color: #22c55e;
}

/* ---- Related Tests ---- */
.test-related {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.test-related h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.test-related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.test-related-link {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-secondary);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  transition: border-color 0.15s ease;
}

.test-related-link:hover {
  border-color: var(--accent-gold);
}

.test-related-link span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 4px;
}

/* ---- FAQ ---- */
.test-faqs {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.test-faqs h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
}

.test-faq-item {
  border-top: 1px solid var(--border-color);
  padding: 16px 0;
}

.test-faq-q {
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
}

.test-faq-q svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.test-faq-item.open .test-faq-q svg {
  transform: rotate(180deg);
}

.test-faq-a {
  display: none;
  margin-top: 10px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 14px;
}

.test-faq-item.open .test-faq-a {
  display: block;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .test-page-shell {
    padding: 96px 16px 20px;
  }

  .test-scale-btn {
    padding: 14px 16px;
  }

  .test-scale-emoji {
    font-size: 20px;
  }

  .test-scale-label {
    font-size: 14px;
  }

  .test-related-grid {
    grid-template-columns: 1fr;
  }

  .test-hero-meta {
    flex-direction: column;
    gap: 6px;
  }

  .test-share {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---- Light Mode ---- */
html[data-theme="light"] .test-progress-segment {
  background: rgba(71, 56, 37, 0.1);
}

html[data-theme="light"] .test-wound-bar-bg {
  background: rgba(71, 56, 37, 0.08);
}

html[data-theme="light"] .test-wound-bar-fill {
  background: rgba(71, 56, 37, 0.2);
}
