/* First-Time Home Buyer flip book (/buyers-guide). Signature flip-book look: navy + aqua spreads,
   serif display type, page-turn animation, quick checks and a handwritten sign-off.
   Everything is scoped under .fb-stage so it doesn't touch the rest of the site. */
.fb-stage {
  --fb-navy: #071a33; --fb-blue: #0f78a8; --fb-aqua: #21b7cc; --fb-aqua-soft: #8ce9f5; --fb-ink: #05080d; --fb-mist: #eef6fa;
  --fb-serif: Baskerville, "Baskerville Old Face", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --fb-sans: Avenir, "Avenir Next", "Helvetica Neue", Arial, Helvetica, sans-serif;
  background: #03101f; color: #fff; padding: 48px 18px 40px; font-family: var(--fb-sans); overflow-x: hidden;
}
.fb { max-width: 1160px; margin: 0 auto; }
.fb-stage button { font: inherit; }
.fb-book { width: min(1120px, 100%); height: min(720px, 80vh); min-height: 580px; position: relative; perspective: 2200px; margin: 0 auto; }

/* Sheets + page turn */
.fb-sheet { position: absolute; inset: 0; transform-origin: left center; transform-style: preserve-3d; opacity: 0; pointer-events: none; z-index: 1;
  transition: transform .85s cubic-bezier(.2,.7,.2,1), opacity .25s; }
