/* ═══════════════════════════════════════════════════════════
   NestVerdict — First-Time Home Buyer Guide Styles
═══════════════════════════════════════════════════════════ */

.guide-hero {
  padding-top: calc(var(--header-h) + 32px);
  padding-bottom: 24px;
  background: var(--off-white);
  border-bottom: 1px solid var(--gray-100);
}
.guide-hero__inner { max-width: 760px; }
.guide-hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: 6px;
}
.guide-hero__sub {
  font-size: 14.5px;
  font-weight: 300;
  color: var(--gray-600);
  line-height: 1.6;
  max-width: 640px;
}

.guide-main { padding: 24px 0 60px; }

/* ── Quiz panel ───────────────────────────────────────────── */
.quiz-panel {
  max-width: 560px;
  margin: 0 auto 40px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px 28px;
}
.quiz-progress {
  height: 6px;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  overflow: hidden;
  margin-bottom: 24px;
}
.quiz-progress__fill {
  height: 100%;
  background: var(--teal);
  border-radius: var(--radius-sm);
  transition: width .25s ease;
}
.quiz-question {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 18px;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}
.quiz-option {
  width: 100%;
  text-align: left;
  padding: 13px 16px;
}
.quiz-option--selected {
  background: var(--teal-dim);
  border-color: var(--teal);
  color: var(--navy);
}
.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.quiz-nav__spacer { flex: 1; }

/* ── Results header ───────────────────────────────────────── */
.guide-results__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.guide-results__eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--teal-text);
  margin-bottom: 4px;
}
.guide-results__identity {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}
.guide-results__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Affordability estimator ─────────────────────────────── */
.afford-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px 24px 20px;
  margin-bottom: 32px;
}
.afford-card__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.afford-card__sub {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 16px;
}
.afford-card__result {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--teal-dim);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.afford-card__result-label {
  font-size: 12.5px;
  color: var(--gray-600);
}
.afford-card__result-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}
.afford-card__result-limit {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--navy);
  width: 100%;
}
.afford-card__result-note {
  font-size: 11.5px;
  color: var(--gray-400);
  width: 100%;
}

/* ── Phase roadmap ────────────────────────────────────────── */
.phase-roadmap {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.phase-roadmap__item {
  flex: 1;
  min-width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--gray-400);
  transition: background .2s ease, color .2s ease;
}
.phase-roadmap__item:hover { background: var(--gray-50); }
.phase-roadmap__num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.phase-roadmap__label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
}
.phase-roadmap__item--current {
  color: var(--navy);
}
.phase-roadmap__item--current .phase-roadmap__num {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

/* ── Phase accordions ─────────────────────────────────────── */
.phase {
  margin-bottom: 10px;
}
.print-phase-title { display: none; }
.phase-accordion {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.phase-accordion summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}
.phase-accordion summary::-webkit-details-marker { display: none; }
.phase-accordion__marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-50);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.phase-accordion__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  flex: 1;
}
.phase-accordion__here {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--teal-text);
  background: var(--teal-dim);
  padding: 4px 10px;
  border-radius: 100px;
}
.phase-accordion[open] .phase-accordion__marker {
  background: var(--teal);
  color: var(--white);
}
.phase-accordion__body {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.guide-step h3 {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.guide-step > p {
  font-size: 13.5px;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 8px;
}
.guide-step__checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.guide-step__checklist li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  color: var(--navy);
  line-height: 1.5;
}
.guide-step__checklist li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}
.guide-step__tip {
  font-size: 12.5px;
  color: var(--gray-600);
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

/* Not relevant to the quiz answers: hidden by default, still present in the DOM/markup (so the
   page stays crawlable with JS disabled) — "See full guide" reveals everything again via CSS. */
.guide-results:not(.guide-results--full) .step--irrelevant {
  display: none;
}
.guide-results:not(.guide-results--full) .phase--empty {
  display: none;
}

.cross-link {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 8px;
}
.cross-link a { color: var(--teal-text); font-weight: 600; }

.guide-cta {
  margin-top: 48px;
  background: var(--navy);
  border-radius: var(--radius-xl);
  padding: 44px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.guide-cta__bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(43,168,160,.20) 0%, transparent 60%);
  pointer-events: none;
}
.guide-cta__inner { position: relative; z-index: 1; }
.guide-cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
}
.guide-cta p {
  font-size: 15px;
  color: rgba(255,255,255,.70);
  margin-bottom: 22px;
}

