/* ============ Holy Quest — Root Discovery Form ============ */

:root {
  --forest: #17281e;
  --forest-soft: #203a2a;
  --forest-softer: #2a4936;
  --cream: #faf3e2;
  --cream-text: #f4ecd8;
  --white: #ffffff;
  --gold: #b8912f;
  --gold-soft: #d8c48a;
  --ink: #221e16;
  --muted: #75705f;
  --muted-on-dark: #b9c2b6;
  --divider-light: #e4dcc5;
  --divider-dark: #2c4436;
  --error: #a13544;

  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'General Sans', 'Helvetica Neue', Arial, sans-serif;

  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.85rem);
  --text-sm: clamp(0.875rem, 0.83rem + 0.2vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.1rem);
  --text-2xl: clamp(2rem, 1.4rem + 3vw, 3.2rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --radius-sm: 0.4rem;
  --radius-md: 0.7rem;
  --radius-lg: 1.1rem;

  --shadow-md: 0 10px 30px rgba(23, 40, 30, 0.14);
  --shadow-lg: 0 20px 60px rgba(23, 40, 30, 0.22);

  --transition: 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ Progress bar ============ */

.progress-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--forest);
  padding: var(--space-2) var(--space-5) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.progress-phase {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.progress-track {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold));
  transition: width 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold-soft);
  white-space: nowrap;
}

/* ============ Layout ============ */

.wizard {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(var(--space-16) + var(--space-4)) var(--space-5) var(--space-24);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.step {
  display: none;
  animation: fadeUp 480ms cubic-bezier(0.16, 1, 0.3, 1);
}

.step.active {
  display: block;
}

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

/* ============ Cover / intro step ============ */

.step-cover {
  background: var(--forest);
  color: var(--cream-text);
  margin: calc(var(--space-16) * -1) calc(var(--space-5) * -1) 0;
  padding: calc(var(--space-16) + var(--space-2)) var(--space-6) var(--space-10);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
}

.step-cover .kicker {
  color: var(--gold);
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.step-cover h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-2xl);
  color: var(--white);
  line-height: 1.05;
  margin-bottom: var(--space-3);
}

.step-cover .sub {
  color: var(--gold-soft);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
}

.self-impact {
  display: flex;
  width: 100%;
  max-width: 420px;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.self-impact div {
  flex: 1;
}

.self-impact .label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--white);
}

.self-impact .tag {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold-soft);
  margin-top: var(--space-1);
}

.self-impact .impact-col {
  text-align: right;
}

.emblem {
  width: 104px;
  height: 104px;
  margin: 0 auto var(--space-4);
  filter: drop-shadow(0 8px 24px rgba(184, 145, 47, 0.3));
}

.step-cover .tagline {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: var(--space-6);
}

.step-cover .why-word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  color: var(--gold-soft);
}

.step-cover .why-caption {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted-on-dark);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.step-cover p.lede {
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--cream-text);
  margin-bottom: var(--space-3);
  max-width: 30ch;
}

.step-cover p.desc {
  font-size: var(--text-base);
  color: var(--muted-on-dark);
  margin-bottom: var(--space-6);
  max-width: 38ch;
}

/* ============ Section steps ============ */

.section-kicker {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-3);
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  color: var(--forest);
  line-height: 1.12;
  margin-bottom: var(--space-4);
  display: flex;
  gap: 0.4ch;
}

.section-heading .num {
  color: var(--gold);
}

.gold-divider {
  height: 2px;
  background: var(--gold);
  width: 56px;
  margin-bottom: var(--space-6);
}

.step-prompt {
  font-style: italic;
  color: var(--muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
}

.step-question {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--ink);
  margin-bottom: var(--space-5);
  line-height: 1.3;
}

.step-note {
  font-style: italic;
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: var(--space-4);
}

/* Dark panel variant (sections 9, cover-adjacent) */
.step.dark {
  background: var(--forest);
  color: var(--cream-text);
  margin: calc(var(--space-16) * -1) calc(var(--space-5) * -1) calc(var(--space-24) * -1);
  padding: calc(var(--space-16) + var(--space-6)) var(--space-6) var(--space-24);
  min-height: 100dvh;
}

.step.dark .section-kicker {
  color: var(--gold);
}
.step.dark .section-heading {
  color: var(--white);
}
.step.dark .step-question {
  color: var(--cream-text);
}
.step.dark .step-prompt,
.step.dark .step-note {
  color: var(--muted-on-dark);
}

/* ============ Option cards (single-select, radio) ============ */

.option-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.option-card {
  display: block;
  cursor: pointer;
}