.fb-sheet.active { opacity: 1; pointer-events: auto; z-index: 2; }
.fb-sheet.turning { z-index: 4; opacity: .4; transform: rotateY(-92deg); pointer-events: none; transition: transform .85s cubic-bezier(.2,.7,.2,1), opacity .85s; }
.fb-sheet.turning.slow { transition: transform 2.2s cubic-bezier(.25,.6,.25,1), opacity 1.8s; }
.fb-sheet.turningBack { z-index: 4; animation: fbTurnBack .6s cubic-bezier(.2,.7,.2,1); }
.fb-sheet.leaving { z-index: 1; opacity: 1; transition: none; pointer-events: none; }
@keyframes fbTurnBack { from { transform: rotateY(-92deg); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .fb-sheet, .fb-sheet.turning, .fb-sheet.turning.slow { transition: opacity .2s; transform: none; }
  .fb-sheet.turningBack { animation: none; }
}

.fb-page { height: 100%; width: 100%; background: #fff; color: var(--fb-ink); border-radius: 4px; overflow: hidden; box-shadow: 0 25px 80px rgba(0,0,0,.42); position: relative; }
.fb-spread { height: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.fb-half { padding: clamp(24px, 3.4vw, 46px); position: relative; overflow: hidden; min-width: 0; }
.fb-flex { display: flex; flex-direction: column; height: 100%; overflow-y: auto; scrollbar-width: none; }
.fb-flex::-webkit-scrollbar { display: none; }
.fb-full { height: 100%; }
.fb-navy { background: var(--fb-navy); color: #fff; }
.fb-blue { background: var(--fb-blue); color: #fff; }
.fb-white { background: #fff; color: var(--fb-ink); }
.fb-mist { background: var(--fb-mist); color: var(--fb-navy); }

/* Type */
.fb-stage h1, .fb-stage h2, .fb-stage h3 { font-family: var(--fb-serif); font-weight: 400; margin: 0; overflow-wrap: break-word; }
.fb-stage h1 { font-size: clamp(40px, 5.4vw, 78px); line-height: .9; letter-spacing: -.035em; }
.fb-stage h2 { font-size: clamp(30px, 3.6vw, 50px); line-height: .98; letter-spacing: -.025em; }
.fb-stage h3 { font-size: clamp(20px, 2.1vw, 27px); line-height: 1.1; margin-bottom: 10px; }
.fb-kicker { font-size: 10px; letter-spacing: .32em; text-transform: uppercase; font-weight: 800; color: var(--fb-blue); line-height: 1.35; }
.fb-navy .fb-kicker, .fb-blue .fb-kicker { color: var(--fb-aqua-soft); }
.fb-teal { color: var(--fb-aqua); }
.fb-navytext { color: var(--fb-navy); }
.fb-body { font-size: clamp(14px, 1.3vw, 17px); line-height: 1.4; max-width: 560px; margin: 10px 0; }
.fb-fine { font-size: 11.5px; line-height: 1.35; color: #4d6072; margin: 10px 0 0; }
.fb-fine a { color: var(--fb-blue); font-weight: 800; }
.fb-fine.fb-light { color: #b8cad6; }
.fb-rule { height: 4px; width: 84px; background: var(--fb-aqua); margin: 14px 0; flex: none; }
.fb-huge { font-family: var(--fb-serif); font-size: clamp(64px, 9vw, 130px); line-height: .8; color: var(--fb-aqua); letter-spacing: -.03em; }
.fb-signature { font-family: "Segoe Script", "Bradley Hand", "Brush Script MT", cursive; font-size: clamp(24px, 2.6vw, 34px); color: var(--fb-aqua); transform: rotate(-3deg); display: inline-block; width: max-content; line-height: 1.2; padding: 0 4px; margin-top: 10px; }
.fb-signature.fb-onblue { color: #fff; margin-top: auto; }
button.fb-link { background: none; border: 0; cursor: pointer; text-align: left; }
button.fb-link:hover { color: var(--fb-aqua-soft); }
.fb-footerMark { margin-top: auto; padding-top: 14px; font-family: var(--fb-serif); letter-spacing: .2em; font-size: 12px; line-height: 1.25; opacity: .9; }
.fb-pageNo { position: absolute; bottom: 16px; right: 22px; font-size: 11px; letter-spacing: .2em; opacity: .55; }
.fb-spread + .fb-pageNo { color: #7f93a6; opacity: .8; }
.fb-stage a:not(.fb-cta) { text-decoration: underline; text-underline-offset: 2px; }

/* Cover + closing pages with photo */
.fb-avatar { position: absolute; right: 0; top: 0; height: 100%; width: 56%; object-fit: cover; object-position: center; filter: saturate(.92) contrast(1.02); }
.fb-avatarFade { position: absolute; inset: 0; background: linear-gradient(90deg, var(--fb-navy) 3%, var(--fb-navy) 42%, rgba(7,26,51,.7) 53%, rgba(7,26,51,.05) 78%); }
.fb-quote { position: relative; z-index: 2; width: 48%; height: 100%; display: flex; flex-direction: column; justify-content: center; padding-bottom: 60px; }
.fb-quote .fb-footerMark { display: none; }
.fb-cover .fb-footerMark, .fb-finalClose ~ .fb-footerMark { position: absolute; left: clamp(24px, 3.4vw, 46px); bottom: 18px; z-index: 3; color: #fff; }
.fb-finalClose { justify-content: flex-start; padding-top: clamp(22px, 3vw, 40px); overflow-y: auto; scrollbar-width: none; }
.fb-finalClose::-webkit-scrollbar { display: none; }
.fb-summary { margin: 12px 0; padding: 12px 14px; border-left: 4px solid var(--fb-aqua); background: rgba(255,255,255,.09); font-size: 13px; line-height: 1.4; }
.fb-summary b { color: var(--fb-aqua-soft); }
.fb-ctas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fb-cta { display: inline-block; background: var(--fb-aqua); color: #04101e; text-decoration: none; padding: 13px 18px; border-radius: 999px; font-weight: 900; font-size: 12px; letter-spacing: .04em; }
.fb-cta:hover { background: var(--fb-aqua-soft); }
.fb-cta.fb-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
.fb-cta.fb-ghost:hover { border-color: var(--fb-aqua); color: var(--fb-aqua-soft); }

/* Lists */
.fb-ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; font-size: clamp(13px, 1.2vw, 15px); line-height: 1.38; max-width: 520px; }
.fb-ticks li { padding-left: 24px; position: relative; }
.fb-ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--fb-aqua-soft); font-weight: 900; }
.fb-ticks b { color: var(--fb-aqua-soft); }
.fb-blue .fb-ticks li::before { color: var(--fb-navy); }
.fb-ticks a { color: #fff; font-weight: 800; }
.fb-tight { gap: 7px; margin-top: 8px; }

/* Quick checks */
.fb-quiz { margin-top: 14px; border: 1px solid #b8cad6; background: #fff; padding: 13px; max-width: 540px; flex: none; }
.fb-quiz h3 { font-size: clamp(17px, 1.7vw, 21px); color: var(--fb-navy); margin-bottom: 8px; }
.fb-quizmini { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--fb-blue); font-weight: 800; margin-bottom: 7px; }
.fb-navy .fb-quizmini { color: var(--fb-aqua-soft); }
.fb-quizopts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fb-quizopt { border: 1px solid #bdccd5; background: #fff; color: var(--fb-navy); padding: 9px 10px; text-align: left; cursor: pointer; font-weight: 700; font-size: 12px; line-height: 1.2; min-height: 40px; }
.fb-quizopt:hover { border-color: var(--fb-aqua); }
.fb-quizopt[aria-pressed="true"] { border-color: var(--fb-aqua); background: #e8f9fc; }
.fb-quizresult { display: none; margin-top: 8px; padding: 10px; background: var(--fb-navy); color: #fff; line-height: 1.35; font-size: 12.5px; }
.fb-quizresult.show { display: block; }
.fb-quizresult b { color: var(--fb-aqua-soft); }
.fb-quizresult a { color: var(--fb-aqua-soft); font-weight: 800; }

/* Calculator */
.fb-calc { margin-top: 6px; display: grid; gap: 12px; }
.fb-field { display: grid; gap: 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; color: var(--fb-blue); }
.fb-field > span { display: flex; justify-content: space-between; align-items: baseline; }
.fb-field output { font-family: var(--fb-serif); font-size: 24px; letter-spacing: 0; text-transform: none; color: var(--fb-navy); font-weight: 400; }
.fb-field input[type="range"] { width: 100%; accent-color: var(--fb-blue); }
.fb-seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.fb-seg button { border: 1px solid #bdccd5; background: #fff; color: var(--fb-navy); padding: 7px 4px; cursor: pointer; font-weight: 800; font-size: 13px; letter-spacing: 0; text-transform: none; }
.fb-seg button small { display: block; font-size: 9px; font-weight: 700; color: #4d6072; margin-top: 2px; }
.fb-seg button[aria-checked="true"] { border-color: var(--fb-aqua); background: #e8f9fc; }
.fb-calcgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fb-calcgrid > div { background: #fff; border: 1px solid rgba(7,26,51,.12); padding: 10px 12px; }
.fb-calcgrid small { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #4d6072; font-weight: 800; }
.fb-calcgrid b { font-family: var(--fb-serif); font-weight: 400; font-size: clamp(17px, 1.7vw, 22px); color: var(--fb-navy); }

/* Roadmap */
.fb-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.fb-card { border: 1px solid rgba(7,26,51,.15); padding: 11px 12px; min-height: 76px; background: #fff; cursor: pointer; transition: .2s; text-align: left; color: var(--fb-navy); }
.fb-card:hover, .fb-card[aria-pressed="true"] { transform: translateY(-3px); border-color: var(--fb-aqua); box-shadow: 0 12px 30px rgba(0,0,0,.08); }
.fb-card[aria-pressed="true"] { background: #e8f9fc; }
.fb-card i { font-style: normal; display: block; font-size: 10px; letter-spacing: .2em; font-weight: 900; color: var(--fb-blue); }
.fb-card b { display: block; font-family: var(--fb-serif); font-weight: 400; font-size: clamp(16px, 1.6vw, 20px); line-height: 1.05; margin-top: 4px; }
.fb-card span { display: block; margin-top: 4px; font-size: 11px; color: #4d6072; }
.fb-stepdetail { margin-top: 12px; padding: 13px 15px; background: var(--fb-navy); color: #fff; font-size: 14px; line-height: 1.4; max-width: 820px; }
.fb-stepdetail b { color: var(--fb-aqua-soft); font-family: var(--fb-serif); font-weight: 400; font-size: 20px; display: block; margin-bottom: 3px; }

/* Checklists */
.fb-checklist { display: grid; gap: 2px; }
.fb-checklist label { display: flex; gap: 9px; align-items: flex-start; padding: 6px 0; font-size: 13px; line-height: 1.3; border-bottom: 1px solid rgba(7,26,51,.08); cursor: pointer; }
.fb-checklist.fb-dark label { border-color: rgba(255,255,255,.12); }
.fb-checklist input { margin-top: 2px; accent-color: var(--fb-aqua); width: 16px; height: 16px; flex: none; }
.fb-checklist input:checked + * , .fb-checklist label:has(input:checked) { opacity: .75; }
.fb-score { margin-top: 8px; font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--fb-blue); }
.fb-navy .fb-score { color: var(--fb-aqua-soft); }

/* Offer anatomy */
.fb-anatomy { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.fb-anatomy > div { border: 1px solid rgba(7,26,51,.15); padding: 11px 12px; }
.fb-anatomy b { font-family: var(--fb-serif); font-weight: 400; font-size: 20px; color: var(--fb-navy); display: block; }
.fb-anatomy span { font-size: 12.5px; line-height: 1.3; color: #4d6072; display: block; margin-top: 3px; }

/* Controls */
.fb-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; }
.fb-navbtn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid #31506d; background: #081d35; color: #fff; font-size: 20px; cursor: pointer; }
.fb-navbtn:hover:not(:disabled) { border-color: var(--fb-aqua); }
.fb-navbtn:disabled { opacity: .35; cursor: default; }
.fb-progress { min-width: 110px; text-align: center; font-size: 12px; letter-spacing: .14em; }
.fb-dot { width: 7px; height: 7px; background: var(--fb-aqua); border-radius: 50%; display: inline-block; margin: 0 5px; vertical-align: middle; }
.fb-autoBtn { height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid #31506d; background: #081d35; color: #fff; font-weight: 900; font-size: 11px; letter-spacing: .12em; cursor: pointer; white-space: nowrap; }
.fb-autoBtn[aria-pressed="true"] { color: var(--fb-aqua-soft); border-color: var(--fb-aqua); }
.fb-contents { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 16px; }
.fb-contents button { background: transparent; border: 1px solid #274562; color: #b8cad6; border-radius: 999px; padding: 7px 12px; font-size: 11px; letter-spacing: .08em; cursor: pointer; }
.fb-contents button:hover { border-color: var(--fb-aqua); color: #fff; }
.fb-contents button[aria-current="true"] { background: var(--fb-aqua); border-color: var(--fb-aqua); color: #04101e; font-weight: 800; }
.fb-stage:focus-within .fb-book { outline: none; }
.fb-stage button:focus-visible, .fb-stage a:focus-visible, .fb-stage input:focus-visible { outline: 2px solid var(--fb-aqua-soft); outline-offset: 2px; }
.fb-noscript { text-align: center; color: #b8cad6; }
.fb-after h2 { margin-top: 10px; }

/* Tablet */
@media (max-width: 980px) {
  .fb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fb-card { min-height: 0; }
}

/* Phones: spreads stack and scroll inside the page so nothing overlaps. */
@media (max-width: 780px) {
  .fb-stage { padding: 28px 10px 30px; }
  .fb-book { height: 76vh; min-height: 600px; }
  .fb-spread { display: block; height: 100%; overflow-y: auto; scrollbar-width: none; }
  .fb-spread::-webkit-scrollbar { display: none; }
  .fb-spread > .fb-half { height: auto; overflow: visible; }
  .fb-half { padding: 26px 22px; }
  .fb-flex { min-height: 0; }
  .fb-spread + .fb-pageNo { display: none; }
  .fb-avatar { width: 100%; height: 45%; opacity: .6; }
  .fb-avatarFade { background: linear-gradient(180deg, rgba(7,26,51,.25) 0%, rgba(7,26,51,.92) 40%, var(--fb-navy) 55%); }
  .fb-quote { width: 100%; justify-content: flex-end; padding-bottom: 54px; }
  .fb-finalClose { justify-content: flex-start; padding-top: 34%; }
  .fb-seg { grid-template-columns: repeat(3, 1fr); }
  .fb-anatomy { grid-template-columns: 1fr; }
  .fb-quizopts { grid-template-columns: 1fr 1fr; }
  .fb-full { overflow-y: auto; }
  .fb-nav { gap: 8px; }
}
@media (max-width: 420px) {
  .fb-progress { min-width: 76px; }
  .fb-autoBtn { padding: 0 11px; font-size: 10px; }
  .fb-quizopts { grid-template-columns: 1fr; }
}
