/* ==========================================================================
   PolicyPeep — stylesheet
   Mobile-first. No external fonts or CDNs (fast loads = cheaper ad clicks).
   ========================================================================== */

:root {
  --ink:        #0A1F3D;
  --ink-soft:   #48586F;
  --ink-faint:  #7C8AA0;
  --brand:      #1B5FFF;
  --brand-dark: #1247C7;
  --brand-tint: #EEF3FF;
  --accent:     #00B87C;
  --accent-tint:#E6F8F1;
  --sun:        #FFB020;
  --line:       #E3E8F0;
  --bg:         #FFFFFF;
  --bg-alt:     #F6F8FC;
  --radius:     14px;
  --radius-lg:  22px;
  --shadow-sm:  0 1px 2px rgba(10,31,61,.06), 0 2px 8px rgba(10,31,61,.05);
  --shadow-md:  0 4px 12px rgba(10,31,61,.08), 0 12px 32px rgba(10,31,61,.08);
  --shadow-lg:  0 8px 24px rgba(10,31,61,.10), 0 24px 64px rgba(10,31,61,.12);
  --maxw:       1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.18; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: 2rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
p  { margin: 0 0 1em; }
a  { color: var(--brand); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }

.eyebrow {
  display: inline-block;
  font-size: .75rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-tint);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}

.muted { color: var(--ink-soft); }
.tiny  { font-size: .8rem; line-height: 1.5; color: var(--ink-faint); }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 1.02rem;
  padding: 16px 26px; border: 0; border-radius: 999px;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(27,95,255,.30); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink-faint); }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 1.16rem;
        letter-spacing: -.03em; color: var(--ink); text-decoration: none; }
.logo svg { flex: none; }
.logo span i { color: var(--brand); font-style: normal; }
.header-phone {
  font-weight: 700; font-size: .92rem; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.header-phone svg { flex: none; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 420px at 88% -8%, rgba(27,95,255,.10), transparent 62%),
    radial-gradient(700px 380px at 4% 6%, rgba(0,184,124,.10), transparent 60%),
    var(--bg-alt);
  padding: 34px 0 44px;
  border-bottom: 1px solid var(--line);
}
.hero h1 { font-size: clamp(1.95rem, 6.4vw, 3.1rem); margin-bottom: 14px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero-sub { font-size: 1.08rem; color: var(--ink-soft); max-width: 34ch; margin-bottom: 22px; }

.hero-grid { display: grid; gap: 30px; }

.trust-row {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 6px; padding: 0; list-style: none;
}
.trust-row li {
  display: flex; align-items: center; gap: 7px;
  font-size: .9rem; font-weight: 600; color: var(--ink-soft);
}
.trust-row svg { flex: none; color: var(--accent); }

/* ---------- Quiz card ---------- */
.quiz-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  scroll-margin-top: 76px; /* clear the sticky header when we scroll it into view */
}
.quiz-head { padding: 18px 22px 0; }
.quiz-progress-track {
  height: 6px; background: var(--line); border-radius: 999px; overflow: hidden;
}
.quiz-progress-bar {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width .32s cubic-bezier(.4,0,.2,1);
}
.quiz-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; font-size: .78rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint);
}
.quiz-back {
  background: none; border: 0; padding: 0; font: inherit; font-size: .78rem;
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-faint); cursor: pointer;
}
.quiz-back:hover { color: var(--ink); }
.quiz-back[hidden] { display: none; }

.quiz-body { padding: 18px 22px 24px; }
.quiz-q { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.quiz-help { font-size: .9rem; color: var(--ink-soft); margin: 0 0 18px; }

.step { animation: stepIn .28s cubic-bezier(.2,.7,.3,1); }
@keyframes stepIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .step { animation: none; }
  html { scroll-behavior: auto; }
}

.options { display: grid; gap: 10px; }
.options.cols-2 { grid-template-columns: 1fr 1fr; }

.opt {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left; font: inherit;
  padding: 15px 16px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink); cursor: pointer;
  transition: border-color .12s, background .12s, transform .12s;
}
.opt:hover { border-color: var(--brand); background: var(--brand-tint); }
.opt:active { transform: scale(.99); }
.opt.is-selected { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 3px rgba(27,95,255,.12); }
.opt-main { flex: 1; min-width: 0; }
.opt-label { font-weight: 700; display: block; }
.opt-note { display: block; font-size: .82rem; color: var(--ink-faint); font-weight: 500; margin-top: 2px; }
.opt-tag {
  flex: none; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-tint); padding: 4px 9px; border-radius: 999px;
}
.opt-arrow { flex: none; color: var(--ink-faint); }
.opt:hover .opt-arrow { color: var(--brand); }