.option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card .card-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--divider-light);
  background: var(--white);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.step.dark .option-card .card-inner {
  background: var(--forest-soft);
  border-color: var(--divider-dark);
}

.option-card .check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid var(--gold);
  margin-top: 2px;
  position: relative;
  transition: background var(--transition);
}

.option-card input:checked ~ .card-inner .check {
  background: var(--gold);
}

.option-card input:checked ~ .card-inner .check::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid var(--forest);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.option-card input:checked ~ .card-inner {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 8%, var(--white));
  transform: translateY(-1px);
}

.step.dark .option-card input:checked ~ .card-inner {
  background: color-mix(in srgb, var(--gold) 16%, var(--forest-soft));
}

.option-card .headline {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--ink);
}

.step.dark .option-card .headline {
  color: var(--cream-text);
}

.option-card .subtext {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-top: var(--space-1);
}

.step.dark .option-card .subtext {
  color: var(--muted-on-dark);
}

/* Emphasized "ALL IN" style card */
.option-card.emphasis .card-inner,
.step.dark .option-card.emphasis .card-inner {
  background: var(--gold);
  border-color: var(--gold);
}
.option-card.emphasis .headline,
.option-card.emphasis .subtext,
.step.dark .option-card.emphasis .headline,
.step.dark .option-card.emphasis .subtext {
  color: var(--forest);
}
.option-card.emphasis .check {
  border-color: var(--forest);
}
.option-card.emphasis input:checked ~ .card-inner .check {
  background: var(--forest);
}
.option-card.emphasis input:checked ~ .card-inner .check::after {
  border-color: var(--gold);
}

/* ============ Chip rows (single-select, hairline) ============ */

.chip-list {
  display: flex;
  flex-direction: column;
}

.chip-row {
  cursor: pointer;
}

.chip-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-row .chip-inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-1);
  border-bottom: 1px solid var(--divider-light);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--ink);
  transition: color var(--transition);
}

.step.dark .chip-row .chip-inner {
  border-bottom-color: var(--divider-dark);
  color: var(--cream-text);
}

.chip-row .dot {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid var(--gold-soft);
  flex-shrink: 0;
  position: relative;
}

.chip-row input:checked ~ .chip-inner .dot {
  background: var(--gold);
  border-color: var(--gold);
}
.chip-row input:checked ~ .chip-inner .dot::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0px;
  width: 4px;
  height: 7px;
  border: solid var(--forest);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.chip-row input:checked ~ .chip-inner {
  color: var(--gold);
}
.step.dark .chip-row input:checked ~ .chip-inner {
  color: var(--gold-soft);
}

/* ============ Text inputs ============ */

.field {
  margin-bottom: var(--space-5);
}

.field label {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--ink);
  margin-bottom: var(--space-2);
}

.step.dark .field label {
  color: var(--cream-text);
}

.field input[type='text'],
.field input[type='email'],
.field input[type='tel'],
.field textarea {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--gold-soft);
  background: transparent;
  padding: var(--space-2) var(--space-1) var(--space-3);
  font-size: var(--text-base);
  color: var(--ink);
  resize: none;
  transition: border-color var(--transition);
}

.step.dark .field input,
.step.dark .field textarea {
  border-bottom-color: var(--muted-on-dark);
  color: var(--cream-text);
}

.field input:focus,
.field textarea:focus {
  border-bottom-color: var(--gold);
}

.field textarea {
  line-height: 2.1;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 480px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* ============ Path cards (informational, section 10) ============ */

.path-card {
  border-left: 3px solid var(--gold-soft);
  padding: var(--space-3) 0 var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}

.path-card .title-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.path-card .title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--gold);
}

.path-card .tag {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted-on-dark);
  text-transform: uppercase;
}

.path-card .desc {
  font-size: var(--text-sm);
  color: var(--muted-on-dark);
  margin-top: var(--space-1);
}

