/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:    #C0272D;
  --navy:   #1B2A4A;
  --blue:   #003399;
  --lgray:  #F4F5F7;
  --mgray:  #D0D3DA;
  --dark:   #2A2A2A;
  --med:    #666666;
  --white:  #ffffff;
  --green:  #1A7A3C;
  --font-head: 'DM Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --max-w: 820px;
}

body {
  font-family: var(--font-body);
  background: #f0f2f5;
  color: var(--dark);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  padding: 28px 0 0;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo-wrap { flex-shrink: 0; }
.logo { height: 62px; width: auto; display: block; }

.header-text { flex: 1; }
.header-tag {
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--blue);
  margin-bottom: 4px;
}
.header-title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}
.header-sub {
  font-size: 13px;
  color: var(--med);
  margin-top: 4px;
  line-height: 1.4;
}
.header-rule {
  max-width: var(--max-w);
  margin: 20px auto 0;
  padding: 0 28px;
  height: 3px;
  background: var(--red);
}

/* ── Referral / Contact Bar ─────────────────────────────────────────────── */
.referral-bar {
  background: var(--white);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--mgray);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.referral-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex-shrink: 0;
}
.referral-label {
  font-weight: 600;
  color: var(--navy);
  font-family: var(--font-head);
}
.referral-contact a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}
.referral-contact a:hover {
  text-decoration: underline;
}
.referral-dot {
  color: var(--mgray);
}
.referral-fields {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.referral-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}
.referral-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--med);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-family: var(--font-head);
}
.referral-field input {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--mgray);
  border-radius: 4px;
  color: var(--dark);
  background: var(--lgray);
  outline: none;
  transition: border-color 0.2s;
}
.referral-field input:focus {
  border-color: var(--blue);
  background: var(--white);
}

/* ── Main Wrap ─────────────────────────────────────────────────────────── */
.form-wrap {
  max-width: var(--max-w);
  margin: 28px auto 40px;
  padding: 0 28px;
}

/* ── Form Section ──────────────────────────────────────────────────────── */
.form-section {
  background: var(--white);
  border-radius: 6px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.section-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
}
.section-hdr.red  { background: var(--red); }
.section-hdr.blue { background: var(--blue); }

/* Standalone section header (not inside .form-section) */
.section-hdr-standalone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
  border-radius: 6px;
}
.section-hdr-standalone.red  { background: var(--red); }
.section-hdr-standalone.blue { background: var(--blue); }

.section-bar-row {
  margin-bottom: 12px;
}

.section-intro {
  font-size: 13px;
  color: var(--med);
  line-height: 1.5;
  margin-top: 10px;
}

.section-num {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.75;
  letter-spacing: 0.05em;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }

label {
  font-family: var(--font-head);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
}
.req { color: var(--red); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--mgray);
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
input:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,51,153,0.1);
}
input::placeholder, textarea::placeholder { color: #aaa; }

textarea { resize: vertical; min-height: 70px; line-height: 1.5; }

/* Currency prefix — reserves enough room so even a 7-digit value like
   1,000,000 never overlaps the $ symbol. Symbol sits 14px from the left;
   input gets 32px left-padding so the leftmost digit clears it cleanly. */
.input-prefix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 500;
  color: var(--med);
  pointer-events: none;
  font-family: var(--font-body);
  line-height: 1;
  z-index: 1;
}
.input-prefix-wrap input {
  padding-left: 32px;
}

/* Suffix wrap (for %) — reserves enough room so a 3-digit value (e.g. 100)
   never overlaps the symbol. Suffix sits 14px from the right edge; input
   gets 28px right-padding so the rightmost digit stops well before the %.
   Spinner arrows are hidden because they would steal the same space. */
.input-suffix-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 500;
  color: var(--med);
  pointer-events: none;
  font-family: var(--font-body);
  line-height: 1;
}
.input-suffix-wrap input {
  padding-right: 28px;
  -moz-appearance: textfield;
}
.input-suffix-wrap input::-webkit-inner-spin-button,
.input-suffix-wrap input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Land Value Row */
.land-value-row {
  margin-top: 12px;
  padding: 14px 16px;
  background: #f8f9fb;
  border: 1px solid var(--mgray);
  border-radius: 6px;
}
.land-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 10px;
}
.land-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
}
.land-field {
  flex: 1;
}
.land-field label {
  font-size: 12px;
  color: var(--med);
  margin-bottom: 4px;
}
.land-or {
  font-size: 13px;
  color: var(--med);
  font-weight: 500;
  padding-top: 18px;
}
@media (max-width: 600px) {
  .land-inputs {
    flex-direction: column;
    gap: 8px;
  }
  .land-or {
    padding-top: 0;
  }
}

