/* ==========================================================================
   Wayfinder Partners — Financial Health Checkup (page styles)
   Extends css/site.css and reuses the pd-* components from
   css/profit-diagnostic.css. This file only adds the fh-* pieces:
   the branch banner, pillar signal cards, waypoints, and the tool card.
   Accent: teal — the checkup spans all four journeys.
   ========================================================================== */

.fh-page { --accent: var(--teal); }

/* The global cyan focus ring is invisible on the white card; navy passes
   WCAG non-text contrast there. Dark sections keep cyan. */
.fh-page .pd-app :focus-visible { outline-color: var(--navy); }
.fh-page .fh-cta :focus-visible { outline-color: var(--cyan); }

/* Deep-dive branch banner above questions 5–8. --p carries the pillar color. */
.fh-branch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--p, var(--accent));
  background: color-mix(in srgb, var(--p, var(--accent)) 9%, #fff);
  border: 1px solid color-mix(in srgb, var(--p, var(--accent)) 30%, #fff);
  border-radius: 99px;
  padding: 7px 14px 7px 11px;
  margin-bottom: 16px;
}
.fh-branch__icon {
  display: inline-flex;
  width: 17px; height: 17px;
  flex: none;
}
.fh-branch__icon svg { width: 100%; height: 100%; }

/* Answer options: full-width rows read better for sentence-length answers */
.fh-options { grid-template-columns: 1fr; }
.fh-options .pd-option { font-size: 15px; line-height: 1.45; }

/* ---------- Results: the focus-area reading gauge ---------- */
.fh-reading {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 12px 40px;
  align-items: center;
  margin: 20px 0 6px;
}
.fh-reading__gauge svg { width: 100%; height: auto; display: block; }
.fh-gauge__track {
  fill: none;
  stroke: var(--mist);
  stroke-width: 21;
  stroke-linecap: round;
}
.fh-gauge__fill {
  fill: none;
  stroke: url(#fh-gg);
  stroke-width: 21;
  stroke-linecap: round;
  stroke-dasharray: var(--f) 1;
  stroke-dashoffset: var(--f);
}
.fh-gauge__marker circle { fill: #fff; stroke: var(--p, var(--accent)); stroke-width: 4.5; }
.fh-gauge__marker .c { fill: var(--p, var(--accent)); stroke: none; }
.fh-gauge__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 52px;
  letter-spacing: -0.02em;
  fill: var(--ink);
}
.fh-gauge__num .d { font-size: 24px; font-weight: 600; fill: var(--ink-faint); letter-spacing: 0; }
.fh-gauge__lbl {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .14em;
  fill: var(--p, var(--accent));
}
.fh-gauge__end {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .1em;
  fill: var(--ink-faint);
}
@media (prefers-reduced-motion: no-preference) {
  .fh-gauge__fill { animation: fhGaugeDraw 1.1s cubic-bezier(.3,.6,.25,1) .35s forwards; }
  @keyframes fhGaugeDraw { to { stroke-dashoffset: 0; } }
  .fh-gauge__marker {
    opacity: 0;
    animation: fhMarkerIn .4s var(--ease-out) 1.25s forwards;
  }
  @keyframes fhMarkerIn {
    from { opacity: 0; transform: scale(.4); transform-origin: center; transform-box: fill-box; }
    to   { opacity: 1; transform: scale(1);  transform-origin: center; transform-box: fill-box; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .fh-gauge__fill { stroke-dashoffset: 0; }
}
@media (max-width: 760px) {
  .fh-reading { grid-template-columns: 1fr; }
  .fh-reading__gauge { max-width: 300px; margin: 0 auto; }
  .fh-reading__text { text-align: left; }
}

/* ---------- Results: pillar signal cards ---------- */
.fh-signals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .fh-signals { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .fh-signals { grid-template-columns: 1fr; } }
.fh-signal {
  position: relative;
  background: var(--mist);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 18px 18px 16px;
}
.fh-signal--focus {
  background: color-mix(in srgb, var(--p) 7%, #fff);
  border-color: color-mix(in srgb, var(--p) 35%, #fff);
}
.fh-signal__flag {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--p);
}
.fh-signal__icon {
  display: inline-flex;
  width: 22px; height: 22px;
  color: var(--p);
  margin-bottom: 10px;
}
.fh-signal__icon svg { width: 100%; height: 100%; }
.fh-signal__name { font-size: 12.5px; font-weight: 600; color: var(--ink-faint); margin-bottom: 4px; line-height: 1.35; }
.fh-signal__level {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(17px, 2vw, 20px);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.fh-signal__meter { display: flex; gap: 5px; }
.fh-signal__meter .seg {
  height: 5px;
  flex: 1;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink-faint) 22%, #fff);
}
.fh-signal__meter .seg.on { background: var(--p); }

/* ---------- Results: waypoints ---------- */
.fh-waypoints {
  list-style: none;
  counter-reset: wp;
  display: grid;
  gap: 12px;
  max-width: 680px;
  margin: 0;
  padding: 0;
}
.fh-waypoints li {
  counter-increment: wp;
  position: relative;
  padding: 16px 20px 16px 58px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  color: var(--ink-soft);
}
.fh-waypoints li::before {
  content: counter(wp);
  position: absolute;
  left: 18px; top: 16px;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, #fff);
}

/* ---------- Results: recommended tool card ---------- */
.fh-tool {
  position: relative;
  display: block;
  max-width: 680px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 22px 20px;
  background: #fff;
  overflow: hidden;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.fh-tool::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad);
}
.fh-tool:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.fh-tool__kicker {
  font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--p, var(--accent));
  margin-bottom: 8px;
}
.fh-tool h4 { font-size: 18px; margin-bottom: 8px; }
.fh-tool__body { font-size: 14.5px; color: var(--ink-soft); max-width: 560px; }
.fh-tool .link-more { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  .fh-tool { transition: none; }
  .fh-tool:hover { transform: none; }
}

/* ---------- Results: booking CTA ---------- */
.fh-cta {
  position: relative;
  margin-top: 40px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 80%);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(28px, 4vw, 42px);
  overflow: hidden;
}
.fh-cta__bg {
  position: absolute;
  right: -30px; top: -20px;
  width: 420px; height: 300px;
  pointer-events: none;
  /* fade the route tail before it reaches the text column */
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 60%);
  mask-image: linear-gradient(100deg, transparent 30%, #000 60%);
}
.fh-cta__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr);
  gap: 32px 48px;
  align-items: start;
}
.fh-cta__kicker {
  font-size: 12px; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
}
.fh-cta h3 {
  font-size: clamp(22px, 2.8vw, 28px);
  letter-spacing: -0.018em;
  margin-bottom: 12px;
}
.fh-cta__body { color: var(--dark-body); font-size: 15.5px; max-width: 560px; }
.fh-cta__body strong { color: #fff; }
.fh-cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 24px;
}
.fh-cta__book {
  background: var(--cyan);
  color: var(--navy-2);
  font-size: 16.5px;
  padding: 18px 30px;
  box-shadow: 0 12px 32px -10px rgba(8,204,252,.45);
}
.fh-cta__book:hover { box-shadow: 0 14px 38px -8px rgba(8,204,252,.6); }
.fh-cta__book .arrow { background: rgba(8,15,30,.16); }
.fh-cta__adjust {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark-faint);
  padding: 10px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,.25);
}
.fh-cta__adjust:hover { color: #fff; }
.fh-cta__urgency {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--dark-faint);
}
.fh-cta__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.fh-cta__chips .chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--dark-body);
  border: 1px solid var(--line-dark);
  border-radius: 99px;
  padding: 8px 14px;
}
.fh-cta__chips .chip svg { width: 15px; height: 15px; color: var(--cyan); flex: none; }
.fh-cta__steps {
  border-left: 1px solid var(--line-dark);
  padding-left: 32px;
  align-self: center;
}
.fh-cta__steps-title {
  font-size: 12px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--dark-faint);
  margin-bottom: 16px;
}
.fh-cta__steps ol { display: grid; gap: 14px; margin: 0; padding: 0; }
.fh-cta__steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14.5px;
  color: var(--dark-body);
  line-height: 1.45;
}
.fh-cta__steps .n {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(8,204,252,.14);
  margin-top: 1px;
}
@media (max-width: 760px) {
  .fh-cta__grid { grid-template-columns: 1fr; gap: 26px; }
  .fh-cta__steps { border-left: none; border-top: 1px solid var(--line-dark); padding-left: 0; padding-top: 22px; }
  .fh-cta__bg { opacity: .5; }
  .fh-cta__book { width: 100%; justify-content: center; font-size: 15px; padding: 16px 18px; }
}