/* form fields */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.field input, .field select {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: 14px 14px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: #fff; appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='none' stroke='%2348586F' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px;
}
.field input:focus, .field select:focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(27,95,255,.15);
}
.field.has-error input, .field.has-error select { border-color: #D93838; }
.field-error { display: none; font-size: .82rem; color: #D93838; font-weight: 600; margin-top: 6px; }
.field.has-error .field-error { display: block; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Month / Day / Year — month needs the most room for the longest name. */
.row-3 { display: grid; grid-template-columns: 1.5fr 1fr 1.1fr; gap: 8px; }
.row-3 select { padding-left: 11px; padding-right: 26px; background-position: right 9px center; }

.consent {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 16px 0 4px; font-size: .74rem; line-height: 1.5; color: var(--ink-faint);
}
.consent input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); }

.quiz-footnote {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-top: 14px; font-size: .78rem; color: var(--ink-faint);
}
.quiz-footnote svg { flex: none; color: var(--accent); }

/* ---------- Sections ---------- */
section { padding: 52px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { max-width: 620px; margin: 0 auto 34px; text-align: center; }
.section-head h2 { font-size: clamp(1.5rem, 4.6vw, 2.1rem); }
.section-head p { color: var(--ink-soft); margin: 0; }

.cards { display: grid; gap: 16px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.card-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand); margin-bottom: 14px;
}
.card h3 { margin-bottom: 6px; }
.card p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* steps */
.steps { display: grid; gap: 22px; counter-reset: s; }
.step-item { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink); color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: .95rem;
}
.step-item h3 { margin-bottom: 4px; }
.step-item p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* carriers */
.carriers { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.carrier-chip {
  font-size: .88rem; font-weight: 700; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px;
}

/* faq */
.faq { max-width: 720px; margin: 0 auto; }
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 17px 20px; font-weight: 700; font-size: 1rem;
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; flex: none; width: 11px; height: 11px;
  border-right: 2.2px solid var(--ink-faint); border-bottom: 2.2px solid var(--ink-faint);
  transform: rotate(45deg) translate(-2px,-2px); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-3px,-3px); }
.faq details p { padding: 0 20px 18px; margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* cta band */
.cta-band {
  background: linear-gradient(135deg, var(--ink) 0%, #123468 100%);
  color: #fff; text-align: center;
}
.cta-band h2 { color: #fff; font-size: clamp(1.55rem, 5vw, 2.2rem); }
.cta-band p { color: rgba(255,255,255,.78); max-width: 46ch; margin: 0 auto 24px; }
.cta-band .btn-primary { background: #fff; color: var(--ink); box-shadow: 0 8px 26px rgba(0,0,0,.28); }
.cta-band .btn-primary:hover { background: #F0F4FF; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 40px 0 32px; }
.footer-top { display: grid; gap: 22px; margin-bottom: 26px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 0; list-style: none; }
.footer-links a { color: var(--ink-soft); text-decoration: none; font-size: .92rem; font-weight: 600; }
.footer-links a:hover { color: var(--brand); }
.disclosure {
  border-top: 1px solid var(--line); padding-top: 20px;
  font-size: .76rem; line-height: 1.65; color: var(--ink-faint);
}
.disclosure p { margin: 0 0 .8em; }
.disclosure p:last-child { margin: 0; }

/* ---------- Quote page ---------- */
.quote-page { background: var(--bg-alt); min-height: 100vh; }
.quote-shell { padding: 26px 0 60px; }
.quote-intro { text-align: center; max-width: 620px; margin: 0 auto 22px; }
.quote-intro h1 { font-size: clamp(1.5rem, 5vw, 2.15rem); margin-bottom: 8px; }
.quote-intro p { color: var(--ink-soft); margin: 0; font-size: 1rem; }
.recap {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px 0 4px;
}
.recap-chip {
  font-size: .82rem; font-weight: 700; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
}
.recap-chip b { color: var(--ink); }
.widget-frame {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 10px; margin-top: 20px; min-height: 640px;
}
#quote-widget { min-height: 620px; }
.widget-loading { display: grid; place-items: center; min-height: 560px; text-align: center; padding: 30px; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%; margin-bottom: 16px;
  border: 3px solid var(--line); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.widget-loading p { margin: 0; font-weight: 600; color: var(--ink-soft); }
.setup-warning {
  max-width: 640px; margin: 0 auto 20px; padding: 16px 18px;
  background: #FFF8E6; border: 1px solid #F3D89A; border-radius: var(--radius);
  font-size: .9rem; color: #6B4E00;
}
.setup-warning strong { display: block; margin-bottom: 4px; }
.setup-warning code { background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; font-size: .85em; }

/* ---------- Legal pages ---------- */
.legal { padding: 40px 0 60px; }
.legal h1 { font-size: 1.9rem; }
.legal h2 { font-size: 1.2rem; margin-top: 1.8em; }
.legal p, .legal li { font-size: .95rem; color: var(--ink-soft); }
.legal ul { padding-left: 1.2em; }

/* ---------- Desktop ---------- */
@media (min-width: 720px) {
  body { font-size: 17px; }
  section { padding: 68px 0; }
  .hero { padding: 52px 0 62px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 26px; }
  .step-item { flex-direction: column; gap: 12px; }
  .footer-top { grid-template-columns: 1fr auto; align-items: center; }
  .quiz-body { padding: 22px 26px 28px; }
  .quiz-head { padding: 22px 26px 0; }
}

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1fr 460px; align-items: center; gap: 52px; }
  .hero-sub { font-size: 1.16rem; }
}

/* Focus visibility for keyboard users */
:focus-visible { outline: 3px solid rgba(27,95,255,.45); outline-offset: 2px; border-radius: 6px; }

.hide-sm { display: none; }
@media (min-width: 480px) { .hide-sm { display: inline; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
