:root {
  color-scheme: light;
  --bg: #f4efe8;
  --card: rgba(255, 250, 245, 0.94);
  --text: #1f2933;
  --muted: #52606d;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-soft: #d7f2ef;
  --border: #e6ddd1;
  --shadow: 0 24px 60px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top, rgba(15, 118, 110, 0.16), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.75), transparent 18%),
    linear-gradient(180deg, #f8f4ee 0%, var(--bg) 100%);
  color: var(--text);
}

a {
  color: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.page-shell-left {
  margin-left: 24px;
  margin-right: auto;
}

.page-shell-tight {
  padding-top: 24px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.card {
  padding: 40px 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.auth-card {
  width: min(100%, 560px);
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
}

.dashboard-section-heading {
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.subtitle {
  margin: 16px 0 28px;
  line-height: 1.6;
  color: var(--muted);
  font-size: 1.08rem;
}

.subtitle-wide {
  max-width: 38rem;
}

.body-copy {
  margin: 0;
  max-width: 42rem;
  line-height: 1.75;
  color: var(--text);
  font-size: 1.04rem;
}

.primary-button,
.secondary-button,
.ghost-button,
.consultation-button {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-size: 1rem;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.secondary-button {
  border: 1px solid var(--border);
  color: var(--text);
  background: #ffffff;
}

.consultation-button {
  background: #f59e0b;
  color: #ffffff;
}

.consultation-button:hover {
  background: #d97706;
  transform: translateY(-1px);
}

.ghost-button {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
}

.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.small-link {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.small-link:hover {
  color: var(--accent-dark);
}

.landing-hero {
  min-height: calc(100vh - 80px);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 360px);
  gap: 24px;
  align-items: center;
}

.landing-copy {
  padding: 28px 0;
}

.metric-card {
  padding: 28px;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.1), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.metric-label {
  display: block;
  margin-bottom: 18px;
  font-weight: 700;
  font-size: 0.95rem;
}

.metric-list,
.report-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
}

.report-card .report-list {
  margin-top: 14px;
}

.referral-display {
  margin: auto 0 0;
  padding-top: 18px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.6;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
}

.ref-note,
.disclaimer,
.supporting-text,
.sidebar-note,
.form-note,
.question-description {
  color: var(--muted);
  line-height: 1.7;
}

.success-message {
  color: var(--accent-dark);
  line-height: 1.7;
}

.cta-row {
  display: flex;
  gap: 12px;
  margin: 32px 0 18px;
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.quiz-sidebar,
.partner-sidebar {
  position: sticky;
  top: 24px;
  padding: 32px 28px;
  background: rgba(31, 41, 51, 0.96);
  color: #f6f7f8;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.quiz-sidebar .subtitle,
.quiz-sidebar .sidebar-note,
.partner-sidebar .sidebar-note {
  color: rgba(246, 247, 248, 0.78);
}

.partner-shell {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.partner-nav {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.partner-nav a {
  padding: 10px 14px;
  border-radius: 14px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}

.partner-main {
  display: grid;
  gap: 24px;
}

.referral-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.referral-box input {
  flex: 1 1 280px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font: inherit;
  font-size: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.dashboard-grid-cta {
  margin-top: 4px;
}

.dashboard-grid-single-card {
  grid-template-columns: minmax(0, 1fr);
}

.stat-card {
  display: grid;
  gap: 10px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  font-size: 2rem;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}

.table-wrap-scroll-y {
  max-height: 1060px;
  overflow-y: auto;
  padding-right: 6px;
}

.table-wrap-scroll-compact {
  max-height: 360px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.table-wrap-scroll-y .data-table {
  margin-top: 0;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table-wrap-scroll-y .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255, 250, 245, 0.98);
}

.data-table th.leaderboard-number-cell,
.data-table td.leaderboard-number-cell {
  text-align: center;
}

.leaderboard-highlight-row td {
  background: #fee2e2;
}

.progress-panel {
  padding: 18px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 18px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #84dcc6, #d7f2ef);
  transition: width 0.25s ease;
}

.quiz-card {
  min-height: 70vh;
}

.question-wrap,
.center-state,
.left {
  max-width: 640px;
}

.question-step {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.option-grid {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.option-button {
  width: 100%;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #ffffff;
  text-align: left;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.option-button:hover,
.option-button.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.question-footer {
  margin-top: 22px;
}

.button-reset {
  width: auto;
}

.center-state {
  min-height: 58vh;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 12px;
}

.center-state.left,
.left {
  justify-items: start;
  text-align: left;
}

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 4px solid rgba(15, 118, 110, 0.14);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

.score-badge,
.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 1.2rem;
}

.score-preview-line {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.1;
  font-weight: 700;
  color: var(--text);
}

.score-preview-number {
  display: inline;
}

.score-preview-band {
  margin: 8px 0 0;
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--muted);
  font-weight: 700;
}

.score-risk-low,
.score-risk-excellent {
  color: #166534;
}

.score-risk-mild {
  color: #ca8a04;
}

.score-risk-moderate {
  color: #ea580c;
}

.score-risk-high {
  color: #b91c1c;
}

.score-badge.score-risk-low,
.score-badge.score-risk-moderate,
.score-badge.score-risk-high,
.score-pill.score-risk-low,
.score-pill.score-risk-moderate,
.score-pill.score-risk-high {
  background: transparent;
}

.weak-area-chip-row,
.cta-grid,
.auth-links,
.inline-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-action-row {
  margin-top: 18px;
}

.stacked-action-form {
  margin-top: 18px;
}

.weak-area-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  font-size: 0.92rem;
}

.lead-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.lead-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.settings-group {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.65);
}

.settings-group legend {
  padding: 0 8px;
  font-weight: 700;
  color: var(--accent-dark);
}

.settings-field-spaced {
  margin-top: 8px;
}

.lead-form .checkbox-inline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  font-weight: 400;
  margin-top: 6px;
  width: fit-content;
  font-size: 0.92rem;
  font-style: italic;
  color: var(--muted);
}

.checkbox-inline-conditional[hidden] {
  display: none !important;
}

.lead-form .checkbox-inline input {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.lead-form input,
.lead-form select,
.lead-form textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text);
  background: #ffffff;
}

.filters-grid input,
.filters-grid select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text);
  background: #ffffff;
}

.phone-input-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
}

.form-error {
  color: #b42318;
}

.report-shell {
  display: grid;
  gap: 24px;
}

.filters-grid,
.detail-grid {
  display: grid;
  gap: 14px;
}

.filters-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 20px;
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 16px 0;
}

.raw-box {
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border);
  overflow: auto;
  white-space: pre-wrap;
}

.stats-bars {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.stats-bar-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.weak-area-detail-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.weak-area-detail-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
}

.weak-area-detail-item p {
  margin: 0;
}

.highlight-danger {
  color: #b42318;
}

.hover-card-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: default;
}