/* Select */
.select-wrap {
  position: relative;
}
select {
  width: 100%;
  padding: 10px 36px 10px 13px;
  border: 1.5px solid var(--mgray);
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,51,153,0.1);
}
.select-arrow {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--med);
  pointer-events: none;
}

/* ── Property Cards ───────────────────────────────────────────────────── */
.property-card {
  background: var(--white);
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  border: 1.5px solid var(--mgray);
  transition: border-color 0.2s;
}
.property-card:hover { border-color: var(--blue); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--lgray);
  border-bottom: 1px solid var(--mgray);
  cursor: default;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

.card-title {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}

.card-address-preview {
  font-size: 12.5px;
  color: var(--med);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-collapse, .btn-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--mgray);
  border-radius: 5px;
  background: var(--white);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 12px;
  color: var(--med);
}
.btn-collapse:hover { border-color: var(--blue); color: var(--blue); }
.btn-remove:hover { border-color: var(--red); color: var(--red); background: #fff5f5; }

.card-body {
  padding: 6px 20px 20px;
  transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
  overflow: hidden;
}
.card-body.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.card-section-label {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 16px 0 4px;
}

.card-divider {
  height: 1px;
  background: var(--mgray);
  margin: 8px 0 4px;
}

/* Add property button */
.btn-add-property {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  margin-bottom: 16px;
  background: var(--white);
  border: 2px dashed var(--mgray);
  border-radius: 6px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-add-property:hover {
  border-color: var(--blue);
  background: #f0f4ff;
}
.plus-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

/* ── Checkboxes ────────────────────────────────────────────────────────── */
.section-note {
  padding: 12px 20px 4px;
  font-size: 13px;
  color: var(--med);
  line-height: 1.4;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 20px 20px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--dark);
  padding: 9px 12px;
  border: 1.5px solid var(--mgray);
  border-radius: 5px;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.check-item:hover { border-color: var(--blue); background: #f0f4ff; }
.check-item input[type="checkbox"] { display: none; }

.checkmark {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 2px solid var(--mgray);
  border-radius: 4px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.check-item input:checked ~ .checkmark {
  background: var(--blue);
  border-color: var(--blue);
}
.check-item input:checked ~ .checkmark::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}
.check-item input:checked ~ span:last-child { color: var(--navy); font-weight: 500; }

/* ── Submit ────────────────────────────────────────────────────────────── */
.submit-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 48px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
  min-width: 240px;
}
.btn-submit:hover  { background: #a0191f; }
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { background: var(--mgray); cursor: not-allowed; }

.submit-note {
  font-size: 12.5px;
  color: var(--med);
  text-align: center;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Validation errors ─────────────────────────────────────────────────── */
input.error, select.error, textarea.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192,39,45,0.1);
}
.error-msg {
  font-size: 11.5px;
  color: var(--red);
  margin-top: 2px;
}

/* ── Success State ─────────────────────────────────────────────────────── */
.success-state {
  background: var(--white);
  border-radius: 6px;
  padding: 56px 40px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.success-icon {
  width: 64px;
  height: 64px;
  background: var(--green);
  color: white;
  font-size: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.success-state h2 {
  font-family: var(--font-head);
  font-size: 24px;
  color: var(--navy);
  margin-bottom: 12px;
}
.success-state p { font-size: 15px; color: var(--dark); line-height: 1.6; margin-bottom: 8px; }
.success-sub { font-size: 13px; color: var(--med); }
.success-sub a { color: var(--blue); }

.hidden { display: none !important; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--white);
  padding: 0;
}
.footer-rule {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 2px;
  background: var(--red);
}
.site-footer .footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 28px 24px;
  text-align: center;
}
.site-footer p {
  text-align: center;
  margin: 6px auto;
  line-height: 1.55;
}
.site-footer .footer-contact {
  font-size: 12px;
  color: var(--med);
}
.site-footer .footer-contact a {
  color: var(--med);
  text-decoration: none;
}
.site-footer .footer-contact a:hover {
  text-decoration: underline;
}
.site-footer .footer-copyright {
  font-size: 12px;
  color: var(--dark);
  font-weight: 500;
  margin-top: 10px;
}
.site-footer .footer-legal,
.site-footer .footer-disclaimer {
  font-size: 11px;
  color: var(--med);
  max-width: 760px;
  line-height: 1.5;
}
.site-footer .footer-disclaimer {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Header — more compact on mobile */
  .header-inner {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    text-align: center;
  }
  .logo { height: 52px; }
  .header-title { font-size: 17px; }
  .header-sub { font-size: 12px; }
  .header-rule { margin-left: 16px; margin-right: 16px; padding: 0; }

  /* Referral bar — stack on mobile */
  .referral-bar { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; }
  .referral-contact { justify-content: center; flex-wrap: wrap; }
  .referral-fields { flex-direction: column; }
  .referral-field { min-width: 100%; }
  .referral-field input { font-size: 16px; }

  /* Form layout */
  .form-wrap { padding: 0 12px; margin: 16px auto 28px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; padding: 14px; }
  .field.full { grid-column: 1; }

  /* Larger touch targets for inputs */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px; /* prevents iOS zoom */
    padding: 12px 13px;
    min-height: 48px;
  }
  select { padding: 12px 36px 12px 13px; }

  /* Checkbox grid — single column */
  .checkbox-grid { grid-template-columns: 1fr; gap: 6px; padding: 10px 14px 14px; }
  .check-item { padding: 10px 12px; font-size: 14px; }
  .checkbox-label { font-size: 14px; gap: 8px; }
  .checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 0;
  }

  /* Section headers */
  .section-hdr, .section-hdr-standalone { padding: 10px 14px; font-size: 12px; }
  .section-note { padding: 10px 14px 4px; }
  .section-intro { font-size: 12.5px; }

  /* Property cards */
  .card-header { padding: 10px 14px; }
  .card-body { padding: 6px 14px 14px; }
  .card-address-preview { display: none; }
  .card-section-label { font-size: 11px; margin: 14px 0 4px; }
  .btn-collapse, .btn-remove {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  /* Flooring rows — stack on mobile */
  .flooring-row {
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
  }
  .flooring-type { min-width: 0; width: 100%; }
  .flooring-pct-wrap { width: 100%; }
  .flooring-pct { width: 100%; }
  .btn-remove-flooring {
    width: 36px;
    height: 36px;
    align-self: flex-end;
  }
  .btn-add-flooring { width: 100%; justify-content: center; padding: 10px 14px; }

  /* Submit area */
  .btn-submit { width: 100%; padding: 16px; font-size: 16px; min-width: unset; }
  .submit-row { margin-top: 4px; }

  /* Success state */
  .success-state { padding: 32px 16px; }
  .success-state h2 { font-size: 20px; }
  .success-state p { font-size: 14px; }

  /* Add property button */
  .btn-add-property { padding: 16px; font-size: 14px; }

  /* Footer */
  .site-footer p { font-size: 11px; padding: 12px 16px; }
}

/* ── Flooring Multi-Row Section ───────────────────────────────────────── */
.flooring-section {
  margin-bottom: 8px;
}
.flooring-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.flooring-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--navy);
}
.flooring-total {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: #e8e8e8;
  color: #666;
  transition: all .2s;
}
.flooring-total.pct-ok {
  background: #e6f4ea;
  color: #1a7f37;
}
.flooring-total.pct-warn {
  background: #fff3e0;
  color: #b45309;
}
.flooring-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.flooring-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.flooring-type {
  flex: 1;
  min-width: 180px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #333;
  appearance: auto;
}
.flooring-type:focus {
  border-color: var(--navy);
  outline: none;
  box-shadow: 0 0 0 2px rgba(27,42,74,.12);
}
.flooring-pct-wrap {
  position: relative;
  width: 130px;
  flex-shrink: 0;
}
.flooring-pct {
  width: 100%;
  /* Right-padding (40px) keeps a 3-digit value (100) clear of the %.
     The text is right-aligned, so its rightmost edge sits exactly at the
     padding boundary — must stay well to the left of the % symbol. */
  padding: 8px 40px 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  text-align: right;
  -moz-appearance: textfield;
}
.flooring-pct::-webkit-inner-spin-button,
.flooring-pct::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.flooring-pct:focus {
  border-color: var(--navy);
  outline: none;
  box-shadow: 0 0 0 2px rgba(27,42,74,.12);
}
.pct-symbol {
  position: absolute;
  /* Symbol sits 12px from the right edge. Combined with the input's 32px
     right-padding above, that leaves a clear gap between any digit and the %. */
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 500;
  color: #666;
  pointer-events: none;
  line-height: 1;
}
.btn-remove-flooring {
  width: 30px;
  height: 30px;
  border: none;
  background: #f0f0f0;
  color: #999;
  font-size: 18px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .15s;
}
.btn-remove-flooring:hover {
  background: #fee;
  color: var(--red);
}
.btn-add-flooring {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1px dashed #bbb;
  border-radius: 6px;
  background: transparent;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
}
.btn-add-flooring:hover {
  border-color: var(--navy);
  background: rgba(27,42,74,.04);
}

