/* Ratehaul site styles. Mobile-first. No build step. */

:root {
  --navy: #0B2545;
  --orange: #F26419;
  --orange-dark: #d4530f;
  --offwhite: #F7F5F0;
  --ink: #1B1B1B;
  --muted: #5B6470;
  --line: #e2ddd3;
  --white: #ffffff;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 8px;
  --gutter: 16px;
  --max: 1120px;
  --tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--offwhite);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--orange-dark); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; color: var(--navy); font-weight: 700; overflow-wrap: anywhere; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.45rem; margin-top: 1.6em; }
h3 { font-size: 1.1rem; margin-top: 1.2em; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; background: #ece8df; padding: 0 4px; border-radius: 3px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.container.narrow { max-width: 760px; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: 10px 14px; z-index: 100; }
.skip-link:focus { left: 8px; }

.eyebrow { color: var(--orange-dark); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; margin-bottom: 0.6em; }
.lead { font-size: 1.1rem; color: var(--muted); }
.fine, .price-fine, .footer-note { font-size: 0.85rem; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 10px 20px;
  border-radius: var(--radius); font-weight: 600; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; line-height: 1.2; text-align: center;
}
.btn-primary { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn-primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: #fff; }
.btn-secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--navy); color: #fff; }
.btn-block { width: 100%; }
.btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header { background: var(--navy); color: #fff; position: relative; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-height: var(--tap); }
.brand img { width: 32px; height: 32px; }
.wordmark { font-weight: 700; font-size: 1.3rem; letter-spacing: -0.01em; }
.site-footer .wordmark { color: #fff; margin-bottom: 0.4em; }

.nav-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: var(--tap); min-width: var(--tap); padding: 8px 10px;
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.35); border-radius: var(--radius);
  font: inherit; font-weight: 600; cursor: pointer;
}
.nav-toggle-bars { width: 20px; height: 2px; background: #fff; position: relative; display: block; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: #fff; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.site-nav { display: none; width: 100%; padding-bottom: 12px; }
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.site-nav a:not(.btn) { display: flex; align-items: center; min-height: var(--tap); padding: 8px 10px; color: #fff; text-decoration: none; border-radius: var(--radius); }
.site-nav a:not(.btn):hover, .site-nav a.is-active { background: rgba(255,255,255,0.1); }
.btn-nav { margin-top: 6px; }

/* ---------- Hero ---------- */
.hero { background: var(--navy); color: #fff; padding: 32px 0 40px; }
.hero-grid { display: grid; gap: 28px; }
.hero h1 { color: #fff; font-size: 2rem; }
.hero .eyebrow { color: #ffb48a; }
.hero .lead { color: rgba(255,255,255,0.85); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 12px; }
.hero-actions .btn-secondary { color: #fff; border-color: #fff; }
.hero-actions .btn-secondary:hover { background: #fff; color: var(--navy); }
.hero-fine { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin: 0; }

.hero-media {
  position: relative; border-radius: 12px; overflow: hidden; min-height: 220px;
  background: linear-gradient(135deg, #123466 0%, #0B2545 60%, #071a33 100%);
  border: 1px solid rgba(255,255,255,0.12);
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-fallback { display: none; }
.hero-media.is-missing .hero-fallback {
  display: block; position: absolute; inset: 0; margin: auto; width: min(86%, 360px); height: fit-content;
  background: var(--white); color: var(--ink); border-radius: 10px; padding: 16px 18px; box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}
.hf-title { font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.hf-row { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.95rem; }
.hf-row:first-of-type { border-top: 0; }
.hf-muted { color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 40px 0; }
.section-alt { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2 { margin-top: 0; font-size: 1.6rem; }
.section-intro { color: var(--muted); max-width: 720px; }
.section-outro { margin-top: 24px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; counter-reset: step; }
.steps li { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps h3 { margin-top: 8px; }
.steps p { margin: 0; color: var(--muted); }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 1em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 0.95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--offwhite); color: var(--navy); font-weight: 600; }
tbody th { font-weight: 500; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.compare-table { min-width: 720px; }
.feature-table td { text-align: center; }
.feature-table thead th:not(:first-child) { text-align: center; }
.yes { color: #1f7a3a; font-weight: 600; }
.no { color: #a8a39a; }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; gap: 20px; margin-top: 24px; }
.price-card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; }
.price-card-featured { border: 2px solid var(--orange); }
.price-card h3 { margin-top: 0; font-size: 1.2rem; }
.price { font-size: 2.2rem; font-weight: 700; color: var(--navy); margin: 0; line-height: 1.1; }
.price-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }
.price-list { margin: 0 0 20px; padding-left: 20px; flex: 1; }
.price-list li { margin-bottom: 6px; }
.price-fine { margin: 10px 0 0; }
.pricing-note { margin-top: 24px; color: var(--muted); font-size: 0.95rem; }
/* Payhip adds its own classes; keep our button sizing */
.payhip-buy-button.btn { display: inline-flex; }

/* ---------- FAQ ---------- */
.faq-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.faq-item summary { cursor: pointer; padding: 12px 44px 12px 16px; min-height: var(--tap); display: flex; align-items: center; font-weight: 600; color: var(--navy); list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 16px; font-size: 1.4rem; color: var(--orange); line-height: 1; }
.faq-item[open] summary::after { content: "\2013"; }
.faq-body { padding: 0 16px 14px; color: var(--ink); }
.faq-body p { margin: 0; }

/* ---------- Prose pages ---------- */
.prose { padding-top: 32px; padding-bottom: 56px; max-width: 800px; } /* top and bottom only: keep .container's side gutter */
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose table { min-width: 560px; }
.toc { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 20px 0 28px; }
.toc-heading { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 8px; color: var(--muted); }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 4px 0; }
.toc a { display: inline-block; padding: 4px 0; }
.cta-box { background: var(--navy); color: #fff; border-radius: 12px; padding: 24px; margin: 36px 0 16px; }
.cta-box p:last-child { margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.cta-box .btn-secondary { color: #fff; border-color: #fff; }
.cta-box .btn-secondary:hover { background: #fff; color: var(--navy); }
.sources { font-size: 0.9rem; color: var(--muted); }
.sources-heading { font-size: 1.1rem; }
.contact-card { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: var(--radius); padding: 16px 20px; margin: 20px 0 28px; }
.contact-label { margin: 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.contact-value { margin: 4px 0 0; font-size: 1.2rem; font-weight: 600; overflow-wrap: anywhere; }
/* Long URLs used as link text (docs step 2) must wrap on a 320 px phone. */
main a { overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.85); padding: 40px 0 28px; margin-top: 24px; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #ffb48a; }
.footer-grid { display: grid; gap: 28px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0; }
.footer-col li a { display: inline-block; padding: 6px 0; min-height: var(--tap); line-height: 32px; }
.footer-heading { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: #ffb48a; margin: 0 0 8px; }
.footer-about p { margin-bottom: 0.6em; }
.footer-note { color: rgba(255,255,255,0.6); }
.footer-copy { margin: 28px 0 0; font-size: 0.85rem; color: rgba(255,255,255,0.6); border-top: 1px solid rgba(255,255,255,0.15); padding-top: 16px; }

/* ---------- Breakpoints ---------- */
@media (min-width: 640px) {
  h1 { font-size: 2.2rem; }
  .hero h1 { font-size: 2.4rem; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid .price-card-featured { grid-column: span 2; }
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav { display: block; width: auto; padding: 0; }
  .site-nav ul { flex-direction: row; align-items: center; gap: 4px; }
  .site-nav a:not(.btn) { padding: 8px 14px; }
  .btn-nav { margin: 0 0 0 8px; }
  .hero { padding: 64px 0 72px; }
  .hero-grid { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 48px; }
  .hero-media { min-height: 320px; }
  .section { padding: 64px 0; }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
  .pricing-grid .price-card-featured { grid-column: auto; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .prose { padding-top: 48px; padding-bottom: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
