/* State of Biohacking 2026 — Survey Form */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  --s-orange: #e8630a;
  --s-orange-light: #fff4eb;
  --s-orange-mid: #fde0c5;
  --s-blue: #3DA5FF;
  --s-blue-light: #eef7ff;
  --s-bg: #f6f5f3;
  --s-card: #ffffff;
  --s-text: #1a1a1a;
  --s-muted: #71717a;
  --s-border: #e4e4e7;
  --s-radius: 10px;
  --s-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Reset within survey scope */
.survey-wrap * { box-sizing: border-box; }

.survey-wrap {
  font-family: var(--s-font);
  color: var(--s-text);
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  -webkit-font-smoothing: antialiased;
}

/* ── Progress bar ── */
.survey-progress-track {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--s-bg);
  padding: 12px 0 8px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}
.survey-progress-bar {
  height: 4px;
  background: var(--s-border);
  border-radius: 2px;
  overflow: hidden;
}
.survey-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--s-orange), #f59e0b);
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Section dots */
.survey-progress-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.prog-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--s-border);
  background: var(--s-card);
  font-family: var(--s-font);
  font-size: 12px;
  font-weight: 700;
  color: var(--s-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
}
.prog-dot:hover {
  border-color: var(--s-orange);
  color: var(--s-orange);
  transform: scale(1.1);
}
.prog-dot.active {
  background: var(--s-orange);
  border-color: var(--s-orange);
  color: #fff;
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(232, 99, 10, 0.3);
}
.prog-dot.completed {
  background: var(--s-blue-light);
  border-color: var(--s-blue);
  color: var(--s-blue);
}

.survey-progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--s-muted);
  margin-top: 6px;
  letter-spacing: 0.02em;
  text-align: center;
}

/* ── Header ── */
.survey-hero {
  text-align: center;
  padding: 32px 0 24px;
  animation: ux-fadeInUp 0.5s ease-out;
}
.survey-hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  line-height: 1.2;
}
.survey-hero h1 span {
  color: var(--s-orange);
}
.survey-hero .hero-sub {
  font-size: 14px;
  color: var(--s-muted);
  margin: 0 0 24px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 600;
}