/* ── Checkbox Grid (Specialty Rooms, Decorative Features) ─────────── */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}
@media (max-width: 600px) {
  .checkbox-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: #444;
  cursor: pointer;
  line-height: 1.4;
}
.checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--navy);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════ */
/* SAVINGS ESTIMATE MODAL                                          */
/* ═══════════════════════════════════════════════════════════════ */

.est-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(27, 42, 74, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow-y: auto;
}
.est-overlay.est-visible {
  opacity: 1;
}

.est-modal {
  background: var(--white);
  border-radius: 14px;
  max-width: 680px;
  width: 100%;
  position: relative;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.est-visible .est-modal {
  transform: translateY(0) scale(1);
}

/* Close button */
.est-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  font-size: 22px;
  color: var(--med);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
}
.est-close:hover {
  background: var(--white);
  color: var(--dark);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Hero section */
.est-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #0d1a30 100%);
  padding: 36px 32px 32px;
  text-align: center;
}
.est-hero-tag {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 10px;
}
.est-hero-amount {
  font-family: var(--font-head);
  font-size: 48px;
  font-weight: 700;
  color: #4ADE80;
  line-height: 1.1;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}
.est-hero-sub {
  font-size: 13.5px;
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
}

/* KPI Cards */
.est-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--mgray);
  border-bottom: 1px solid var(--mgray);
}
.est-kpi {
  background: var(--white);
  padding: 20px 16px;
  text-align: center;
}
.est-kpi-highlight {
  background: #fefce8;
}
.est-kpi-label {
  font-family: var(--font-head);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--med);
  margin-bottom: 6px;
}
.est-kpi-value {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.est-roi-value {
  color: var(--red);
}
.est-kpi-note {
  font-size: 11.5px;
  color: var(--med);
  margin-top: 4px;
}

/* Table section */
.est-table-wrap {
  padding: 24px 28px 16px;
}
.est-section-title {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}

.est-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.est-table th {
  font-family: var(--font-head);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--med);
  padding: 8px 10px;
  border-bottom: 2px solid var(--mgray);
  text-align: left;
}
.est-th-num {
  text-align: right !important;
}
.est-td-label {
  padding: 10px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.est-td-num {
  padding: 10px 10px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--dark);
}
.est-td-savings {
  color: var(--green);
  font-weight: 600;
}
.est-prop-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--lgray);
  color: var(--navy);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}
