/* HomePilot Connect — fixed buyer-demand map backdrop */

html {
  background: #061427;
}

.connect-body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background: #061427;
}

.connect-body::before,
.connect-body::after {
  content: "";
  position: fixed;
  inset: 70px 0 0;
  pointer-events: none;
}

.connect-body::before {
  z-index: -2;
  background-color: #061427;
  background-image: url("../connect-buyer-demand-map-v1.webp");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  transform: translateZ(0);
}

.connect-body::after {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(3, 12, 24, 0.08) 0%, rgba(3, 12, 24, 0.25) 46%, rgba(3, 12, 24, 0.78) 100%),
    linear-gradient(90deg, rgba(5, 17, 33, 0.88) 0%, rgba(5, 17, 33, 0.58) 34%, rgba(5, 17, 33, 0.16) 72%, rgba(5, 17, 33, 0.42) 100%);
}

.connect-shell {
  position: relative;
  z-index: 1;
}

.connect-marketplace-hero {
  border: 1px solid rgba(215, 181, 95, 0.24);
  background: linear-gradient(135deg, rgba(7, 23, 42, 0.94), rgba(18, 48, 82, 0.82));
  box-shadow: 0 26px 80px rgba(2, 10, 22, 0.34);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}

.connect-panel,
.connect-stat,
.connect-modebar {
  box-shadow: 0 18px 48px rgba(2, 10, 22, 0.16);
}

.connect-panel {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.96);
}

.connect-auth-copy {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(250, 248, 242, 0.95));
}

.connect-section-heading h2 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.34);
}

.connect-section-heading > div > p {
  color: rgba(255, 255, 255, 0.76);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

.connect-modebar {
  background: rgba(233, 237, 243, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.62);
}

.connect-notice:not([hidden]) {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

@supports ((-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px))) {
  .connect-panel {
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

/* Compatibility for the current Connect shell: restore the same branded nav treatment. */
.connect-header {
  min-height: 70px;
  background: #0A1628;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 clamp(20px,4vw,60px);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(10,22,40,.12);
}

.connect-header .connect-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: #fff;
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  font-weight: 700;
  white-space: nowrap;
}

.connect-header .connect-brand strong {
  color: #d7b55f;
}

.connect-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Restore guest Explore styling even while the current HTML shell is simplified. */
.connect-explore {
  margin-top: 26px;
  scroll-margin-top: 92px;
}

.connect-explore-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 18px;
  padding: 0 4px;
}

.connect-explore-heading h2 {
  max-width: 820px;
  margin: 7px 0 9px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-shadow: 0 3px 24px rgba(0,0,0,.36);
}

.connect-explore-heading p {
  max-width: 790px;
  margin: 0;
  color: rgba(255,255,255,.82);
  font-size: .98rem;
  line-height: 1.68;
}

.connect-guest-free-badge {
  border: 1px solid rgba(215,181,95,.38);
  background: rgba(8,25,45,.88);
  color: #f1d989;
}

.connect-guest-modebar {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  width: min(680px,100%);
  margin: 0 auto 18px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 15px;
  background: rgba(7,21,39,.84);
}

.connect-guest-mode-btn {
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: rgba(255,255,255,.78);
  font: inherit;
  font-size: .88rem;
  font-weight: 800;
}

.connect-guest-mode-btn.active {
  background: #fff;
  color: #0A1628;
}

.connect-guest-layout {
  display: grid;
  grid-template-columns: minmax(0,1.08fr) minmax(330px,.92fr);
  gap: 20px;
  align-items: start;
}

.connect-guest-form-card,
.connect-guest-preview {
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(2,10,22,.2);
  padding: 22px;
  color: #172033;
}

.connect-guest-card-heading h3,
.connect-guest-preview h3 {
  margin: 6px 0 8px;
  color: #0A1628;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  line-height: 1.25;
}

.connect-guest-card-heading p,
.connect-guest-preview p {
  margin: 0;
  color: #697386;
  font-size: .9rem;
  line-height: 1.6;
}

.connect-guest-form-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
}

.connect-guest-form-grid .span-2 { grid-column: 1 / -1; }

.connect-guest-form-grid label {
  display: grid;
  gap: 7px;
  color: #40506A;
  font-size: .82rem;
  font-weight: 750;
}

.connect-guest-form-grid input,
.connect-guest-form-grid select,
.connect-guest-form-grid textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #CED6E1;
  border-radius: 10px;
  background: #fff;
  color: #172033;
  font: inherit;
  font-size: 16px;
  line-height: 1.25;
}

.connect-guest-form-grid textarea {
  min-height: 90px;
  resize: vertical;
}

.connect-guest-preview-btn,
.connect-guest-convert {
  width: 100%;
  min-height: 50px;
}

.connect-guest-preview {
  position: sticky;
  top: 92px;
  min-height: 340px;
}

.connect-guest-privacy-strip {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 18px;
  padding: 14px 17px;
  border: 1px solid rgba(215,181,95,.24);
  border-radius: 14px;
  background: rgba(6,20,39,.9);
  color: rgba(255,255,255,.82);
}