/* ==========================================================================
   Motion — question transitions, answer confirmation, results reveal.
   Everything is opacity/transform only (compositor-friendly: no layout or
   paint work per frame), and all of it disappears under reduced motion.
   ========================================================================== */

/* Crisper touch feedback: no gray tap flash, no double-tap zoom delay */
.fh-page .pd-option,
.fh-page .pd-controls .btn,
.fh-page .pd-back,
.fh-page .pd-restart,
.fh-page .pd-start {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.fh-options .pd-option:active { transform: scale(.985); }

/* Answer confirmation: chosen option pops once, the rest recede */
.fh-options .pd-option { transition: border-color .16s, background .16s, opacity .22s, transform .18s var(--ease-out); }
.fh-options .pd-option.is-dimmed { opacity: .45; }
.fh-options .pd-option.is-chosen { z-index: 1; }

@media (prefers-reduced-motion: no-preference) {
  /* Step entrance — forward glides up, back glides down */
  .fh-page .fh-in-fwd { animation: fhStepFwd .3s var(--ease-out) both; }
  .fh-page .fh-in-back { animation: fhStepBack .3s var(--ease-out) both; }
  @keyframes fhStepFwd  { from { opacity: 0; transform: translateY(16px); } }
  @keyframes fhStepBack { from { opacity: 0; transform: translateY(-16px); } }

  /* Options cascade in behind the question */
  .fh-options .pd-option {
    animation: fhOptIn .34s var(--ease-out) both;
    animation-delay: calc(60ms + var(--i, 0) * 50ms);
  }
  @keyframes fhOptIn { from { opacity: 0; transform: translateY(12px); } }

  .fh-options .pd-option.is-chosen { animation: fhChosen .32s var(--ease-out); }
  @keyframes fhChosen {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.016); }
    100% { transform: scale(1); }
  }

  /* Gate fields cascade like the options */
  .fh-page .pd-gate-grid .pd-field { animation: fhOptIn .34s var(--ease-out) both; }
  .fh-page .pd-gate-grid .pd-field:nth-child(1) { animation-delay: 60ms; }
  .fh-page .pd-gate-grid .pd-field:nth-child(2) { animation-delay: 110ms; }
  .fh-page .pd-gate-grid .pd-field:nth-child(3) { animation-delay: 160ms; }
  .fh-page .pd-gate-grid .pd-field:nth-child(4) { animation-delay: 210ms; }
  .fh-page .pd-gate-grid .pd-field:nth-child(5) { animation-delay: 260ms; }

  /* Results: signal cards cascade, meters draw in, waypoints follow */
  .fh-signal {
    animation: fhOptIn .38s var(--ease-out) both;
    animation-delay: calc(120ms + var(--i, 0) * 80ms);
  }
  .fh-signal__meter .seg.on {
    transform-origin: left center;
    animation: fhSegIn .45s var(--ease-out) both;
    animation-delay: calc(320ms + var(--i, 0) * 80ms + var(--s, 0) * 90ms);
  }
  @keyframes fhSegIn { from { transform: scaleX(0); } }

  .fh-waypoints li {
    animation: fhOptIn .36s var(--ease-out) both;
    animation-delay: calc(140ms + var(--wp, 0) * 70ms);
  }
  .fh-waypoints li:nth-child(1) { --wp: 0; }
  .fh-waypoints li:nth-child(2) { --wp: 1; }
  .fh-waypoints li:nth-child(3) { --wp: 2; }
  .fh-waypoints li:nth-child(4) { --wp: 3; }
}