.est-prop-addr {
  color: var(--dark);
  font-size: 13px;
}
.est-total-row td {
  border-top: 2px solid var(--mgray);
  padding-top: 12px;
}

/* Single-property detail table */
.est-table-detail td {
  padding: 9px 10px;
  border-bottom: 1px solid #f0f0f0;
}
.est-detail-label {
  color: var(--dark);
  font-size: 13px;
}
.est-detail-val {
  text-align: right;
  font-weight: 600;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.est-table-detail .est-total-row td {
  border-top: 2px solid var(--mgray);
  border-bottom: none;
  padding-top: 12px;
}

/* CTA Section */
.est-cta-section {
  padding: 20px 28px 28px;
}
.est-cta-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f0f4ff;
  border: 1px solid #d0dcf0;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 12.5px;
  color: var(--navy);
  line-height: 1.5;
  margin-bottom: 20px;
}
.est-shield-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--blue);
  margin-top: 1px;
}
.est-cta-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.est-btn-proceed {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}
.est-btn-proceed:hover {
  background: #a0191f;
}
.est-btn-proceed:active {
  transform: scale(0.98);
}
.est-arrow {
  width: 18px;
  height: 18px;
}
.est-btn-back {
  background: none;
  border: 1.5px solid var(--mgray);
  border-radius: 8px;
  padding: 13px 24px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--med);
  cursor: pointer;
  transition: all 0.15s;
}
.est-btn-back:hover {
  border-color: var(--navy);
  color: var(--navy);
}
.est-fine-print {
  text-align: center;
  font-size: 12px;
  color: var(--med);
  margin-top: 14px;
  line-height: 1.4;
}

