
/* v58: Standard header/footer for selector pages and visual cleanup */
.has-standard-layout.work-with-us-page,
.has-standard-layout.mortgage-options-page {
  min-height: 100vh;
  background: #f6fbff;
  color: #102033;
  font-family: 'Roboto', Arial, sans-serif;
}
.has-standard-layout .site-header {
  position: sticky;
  top: 16px;
  z-index: 1000;
}
.work-with-us-page.has-standard-layout .referral-page-main,
.mortgage-options-page.has-standard-layout .mortgage-options-main {
  overflow: hidden;
}
.referral-intro-section,
.mortgage-options-hero-section {
  position: relative;
  padding: 148px 0 96px;
  background:
    radial-gradient(circle at 12% 16%, rgba(24,148,204,.18), transparent 32%),
    radial-gradient(circle at 88% 10%, rgba(8,46,89,.12), transparent 34%),
    linear-gradient(180deg, #f3faff 0%, #ffffff 100%);
}
.referral-intro-section::before,
.mortgage-options-hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(7,23,51,.05), transparent 35%, rgba(12,132,190,.06));
}
.referral-layout {
  position: relative;
  display: grid;
  grid-template-columns: .78fr 1fr;
  gap: 40px;
  align-items: center;
}
.referral-copy-panel {
  padding: 34px 0;
}
.referral-copy-panel h1,
.referral-form-card h2,
.mortgage-options-hero h1 {
  margin: 12px 0 18px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: #111;
  letter-spacing: -.04em;
  line-height: .9;
}
.referral-copy-panel h1 {
  font-size: clamp(58px, 7vw, 112px);
}
.referral-copy-panel p:not(.section-kicker),
.mortgage-options-hero p {
  color: #5b6876;
  font-size: 18px;
  line-height: 1.7;
  max-width: 560px;
}
.referral-action-panel {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(13,89,143,.13);
  border-radius: 34px;
  padding: 22px;
  box-shadow: 0 28px 80px rgba(13,49,84,.10);
  backdrop-filter: blur(14px);
}
.work-with-us-page .referral-selector,
.work-with-us-page .referral-form-shell {
  min-height: auto;
  display: block;
  justify-content: initial;
  color: inherit;
  text-align: initial;
  padding: 0;
}
.referral-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  margin: 0;
}
.referral-type-grid button {
  min-height: 86px;
  border: 1px solid rgba(13,89,143,.13);
  border-radius: 22px;
  padding: 20px 18px;
  background: linear-gradient(180deg,#fff 0%,#f6fbff 100%);
  color: #0c243d;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  box-shadow: 0 16px 38px rgba(10,33,61,.08);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  text-align: left;
}
.referral-type-grid button i {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(13,145,205,.11);
  color: #0d91cd;
  flex: 0 0 42px;
}
.referral-type-grid button:hover {
  transform: translateY(-3px);
  border-color: rgba(13,145,205,.34);
  box-shadow: 0 20px 48px rgba(10,33,61,.12);
  background: #fff;
}
.referral-form-section {
  padding: 84px 0 100px;
  background: #fff;
}
.referral-form-section[hidden] { display: none !important; }
.referral-back {
  color: #0c243d;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(13,89,143,.14);
  background: #fff;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 800;
  margin: 0 0 18px;
  cursor: pointer;
}
.referral-form-card {
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(15,74,118,.12);
  border-radius: 32px;
  padding: 38px;
  box-shadow: 0 26px 70px rgba(0,0,0,.10);
}
.referral-form-card h2 {
  font-size: clamp(38px,5vw,72px);
}
.referral-note { color:#5b6876; margin:0 0 28px; font-size:16px; }
.referral-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.referral-form-grid label { display:grid; gap:8px; color:#102033; font-size:13px; text-transform:uppercase; letter-spacing:.08em; font-weight:800; }
.referral-form-grid label.full { grid-column:1/-1; }
.referral-form-grid input, .referral-form-grid textarea { width:100%; border:1px solid #dce8f1; border-radius:16px; padding:15px 16px; font:500 16px 'Roboto',Arial,sans-serif; color:#102033; background:#fbfdff; box-sizing:border-box; }
.referral-form-grid textarea { resize:vertical; }
.referral-consent { display:flex; align-items:flex-start; gap:10px; margin:22px 0; color:#5b6876; line-height:1.55; }
.referral-consent input { margin-top:5px; }
.referral-submit { width:100%; justify-content:center; }
.referral-status { margin:14px 0 0; font-weight:700; color:#0d6f9f; }
.referral-status.error { color:#a33; }
.referral-status.success { color:#0b7a45; }
.mortgage-options-hero {
  text-align: center;
  max-width: 880px;
  margin: 0 auto 46px;
}
.mortgage-options-hero h1 {
  font-size: clamp(48px, 5.8vw, 86px);
}
.mortgage-options-hero p {
  margin: 0 auto;
  max-width: 760px;
}
.mortgage-options-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.mortgage-option-card {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px;
  border: 1px solid rgba(13,89,143,.14);
  border-radius: 24px;
  background: rgba(255,255,255,.88);
  color: #0c243d;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 22px 54px rgba(10,33,61,.08);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.mortgage-option-card i { color:#0d91cd; }
.mortgage-option-card:hover {
  transform: translateY(-3px);
  border-color: rgba(13,145,205,.35);
  box-shadow: 0 28px 66px rgba(10,33,61,.12);
}
@media (max-width: 980px) {
  .referral-layout { grid-template-columns: 1fr; gap: 26px; }
  .referral-copy-panel { text-align: center; padding: 0; }
  .referral-copy-panel p:not(.section-kicker) { margin-left:auto; margin-right:auto; }
  .mortgage-options-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .has-standard-layout .site-header { top: 12px; }
  .referral-intro-section,
  .mortgage-options-hero-section { padding: 128px 0 62px; }
  .referral-action-panel { padding: 14px; border-radius: 26px; }
  .referral-type-grid,
  .mortgage-options-grid,
  .referral-form-grid { grid-template-columns: 1fr; }
  .referral-type-grid button { min-height: 72px; padding: 16px 15px; border-radius: 18px; font-size: 16px; }
  .referral-copy-panel h1 { font-size: clamp(62px, 20vw, 92px); }
  .mortgage-options-hero h1 { font-size: clamp(48px, 14vw, 72px); }
  .referral-form-section { padding: 54px 0 72px; }
  .referral-form-card { padding: 24px 18px; border-radius: 26px; }
  .mortgage-option-card { min-height: 82px; padding: 20px; border-radius: 20px; }
}

/* v59: Premium referral form redesign */
.referral-form-wrap {
  max-width: 1280px;
}
.referral-form-card-premium {
  position: relative;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(21,151,211,.10), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
}
.referral-form-card-premium::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 7px;
  background: linear-gradient(90deg, #09233f, #0d91cd, #8ed4ff);
}
.referral-form-head {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-start;
  padding: 42px 44px 24px;
  border-bottom: 1px solid rgba(13,89,143,.10);
}
.referral-form-head h2 {
  margin-bottom: 12px;
  max-width: 820px;
}
.referral-selected-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  color: #0c3154;
  background: #edf8ff;
  border: 1px solid rgba(13,145,205,.18);
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(10,33,61,.08);
  white-space: nowrap;
}
.referral-selected-pill i {
  color: #0d91cd;
}
.referral-form-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  padding: 34px 44px 44px;
}
.referral-premium-form {
  min-width: 0;
}
.referral-section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 16px;
  color: #0c3154;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 13px;
}
.referral-section-label span {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #0d91cd, #07213c);
  letter-spacing: 0;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(13,145,205,.22);
}
.referral-form-grid-enhanced {
  gap: 18px 20px;
  margin-bottom: 28px;
}
.referral-form-grid-enhanced .referral-field {
  position: relative;
  gap: 10px;
  min-width: 0;
}
.referral-form-grid-enhanced .referral-field > span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #0c243d;
  font-size: 12px;
  letter-spacing: .11em;
  text-transform: uppercase;
  font-weight: 900;
}
.referral-form-grid-enhanced .referral-field > span i {
  color: #0d91cd;
  font-size: 13px;
}
.referral-form-grid-enhanced input,
.referral-form-grid-enhanced select,
.referral-form-grid-enhanced textarea {
  width: 100%;
  min-height: 56px;
  border: 1px solid #d6e6f2;
  border-radius: 18px;
  padding: 16px 17px;
  font: 600 16px 'Roboto', Arial, sans-serif;
  color: #102033;
  background: rgba(255,255,255,.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 10px 26px rgba(10,33,61,.04);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  box-sizing: border-box;
  outline: none;
}
.referral-form-grid-enhanced textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.6;
}
.referral-form-grid-enhanced select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #0d91cd 50%), linear-gradient(135deg, #0d91cd 50%, transparent 50%);
  background-position: calc(100% - 22px) 25px, calc(100% - 16px) 25px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 44px;
}
.referral-form-grid-enhanced input:focus,
.referral-form-grid-enhanced select:focus,
.referral-form-grid-enhanced textarea:focus {
  border-color: rgba(13,145,205,.58);
  box-shadow: 0 0 0 5px rgba(13,145,205,.10), 0 16px 34px rgba(10,33,61,.07);
  background: #fff;
}
.referral-confirm-panel {
  margin: 8px 0 20px;
  padding: 18px 20px;
  border: 1px solid rgba(13,145,205,.15);
  border-radius: 20px;
  background: linear-gradient(180deg, #f6fbff, #ffffff);
}
.referral-confirm-panel .referral-consent {
  margin: 0;
  color: #455565;
  font-weight: 600;
}
.referral-confirm-panel .referral-consent input {
  width: 18px;
  height: 18px;
  accent-color: #0d91cd;
}
.referral-actions-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}
.referral-status {
  min-height: 24px;
}
.referral-submit-pro {
  min-height: 58px;
  min-width: 260px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 18px;
  padding: 0 26px;
  color: #fff;
  background: linear-gradient(135deg, #0d91cd 0%, #06345f 100%);
  font: 900 15px 'Roboto', Arial, sans-serif;
  letter-spacing: .02em;
  box-shadow: 0 20px 42px rgba(13,89,143,.24);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.referral-submit-pro:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 54px rgba(13,89,143,.30);
  filter: brightness(1.03);
}
.referral-submit-pro:disabled {
  opacity: .72;
  cursor: wait;
  transform: none;
}
.referral-form-sidebar {
  display: grid;
  gap: 14px;
  align-content: start;
}
.sidebar-card {
  position: relative;
  padding: 20px;
  border: 1px solid rgba(13,89,143,.12);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(10,33,61,.07);
  color: #425365;
}
.sidebar-card strong,
.sidebar-card h3 {
  display: block;
  color: #0c243d;
  font-weight: 900;
  margin: 0 0 8px;
}
.sidebar-card p {
  margin: 0;
  line-height: 1.58;
  font-size: 14px;
}
.sidebar-card-dark {
  background: linear-gradient(145deg, #061b35, #0c6092);
  color: rgba(255,255,255,.80);
  border-color: rgba(255,255,255,.14);
  box-shadow: 0 22px 52px rgba(7,23,51,.20);
}
.sidebar-card-dark h3 { color: #fff; }
.sidebar-icon,
.sidebar-step {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  font-weight: 900;
}
.sidebar-icon {
  color: #fff;
  background: rgba(255,255,255,.14);
}
.sidebar-step {
  color: #0d91cd;
  background: rgba(13,145,205,.10);
}
@media (max-width: 1020px) {
  .referral-form-body {
    grid-template-columns: 1fr;
  }
  .referral-form-sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .sidebar-card-dark {
    grid-column: 1 / -1;
  }
}
@media (max-width: 720px) {
  .referral-form-head {
    flex-direction: column;
    padding: 32px 20px 22px;
  }
  .referral-selected-pill {
    width: 100%;
    justify-content: center;
    white-space: normal;
  }
  .referral-form-body {
    padding: 26px 18px 28px;
    gap: 24px;
  }
  .referral-section-label {
    font-size: 12px;
  }
  .referral-actions-row {
    grid-template-columns: 1fr;
  }
  .referral-submit-pro {
    width: 100%;
    min-width: 0;
  }
  .referral-form-sidebar {
    grid-template-columns: 1fr;
  }
  .referral-form-grid-enhanced input,
  .referral-form-grid-enhanced select,
  .referral-form-grid-enhanced textarea {
    font-size: 16px;
    border-radius: 16px;
  }
}
