/* Quiz-specific navigation highlight */
.nav-link[data-page="quiz"].active {
  color: var(--color-primary);
}

/* Quiz page container adjustments */
/* Updated to match actual ID in index.html */
#landingPage,
#quizPage {
  /* Reserve space for header+footer so pages don't force extra scroll space */
  min-height: calc(100vh - 140px);
  padding-bottom: var(--space-16, 16px);
}

/* Mobile responsive adjustments for quiz */
@media (max-width: 768px) {
  #quizPage {
    padding: var(--space-24) var(--space-12);
  }

  .quiz-container {
    max-width: 100%;
  }
}

/* Landing page layout: center hero and 3-column level cards */
#landingPage .container {
  min-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  justify-content: center; /* centers hero + cards vertically */
  align-items: center;
}

/* Hero constraints so content stays centered and doesn't span full width */
#landingPage .hero-section {
  max-width: 900px;
  width: 100%;
  margin-bottom: 1.5rem;
}

/* Grid for the three level cards */
#landingPage .level-cards {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

/* Card appearance */
#landingPage .level-card {
  background: var(--color-surface, #ffffff);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 220px;
  transition: transform .18s ease, box-shadow .18s ease;
  text-align: center;
}

/* Ensure quiz content doesn't create extra bottom whitespace */
#quizPage .quiz-container {
  padding-bottom: 8px;
  margin-bottom: 0;
}

/* Hover affordance */
#landingPage .level-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

/* Badge, title, audience and CTA spacing */
#landingPage .level-badge {
  background: var(--color-muted-surface, rgba(33,128,141,0.08));
  color: var(--color-primary, #21808d);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .85rem;
  margin-bottom: 10px;
  display: inline-block;
}

#landingPage .level-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.2;
}

#landingPage .level-audience {
  color: var(--color-muted, #6b7280);
  margin-bottom: 16px;
  font-size: .95rem;
}

/* Make CTA button easier to tap and aligned */
#landingPage .level-cta .btn {
  width: 100%;
  max-width: 260px;
  align-self: center;
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
  #landingPage .level-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #landingPage .container {
    padding-left: var(--space-12, 12px);
    padding-right: var(--space-12, 12px);
  }

  #landingPage .level-cards {
    grid-template-columns: 1fr;
  }

  #landingPage .level-card {
    min-height: auto;
    padding: 18px;
  }

  #landingPage .level-cta .btn {
    max-width: 100%;
  }
}

/* Results page styling */
#resultsPage {
  padding-top: 28px;
  padding-bottom: 36px;
  background: linear-gradient(180deg, rgba(246,249,250,0.6) 0%, rgba(255,255,255,0.4) 100%);
}

.results-hero-card {
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(255,255,255,0.8), rgba(255,255,255,0.95));
  padding: 22px;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(15,23,42,0.06);
  min-height: 220px;
}

