/* ============================================================
   Mark Norman – Better Mortgage Solutions
   Shared funnel design system (recovered from original CSS tokens)
   ============================================================ */
:root {
  --navy: #173a70;
  --navy-2: #224c8f;
  --gold: #d8b56a;
  --gold-2: #ecd39b;
  --deep-red: #9d1116;
  --dark: #2d2a26;
  --white: #ffffff;
  --border: #d9d7d2;
  --muted: #5f6672;
  --shadow: 0 10px 30px rgba(23, 58, 112, 0.10);
  --success-bg: #eef6f2;
  --success-border: #bfd8ca;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #f3f3f4 0%, #fafafa 100%);
  color: var(--dark);
  line-height: 1.5;
}

.funnel-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

.card {
  background: var(--white);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: var(--white);
  padding: 34px 26px 28px;
  min-height: 190px;
}
.logo-badge {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 220px;
  max-width: 42%;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
  text-align: center;
  color: var(--navy);
}
.logo-badge strong { display: block; font-size: 16px; letter-spacing: 0.04em; }
.logo-badge span { display: block; font-size: 10px; letter-spacing: 0.12em; color: var(--muted); margin-top: 2px; text-transform: uppercase; }
.hero-copy { padding-right: 255px; padding-top: 4px; }
.hero h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 470px;
  font-weight: 800;
}
.hero p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  max-width: 500px;
  color: rgba(255, 255, 255, 0.93);
}

/* ---------- Content ---------- */
.content { padding: 30px; }

/* ---------- Progress ---------- */
.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.progress-track {
  width: 100%;
  height: 10px;
  background: #ece9e3;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 28px;
}
.progress-fill {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* ---------- Steps & fieldsets ---------- */
.step { display: none; }
.step.is-active { display: block; }

fieldset {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 20px 20px;
  margin: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fcfcfc 100%);
}
legend {
  color: var(--navy);
  font-weight: 800;
  padding: 0 8px;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.step-intro {
  margin: 2px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  max-width: 640px;
}

/* ---------- Grid & fields ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
}
.full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label,
.choice-group > .group-label {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.01em;
  color: #273142;
}
.hint { font-size: 11px; 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: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  color: var(--dark);
  background: #ffffff;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(216, 181, 106, 0.18);
}
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; }
.input-prefix input { padding-left: 28px; }

/* ---------- Choice pills (radio / checkbox) ---------- */
.choice-group { display: flex; flex-direction: column; gap: 10px; }
.group-label { margin-bottom: 2px; }
.choices { display: grid; gap: 10px; }
.choices.inline { display: flex; flex-wrap: wrap; gap: 10px; }

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid #ddd8cf;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfaf8 100%);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-size: 14px;
  font-weight: 600;
  color: #2f3948;
}
.choice:hover { border-color: var(--gold); }
.choice input { width: auto; margin-top: 2px; accent-color: var(--navy); }
.choice:has(input:checked) {
  border-color: var(--gold);
  background: linear-gradient(180deg, #fffdf8 0%, #f8f4ec 100%);
  box-shadow: 0 0 0 3px rgba(216, 181, 106, 0.15);
}
.choices.inline .choice { border-radius: 999px; padding: 10px 14px; }

[data-group-error] { color: var(--deep-red); font-size: 12px; font-weight: 700; }

/* ---------- Hidden / conditional ---------- */
/* Ensure the `hidden` attribute always wins over component display rules. */
[hidden] { display: none !important; }
[data-show-if] { margin-top: 6px; }

/* ---------- Notes / callouts ---------- */
.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 #d8c7a0;
  background: linear-gradient(180deg, #fffdf8 0%, #faf7f0 100%);
  border-radius: 16px;
  padding: 16px;
}

/* ---------- Actions ---------- */
.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 20px;
  flex-wrap: wrap;
}
button {
  appearance: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: var(--white);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 15px 22px;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(23, 58, 112, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(23, 58, 112, 0.22); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn-secondary {
  background: linear-gradient(180deg, #f7f7f8 0%, #eceef2 100%);
  color: var(--navy);
  border: 1px solid #d8dce4;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: 14px;
}
.disclaimer { font-size: 11px; color: #6b7280; line-height: 1.5; max-width: 700px; margin-top: 18px; }

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

/* ---------- Success / confirmation ---------- */
.success { display: none; }
.success.is-visible { display: block; }
.success-card {
  border-radius: 18px;
  padding: 26px 22px;
  border: 1px solid var(--success-border);
  background: linear-gradient(180deg, #f7faf8 0%, var(--success-bg) 100%);
}
.success-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  color: var(--navy);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.success-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.6; color: #374151; }
.booking {
  margin-top: 12px;
  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: 18px; display: inline-block; text-decoration: none; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero h1 { font-size: 28px; }
  .content, .hero { padding: 20px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .hero-copy { padding-right: 0; padding-top: 0; }
  .logo-badge { position: static; display: block; width: 220px; max-width: 100%; margin: 0 0 18px auto; }
  fieldset { padding: 20px 16px 18px; }
  .step-actions { flex-direction: column-reverse; align-items: stretch; }
  .step-actions button { width: 100%; }
}
