/*
  New Energy Commercial Intelligence
  Step 2 and Step 3 redesign — CSS only.

  No JavaScript, observers, stage controllers or event changes.
  Step 1 remains exactly as it is.
*/

/* =========================================================
   Active-stage detection
   ========================================================= */

body.commercial-residential-part-one:has(
  .journey-panel[data-stage="3"].active:not([hidden])
) .hero,
body.commercial-residential-part-one:has(
  .journey-panel[data-stage="4"].active:not([hidden])
) .hero {
  display: none !important;
}

body.commercial-residential-part-one:has(
  .journey-panel[data-stage="3"].active:not([hidden])
) .progress.three-step-progress,
body.commercial-residential-part-one:has(
  .journey-panel[data-stage="4"].active:not([hidden])
) .progress.three-step-progress {
  margin-top: 22px !important;
  margin-bottom: 18px !important;
}

body.commercial-residential-part-one:has(
  .journey-panel[data-stage="3"].active:not([hidden])
) .progress.three-step-progress
+ .journey-panel,
body.commercial-residential-part-one:has(
  .journey-panel[data-stage="4"].active:not([hidden])
) .progress.three-step-progress
+ .journey-panel {
  margin-top: 0 !important;
}

/* Keep hidden journey stages completely outside the layout. */
body.commercial-residential-part-one
.journey-panel[hidden] {
  display: none !important;
}

