/* ============================================================
   Mark Norman – Better Mortgage Solutions
   Conversion-optimized, mobile-first lead funnel.
   Conversational "one question per screen" UI in Mark's brand
   (navy + gold, serif headings echoing the logo wordmark).
   ============================================================ */
:root {
  --navy: #173a70;
  --navy-2: #224c8f;
  --navy-ink: #0f2748;
  --gold: #d8b56a;
  --gold-2: #ecd39b;
  --deep-red: #9d1116;
  --dark: #2d2a26;
  --white: #ffffff;
  --paper: #f6f7f9;
  --border: #dcdfe6;
  --muted: #5f6672;
  --shadow: 0 18px 50px rgba(15, 39, 72, 0.12);
  --shadow-sm: 0 6px 18px rgba(15, 39, 72, 0.08);
  --success-bg: #eef6f2;
  --success-border: #bfd8ca;
  --radius-card: 20px;
  --display: 'Oswald', 'Arial Narrow', Arial, Helvetica, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
}

/* Self-hosted Oswald (variable) — no external Google Fonts dependency */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url('/assets/fonts/oswald.woff2') format('woff2');
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding: 84px 0 104px; /* keep fields clear of sticky bars */
}

body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(1200px 600px at 50% -10%, #eaeef5 0%, rgba(234, 238, 245, 0) 60%),
    linear-gradient(180deg, #f3f5f8 0%, #fafbfc 100%);
  color: var(--dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.funnel-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 14px 14px 40px;
}

/* No overflow:hidden — it would break the sticky bars. */
.card {
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 39, 72, 0.06);
}

/* ---------- Sticky brand bar (logo + progress) ---------- */
.brand-bar {
  position: sticky;
  top: 0;
  z-index: 8;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  border-bottom: 1px solid rgba(15, 39, 72, 0.06);
  padding: 12px 16px 0;
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.brand-row .logo { width: 150px; height: auto; }
.brand-row .cca-badge { height: 48px; width: auto; flex: 0 0 auto; }
/* On the landing screen, hide the small bar badge and show a large, legible one in-page. */
body.on-landing .brand-row .cca-badge { display: none; }
/* Hero lead: headline left, award seal right — flexbox (renders the same in every browser) */
.hero-lead { display: flex; gap: 16px; align-items: center; }
.hero-lead .hero-text { flex: 1 1 auto; min-width: 0; }
.award-seal { flex: 0 0 auto; height: 116px; width: auto; }
.step-count {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.progress-track {
  width: 100%;
  height: 6px;
  background: #e9ecf2;
  border-radius: 999px;
  overflow: hidden;
  transform: translateY(1px);
}
.progress-fill {
  height: 100%;
  width: 12%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Content / stage ---------- */
.content { padding: 16px 16px 14px; }

/* ---------- Steps ---------- */
.step { display: none; }
.step.is-active { display: block; animation: stepIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* The question itself */
legend {
  display: block;
  width: 100%;
  padding: 0;
  font-family: var(--display);
  color: var(--navy);
  font-weight: 700;
  font-size: clamp(1.35rem, 1.05rem + 2.2vw, 2.1rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.step-intro {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 46ch;
}
.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.q-body { margin-top: 14px; }
.accent { color: var(--gold); }
.offer { margin: 8px 0 0; font-weight: 800; font-size: 17px; color: var(--navy); }

/* ---------- Landing: social proof + advisor credibility ---------- */
.social-proof {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--navy-ink);
}
.social-proof strong { color: var(--navy); font-weight: 800; }

.advisor-card {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--success-border);
  background: linear-gradient(180deg, #f9fbfa 0%, var(--success-bg) 100%);
  border-radius: 16px;
}
.advisor-photo {
  flex: 0 0 auto;
  width: 92px; height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: var(--shadow-sm);
}
.advisor-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.advisor-name { font-family: var(--display); font-weight: 700; color: var(--navy); font-size: 19px; line-height: 1.12; letter-spacing: -0.01em; }
.advisor-role { font-size: 12.5px; color: var(--muted); line-height: 1.35; }

@media (min-width: 721px) {
  .advisor-photo { width: 104px; height: 104px; }
  .advisor-name { font-size: 21px; }
}
.benefit-list { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.benefit-list li { display: flex; gap: 12px; align-items: center; font-weight: 700; color: var(--navy-ink); font-size: 16px; }
.benefit-list svg { width: 20px; height: 20px; color: var(--gold); flex: 0 0 auto; }
.steps { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: s; }
.steps li { display: flex; gap: 12px; align-items: center; font-size: 13.5px; color: var(--navy-ink); font-weight: 600; }
.steps li::before { counter-increment: s; content: counter(s); flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-size: 12px; display: grid; place-items: center; }

/* ---------- Inputs ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label,
.choice-group > .group-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--navy-ink);
}
.hint { font-size: 12px; color: #6b7280; margin-top: 1px; line-height: 1.45; }

input[type="text"], input[type="email"], input[type="tel"],
input[type="number"], select, textarea {
  width: 100%;
  padding: 15px 16px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  font-size: 16px; /* prevents iOS zoom */
  color: var(--dark);
  background: #fff;
  outline: none;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--navy-2);
  box-shadow: 0 0 0 4px rgba(34, 76, 143, 0.14);
}
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; font-weight: 700; }
.input-prefix input { padding-left: 30px; }

/* ---------- Choice cards (radio / checkbox) ---------- */
.choice-group { display: flex; flex-direction: column; gap: 12px; }
.group-label { margin-bottom: 2px; }
.choices { display: grid; gap: 10px; }
.choices.inline { grid-template-columns: 1fr 1fr; }

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.05s ease;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy-ink);
  position: relative;
}
.choice:hover { border-color: var(--navy-2); }
.choice:active { transform: scale(0.995); }
/* custom control */
.choice input { appearance: none; -webkit-appearance: none; margin: 0; flex: 0 0 auto;
  width: 22px; height: 22px; border: 2px solid #c4c9d4; border-radius: 50%;
  background: #fff; transition: border-color 0.15s ease, background 0.15s ease; position: relative; }
.choice input[type="checkbox"] { border-radius: 7px; }
.choice input:checked { border-color: var(--navy); background: var(--navy); }
.choice input:checked::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.choice input[type="checkbox"]:checked::after { left: 6px; top: 2.5px; }
.choice input:focus-visible { box-shadow: 0 0 0 4px rgba(34, 76, 143, 0.18); }
.choice:has(input:checked) {
  border-color: var(--navy);
  background: linear-gradient(180deg, #f7faff 0%, #eef3fc 100%);
  box-shadow: 0 0 0 1.5px var(--navy), var(--shadow-sm);
}

/* ---------- Inline validation ---------- */
.error-msg { margin: 8px 0 0; color: var(--deep-red); font-size: 13px; font-weight: 700; line-height: 1.4; }
input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: var(--deep-red);
  box-shadow: 0 0 0 4px rgba(157, 17, 22, 0.12);
}
.choice-group.group-invalid > .group-label { color: var(--deep-red); }
[data-group-error] { color: var(--deep-red); font-size: 13px; font-weight: 700; margin: 8px 0 0; }
.field, .choice-group, .q-body { scroll-margin-top: 84px; scroll-margin-bottom: 104px; }

/* ---------- Hidden / conditional ---------- */
[hidden] { display: none !important; }
[data-show-if] { margin-top: 12px; }

/* ---------- Notes / callouts / upload ---------- */
.note-box {
  background: linear-gradient(180deg, #f8f4ec 0%, #f5efe4 100%);
  border: 1px solid #ead9bd; color: #5a4630;
  padding: 14px 16px; border-radius: 14px; font-size: 13px; line-height: 1.55;
}
.upload-box {
  border: 2px dashed #c9d0dd;
  background: linear-gradient(180deg, #fbfcfe 0%, #f5f7fb 100%);
  border-radius: 16px; padding: 16px;
}
.upload-box label { font-weight: 700; font-size: 14px; color: var(--navy-ink); display: block; margin-bottom: 8px; }

/* ---------- Actions ---------- */
.step-actions {
  display: flex; align-items: center; gap: 12px;
  position: sticky; bottom: 0; z-index: 5;
  margin: 22px -18px 0;
  padding: 14px 18px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 22%);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}
/* Auto-advance steps don't need a Continue button or a floating bar. */
fieldset[data-autoadvance] .step-actions {
  position: static; margin: 18px 0 0; padding: 0;
  background: none; justify-content: flex-start;
}
button { appearance: none; border: none; font-family: inherit; cursor: pointer; }
.btn-primary {
  background: linear-gradient(135deg, var(--navy-2), var(--navy));
  color: #fff; font-size: 16px; font-weight: 800; letter-spacing: 0.01em;
  padding: 16px 22px; border-radius: 14px;
  box-shadow: 0 12px 24px rgba(23, 58, 112, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 30px rgba(23, 58, 112, 0.26); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; transform: none; }
.step-actions .btn-primary { flex: 1 1 auto; }
/* Back is a quiet text link */
.btn-secondary {
  background: none; color: var(--muted); border: none;
  font-size: 15px; font-weight: 700; padding: 12px 8px; border-radius: 10px;
  flex: 0 0 auto;
}
.btn-secondary:hover { color: var(--navy); }
.step-actions span:empty { display: none; }

.disclaimer { font-size: 11.5px; color: #6b7280; line-height: 1.5; max-width: 60ch; margin: 16px 0 4px; }

/* required marker */
.req::after { content: " *"; color: var(--deep-red); }

/* ---------- Trust row (persistent reassurance) ---------- */
.trust-row {
  display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center;
  margin: 18px 4px 2px; padding-top: 16px;
  border-top: 1px solid rgba(15, 39, 72, 0.07);
}
.trust-row span {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.01em;
}
.trust-row svg { width: 13px; height: 13px; flex: 0 0 auto; color: var(--gold); }

/* ---------- Footer (Premiere Mortgage Centre) ---------- */
.brand-footer {
  margin: 14px 0 2px;
  background: var(--navy-ink);
  border-radius: 14px;
  padding: 11px 14px;
  text-align: center;
}
.brand-footer .premiere-logo { width: 116px; max-width: 44%; margin: 0 auto; display: block; }

/* ---------- Success / confirmation ---------- */
.success { display: none; }
.success.is-visible { display: block; animation: stepIn 0.32s ease both; }
.success-card {
  border-radius: 18px; padding: 26px 20px;
  border: 1px solid var(--success-border);
  background: linear-gradient(180deg, #f7faf8 0%, var(--success-bg) 100%);
  text-align: center;
}
.success-badge {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2f8f64, #2b7d57); color: #fff;
}
.success-badge svg { width: 28px; height: 28px; }
.success-card h2 {
  margin: 0 0 8px; font-family: var(--display);
  font-size: clamp(1.4rem, 1.1rem + 1.6vw, 1.75rem);
  color: var(--navy); font-weight: 700; letter-spacing: -0.01em;
}
.success-card p { margin: 0 auto 12px; font-size: 14.5px; line-height: 1.6; color: #374151; max-width: 44ch; }
.booking {
  margin: 16px auto 0; max-width: 360px; text-align: left;
  background: linear-gradient(180deg, #faf7f1 0%, #f8f4ec 100%);
  border: 1px solid #e4d6b6; border-left: 5px solid var(--gold);
  padding: 14px 16px; border-radius: 14px;
}
.booking .label { font-size: 12px; color: var(--muted); font-weight: 700; }
.booking-date { display: inline-block; margin-top: 6px; font-size: 16px; font-weight: 800; color: var(--navy); }
.success .btn-primary { margin-top: 20px; display: inline-block; text-decoration: none; text-align: center; }
.calendar-intro { font-weight: 600; margin: 0 auto 6px; font-size: 14.5px; }
.calendar-embed { margin-top: 12px; width: 100%; }
.calendar-embed iframe { width: 100%; border: none; min-height: 620px; display: block; }
/* Reassurance lives BELOW the calendar so it never pushes the booking action
   down. Anyone ready to book acts immediately; hesitaters scroll for reasons. */
.post-calendar { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--success-border); }
.cover-heading { font-weight: 700 !important; color: var(--navy); margin: 0 auto 10px !important; font-size: 14.5px; }
.post-calendar .benefit-list { margin-top: 0; }

/* ============================================================
   Tablet / desktop
   ============================================================ */
@media (min-width: 721px) {
  :root { --radius-card: 24px; }
  .funnel-wrap { max-width: 640px; padding: 40px 18px 64px; }
  .brand-bar { padding: 16px 28px 0; }
  .brand-row .logo { width: 200px; }
  .award-seal { height: 128px; }
  .content { padding: 30px 34px 26px; }
  .choices.inline { grid-template-columns: repeat(3, 1fr); }

  /* In-flow action row on desktop (no floating bar). */
  .step-actions {
    position: static; margin: 26px 0 0; padding: 0; background: none;
    flex-direction: row-reverse; justify-content: flex-start; gap: 16px;
  }
  .step-actions .btn-primary { flex: 0 0 auto; min-width: 200px; }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .step.is-active, .success.is-visible { animation: none; }
  .btn-primary, .progress-fill, .choice, input, select, textarea { transition: none !important; }
}