/* ==========================================================================
   Mobile — tighter hero, roomier card, thumb-sized controls.
   Scoped to .fh-page so the other tools keep their current behavior.
   ========================================================================== */
@media (max-width: 640px) {
  /* Hero: keep the drama, halve the scroll tax */
  .fh-page .pd-hero .container {
    padding-top: calc(var(--header-h) + 30px);
    padding-bottom: 34px;
  }
  .fh-page .pd-hero__facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 22px;
    padding-top: 16px;
    font-size: 11.5px;
    line-height: 1.4;
    text-align: center;
  }
  .fh-page .pd-hero__facts strong { font-size: 14px; margin-bottom: 2px; }
  .fh-page .pd-hero__start { margin-top: 24px; }
  .fh-page .pd-start__circle { width: 46px; height: 46px; }

  /* Card: less chrome, more question */
  .fh-page .pd-shell .container { padding-left: 14px; padding-right: 14px; }
  .fh-page .pd-app { padding: 22px 18px 24px; }
  .fh-page .pd-progress { margin-bottom: 22px; }
  .fh-page .pd-step h2 { font-size: 20px; }
  .fh-page .pd-step .pd-support { font-size: 14.5px; margin-bottom: 20px; }
  .fh-options { gap: 10px; }
  .fh-options .pd-option { padding: 14px 15px; font-size: 14.5px; gap: 10px; }

  /* Controls: Continue becomes a full-width thumb target */
  .fh-page .pd-controls { margin-top: 26px; padding-top: 20px; gap: 10px; }
  .fh-page .pd-controls .btn {
    flex: 1;
    justify-content: center;
    padding: 16px 20px;
  }
  .fh-page .pd-back { flex: none; }

  /* Footline stacks quietly */
  .fh-page .pd-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
}

