/* Assessment page styles */

/* Simpler background for assessment page */
.page-assessment {
  background: linear-gradient(180deg, var(--color-gradient-green) 0%, var(--color-bg-light) 40%);
}

/* Narrower container for report content */
.assessment-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--spacing-lg) var(--spacing-md);
}

/* --- Assessment header (logo) --- */

.assessment-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.assessment-logo {
  height: 48px;
  margin: 0 auto;
  transition: transform 0.2s;
}

.assessment-logo.logo-drop-active {
  transform: scale(1.1);
  filter: brightness(1.1);
}

/* --- Instruction text --- */

.assessment-instruction {
  text-align: center;
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--spacing-lg);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Survey carousel --- */

#survey-section {
  position: relative;
  min-height: 400px;
}

.survey-slide {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.survey-slide.slide-in {
  opacity: 0;
  transform: translateX(40px);
}

.survey-slide.slide-out {
  opacity: 0;
  transform: translateX(-40px);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

/* Progress dots */

.survey-progress {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background 0.3s, transform 0.3s;
}

.progress-dot.filled {
  background: var(--color-primary-light);
}

.progress-dot.active {
  background: var(--color-primary);
  transform: scale(1.3);
}

/* Nav (back + counter) */

.survey-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-sm);
}

.survey-back {
  background: none;
  border: none;
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  transition: background 0.15s;
}

.survey-back:hover {
  background: var(--color-bg-light);
}

.survey-counter {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  opacity: 0.7;
}

/* Disclaimer slide */

.disclaimer-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--spacing-sm);
}

.disclaimer-accept-btn {
  margin-top: var(--spacing-sm);
}

/* Question text */

.survey-question {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  color: var(--color-dark);
  margin-bottom: var(--spacing-md);
  line-height: var(--line-height-normal);
}

/* Glossary terms: dashed underline, whole word clickable */

.glossary-term {
  position: relative;
  display: inline;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-text-secondary);
  cursor: pointer;
}

.glossary-term:hover {
  text-decoration-color: var(--color-primary);
}

/* Also style glossary terms inside option buttons */
.l1-option .glossary-term,
.l2-option .glossary-term {
  text-decoration-color: var(--color-border);
}

.tooltip-content {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: var(--spacing-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  width: 280px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  z-index: 10;
}

.tooltip-content.visible {
  display: block;
}

/* L1 options (radio-style vertical cards) */

.l1-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.l1-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: var(--font-size-sm);
  color: var(--color-dark);
  background: var(--color-bg-white);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

@media (hover: hover) {
  .l1-option:hover {
    border-color: var(--color-primary-light);
    background: var(--color-gradient-green);
  }
}

.l1-option.selected {
  border-color: var(--color-primary);
  background: rgba(132, 192, 98, 0.1);
}

/* L2 options (checkbox-style cards) */

.l2-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: var(--spacing-md);
}

.l2-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  padding-left: 2.5rem;
  font-family: inherit;
  font-size: var(--font-size-sm);
  color: var(--color-dark);
  background: var(--color-bg-white);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.l2-option::before {
  content: '';
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  transition: background 0.2s, border-color 0.2s;
}

@media (hover: hover) {
  .l2-option:hover {
    border-color: var(--color-primary-light);
  }
}

.l2-option.checked {
  border-color: var(--color-primary);
  background: rgba(132, 192, 98, 0.06);
}

.l2-option.checked::before {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

/* "None of the above" option — visual separator */

.l2-option-none {
  margin-top: var(--spacing-xs);
  border-style: dashed;
}

/* Next / Get Your Report button for L2 */

.survey-next-btn {
  display: block;
  width: 100%;
  margin-top: var(--spacing-xs);
}

.survey-next-btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

/* --- Report actions --- */

.report-actions {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

.report-actions .btn-outline,
.report-actions .share-text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.5rem;
}

/* --- Button outline variant --- */

.btn-outline {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  display: inline-block;
  padding: 0.6rem 1.5rem;
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
}

.btn-outline:hover {
  background: var(--color-bg-light);
  text-decoration: none;
}

/* --- Row selector --- */

.row-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.row-selector .label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.row-selector select {
  padding: 0.4rem 0.8rem;
  font-family: inherit;
  font-size: var(--font-size-sm);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg-white);
}