/* ── Form 3115 CPA Toggle ─────────────────────────────────────────────── */
.est-3115-toggle {
  margin: 16px 24px 0;
  padding: 14px 16px;
  background: #f0f7f4;
  border: 1px solid #c8e0d4;
  border-radius: 8px;
}
.est-toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}
.est-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.est-toggle-text strong {
  font-size: 13px;
  color: #1B2A4A;
}
.est-toggle-sub {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
}
/* Toggle switch */
.est-toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  margin-top: 2px;
}
.est-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.est-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  border-radius: 24px;
  transition: background 0.25s;
}
.est-toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
}
.est-toggle-switch input:checked + .est-toggle-slider {
  background: #1B6B3A;
}
.est-toggle-switch input:checked + .est-toggle-slider::before {
  transform: translateX(20px);
}

/* Modal responsive */
@media (max-width: 600px) {
  .est-overlay { padding: 12px; }
  .est-modal {
    max-width: 100%;
    border-radius: 10px;
    max-height: 95vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .est-close {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
  .est-hero {
    padding: 28px 16px 24px;
  }
  .est-hero-amount {
    font-size: 32px;
  }
  .est-hero-sub {
    font-size: 12px;
  }
  .est-kpis {
    grid-template-columns: 1fr;
  }
  .est-kpi {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }
  .est-kpi-value {
    font-size: 20px;
  }
  .est-kpi-label {
    margin-bottom: 0;
  }
  .est-kpi-note {
    display: none;
  }
  .est-table-wrap {
    padding: 14px 12px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .est-table {
    font-size: 12px;
    min-width: 380px;
  }
  .est-table th, .est-table td {
    padding: 8px 6px;
  }
  .est-section-title {
    font-size: 11px;
  }
  .est-cta-section {
    padding: 14px 12px 20px;
  }
  .est-cta-note {
    font-size: 11.5px;
    padding: 12px;
  }
  .est-cta-buttons {
    flex-direction: column;
  }
  .est-btn-proceed {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
    font-size: 16px;
  }
  .est-btn-back {
    width: 100%;
    text-align: center;
    padding: 14px 24px;
  }
  .est-fine-print {
    font-size: 11px;
  }
}

/* ── Cost Seg Report Generation Section ─────────────────────────────── */
.costseg-report-section {
  margin-top: 28px;
  text-align: left;
}

.costseg-report-divider {
  height: 2px;
  background: linear-gradient(90deg, var(--red) 0%, var(--navy) 100%);
  margin: 24px 0;
  border-radius: 2px;
}

.costseg-report-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px;
}

.costseg-report-desc {
  font-size: 13.5px;
  color: var(--med);
  line-height: 1.6;
  margin: 0 0 18px;
}

.costseg-property-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.costseg-prop-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 1px solid var(--mgray);
  border-radius: 8px;
  padding: 14px 18px;
  gap: 16px;
}

.costseg-prop-info {
  flex: 1;
  min-width: 0;
}

.costseg-prop-addr {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.costseg-prop-meta {
  font-size: 12.5px;
  color: var(--med);
  margin-top: 2px;
}

.btn-generate-report {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: none;
  border-radius: 6px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  color: var(--white);
  background: var(--navy);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, opacity 0.2s;
}

.btn-generate-report:hover:not(:disabled) {
  background: #0e1b33;
}

.btn-generate-report:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-report-done {
  background: var(--green) !important;
  opacity: 1 !important;
}

.gen-icon {
  font-size: 15px;
}

.gen-check {
  font-size: 14px;
  font-weight: 700;
}

/* Small inline spinner for the generate button */
.spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Cost seg status messages */
.costseg-status {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.55;
}

.costseg-status-progress {
  background: #EBF0FA;
  color: var(--navy);
  border: 1px solid #C8D4EB;
}

.costseg-status-success {
  background: #EDF7EF;
  color: #1A5C2E;
  border: 1px solid #B8DCBE;
}

.costseg-status-error {
  background: #FDECEC;
  color: #8B1A1A;
  border: 1px solid #E8BFBF;
}

.costseg-summary {
  font-size: 12.5px;
  color: #4A7C5A;
}

@media (max-width: 600px) {
  .costseg-prop-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .btn-generate-report {
    justify-content: center;
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* V2 ACCORDION STYLES                                                         */
/* Appended — no existing rules modified                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ── Progress Indicator ──────────────────────────────────────────────────── */
.intake-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--mgray);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
}

.intake-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--mgray);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.intake-progress-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: var(--progress, 0%);
  background: var(--green);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.intake-progress-text {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Accordion Header ────────────────────────────────────────────────────── */
.accordion-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  min-height: 44px;
  background: var(--lgray);
  border: none;
  border-top: 1px solid var(--mgray);
  border-radius: 0;
  cursor: pointer;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  text-align: left;
  position: relative;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}

.accordion-hdr:first-of-type {
  border-top: none;
}

.accordion-hdr:hover {
  background: #e8edf5;
  color: var(--blue);
}

/* Chevron icon inside accordion header */
.accordion-hdr .chev {
  margin-left: auto;
  font-size: 11px;
  color: var(--med);
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  /* Right-facing triangle → points down when expanded */
  display: inline-block;
}

.accordion-hdr[aria-expanded="true"] .chev {
  transform: rotate(90deg);
}

/* Error state — red dot on right */
.accordion-hdr.has-error::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: 6px;
  box-shadow: 0 0 0 2px rgba(192,39,45,0.2);
}