/* =========================================================
   Step 2 — Confirm the roof
   One purpose, one dominant visual.
   ========================================================= */

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active {
  max-width: 1180px;
  margin-inline: auto;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.content-card.roof-card {
  padding:
    clamp(26px, 3vw, 40px) !important;
  border: 1px solid
    rgba(69, 111, 130, 0.14) !important;
  border-radius: 32px !important;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(247, 251, 252, 0.98)
    ) !important;
  box-shadow:
    0 24px 65px
    rgba(42, 75, 90, 0.10) !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-heading {
  display: grid !important;
  grid-template-columns:
    minmax(0, 1fr)
    auto;
  gap: 28px;
  align-items: start !important;
  margin: 0 0 20px !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-heading .eyebrow {
  margin-bottom: 8px !important;
  color: #147fb7 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-heading h2 {
  max-width: 790px;
  margin: 0 !important;
  color: #293f4a;
  font-size:
    clamp(34px, 3.4vw, 50px) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.047em !important;
  text-wrap: balance;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-heading p {
  max-width: 720px;
  margin: 13px 0 0 !important;
  color: #647983 !important;
  font-size: 14.5px !important;
  line-height: 1.55 !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-source-chip {
  min-width: 155px;
  padding: 12px 15px !important;
  border: 1px solid
    rgba(42, 111, 145, 0.14) !important;
  border-radius: 17px !important;
  background:
    linear-gradient(
      145deg,
      rgba(235, 247, 252, 0.94),
      rgba(247, 252, 254, 0.94)
    ) !important;
  box-shadow: none !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-source-chip span {
  color: #1779aa !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-source-chip strong {
  margin-top: 5px !important;
  color: #314b58 !important;
  font-size: 15px !important;
}

/* Progress becomes a compact evidence rail rather than five cards. */
body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-progress {
  display: grid !important;
  grid-template-columns:
    repeat(5, minmax(0, 1fr)) !important;
  gap: 0 !important;
  margin: 0 0 20px !important;
  padding: 13px 16px !important;
  border: 1px solid
    rgba(72, 115, 133, 0.12);
  border-radius: 18px;
  background:
    rgba(241, 248, 249, 0.76);
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-progress li {
  position: relative;
  justify-content: center;
  min-height: 28px;
  padding: 5px 12px !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #788b94 !important;
  text-align: center;
  font-size: 10px !important;
  font-weight: 750 !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-progress li + li {
  border-left: 1px solid
    rgba(73, 114, 132, 0.13);
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-progress li.active {
  color: #147eb7 !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-progress li.done {
  color: #27815c !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-progress li span {
  flex: 0 0 7px;
  width: 7px !important;
  height: 7px !important;
  box-shadow: none !important;
}

/* The actual roof is the dominant visual. */
body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.map-shell {
  overflow: hidden !important;
  border: 1px solid
    rgba(49, 101, 124, 0.17) !important;
  border-radius: 25px !important;
  background: #dce8ed !important;
  box-shadow:
    0 24px 58px
    rgba(35, 68, 82, 0.15) !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
#businessRoofMap {
  height: 570px !important;
  min-height: 570px !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.map-overlay {
  padding: 11px 14px !important;
  border: 1px solid
    rgba(255, 255, 255, 0.44) !important;
  border-radius: 14px !important;
  background:
    rgba(15, 47, 61, 0.78) !important;
  box-shadow:
    0 12px 30px
    rgba(2, 24, 34, 0.20) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.map-overlay strong {
  font-size: 13.5px !important;
  line-height: 1.35 !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.roof-confirmed-card {
  margin-top: 18px !important;
  padding: 17px 18px !important;
  border: 1px solid
    rgba(55, 153, 103, 0.24) !important;
  border-radius: 19px !important;
  background:
    linear-gradient(
      135deg,
      rgba(242, 253, 247, 0.97),
      rgba(249, 255, 251, 0.97)
    ) !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
.panel-actions {
  margin-top: 20px !important;
  padding-top: 0 !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="3"].active
#confirmRoofButton {
  min-width: 190px;
}

/* =========================================================
   Step 3 — Opportunity
   Uses the existing report content, presented as one result.
   ========================================================= */

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active {
  max-width: 1180px;
  margin-inline: auto;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.content-card.report-card {
  padding:
    clamp(28px, 3.2vw, 44px) !important;
  border: 1px solid
    rgba(69, 111, 130, 0.14) !important;
  border-radius: 32px !important;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(247, 252, 250, 0.98)
    ) !important;
  box-shadow:
    0 24px 65px
    rgba(42, 75, 90, 0.10) !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-title {
  display: grid !important;
  grid-template-columns:
    minmax(0, 1fr)
    auto;
  gap: 26px !important;
  align-items: start !important;
  margin-bottom: 24px !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-title .eyebrow {
  margin-bottom: 8px !important;
  color: #147fb7 !important;
  font-size: 11px !important;
  letter-spacing: 0.09em !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-title h2 {
  margin: 0 !important;
  color: #293f4a;
  font-size:
    clamp(40px, 4.3vw, 60px) !important;
  line-height: 0.98 !important;
  letter-spacing: -0.052em !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-title p {
  max-width: 760px !important;
  margin: 14px 0 0 !important;
  color: #637984 !important;
  font-size: 15px !important;
  line-height: 1.58 !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-status {
  padding: 10px 14px !important;
  border: 1px solid
    rgba(45, 142, 96, 0.18) !important;
  border-radius: 999px !important;
  color: #287c59 !important;
  background:
    rgba(232, 248, 240, 0.92) !important;
  font-size: 10px !important;
  font-weight: 850 !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-identity {
  gap: 11px !important;
  margin-top: 0 !important;
  padding: 14px !important;
  border: 1px solid
    rgba(70, 113, 132, 0.12);
  border-radius: 21px;
  background:
    rgba(241, 248, 249, 0.72);
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-identity > div {
  min-width: 0;
  padding: 15px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background:
    rgba(255, 255, 255, 0.88) !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-identity strong {
  overflow-wrap: anywhere;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-grid {
  gap: 14px !important;
  margin-top: 18px !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-feature {
  min-height: 230px;
  padding: 24px !important;
  border: 1px solid
    rgba(69, 112, 131, 0.13) !important;
  border-radius: 22px !important;
  background:
    rgba(255, 255, 255, 0.92) !important;
  box-shadow: none !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-feature.feature-primary {
  border-color:
    rgba(43, 143, 194, 0.22) !important;
  background:
    linear-gradient(
      145deg,
      rgba(248, 253, 255, 0.98),
      rgba(235, 248, 254, 0.98)
    ) !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-feature h3 {
  margin: 12px 0 9px !important;
  color: #304b57;
  font-size: 21px !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-feature p {
  min-height: 84px !important;
  color: #667b85 !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.pending-label {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  color: #627d89 !important;
  background:
    rgba(234, 243, 246, 0.95) !important;
  font-size: 9px !important;
  font-weight: 800 !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-callout {
  margin-top: 18px !important;
  padding:
    clamp(25px, 3vw, 34px) !important;
  border: 1px solid
    rgba(44, 131, 89, 0.13);
  border-radius: 23px !important;
  color: #2f4a42 !important;
  background:
    radial-gradient(
      circle at 90% 10%,
      rgba(185, 235, 208, 0.52),
      transparent 32%
    ),
    linear-gradient(
      135deg,
      rgba(234, 249, 241, 0.97),
      rgba(247, 253, 250, 0.98)
    ) !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-callout span {
  color: #25815a !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-callout h3 {
  max-width: 780px;
  color: #29493d !important;
  font-size:
    clamp(28px, 3vw, 38px) !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.report-callout p {
  color: #5c766c !important;
}

body.commercial-residential-part-one
.journey-panel[data-stage="4"].active
.panel-actions {
  margin-top: 20px !important;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 820px) {
  body.commercial-residential-part-one
  .journey-panel[data-stage="3"].active
  #businessRoofMap {
    height: 470px !important;
    min-height: 470px !important;
  }

  body.commercial-residential-part-one
  .journey-panel[data-stage="4"].active
  .report-identity {
    grid-template-columns:
      repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 650px) {
  body.commercial-residential-part-one
  .journey-panel[data-stage="3"].active
  .content-card.roof-card,
  body.commercial-residential-part-one
  .journey-panel[data-stage="4"].active
  .content-card.report-card {
    padding: 22px 16px !important;
    border-radius: 24px !important;
  }

  body.commercial-residential-part-one
  .journey-panel[data-stage="3"].active
  .roof-heading,
  body.commercial-residential-part-one
  .journey-panel[data-stage="4"].active
  .report-title {
    grid-template-columns: 1fr !important;
  }

  body.commercial-residential-part-one
  .journey-panel[data-stage="3"].active
  .roof-progress {
    grid-template-columns:
      repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }

  body.commercial-residential-part-one
  .journey-panel[data-stage="3"].active
  .roof-progress li,
  body.commercial-residential-part-one
  .journey-panel[data-stage="3"].active
  .roof-progress li + li {
    justify-content: flex-start;
    border: 0 !important;
    border-radius: 11px !important;
    background:
      rgba(255, 255, 255, 0.72) !important;
  }

  body.commercial-residential-part-one
  .journey-panel[data-stage="3"].active
  #businessRoofMap {
    height: 380px !important;
    min-height: 380px !important;
  }

  body.commercial-residential-part-one
  .journey-panel[data-stage="4"].active
  .report-identity,
  body.commercial-residential-part-one
  .journey-panel[data-stage="4"].active
  .report-grid {
    grid-template-columns: 1fr !important;
  }
}

/*
  Safari supports :has() in the versions used by this portal.
  Browsers without :has() retain the current working layout rather
  than losing any functionality.
*/