/* --- Report section --- */

.report-section {
  display: none;
}

.report-section.visible {
  display: block;
}

.section-heading {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-dark);
  margin-bottom: var(--spacing-sm);
}

.pattern-heading {
  font-weight: var(--font-weight-bold);
}

.intro-text {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-lg);
}

/* --- Dimension cards --- */

.dimension-card {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-sm);
  overflow: hidden;
}

.dimension-card summary {
  padding: var(--spacing-sm) var(--spacing-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-lg);
  list-style: none;
}

.dimension-card summary::-webkit-details-marker {
  display: none;
}

.dimension-card summary::before {
  content: '\25B8';
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  transition: transform 0.15s;
}

.dimension-card[open] summary::before {
  transform: rotate(90deg);
}

.dim-body {
  padding: 0 var(--spacing-md) var(--spacing-md);
}

.dim-body h4 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-xs);
  color: var(--color-dark);
}

.dim-body p {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
}

.dim-body ul {
  padding-left: 1.5rem;
  margin-top: var(--spacing-xs);
}

.dim-body li {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: 0.2rem;
}

.score-badge {
  font-size: var(--font-size-xs);
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-weight: var(--font-weight-medium);
  margin-left: auto;
  white-space: nowrap;
}

.score-badge.protective {
  background: rgba(76, 175, 80, 0.15);
  color: #2e7d32;
}

.score-badge.functional {
  background: rgba(255, 235, 59, 0.2);
  color: #9e6c00;
}

.score-badge.strained {
  background: rgba(255, 152, 0, 0.15);
  color: #bf360c;
}

.score-badge.high-concern {
  background: rgba(244, 67, 54, 0.15);
  color: #c62828;
}

/* --- Divider --- */

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--spacing-lg) 0;
}

/* --- Forecast section --- */

.forecast-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  opacity: 0.7;
  margin-bottom: var(--spacing-xs);
}

/* Pattern timeline (CSS flex bar) */

.pattern-timeline {
  display: flex;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: var(--spacing-sm);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.pattern-span {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.4rem;
  transition: opacity 0.15s;
}

.pattern-span:hover {
  opacity: 0.85;
}

/* Timeline date axis */

.timeline-axis {
  position: relative;
  height: 20px;
  margin-bottom: var(--spacing-xs);
}

.timeline-date {
  position: absolute;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  opacity: 0.7;
  transform: translateX(-50%);
  white-space: nowrap;
}

.timeline-date:first-child {
  transform: none;
}

.forecast-narrative {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-lg);
}

/* Back link */

.back-link {
  display: inline-block;
  margin-bottom: var(--spacing-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.back-link:hover {
  color: var(--color-text-primary);
}

/* --- Responsive --- */

@media (max-width: 768px) {
  .assessment-wrap {
    padding: var(--spacing-sm);
  }

  .survey-question {
    font-size: var(--font-size-lg);
  }

  .tooltip-content {
    width: 220px;
    left: auto;
    right: -1rem;
    transform: none;
  }

  .dimension-card summary {
    padding: var(--spacing-sm);
    font-size: var(--font-size-base);
  }

  #survey-section {
    min-height: 350px;
  }
}

@media (max-width: 480px) {
  .survey-progress {
    gap: 4px;
  }

  .progress-dot {
    width: 6px;
    height: 6px;
  }

  .l1-option,
  .l2-option {
    padding: 0.6rem 0.8rem;
    font-size: var(--font-size-xs);
  }

  .l2-option {
    padding-left: 2.2rem;
  }
}

@media (max-width: 375px) {
  .score-badge {
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
  }
}

/* --- User testing CTA --- */

.user-testing-cta {
  text-align: center;
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md) var(--spacing-md);
  border-radius: var(--radius-lg, 12px);
  background: rgba(255, 198, 127, 0.15);
}

.user-testing-text {
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
  line-height: var(--line-height-normal);
}

.btn-user-testing {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  font-size: var(--font-size-cta);
  padding: 0.85rem 2rem;
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
  border: none;
}

.btn-user-testing:hover {
  background: #ffb85c;
  transform: translateY(-1px);
}

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