/* Complete state — green checkmark on right */
.accordion-hdr.is-complete::after {
  content: '✓';
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  flex-shrink: 0;
  margin-left: 6px;
  line-height: 1;
}

/* Can't have both; has-error takes precedence */
.accordion-hdr.has-error.is-complete::after {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
}

/* ── Accordion Body ───────────────────────────────────────────────────────── */
.accordion-body {
  padding: 16px 20px 20px;
  overflow: hidden;
  /* Smooth open/close via max-height */
  max-height: 4000px;
  transition:
    max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease,
    padding 0.25s ease;
  opacity: 1;
}

/* Hidden state — use [hidden] attribute to hide body */
.accordion-body[hidden]:not(.hidden) {
  display: block !important; /* override browser default so transitions work */
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}

/* Fade-in when body becomes visible */
.accordion-body:not([hidden]) {
  animation: accordionFadeIn 0.2s ease forwards;
  visibility: visible;
}

@keyframes accordionFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Nested / Sub-Accordion Styles ──────────────────────────────────────── */
/* Sub-accordions (categories inside renovations) — indented, smaller font */
.accordion-nested .accordion-hdr {
  padding-left: 28px;
  font-size: 12.5px;
  font-weight: 600;
  background: #f8f9fb;
  border-top-color: #e8eaef;
}

.accordion-nested .accordion-hdr:hover {
  background: #eef1f7;
}

.accordion-nested .accordion-body {
  padding-left: 28px;
  padding-right: 16px;
  background: #fafbfc;
}

/* ── Renovation Category Grid ───────────────────────────────────────────── */
.renovation-categories {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 12px;
}

.renovation-category {
  background: var(--white);
  border: 1.5px solid var(--mgray);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.renovation-category:hover {
  border-color: #b0b8c8;
}

/* ── Sub-Item Inline Expanded Row ───────────────────────────────────────── */
.renovation-sub-item-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr;
  gap: 10px;
  align-items: start;
  margin-top: 8px;
  padding: 12px 14px;
  background: #f4f7fb;
  border-radius: 6px;
  border: 1px solid #dde3ee;
  animation: accordionFadeIn 0.15s ease forwards;
}

.renovation-sub-item-row label {
  font-size: 11px;
  font-weight: 600;
  color: var(--med);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
  display: block;
  font-family: var(--font-head);
}

/* ── Look-Back Badge ────────────────────────────────────────────────────── */
.lookback-badge {
  display: inline-block;
  background: linear-gradient(135deg, #d4a017, #b8860b);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: 8px;
}

/* ── Photo Portal Button (disabled placeholder) ─────────────────────────── */
.photo-portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1.5px dashed var(--mgray);
  border-radius: 5px;
  background: var(--lgray);
  color: var(--med);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  cursor: not-allowed;
  opacity: 0.65;
  position: relative;
  margin-top: 6px;
}