/* Inline mock card */
.hero-card-preview {
  margin: 0 auto 0;
  max-width: 100%;
}
.survey-hero {
  margin-bottom: 40px;
}
.mock-card {
  border-radius: var(--s-radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  background: #fff;
  font-family: var(--s-font);
  pointer-events: none;
  user-select: none;
  position: relative;
  opacity: 0.92;
}
.mock-sample-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 1;
}
.mock-header {
  background: linear-gradient(135deg, #e8630a, #f59e0b);
  color: #fff;
  padding: 18px 20px;
  text-align: center;
}
.mock-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.mock-sub { font-size: 10px; opacity: 0.85; }
.mock-body { padding: 20px; }
.mock-level { text-align: center; margin-bottom: 14px; }
.mock-level-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: linear-gradient(135deg, #e8630a, #f59e0b);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}
.mock-level-title { font-size: 16px; font-weight: 700; }
.mock-bars { margin-bottom: 24px; }
.mock-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
}
.mock-bar-label {
  flex: 0 0 105px;
  text-align: right;
  color: #4b5563;
}
.mock-bar {
  flex: 1;
  height: 8px;
  background: #e5e5e7;
  border-radius: 4px;
  overflow: hidden;
}
.mock-bar div {
  height: 100%;
  background: linear-gradient(90deg, #e8630a, #f59e0b);
  border-radius: 4px;
}
.mock-bar-score {
  flex: 0 0 70px;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.mock-bar-score em {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  color: #e8630a;
  margin-left: 3px;
}
.mock-labels {
  text-align: center;
  font-size: 10px;
  color: #4b5563;
  margin-top: 16px;
  margin-bottom: 28px;
  line-height: 1.8;
}
.mock-labels b { color: #1a1a1a; }
.mock-labels img.emoji, .mock-labels img.wp-smiley { margin-left: 15px !important; }
.mock-traits {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mock-traits span {
  display: inline-block;
  padding: 3px 10px;
  background: #3DA5FF;
  color: #fff;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

/* Value props */
.hero-props {
  text-align: left;
  max-width: 440px;
  margin: 0 auto 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-prop {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--s-text);
}
.hero-prop-icon {
  flex-shrink: 0;
  font-size: 18px;
}

/* CTA */
.hero-cta-wrap {
  text-align: center;
  margin-top: 8px;
}
.hero-cta-btn {
  display: inline-block;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--s-orange), #f59e0b);
  color: #fff;
  border: none;
  border-radius: var(--s-radius);
  font-size: 17px;
  font-weight: 700;
  font-family: var(--s-font);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(232,99,10,0.3);
}
.hero-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232,99,10,0.4);
}
.hero-meta {
  font-size: 13px;
  color: var(--s-muted);
  margin: 12px 0 0;
}

/* ── Section container ── */
.section-container {
  position: relative;
  overflow: hidden;
}

/* ── Section ── */
.survey-section {
  display: none;
  opacity: 0;
  transform: translateX(0);
}
.survey-section.active {
  display: block;
  opacity: 1;
  animation: ux-fadeInUp 0.4s ease-out;
}

/* Transitions */
.survey-section.exit-left {
  animation: ux-slideOutLeft 0.35s ease-in forwards;
}
.survey-section.exit-right {
  animation: ux-slideOutRight 0.35s ease-in forwards;
}
.survey-section.enter-right {
  animation: ux-slideInRight 0.4s ease-out;
}
.survey-section.enter-left {
  animation: ux-slideInLeft 0.4s ease-out;
}

/* ── Section header ── */
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 16px;
}
.section-icon {
  font-size: 22px;
  line-height: 1;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-count {
  font-size: 12px;
  color: var(--s-muted);
  font-weight: 500;
  margin-left: auto;
  background: var(--s-blue-light);
  padding: 3px 10px;
  border-radius: 20px;
  color: var(--s-blue);
}

/* ── Question card ── */
.q-card {
  background: var(--s-card);
  border: 1px solid var(--s-border);
  border-radius: var(--s-radius);
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  animation: ux-fadeInUp 0.4s ease-out both;
}
/* Stagger card animations within a section */
.survey-section.active .q-card:nth-child(2) { animation-delay: 0.05s; }
.survey-section.active .q-card:nth-child(3) { animation-delay: 0.10s; }
.survey-section.active .q-card:nth-child(4) { animation-delay: 0.15s; }
.survey-section.active .q-card:nth-child(5) { animation-delay: 0.20s; }
.survey-section.active .q-card:nth-child(6) { animation-delay: 0.25s; }
.survey-section.active .q-card:nth-child(7) { animation-delay: 0.30s; }
.survey-section.active .q-card:nth-child(8) { animation-delay: 0.35s; }
.survey-section.active .q-card:nth-child(9) { animation-delay: 0.40s; }
.survey-section.active .q-card:nth-child(10) { animation-delay: 0.45s; }

.q-card:hover {
  border-color: #d4d4d8;
}
.q-card.q-answered {
  border-color: #b8dbf8;
  box-shadow: 0 0 0 1px #b8dbf8;
}
.q-card.q-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px #fecaca;
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.q-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.q-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--s-orange-light);
  color: var(--s-orange);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.q-answered .q-num {
  background: var(--s-blue);
  color: #fff;
  transform: scale(1.05);
}
.q-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
}
.q-hint {
  font-size: 12px;
  color: var(--s-muted);
  margin-top: 2px;
  font-weight: 400;
  display: block;
}

/* ── Choice pills (radio + checkbox) ── */
.q-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.q-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--s-border);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  background: var(--s-card);
  line-height: 1.3;
}
.q-pill:hover {
  border-color: #a1a1aa;
  background: #fafafa;
  transform: translateY(-1px);
}
.q-pill:active {
  transform: translateY(0) scale(0.98);
}
.q-pill.selected {
  border-color: var(--s-orange);
  background: var(--s-orange-light);
  color: var(--s-orange);
  font-weight: 600;
  animation: ux-pillPop 0.25s ease-out;
}

.q-pill .pill-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--s-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.q-pill.q-radio .pill-check {
  border-radius: 50%;
}
.q-pill.selected .pill-check {
  border-color: var(--s-orange);
  background: var(--s-orange);
}
.q-pill.selected .pill-check svg {
  opacity: 1;
}
.q-pill .pill-check svg {
  opacity: 0;
  width: 10px;
  height: 10px;
  transition: opacity 0.15s;
}

/* "Other" text input */
.q-other-input {
  margin-top: 8px;
  display: none;
}
.q-other-input.visible {
  display: block;
  animation: ux-fadeInUp 0.3s ease-out;
}
.q-other-input input {
  width: 100%;
  max-width: 300px;
  padding: 8px 12px;
  border: 1.5px solid var(--s-border);
  border-radius: 8px;
  font-family: var(--s-font);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s;
}
.q-other-input input:focus {
  border-color: var(--s-orange);
}

