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

:root {
  --ink: #16181d;
  --muted: #656a73;
  --blue: #2357e6;
  --blue-dark: #1745c4;
  --navy: #16233f;
  --red: #d83a4b;
  --green: #22c55e;
  --line: #e5e7eb;
  --surface: #f6f6f3;
  --white: #fff;
}

html { min-height: 100%; }
body {
  background: var(--surface);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  min-height: 100vh;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.form-header {
  align-items: center;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 68px;
  justify-content: space-between;
  padding: 0 36px;
  position: relative;
  z-index: 5;
}
.form-brand { color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: -.025em; text-decoration: none; }
.header-help { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.header-help:hover { color: var(--blue); }

.form-layout { display: grid; grid-template-columns: minmax(330px, .78fr) minmax(560px, 1.22fr); min-height: calc(100vh - 68px); }
.form-aside {
  background-image: url('../assets/hero-family.png');
  background-position: 67% center;
  background-size: cover;
  color: var(--white);
  min-height: calc(100vh - 68px);
  overflow: hidden;
  padding: 64px 54px;
  position: relative;
}
.aside-overlay { background: linear-gradient(180deg, rgba(8,14,27,.38), rgba(8,14,27,.91)); inset: 0; position: absolute; }
.aside-content { bottom: 64px; left: 54px; max-width: 430px; position: absolute; right: 54px; z-index: 1; }
.aside-eyebrow { align-items: center; display: inline-flex; font-size: 11px; font-weight: 700; gap: 8px; letter-spacing: .08em; margin-bottom: 18px; text-transform: uppercase; }
.aside-eyebrow span { animation: pulse 1.8s infinite; background: var(--green); border-radius: 50%; height: 7px; width: 7px; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .42; } }
.aside-content h1 { font-size: clamp(40px, 4.2vw, 64px); letter-spacing: -.055em; line-height: .98; margin: 0 0 20px; }
.aside-content > p { color: rgba(255,255,255,.78); font-size: 15px; line-height: 1.65; margin: 0; }
.aside-benefits { display: grid; gap: 12px; list-style: none; margin: 30px 0 0; padding: 0; }
.aside-benefits li { align-items: center; display: flex; font-size: 13px; font-weight: 600; gap: 10px; }
.check { align-items: center; background: rgba(255,255,255,.16); border-radius: 50%; display: inline-flex; flex: 0 0 auto; height: 24px; justify-content: center; width: 24px; }

.form-panel { align-items: flex-start; display: flex; justify-content: center; overflow: auto; padding: 54px 48px 40px; }
.form-shell { max-width: 660px; width: 100%; }
.progress-meta { align-items: center; color: var(--muted); display: flex; font-size: 12px; font-weight: 600; justify-content: space-between; }
.progress-track { background: #e3e6ec; border-radius: 999px; height: 6px; margin: 12px 0 48px; overflow: hidden; }
.progress-fill { background: var(--blue); border-radius: inherit; height: 100%; transition: width .28s ease; width: 8.333%; }
.mobile-back { background: none; border: 0; color: var(--ink); cursor: pointer; font-size: 20px; padding: 0 10px 0 0; }

#property-form { min-height: 470px; }
.form-step { border: 0; display: none; margin: 0; padding: 0; }
.form-step.is-active { animation: stepIn .25s ease; display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.form-step legend { font-size: clamp(30px, 3.4vw, 43px); font-weight: 800; letter-spacing: -.045em; line-height: 1.08; margin: 0; max-width: 620px; padding: 0; }
.step-helper { color: var(--muted); font-size: 15px; line-height: 1.6; margin: 14px 0 32px; }
.input-label { color: #3f444d; display: flex; font-size: 12px; font-weight: 700; justify-content: space-between; margin-bottom: 8px; }
.input-label span { color: #9297a0; font-weight: 500; }
.text-input {
  appearance: none;
  background: var(--white);
  border: 1.5px solid #ccd1da;
  border-radius: 11px;
  color: var(--ink);
  font-size: 16px;
  min-height: 56px;
  outline: none;
  padding: 15px 16px;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.text-input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(35,87,230,.1); }
.text-input::placeholder { color: #9ba0aa; }
.short-input { max-width: 260px; }
.field-error { color: #b42334; font-size: 12px; min-height: 18px; margin: 8px 0 0; }
.form-step.has-error .text-input { border-color: #d83a4b; }

.choice-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-card { cursor: pointer; min-width: 0; position: relative; }
.choice-card input { opacity: 0; pointer-events: none; position: absolute; }
.choice-card span {
  align-items: center;
  background: var(--white);
  border: 1.5px solid #d4d8e0;
  border-radius: 11px;
  color: #333842;
  display: flex;
  font-size: 14px;
  font-weight: 600;
  justify-content: space-between;
  min-height: 58px;
  padding: 14px 16px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.choice-card span::after { border: 1.5px solid #b9bec8; border-radius: 50%; content: ''; flex: 0 0 auto; height: 18px; margin-left: 12px; width: 18px; }
.choice-card:hover span { border-color: #9ba9cb; }
.choice-card input:focus-visible + span { box-shadow: 0 0 0 4px rgba(35,87,230,.1); }
.choice-card input:checked + span { background: #eef3ff; border-color: var(--blue); color: #173987; }
.choice-card input:checked + span::after { background: radial-gradient(circle, var(--blue) 0 4px, transparent 5px); border-color: var(--blue); }
.choice-card-wide { grid-column: 1 / -1; }

.price-input-wrap { position: relative; }
.price-input-wrap > span { color: var(--ink); font-size: 18px; font-weight: 700; left: 17px; position: absolute; top: 50%; transform: translateY(-50%); }
.price-input-wrap .text-input { padding-left: 34px; }
.contact-grid { display: grid; gap: 18px 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.consent-copy { color: #767b84; font-size: 10.5px; line-height: 1.55; margin: 20px 0 0; }
.consent-copy a { color: var(--blue); }

.form-actions { align-items: center; display: flex; justify-content: space-between; margin-top: 38px; }
.back-button, .continue-button, .submit-button { border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 700; min-height: 50px; padding: 12px 22px; }
.back-button { background: transparent; border: 0; color: var(--muted); padding-left: 0; }
.back-button:hover { color: var(--ink); }
.continue-button, .submit-button { background: var(--blue); border: 0; color: var(--white); margin-left: auto; min-width: 160px; }
.continue-button:hover, .submit-button:hover { background: var(--blue-dark); }
.privacy-note { align-items: center; color: #878c95; display: flex; font-size: 11px; gap: 7px; justify-content: center; margin: 28px 0 0; text-align: center; }

.success-panel { padding-top: 30px; text-align: center; }
.success-icon { align-items: center; background: #e8f8ee; border-radius: 50%; color: #168a43; display: flex; font-size: 28px; height: 68px; justify-content: center; margin: 0 auto 24px; width: 68px; }
.success-kicker { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.success-panel h2 { font-size: 36px; letter-spacing: -.04em; line-height: 1.08; margin: 12px auto 14px; max-width: 520px; }
.success-panel p { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 0 auto 24px; max-width: 520px; }
.success-panel a { color: var(--blue); font-size: 14px; font-weight: 700; }

[hidden] { display: none !important; }

@media (max-width: 980px) {
  .form-layout { grid-template-columns: 310px minmax(0, 1fr); }
  .form-aside { padding: 42px 32px; }
  .aside-content { bottom: 42px; left: 32px; right: 32px; }
  .aside-content h1 { font-size: 42px; }
  .form-panel { padding: 48px 32px 36px; }
}

@media (max-width: 760px) {
  body { background: var(--white); }
  .form-header { height: 62px; padding: 0 18px; }
  .form-brand { font-size: 15px; }
  .form-layout { display: block; min-height: calc(100vh - 62px); }
  .form-aside { display: none; }
  .form-panel { display: block; overflow: visible; padding: 28px 20px 30px; }
  .form-shell { margin: 0 auto; max-width: 560px; }
  .progress-meta { justify-content: flex-start; }
  #progress-percent { margin-left: auto; }
  .mobile-back:not([hidden]) { display: inline-block; }
  .progress-track { margin: 10px 0 38px; }
  #property-form { min-height: 0; }
  .form-step legend { font-size: clamp(29px, 8.8vw, 38px); }
  .step-helper { font-size: 14px; margin-bottom: 26px; }
  .choice-grid, .choice-grid-three { gap: 10px; grid-template-columns: 1fr; }
  .choice-card-wide { grid-column: auto; }
  .choice-card span { min-height: 54px; }
  .contact-grid { grid-template-columns: 1fr; }
  .short-input { max-width: none; }
  .back-button { display: none; }
  .continue-button, .submit-button { width: 100%; }
  .form-actions { margin-top: 28px; }
  .privacy-note { margin-top: 22px; }
}

@media (max-width: 360px) {
  .form-panel { padding-left: 16px; padding-right: 16px; }
  .form-step legend { font-size: 28px; }
}

#results {
    z-index: 1000;

    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;

    max-height: 300px;
    overflow-y: auto;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#results:empty {
    display: none;
}

#results > div {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    border-bottom: 1px solid #f2f2f2;
    transition: background-color 0.15s ease;
}

#results > div:last-child {
    border-bottom: none;
}

#results > div:hover,
#results > div.active {
    background: #f5f5f5;
}