.photo-portal-btn:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--white);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ── Renovation Summary Strip ───────────────────────────────────────────── */
.renovation-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 14px 18px;
  background: #f0f4fb;
  border: 1px solid #d0daea;
  border-radius: 6px;
}

.renovation-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.renovation-summary-label {
  font-family: var(--font-head);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--med);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.renovation-summary-value {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

/* ── Mobile-first overrides for V2 accordion (< 640px) ─────────────────── */
@media (max-width: 640px) {
  /* Progress bar — thinner on mobile */
  .intake-progress {
    height: 40px;
    padding: 0 14px;
    gap: 10px;
  }

  /* Accordion header — full-width, ensure 44px tap target */
  .accordion-hdr {
    padding: 13px 14px;
    min-height: 44px;
    font-size: 12.5px;
  }

  .accordion-nested .accordion-hdr {
    padding-left: 18px;
    font-size: 12px;
  }

  /* Accordion body — reduced padding */
  .accordion-body {
    padding: 12px 14px 16px;
  }

  .accordion-nested .accordion-body {
    padding-left: 14px;
    padding-right: 10px;
  }

  /* Renovation sub-item rows — stack vertically on mobile */
  .renovation-sub-item-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
  }

  /* Renovation summary — stack on mobile */
  .renovation-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }

  /* Renovation category grid — full-width stacked */
  .renovation-categories {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  /* Look-back badge — slightly smaller */
  .lookback-badge {
    font-size: 10px;
    padding: 2px 7px;
  }

  /* Photo portal — full width on mobile */
  .photo-portal-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 12px;
    min-height: 44px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* QUICK QUOTE MODAL                                                           */
/* All classes prefixed with .quote- to avoid conflicts                        */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* ── Native <dialog> backdrop ──────────────────────────────────────────────── */
.quote-modal::backdrop {
  background: rgba(27, 42, 74, 0.60);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ── Modal container ─────────────────────────────────────────────────────── */
.quote-modal {
  max-width: 520px;
  width: 100%;
  margin: auto; /* centers the dialog in the viewport */
  padding: 0;
  border: none;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.28), 0 0 0 1px rgba(0,0,0,0.06);
  background: var(--white);
  overflow: hidden;
  /* Prevent overflow on small viewports */
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Inner content wrapper ───────────────────────────────────────────────── */
.quote-modal-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 32px 32px 28px;
}

/* ── Modal header ────────────────────────────────────────────────────────── */
.quote-modal-header {
  margin-bottom: 20px;
}

.quote-modal-title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  margin: 0 0 6px;
}

.quote-modal-sub {
  font-size: 13.5px;
  color: var(--med);
  line-height: 1.4;
  margin: 0;
}

/* ── Field wrapper ───────────────────────────────────────────────────────── */
.quote-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.quote-field label {
  font-family: var(--font-head);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
}

/* Inputs inside the modal inherit the existing input styles but we ensure
   they have no extra margin from the global label rule */
.quote-modal-inner input[type="text"],
.quote-modal-inner input[type="email"],
.quote-modal-inner input[type="number"],
.quote-modal-inner select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--mgray);
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

/* Currency inputs inside the modal need extra left padding so the typed
   value never sits behind the $ prefix. This must override the shorthand
   `padding: 10px 13px` rule above, so we match either input type. */
.quote-modal-inner .input-prefix-wrap input[type="text"],
.quote-modal-inner .input-prefix-wrap input[type="number"] {
  padding-left: 32px;
}

.quote-modal-inner select {
  padding: 10px 36px 10px 13px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.quote-modal-inner input:focus,
.quote-modal-inner select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,51,153,0.10);
}

.quote-modal-inner input::placeholder {
  color: #aaa;
}

/* ── Two-column name row (desktop) ──────────────────────────────────────── */
.quote-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Inline error message ────────────────────────────────────────────────── */
.quote-form-error {
  background: #fff0f0;
  border: 1px solid #f5c6c7;
  border-radius: 5px;
  padding: 9px 13px;
  font-size: 13px;
  color: var(--red);
  margin-bottom: 12px;
  line-height: 1.4;
}