/* ── Supplement total follow-up ── */
.q-supp-followup {
  display: none;
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--s-orange-light);
  border-radius: 8px;
  border: 1px solid var(--s-orange-mid);
}
.q-supp-followup.visible {
  display: block;
  animation: ux-fadeInUp 0.3s ease-out;
}
.supp-followup-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--s-text);
  margin-bottom: 8px;
}
.supp-followup-input {
  width: 100px;
  padding: 8px 12px;
  border: 1.5px solid var(--s-border);
  border-radius: 8px;
  font-family: var(--s-font);
  font-size: 14px;
  outline: none;
  text-align: center;
}
.supp-followup-input:focus {
  border-color: var(--s-orange);
}

/* ── Rating row ── */
.q-rating {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}
.q-rating-opt {
  flex: 1;
  min-width: 0;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--s-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  background: var(--s-card);
}
.q-rating-opt:hover {
  border-color: var(--s-orange);
  background: var(--s-orange-light);
  transform: translateY(-2px);
}
.q-rating-opt:active {
  transform: translateY(0) scale(0.95);
}
.q-rating-opt.selected {
  border-color: var(--s-orange);
  background: var(--s-orange);
  color: #fff;
  animation: ux-pillPop 0.25s ease-out;
  box-shadow: 0 2px 8px rgba(232, 99, 10, 0.25);
}
.q-rating-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: var(--s-muted);
}

/* ── Navigation bar ── */
.survey-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 16px;
  gap: 12px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--s-bg) 80%, transparent);
  padding-bottom: 20px;
  padding-top: 32px;
  z-index: 50;
}
.survey-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  border: 2px solid var(--s-border);
  border-radius: 10px;
  font-family: var(--s-font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--s-card);
  color: var(--s-text);
}
.survey-nav-btn svg {
  width: 18px;
  height: 18px;
}
.survey-nav-btn:hover {
  border-color: var(--s-orange);
  color: var(--s-orange);
  transform: translateY(-1px);
}
.survey-nav-btn:active {
  transform: translateY(0);
}
.survey-back-btn {
  background: transparent;
}
.survey-next-btn {
  background: var(--s-orange);
  color: #fff;
  border-color: var(--s-orange);
}
.survey-next-btn:hover {
  background: #d45808;
  border-color: #d45808;
  color: #fff;
  box-shadow: 0 4px 16px rgba(232, 99, 10, 0.3);
}
.survey-next-btn.survey-submit-btn {
  background: linear-gradient(135deg, var(--s-orange), #f59e0b);
  border-color: var(--s-orange);
  padding: 14px 36px;
  font-size: 16px;
  letter-spacing: 0.01em;
}
.survey-next-btn.survey-submit-btn:hover {
  box-shadow: 0 6px 20px rgba(232, 99, 10, 0.35);
  transform: translateY(-2px);
}
.survey-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.survey-error-msg {
  color: #ef4444;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  flex: 1;
  display: none;
}
.survey-error-msg.visible {
  display: block;
  animation: ux-fadeInUp 0.3s ease-out;
}

.answer-now-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--s-orange);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
}
.answer-now-link:hover {
  color: #b45309;
}

/* Warning state for submit with skipped questions */
.survey-warning-btn {
  background: linear-gradient(135deg, #d97706, #b45309) !important;
}

/* ── Footer note ── */
.survey-footer {
  text-align: center;
  font-size: 12px;
  color: var(--s-muted);
  padding: 16px 0;
}
.survey-footer a {
  color: var(--s-orange);
  text-decoration: none;
}

/* ── Loading state ── */
.survey-loading {
  text-align: center;
  padding: 60px 0;
}
.survey-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--s-border);
  border-top-color: var(--s-orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 640px) {
  .survey-wrap { padding: 16px 12px 100px; }
  .survey-hero h1 { font-size: 22px; }
  .survey-hero { padding: 20px 0 16px; }
  .hero-card-preview { max-width: 100%; }
  .hero-props { max-width: 100%; }
  .hero-cta-btn { width: 100%; padding: 14px 20px; }
  .q-card { padding: 18px 16px; }
  .q-pill { padding: 7px 11px; font-size: 13px; }
  .q-rating-opt { height: 38px; font-size: 13px; }
  .survey-nav { padding: 20px 0 16px; }
  .survey-nav-btn { padding: 10px 20px; font-size: 14px; }
  .survey-next-btn.survey-submit-btn { width: auto; padding: 12px 28px; }
  .prog-dot { width: 26px; height: 26px; font-size: 11px; }
  .section-head { padding: 8px 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .survey-section.active,
  .survey-section.exit-left,
  .survey-section.exit-right,
  .survey-section.enter-right,
  .survey-section.enter-left,
  .q-card,
  .q-pill.selected,
  .q-rating-opt.selected,
  .q-other-input.visible,
  .q-card.q-error {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