.connect-guest-privacy-strip strong { color: #fff; }
.connect-guest-privacy-strip > span { color: #D8B95D; }

@media (max-width: 980px) {
  .connect-body::before { background-position: 62% top; }
  .connect-body::after {
    background:
      linear-gradient(180deg, rgba(3,12,24,.16) 0%, rgba(3,12,24,.38) 48%, rgba(3,12,24,.82) 100%),
      linear-gradient(90deg, rgba(5,17,33,.7) 0%, rgba(5,17,33,.28) 74%, rgba(5,17,33,.5) 100%);
  }
  .connect-guest-layout { grid-template-columns: 1fr; }
  .connect-guest-preview { position: relative; top: auto; }
}

@media (max-width: 680px) {
  .connect-body::before,
  .connect-body::after {
    position: absolute;
    inset: 62px 0 0;
    min-height: calc(100% - 62px);
  }

  .connect-body::before {
    background-position: 66% top;
    transform: none;
  }

  .connect-header {
    min-height: 62px;
    padding: 0 16px;
  }

  .connect-header .connect-brand {
    font-size: 1.12rem;
  }

  .connect-header-actions {
    gap: 7px;
  }

  .connect-header-actions .connect-secondary-btn {
    padding: 8px 10px;
    font-size: .76rem;
  }

  .connect-shell {
    width: min(100% - 24px, 1440px);
    padding-top: 18px;
  }

  .connect-hero,
  .connect-marketplace-hero {
    padding: 26px 20px;
    border-radius: 18px;
  }

  .connect-hero h1,
  .connect-marketplace-hero h1 {
    font-size: clamp(2rem, 11vw, 3rem);
    line-height: 1.02;
  }

  .connect-hero p,
  .connect-marketplace-hero p {
    color: rgba(255,255,255,.82);
    font-size: 1rem;
    line-height: 1.6;
  }

  .connect-explore-heading {
    display: block;
    margin-bottom: 14px;
  }

  .connect-explore-heading h2 {
    font-size: 1.85rem;
    line-height: 1.08;
  }

  .connect-explore-heading p {
    color: rgba(255,255,255,.82);
  }

  .connect-guest-modebar {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .connect-guest-form-card,
  .connect-guest-preview {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .connect-guest-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .connect-guest-form-grid .span-2 { grid-column: auto; }

  .connect-guest-form-grid label {
    width: 100%;
    margin: 0;
    color: #40506A;
    font-size: .85rem;
  }

  .connect-guest-form-grid input,
  .connect-guest-form-grid select,
  .connect-guest-form-grid textarea {
    display: block;
    width: 100% !important;
    max-width: 100%;
    min-height: 52px;
    margin: 0;
    padding: 13px 14px;
    border-radius: 12px;
    font-size: 16px;
  }

  .connect-guest-form-grid textarea { min-height: 96px; }

  .connect-guest-preview {
    min-height: 260px;
    margin-top: 0;
  }

  .connect-guest-privacy-strip {
    padding: 14px;
    font-size: .84rem;
    line-height: 1.55;
  }

  /* Signed-in buyer form: keep the Safari-safe small-card approach, but restore clean visual grouping. */
  #buyerProfileForm {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    overflow: visible !important;
  }

  #buyerProfileForm > h3,
  #buyerProfileForm > .connect-form-intro {
    background: #fff !important;
    margin: 0 !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  #buyerProfileForm > h3 {
    padding-top: 20px !important;
    padding-bottom: 8px !important;
    border-radius: 18px 18px 0 0 !important;
  }

  #buyerProfileForm > .connect-form-intro {
    padding-top: 4px !important;
    padding-bottom: 20px !important;
    border-radius: 0 0 18px 18px !important;
    color: #697386 !important;
  }

  #buyerProfileForm .connect-form-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin-top: 12px !important;
  }

  #buyerProfileForm .connect-form-grid > label {
    width: 100% !important;
    margin: 0 !important;
    padding: 14px !important;
    background: #fff !important;
    border: 1px solid rgba(10,22,40,.08) !important;
    border-radius: 16px !important;
    color: #40506A !important;
  }

  #buyerProfileForm .connect-form-grid input,
  #buyerProfileForm .connect-form-grid select,
  #buyerProfileForm .connect-form-grid textarea {
    width: 100% !important;
    min-height: 52px !important;
    margin-top: 8px !important;
    font-size: 16px !important;
  }

  #buyerProfileForm > .connect-fair-housing-note,
  #buyerProfileForm > .connect-check-grid,
  #buyerProfileForm > .connect-consent-box {
    margin: 12px 0 0 !important;
    padding: 16px !important;
    background: #fff !important;
    border-radius: 16px !important;
    color: #40506A !important;
  }

  #buyerProfileForm > .connect-primary-btn {
    display: block !important;
    margin: 14px 0 0 !important;
    width: 100% !important;
    min-height: 56px !important;
    padding: 14px 18px !important;
    background: #d7b55f !important;
    color: #0A1628 !important;
    border: 1px solid #d7b55f !important;
    border-radius: 14px !important;
    font-weight: 800 !important;
    font-size: 17px !important;
    -webkit-text-fill-color: #0A1628 !important;
  }
}