.hover-card {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 30;
  min-width: 240px;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(180, 35, 24, 0.16);
  background: rgba(31, 41, 51, 0.97);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.24);
  color: #f8fafc;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.hover-card-anchor:hover .hover-card,
.hover-card-anchor:focus-within .hover-card {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hover-card-row {
  display: block;
  line-height: 1.55;
  font-size: 0.92rem;
}

.hover-card-row + .hover-card-row {
  margin-top: 4px;
}

.hover-card-row strong {
  color: #d7f2ef;
}

.hover-card-list {
  margin: 8px 0 0 18px;
  padding: 0;
  line-height: 1.55;
  font-size: 0.92rem;
}

.hover-card-list li + li {
  margin-top: 4px;
}

.hover-card-list strong {
  color: #d7f2ef;
}

.hover-card-note {
  display: block;
  margin-top: 4px;
  line-height: 1.55;
  font-size: 0.92rem;
  color: #f8fafc;
  white-space: pre-wrap;
}

.weak-area-detail-item p + p {
  margin-top: 6px;
  color: var(--muted);
}

.report-header {
  text-align: left;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.report-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.report-card p {
  line-height: 1.75;
}

.report-list li {
  margin-bottom: 10px;
}

.report-list li span {
  display: inline-block;
}

.leader-list {
  display: grid;
  gap: 10px;
}

.leader-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.leader-num {
  min-width: 20px;
  font-weight: 700;
}

.leader-text {
  flex: 1;
}

.leader-text-stacked {
  display: grid;
  gap: 2px;
}

.leader-text-stacked span {
  display: block;
}

.leader-subtle-line {
  font-style: italic;
}

.compact li {
  margin-bottom: 4px;
}

.credibility-block {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.cta-card {
  text-align: left;
  margin-top: 16px;
}

.cta-card h2 {
  margin-bottom: 18px;
}

.consultation-button {
  margin-top: 6px;
}

.report-dashboard {
  max-width: 900px;
  margin: 0 auto;
}

.report {
  max-width: 900px;
  margin: auto;
}

.report-card {
  background: #f9f9f8;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.report-header-card {
  text-align: left;
}

.report-title {
  font-size: 28px;
  font-weight: 700;
}

.report-sub {
  color: #666;
}

.section-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
}

.score.excellent {
  color: green;
}

.score.mild {
  color: #d4a000;
}

.score.moderate {
  color: orange;
}

.score.high {
  color: red;
}

.score-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-number {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
}

.score-label {
  font-weight: 600;
}

.score-bar {
  height: 8px;
  background: #ddd;
  border-radius: 5px;
  overflow: hidden;
}

.score-fill {
  height: 8px;
  border-radius: 5px;
}

.score-fill--excellent {
  background: #1f7a6c;
}

.score-fill--mild {
  background: #d48b00;
}

.score-fill--moderate {
  background: #ea580c;
}

.score-fill--high {
  background: #b91c1c;
}

.risk-badge {
  display: inline-block;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  background: #e8f5f3;
}

.risk-badge--excellent {
  background: #e8f5f3;
  color: #166534;
}

.risk-badge--mild {
  background: #fff7dd;
  color: #a16207;
}

.risk-badge--moderate {
  background: #ffedd5;
  color: #c2410c;
}

.risk-badge--high {
  background: #fee2e2;
  color: #b91c1c;
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.domain-box {
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid #eee;
}

.tag-row {
  margin: 6px 0 10px;
}

.tag {
  display: inline-block;
  background: #ffe8e8;
  padding: 6px 10px;
  border-radius: 6px;
  margin: 4px;
}

.analysis-box {
  background: #eef4f3;
  padding: 14px;
  border-radius: 10px;
}

.action-grid {
  display: grid;
  gap: 10px;
}

.consult-box {
  background: #fff4e6;
  border-left: 4px solid #d48b00;
  padding: 14px;
  border-radius: 8px;
  margin-top: 14px;
}

.btn-consult {
  background: #d48b00;
  color: #fff;
  font-weight: 700;
}

.btn-danger {
  background: red;
  color: white;
  padding: 8px 12px;
  border: none;
  margin: 5px;
  cursor: pointer;
  border-radius: 8px;
  font: inherit;
}

.nav-reset-form {
  margin: 0;
}

.nav-reset-button {
  width: 100%;
}

.report.simple .report-card {
  background: #fff;
}

.report.wellness {
  background: #f4f7f6;
}

.report.wellness .report-card {
  background: #f4f7f6;
}

.report.longevity {
  background: #f9f9f8;
}

.report.longevity .report-card {
  background: #f9f9f8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.report.apple {
  background: #fff;
}

.report.apple .report-card {
  background: #fff;
  border: 1px solid #eee;
}

.report.apple .score-fill {
  background: #34c759;
}

.report.apple .tag {
  background: #e5f5ea;
}

.report.insidetracker {
  background: #f6f8fb;
}

.report.insidetracker .report-card {
  background: #fff;
  border: 1px solid #e0e6ef;
}

.report.insidetracker .score-fill {
  background: #00a3ff;
}

.report.insidetracker .tag {
  background: #ffe8e8;
}

.report.nuskin {
  background: #f5f7f6;
}

.report.nuskin .report-card {
  background: #fff;
  border-left: 4px solid #1f7a6c;
}

.report.nuskin .score-fill {
  background: #1f7a6c;
}

.report.nuskin .tag {
  background: #e8f5f3;
}

.apple .btn-primary {
  background: #34c759;
}

.insidetracker .btn-primary {
  background: #00a3ff;
}

.nuskin .btn-primary {
  background: #1f7a6c;
}

.longevity .btn-primary {
  background: #1f7a6c;
}

.wellness .btn-primary {
  background: #1f7a6c;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .landing-hero,
  .quiz-layout,
  .partner-shell,
  .report-grid,
  .dashboard-grid,
  .detail-grid,
  .domain-grid {
    grid-template-columns: 1fr;
  }

  .quiz-sidebar,
  .partner-sidebar {
    position: static;
  }

  .page-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100%, calc(100% - 24px));
    padding: 18px 0 32px;
  }

  .page-shell-left {
    margin-left: auto;
  }

  .card,
  .quiz-sidebar,
  .partner-sidebar {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .cta-grid,
  .cta-row,
  .auth-links,
  .referral-box {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
    text-align: center;
  }

  .phone-input-row {
    grid-template-columns: 1fr;
  }
}