/* ── Button row ──────────────────────────────────────────────────────────── */
.quote-btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

/* Primary CTA — NSCS red */
.quote-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  padding: 13px 28px;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
}

.quote-btn-primary:hover {
  background: #a0191f;
}

.quote-btn-primary:active {
  transform: scale(0.98);
}

.quote-btn-primary:disabled {
  background: var(--mgray);
  cursor: not-allowed;
}

/* Secondary / ghost button */
.quote-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1.5px solid var(--mgray);
  border-radius: 7px;
  color: var(--med);
  font-family: var(--font-head);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  width: 100%;
}

.quote-btn-secondary:hover {
  border-color: var(--navy);
  color: var(--navy);
}

/* ── Result state ────────────────────────────────────────────────────────── */
.quote-result-header {
  text-align: center;
  margin-bottom: 20px;
  padding: 24px 20px 20px;
  background: linear-gradient(135deg, var(--navy) 0%, #0d1a30 100%);
  border-radius: 8px;
}

.quote-result-label {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin: 0 0 8px;
}

/* Big number — 56px desktop, navy brand color */
.quote-big-number {
  font-family: var(--font-head);
  font-size: 56px;
  font-weight: 700;
  color: #4ADE80;
  text-align: center;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}

.quote-result-sub {
  font-size: 12.5px;
  color: rgba(255,255,255,0.60);
  line-height: 1.4;
  margin: 0;
}

/* ── Disclaimer small print ──────────────────────────────────────────────── */
.quote-disclaimer {
  font-size: 11.5px;
  color: var(--med);
  line-height: 1.5;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: var(--lgray);
  border-radius: 5px;
  border-left: 3px solid var(--mgray);
}

/* ── Mobile: full-screen modal, big-number 44px, single column ─────────── */
@media (max-width: 640px) {
  .quote-modal {
    max-width: 100%;
    width: 100%;
    min-height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    /* Dialog element is centered by default; on mobile we want full screen */
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
  }

  .quote-modal-inner {
    padding: 24px 20px 28px;
  }

  .quote-modal-title {
    font-size: 17px;
  }

  .quote-name-row {
    grid-template-columns: 1fr; /* stack on mobile */
  }

  .quote-big-number {
    font-size: 44px;
  }

  .quote-modal-inner input[type="text"],
  .quote-modal-inner input[type="email"],
  .quote-modal-inner input[type="number"],
  .quote-modal-inner select {
    font-size: 16px; /* prevent iOS auto-zoom */
    min-height: 48px;
  }
}

/* ── Quick Quote → Full Intake prefill (rev 00060+) ─────────────────────── */
/* Brief soft-glow flash on fields we auto-filled from the quick quote so the
   prospect can see exactly what carried over. */
.qq-prefilled {
  animation: qqPrefillFlash 2.4s ease-out;
}
@keyframes qqPrefillFlash {
  0%   { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.0); background-color: #fff; }
  15%  { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.55); background-color: #fff7ed; }
  60%  { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35); background-color: #fffbeb; }
  100% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.0); background-color: #fff; }
}

/* Toast that appears after we prefill — dismisses itself after ~4.5s */
.qq-prefill-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a1a;
  color: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
  line-height: 1.4;
}
.qq-prefill-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (max-width: 600px) {
  .qq-prefill-toast {
    bottom: 16px;
    font-size: 13px;
    padding: 12px 18px;
  }
}

/* ── Pool features checkbox grid (rev 00064+) ──────────────────────────── */
/* Used inside Section H for Pool Features. Mirrors the inline-styled boat-dock
   grid, but extracted so we can apply consistent visual polish across the
   form. The grid wraps automatically on narrow screens. */
.field-full {
  grid-column: 1 / -1;
}
.label-hint {
  color: #666;
  font-weight: 400;
  font-size: 12px;
  margin-left: 6px;
}
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 14px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.check-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 5px;
  transition: background-color 0.12s;
  user-select: none;
  font-size: 14px;
  color: var(--dark);
}
.check-pill:hover {
  background: #eef2f7;
}
.check-pill input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--blue, #003399);
  flex-shrink: 0;
}
.check-pill span {
  line-height: 1.3;
}
@media (max-width: 600px) {
  .checkbox-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    padding: 10px;
  }
  .check-pill {
    font-size: 13px;
    padding: 5px 6px;
  }
}