.path-card.emphasis {
  border-left: none;
  background: var(--gold);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.path-card.emphasis .title,
.path-card.emphasis .desc {
  color: var(--forest);
}
.path-card.emphasis .tag {
  color: var(--forest-soft);
}

.closing-lines p {
  color: var(--cream-text);
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}
.closing-lines p.strong {
  font-weight: 600;
  color: var(--gold-soft);
}

/* ============ Nav buttons ============ */

.nav-row {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.btn {
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  border: 2px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  flex: 1;
  text-align: center;
}

.btn-primary {
  background: var(--gold);
  color: var(--forest);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border-color: var(--gold-soft);
  color: var(--ink);
  flex: 0 0 auto;
}
.step.dark .btn-ghost {
  color: var(--cream-text);
  border-color: var(--muted-on-dark);
}

.btn-cta {
  background: var(--gold);
  color: var(--forest);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  padding: var(--space-5) var(--space-8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
}
.btn-cta:hover {
  transform: translateY(-2px);
}
.btn-cta:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.hint {
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: var(--space-2);
  min-height: 1em;
}

/* ============ Success state ============ */

.step-success {
  background: var(--forest);
  color: var(--cream-text);
  margin: calc(var(--space-16) * -1) calc(var(--space-5) * -1) 0;
  padding: var(--space-6);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.step-success .emblem {
  width: 100px;
  height: 100px;
}

.step-success h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  color: var(--white);
  margin-bottom: var(--space-4);
}

.step-success p {
  color: var(--muted-on-dark);
  max-width: 34ch;
  margin-bottom: var(--space-2);
}

.social-row {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.social-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  color: var(--gold-soft);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.social-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.social-link:hover,
.social-link:focus-visible {
  color: var(--forest);
  background: var(--gold);
  border-color: var(--gold);
}

.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.privacy-note {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--muted-on-dark);
  margin-top: var(--space-3);
}

.footer-mark {
  position: fixed;
  bottom: var(--space-3);
  left: 0;
  right: 0;
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-soft);
  opacity: 0.6;
  pointer-events: none;
  z-index: 40;
}

.step.dark ~ .footer-mark,
body:has(.step.dark.active) .footer-mark {
  color: var(--muted-on-dark);
}

/* ==========================================================================
   Home links — tie Root Discovery back to Holy Quest Total Vision
   ========================================================================== */

/* Persistent "← Holy Quest Total Vision" chip, top-left on every step */
.home-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--gold-soft);
  text-decoration: none;
  background: rgba(23, 40, 30, 0.55);
  border: 1px solid rgba(216, 196, 138, 0.22);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0.78;
  transition: opacity 200ms ease, background 200ms ease, color 200ms ease, transform 200ms ease, border-color 200ms ease;
  z-index: 45;
}

.home-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.home-link:hover,
.home-link:focus-visible {
  opacity: 1;
  background: rgba(184, 145, 47, 0.92);
  border-color: rgba(216, 196, 138, 0.6);
  color: var(--forest);
  transform: translateY(-1px);
  outline: none;
}

/* On dark steps, keep the chip readable */
.step.dark ~ .home-link,
body:has(.step.dark.active) .home-link {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(216, 196, 138, 0.3);
  color: var(--gold-soft);
}

/* Mobile: tuck the chip smaller so it doesn't crowd the progress shell */
@media (max-width: 640px) {
  .home-link {
    top: calc(var(--space-2));
    left: calc(var(--space-2));
    padding: 0.4rem 0.7rem;
    font-size: 0.66rem;
    letter-spacing: 0.05em;
  }
  .home-link span {
    display: none;
  }
  .home-link svg {
    width: 15px;
    height: 15px;
  }
  /* Give it a slightly larger tap target on mobile */
  .home-link {
    min-width: 34px;
    min-height: 34px;
    justify-content: center;
  }
}

/* Wrap the emblem in an anchor without breaking existing layout */
.emblem-link {
  display: block;
  width: fit-content;
  margin: 0 auto;
  text-decoration: none;
  border-radius: 50%;
  transition: transform 300ms ease, filter 300ms ease;
}

.emblem-link:hover .emblem,
.emblem-link:focus-visible .emblem {
  filter: drop-shadow(0 10px 32px rgba(184, 145, 47, 0.55));
  transform: scale(1.03);
}

.emblem-link:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 6px;
}

.emblem-link .emblem {
  transition: transform 300ms ease, filter 300ms ease;
}

/* Big "Return to Holy Quest Total Vision" CTA on the success step */
.return-home-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6ch;
  margin: var(--space-6) auto 0;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  transition: background 220ms ease, color 220ms ease, border-color 220ms ease, transform 220ms ease;
}

.return-home-cta svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.return-home-cta:hover,
.return-home-cta:focus-visible {
  background: var(--gold);
  color: var(--forest);
  border-color: var(--gold);
  transform: translateY(-1px);
  outline: none;
}

/* Footer mark as link — keep the existing look, just make it clickable */
.footer-mark.footer-mark--link {
  text-decoration: none;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 220ms ease, color 220ms ease;
}

.footer-mark.footer-mark--link:hover,
.footer-mark.footer-mark--link:focus-visible {
  opacity: 1;
  color: var(--gold);
  outline: none;
}