.guide-extras {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.guide-extra-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
}
.guide-extra-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.guide-extra-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.pdf-note {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-top: 8px;
}

.guide-disclaimer {
  margin-top: 24px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--gray-400);
  text-align: center;
}
.print-disclaimer { display: none; }

.email-form {
  display: flex;
  gap: 8px;
}
.email-form input {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border-radius: 100px;
  border: 1.5px solid var(--gray-100);
  background: var(--off-white);
  font-size: 14px;
  min-width: 0;
}
.email-form input:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--white);
}
.email-form__success {
  font-size: 13px;
  color: var(--teal-text);
  font-weight: 500;
}
.email-form__success[hidden] { display: none; }

@media (max-width: 1024px) {
  .guide-extras { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .guide-cta { padding: 32px 22px; }
  .guide-results__actions { width: 100%; }
  .phase-roadmap__item { min-width: 76px; }
}

/* ── Print (Download PDF) ─────────────────────────────────── */
.print-brand-footer, .print-brand-header { display: none; }

@media print {
  .header, .mobile-menu, .mobile-menu-backdrop, .footer,
  .quiz-panel, .afford-card, .phase-roadmap, .guide-cta, .guide-extras,
  .guide-results__actions, .guide-disclaimer, .cross-link { display: none !important; }
  body { background: var(--white); }
  /* @page margins (verified via test rendering to reserve consistent space on every printed page,
     not just the first) create a 30mm top/bottom band on an A4 page (237mm tall content box).
     Chromium's position:fixed containing block for print is that CONTENT box (already inset by
     the @page margin), not the full physical page — so the header sits at a NEGATIVE top (pulling
     it up into the reserved top band) and the footer sits at a top offset just past the content
     box's own height (pushing it down into the reserved bottom band). Also confirmed by testing:
     `position: fixed; bottom: 0` does not render at all in this print engine — `top` is the only
     direction that reliably repeats on every page, hence both use `top`, never `bottom`. */
  @page { size: A4 portrait; margin: 32mm 12mm 34mm; }

  .print-brand-header {
    display: flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    top: -20mm; left: 0; right: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
  }
  .print-brand-header__logo-img { height: 22px; width: auto; }
  .print-brand-header__logo-text { font-family: var(--font-display); font-size: 14px; font-weight: 700; }
  .print-brand-header__accent { color: var(--teal-text); }
  .print-brand-header__title {
    margin-left: auto;
    font-size: 11px;
    color: var(--gray-600);
  }

  /* Content box is ~237mm tall; 240mm sits just past its end, inside the 30mm bottom margin band. */
  .print-brand-footer {
    display: block;
    position: fixed;
    top: 233mm; left: 0; right: 0;
    padding-top: 6px;
    border-top: 1px solid var(--gray-200);
    background: var(--white);
  }
  .print-brand-footer__brand {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }
  .print-brand-footer__logo { font-family: var(--font-display); font-size: 11px; font-weight: 700; color: var(--navy); }
  .print-brand-footer__accent { color: var(--teal-text); }
  .print-brand-footer__url { font-size: 9px; color: var(--gray-400); }
  .print-disclaimer {
    display: block;
    font-size: 8px;
    line-height: 1.35;
    color: var(--gray-400);
    margin-top: 3px;
  }

  .phase-accordion { break-inside: avoid; box-shadow: none; }

  /* <details>/<summary> have flaky, inconsistent fragmentation behavior across print page
     breaks — confirmed via test rendering: whenever a phase's <summary> landed as the very
     first thing on a fresh page, it silently failed to render at all (while the exact same
     heading printed fine mid-page). A plain heading element doesn't have this bug, so print
     uses a static duplicate instead of the interactive summary. */
  .phase-accordion summary { display: none; }
  .print-phase-title {
    display: block;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    margin: 18px 0 6px;
  }
  .phase:first-child .print-phase-title { margin-top: 0; }
}
