/* Shared styles for the loan guide pages. Tokens match the homepage + matthew.mortgage reels brand. */
:root {
  --navy: #16305B;
  --navy2: #1F3D6E;
  --gold: #E08A4E;
  --copper: #B85C1E;
  --stone: #EDE6D6;
  --off: #F7F3EC;
  --white: #ffffff;
  --text: #1C2638;
  --body: #4D4A44;
  --muted: #6F6A60;
  --border: #E7DFD0;
  --green: #3A5233;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Instrument Sans', sans-serif;
  background: var(--off);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 84px;
}
a { color: var(--copper); }
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex-shrink: 0; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* top nav */
.nav { background: var(--navy); position: sticky; top: 0; z-index: 50; }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.nav-name { color: var(--white); text-decoration: none; font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.nav-name small { display: block; color: var(--gold); font-size: 0.62rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: rgba(255,255,255,0.75); text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.nav-links a:hover { color: var(--white); }
.nav-call { background: var(--gold); color: var(--navy) !important; padding: 8px 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nav-short { display: none; }
@media (max-width: 640px) {
  .nav-links a:not(.nav-call) { display: none; }
  .nav-num { display: none; }
  .nav-short { display: inline; }
}

/* breadcrumb */
.crumbs { font-size: 0.75rem; color: var(--muted); padding: 16px 0 0; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--copper); }
.byline { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

/* hero */
.hero { background: var(--navy); color: var(--white); border-radius: 18px; padding: 36px 24px; margin: 16px 0 0; display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center; }
.hero-eyebrow { color: var(--gold); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }
.hero h1 { font-size: 2rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 14px; }
.hero h1 span { color: var(--gold); }
.hero p { color: rgba(255,255,255,0.75); font-size: 1rem; max-width: 560px; }
.hero-photo { width: 140px; border-radius: 16px; border: 2px solid rgba(224,138,78,0.4); display: none; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
@media (min-width: 720px) {
  .hero { grid-template-columns: 1fr auto; padding: 44px 40px; }
  .hero h1 { font-size: 2.6rem; }
  .hero-photo { display: block; width: 180px; }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 20px; border-radius: 12px; font-family: inherit; font-size: 0.95rem; font-weight: 700; text-decoration: none; border: none; cursor: pointer; }
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-ghost { background: rgba(255,255,255,0.08); color: var(--white); border: 1px solid rgba(255,255,255,0.18); }
.btn-dark { background: var(--navy); color: var(--white); }

/* content */
main section { padding: 36px 0 0; }
h2 { font-size: 1.45rem; line-height: 1.25; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 18px 0 6px; }
main p { color: var(--body); margin-bottom: 12px; font-size: 0.98rem; }
main ul { list-style: none; margin: 8px 0 14px; }
main li { color: var(--body); padding-left: 26px; position: relative; margin-bottom: 8px; font-size: 0.97rem; }
main li::before { content: ''; position: absolute; left: 4px; top: 0.55em; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }

.card { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 22px; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.fact { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.fact b { display: block; font-size: 1.25rem; color: var(--navy); }
.fact span { font-size: 0.78rem; color: var(--muted); }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(4, 1fr); } }

.steps { counter-reset: step; display: grid; gap: 10px; margin-top: 14px; }
.step { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 16px 16px 16px 58px; position: relative; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 16px; top: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--gold); font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; }
.step b { display: block; margin-bottom: 2px; }
.step p { margin: 0; font-size: 0.92rem; }

.callout { background: var(--stone); border-left: 4px solid var(--copper); border-radius: 12px; padding: 16px 18px; margin: 14px 0; }
.callout p { margin: 0; color: var(--text); }

.compare { width: 100%; border-collapse: collapse; margin-top: 12px; background: var(--white); border-radius: 14px; overflow: hidden; font-size: 0.9rem; }
.compare th, .compare td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare th { background: var(--navy); color: var(--white); font-weight: 600; }
.compare td { color: var(--body); }
.compare tr:last-child td { border-bottom: none; }

/* rates page */
.rates-widget { background: var(--white); border: 1px solid var(--border); border-radius: 16px; padding: 12px; margin-top: 12px; }
.rates-widget iframe { display: block; border: 0; }
.rates-widget-lg { display: none !important; }
@media (min-width: 720px) { .rates-widget-sm { display: none !important; } .rates-widget-lg { display: block !important; } }
.rates-note { font-size: 0.78rem; color: var(--muted); margin-top: 8px; }
.glossary { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
@media (min-width: 640px) { .glossary { grid-template-columns: 1fr 1fr; } }
.glossary .card { padding: 16px 18px; }
.glossary b { display: block; color: var(--navy); margin-bottom: 2px; }
.glossary p { margin: 0; font-size: 0.92rem; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; }
.table-scroll .compare { min-width: 600px; }
.table-scroll .compare td:nth-child(3) { color: var(--navy); background: var(--off); }

/* FAQ */
.faq details { background: var(--white); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--copper); font-weight: 700; }
.faq details[open] summary::after { content: '−'; }
.faq details p { padding: 0 18px 16px; margin: 0; }

/* lead form */
.lead { background: var(--navy); border-radius: 18px; padding: 28px 22px; color: var(--white); margin-top: 40px; }
.lead h2 { color: var(--white); }
.lead > p { color: rgba(255,255,255,0.7); }
.lead-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
@media (min-width: 640px) { .lead-grid { grid-template-columns: 1fr 1fr; } .lead-grid .full { grid-column: span 2; } }
.lead label { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: rgba(255,255,255,0.6); margin-bottom: 6px; }
.lead input, .lead textarea, .lead select { width: 100%; background: var(--navy2); border: 1.5px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 14px; color: var(--white); font-family: inherit; font-size: 0.95rem; outline: none; }
.lead input::placeholder, .lead textarea::placeholder { color: rgba(255,255,255,0.35); }
.lead input:focus, .lead textarea:focus { border-color: var(--gold); }
.lead textarea { min-height: 90px; resize: vertical; }
.lead .btn-primary { width: 100%; margin-top: 4px; }
.lead-note { font-size: 0.7rem; color: rgba(255,255,255,0.45); text-align: center; margin-top: 10px; }
.lead-error { display: none; color: #ffb4a8; text-align: center; font-size: 0.85rem; margin-top: 10px; }
.lead-error a { color: var(--gold); }
.lead-success { display: none; text-align: center; padding: 16px 0; }
.lead-success h3 { color: var(--white); font-size: 1.2rem; }
.lead-success p { color: rgba(255,255,255,0.7); }

/* related guides */
.guides { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .guides { grid-template-columns: 1fr 1fr; } }
.guide { display: block; background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; text-decoration: none; color: var(--text); font-weight: 600; }
.guide span { display: block; font-weight: 400; font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.guide:hover { border-color: var(--copper); }

/* about strip */
.about { display: flex; gap: 16px; align-items: center; }
.about img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); flex-shrink: 0; }
.about p { margin: 0; }

/* footer */
footer { background: var(--navy); color: rgba(255,255,255,0.6); margin-top: 48px; padding: 32px 0; font-size: 0.78rem; }
footer .wrap > * + * { margin-top: 10px; }
footer a { color: rgba(255,255,255,0.85); text-decoration: none; margin-right: 14px; }
footer strong { color: var(--white); font-size: 1rem; }

/* mobile action bar */
.action-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: var(--navy); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 10px; box-shadow: 0 -8px 32px rgba(0,0,0,0.25); }
.action-bar a { flex: 1; padding: 13px 8px; border-radius: 12px; text-align: center; font-weight: 700; font-size: 0.9rem; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 6px; }
.action-bar .ab-primary { background: var(--gold); color: var(--navy); }
.action-bar .ab-secondary { background: rgba(255,255,255,0.08); color: var(--white); border: 1px solid rgba(255,255,255,0.15); }
@media (min-width: 720px) { .action-bar { display: none; } body { padding-bottom: 0; } }