.results-hero-left {
  flex: 1;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.results-title {
  margin: 0 0 8px;
  font-size: 1.6rem;
  line-height: 1.15;
}

.results-subtitle {
  margin: 0;
  color: var(--color-muted, #6b7280);
  margin-top: 6px;
  max-width: 640px;
}

.results-hero-right {
  width: 260px;
  flex: 0 0 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* Score circle layout */
.score-circle-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  min-width: 160px;
  min-height: auto;
  padding-bottom: 0;
}

/* wrapper around SVG so we can absolutely center the number relative to the circle */
.score-svg-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-circle {
  width: 160px;
  height: 160px;
  display: block;
}

/* Center the numeric value inside the SVG */
.score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 4px;
  pointer-events: none;
  background: transparent;
  z-index: 2;
}

.score-number {
  font-size: 36px;
  line-height: 1;
  font-weight: 700;
  color: var(--color-primary, #21808d);
}

.score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: baseline;
  gap: 6px;
  pointer-events: none;
  background: transparent;
}

.score-max {
  color: var(--color-muted, #6b7280);
  font-size: 0.95rem;
  line-height: 1;
  align-self: flex-end;
  margin-bottom: 2px;
}

/* Ensure stage text is below the circle and not overlapping */
.score-stage {
  margin-top: 18px;
  text-align: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Small-screen adjustments */
@media (max-width: 640px) {
  .score-svg-wrap { width: 140px; height: 140px; }
  .score-circle { width: 140px; height: 140px; }
  .score-number { font-size: 28px; }
  .score-max { font-size: 0.9rem; }
  .score-stage { margin-top: 10px; }
}

/* animate stroke when score updates */
.score-progress {
  transition: stroke-dashoffset 900ms cubic-bezier(.22,.9,.12,1);
}

/* Dimensions grid */
.dimensions-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.dimension-item {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 6px 16px rgba(15,23,42,0.04);
}

.dimension-item .dimension-name {
  font-weight: 600;
  margin-bottom: 8px;
}

.dimension-item .dimension-score {
  font-size: 1.25rem;
  color: var(--color-primary, #21808d);
}

/* Priorities */
.priorities-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.priority-card {
  background: linear-gradient(180deg,#fff,#fbfdfe);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 6px 16px rgba(15,23,42,0.04);
}

.priority-card h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.priority-card p {
  margin: 0;
  color: var(--color-muted,#6b7280);
  font-size: .95rem;
}

/* Email capture */
.email-form .form-control {
  flex: 1;
}

/* Results CTA */
.results-actions-row .btn {
  margin-right: 12px;
}

/* Responsive */
@media (max-width: 980px) {
  .results-hero-card {
    flex-direction: column;
    align-items: stretch;
  }

  .results-hero-right {
    width: 100%;
    margin-top: 12px;
  }

  .dimensions-container,
  .priorities-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .dimensions-container,
  .priorities-container {
    grid-template-columns: 1fr;
  }

  .score-value {
    margin-top: -110px;
  }

  .results-title {
    font-size: 1.35rem;
  }
}

/* Card body for quiz cards */
.card__body {
  padding: 20px;
}

/* Options container */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Quiz option items */
.option-item {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #ffffff;
  gap: 12px;
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.option-item span {
  flex: 1;
  line-height: 1.5;
  color: #374151;
}

.option-item:hover {
  background: rgba(33,128,141,0.05);
  border-color: var(--color-primary, #21808d);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.option-item.selected {
  background: rgba(33,128,141,0.08);
  border-color: var(--color-primary, #21808d);
  border-width: 2px;
}

.option-item.selected span {
  color: #1f2937;
  font-weight: 500;
}

/* Quiz header and progress */
.quiz-header {
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.status {
  font-size: 0.85rem;
  color: var(--color-muted, #6b7280);
  padding: 4px 8px;
  background: rgba(33,128,141,0.1);
  border-radius: 4px;
}

.section-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-primary, #21808d);
  font-weight: 600;
}

.section-heading {
  font-size: 1.5rem;
  margin-bottom: 16px;
  font-weight: 600;
}

/* List bullets */
.list-bullets {
  list-style: none;
  padding-left: 0;
}

.list-bullets li {
  padding-left: 24px;
  position: relative;
  margin-bottom: 8px;
}

.list-bullets li:before {
  content: "•";
  position: absolute;
  left: 8px;
  color: var(--color-primary, #21808d);
  font-weight: bold;
}

/* Page visibility */
.page {
  display: block;
}

.page.hidden {
  display: none;
}

.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; display:flex; align-items:center; justify-content:center; background: rgba(0,0,0,0.4); z-index: 1000; }
.modal__dialog { width: min(560px, 92vw); background:#fff; border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,0.2); overflow:hidden; }
.modal__header, .modal__footer { padding:16px 18px; }
.modal__body { padding:0 18px 18px; }
.modal__header { border-bottom:1px solid #eee; display:flex; align-items:center; justify-content:space-between; }
.modal__footer { border-top:1px solid #eee; display:flex; gap:8px; justify-content:flex-end; }
.modal__close { background:none; border:none; font-size:20px; line-height:1; cursor:pointer; }
.chips .chip { display:inline-block; background:#f4f6f8; color:#444; padding:6px 10px; border-radius:999px; font-size:12px; margin-right:6px; }
.toasts { position: fixed; bottom: 20px; right: 20px; display:flex; flex-direction:column; gap:10px; z-index: 1001; }
.toast { background:#1f2937; color:#fff; padding:10px 14px; border-radius:8px; box-shadow:0 6px 20px rgba(0,0,0,0.25); font-size:14px; }
.toast { background:#1f2937; color:#fff; padding:10px 14px; border-radius:8px; box-shadow:0 6px 20px rgba(0,0,0,0.25); font-size:14px; transition: opacity .4s ease; }

/* Loading Overlay for Quiz Analysis */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  display: none;
}

.loading-content {
  text-align: center;
  padding: 2rem;
  max-width: 500px;
}

.spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem;
  border: 4px solid #e9eef0;
  border-top-color: var(--color-primary, #21808d);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-primary, #21808d);
  margin-bottom: 0.75rem;
}

.loading-text {
  font-size: 1rem;
  color: #666;
  line-height: 1.5;
}