/* ═══════════════════════════════════════════════════════════════
   NJ SOLAR MODERNIZATION PROGRAM
   Modern Government Portal — whitehouse.gov-inspired
   Typography: Instrument Serif (display) · Instrument Sans (body)
   ═══════════════════════════════════════════════════════════════ */

:root {
  --navy:       #0D132D;
  --navy-mid:   #1A2340;
  --navy-light: #2A3456;
  --buff:       #C5A253;
  --buff-light: #D4B76A;
  --buff-pale:  #E8D9AD;
  --pale:       #D9DEE8;
  --cream:      #F4F3EF;
  --white:      #FFFFFF;
  --ink:        #1A1A1A;
  --charcoal:   #293340;
  --slate:      #5E6772;
  --muted:      #8C939C;
  --line:       #D9DEE8;
  --line-light: #ECEDF0;
  --sage:       #1A6B3E;
  --red:        #B50000;

  --radius:     4px;
  --shadow:     0 1px 3px rgba(13, 19, 45, 0.06), 0 6px 16px rgba(13, 19, 45, 0.04);
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  color: var(--navy);
  margin: 0;
  line-height: 1.15;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

a { color: var(--navy); }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

.match-includes { display: none; }

/* ═══ TOPBAR ═══ */
.topbar {
  background: var(--navy);
  padding: 14px 0;
  color: var(--white);
}
.topbar .row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar .medallion {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.topbar .name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}
.topbar .stepper {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}
.topbar .step-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--pale);
  font-weight: 500;
  white-space: nowrap;
}
.topbar .step-label .current {
  color: var(--buff-light);
  font-weight: 700;
}
.topbar .bar {
  flex: 1;
  height: 2px;
  background: rgba(217, 222, 232, 0.15);
  border-radius: 1px;
  overflow: hidden;
}
.topbar .bar-fill {
  height: 100%;
  background: var(--buff);
  transition: width 0.4s var(--ease);
  width: 14%;
}

/* ═══ DISCLOSURE ═══ */
.disclosure {
  padding: 10px 0;
  font-size: 12px;
  color: var(--slate);
  text-align: center;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line-light);
}
.disclosure strong {
  color: var(--navy);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
}

/* ═══ TRUST BAR ═══ */
.trust-bar {
  background: var(--white);
  border-bottom: 1px solid var(--line-light);
  padding: 9px 0;
}
.trust-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--charcoal);
  white-space: nowrap;
}
.trust-item strong {
  font-weight: 700;
  color: var(--navy);
}
.trust-item svg {
  flex-shrink: 0;
}
.trust-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

/* ═══ HOW IT WORKS ═══ */
.how-it-works {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-top: 28px;
}
.how-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.how-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.how-step p {
  margin: 0;
  font-size: 12px;
  color: var(--slate);
  line-height: 1.4;
}
.how-divider {
  width: 24px;
  height: 1px;
  background: var(--line);
  flex-shrink: 0;
  margin: 14px 8px 0;
}

/* ═══ STEP SECTIONS ═══ */
.step {
  display: none;
  padding: 48px 0 80px;
}
.step.active {
  display: block;
  animation: fadeIn 0.4s var(--ease) both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ STEP CARDS ═══ */
.step-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 44px 36px;
}

.step-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--slate);
  font-weight: 600;
  margin-bottom: 20px;
}

.step-card h2 {
  font-size: clamp(26px, 3.5vw, 34px);
  margin-bottom: 10px;
}
.step-card .lede {
  font-size: 15px;
  color: var(--slate);
  margin: 0 0 28px;
  line-height: 1.65;
}

/* ═══ FORM ELEMENTS ═══ */
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.field input[type="text"],
.field input[type="number"],
.field input[type="email"],
.field input[type="tel"],
.field select {
  width: 100%;
  font-family: 'Instrument Sans', sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(13, 19, 45, 0.06);
}
.field input::placeholder {
  color: var(--muted);
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%230D132D' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 44px;
}

.bill-wrap { position: relative; }
.bill-wrap::before {
  content: '$';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--navy);
  font-size: 18px;
  font-weight: 600;
  pointer-events: none;
  z-index: 1;
}
.bill-wrap input[type="number"] {
  padding-left: 36px;
  -moz-appearance: textfield;
}
.bill-wrap input[type="number"]::-webkit-outer-spin-button,
.bill-wrap input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.field-error {
  font-size: 13px;
  color: var(--red);
  margin-top: 8px;
  display: none;
  font-weight: 500;
}
.field-error.show { display: block; }

/* ═══ CHOICE CARDS ═══ */
.choice-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.choice-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.choice-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.choice {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: left;
  font-size: 15px;
  color: var(--charcoal);
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.choice:hover {
  border-color: var(--navy-light);
}
.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.choice .icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.choice .icon svg { width: 28px; height: 28px; display: block; }
.choice .content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.choice .title {
  font-weight: 600;
  color: var(--navy);
  font-size: 15px;
  line-height: 1.25;
}
.choice .desc {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.4;
}
.choice.selected {
  border-color: var(--navy);
  background: rgba(13, 19, 45, 0.02);
}
.choice.selected .icon {
  background: var(--navy);
}
.choice.selected .icon svg {
  filter: brightness(0) invert(1);
}

/* 2-col compact */
.choice-grid.cols-2 .choice {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 14px 12px;
}
.choice-grid.cols-2 .choice .content { align-items: center; }
.choice-grid.cols-2 .choice .icon {
  width: 30px;
  height: 30px;
  background: none;
}
.choice-grid.cols-2 .choice .icon svg { width: 26px; height: 26px; }
.choice-grid.cols-2 .choice .title { font-size: 14px; }
.choice-grid.cols-2 .choice.selected .icon { background: none; }
.choice-grid.cols-2 .choice.selected .icon svg { filter: none; }

/* ═══ BUTTONS ═══ */
.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--white);
  letter-spacing: 0.02em;
  transition: background 0.15s, transform 0.06s;
  flex: 1;
}
.btn:hover { background: var(--navy-mid); }
.btn:active { transform: translateY(1px); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--line);
  flex: 0 0 auto;
  padding-left: 18px;
  padding-right: 18px;
}
.btn-secondary:hover { background: var(--cream); border-color: var(--navy-light); }

.btn-gold {
  background: var(--buff);
  color: var(--navy);
  font-weight: 700;
}
.btn-gold:hover { background: var(--buff-light); }

/* ═══ MAP BLOCK ═══ */
.map-block {
  margin: 4px 0 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream);
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate);
  font-size: 13px;
}
.map-block img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.map-caption {
  font-size: 12px;
  color: var(--slate);
  margin: -14px 0 18px;
  text-align: center;
}

/* ═══ REVEAL (Step 7) ═══ */
.great-news {
  font-size: clamp(24px, 3.2vw, 30px);
  margin-bottom: 6px;
  color: var(--sage);
}
.discovery {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
  margin: 0 0 4px;
}
.discovery strong {
  font-weight: 700;
  background: rgba(197, 162, 83, 0.12);
  padding: 1px 5px;
  border-radius: 2px;
}
.zero-down-line {
  font-size: 11px;
  font-weight: 600;
  color: var(--buff);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}
.zero-down-line .star {
  color: var(--buff);
  margin-right: 4px;
}

.reveal-figures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 0;
}
.figure-tile {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 14px 12px 12px;
  text-align: center;
}
.figure-tile .icon {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}
.figure-tile .icon svg { width: 20px; height: 20px; display: block; }
.figure-tile .label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--pale);
  font-weight: 600;
  margin-bottom: 2px;
}
.figure-tile .value {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(26px, 4.5vw, 32px);
  font-weight: 400;
  color: var(--white);
  line-height: 1;
}
.figure-tile .value .unit {
  font-size: 12px;
  color: var(--pale);
  margin-left: 2px;
  font-family: 'Instrument Sans', sans-serif;
}

.form-heading {
  font-family: 'Instrument Serif', serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--navy);
  margin: 0 0 4px;
  line-height: 1.3;
}
.form-sub {
  font-size: 12px;
  color: var(--slate);
  margin: 0 0 14px;
  line-height: 1.5;
}

/* ═══ CALCULATING ═══ */
.calc-card { text-align: left; }
.calc-card h2 { font-size: clamp(22px, 3.2vw, 28px); margin-bottom: 6px; }
.calc-card .lede { margin-bottom: 24px; }

.calc-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.calc-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-light);
  transition: opacity 0.3s;
}
.calc-step:last-child { border-bottom: none; }
.calc-step.pending { opacity: 0.3; }
.calc-step.active,
.calc-step.done { opacity: 1; }

.calc-step .calc-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  position: relative;
  background: var(--white);
  border: 2px solid var(--line);
}
.calc-step.active .calc-icon {
  border-color: var(--navy);
}
.calc-step.active .calc-icon::before {
  content: '';
  position: absolute;
  inset: -2px;
  border: 2.5px solid transparent;
  border-top-color: var(--navy);
  border-right-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.calc-step.done .calc-icon {
  background: var(--sage);
  border-color: var(--sage);
}
.calc-step.done .calc-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 48%;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2.2px 2.2px 0;
  transform: translate(-50%, -55%) rotate(45deg);
}
.calc-step .calc-label {
  font-size: 14px;
  color: var(--navy);
  font-weight: 500;
  line-height: 1.35;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ CONTACT FIELDS ═══ */
.contact-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.contact-fields .field-full { grid-column: 1 / -1; }

.reassurance {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 14px;
  margin-bottom: 0;
  line-height: 1.55;
}

/* ═══ CONFIRMATION ═══ */
.confirm-card {
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 56px 44px;
}
.confirm-card .check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 24px;
  font-family: serif;
}
.confirm-card h2 {
  font-size: clamp(26px, 4vw, 34px);
  margin-bottom: 14px;
}
.confirm-card p {
  color: var(--slate);
  font-size: 15px;
  max-width: 480px;
  margin: 0 auto 12px;
  line-height: 1.65;
}
.confirm-card .next-steps {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 28px;
  text-align: left;
}
.confirm-card .next-steps h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--slate);
  margin-bottom: 12px;
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 600;
}
.confirm-card .next-steps ol {
  margin: 0;
  padding-left: 22px;
  color: var(--charcoal);
  font-size: 14px;
  line-height: 1.65;
}
.confirm-card .next-steps li { margin-bottom: 8px; }

/* ═══ FOOTER ═══ */
footer {
  background: var(--navy);
  color: var(--pale);
  padding: 40px 0 28px;
  font-size: 13px;
  line-height: 1.65;
  margin-top: auto;
}
footer .foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
footer h4 {
  font-family: 'Instrument Serif', serif;
  color: var(--white);
  font-size: 17px;
  font-weight: 400;
  margin-bottom: 10px;
}
footer a {
  color: var(--pale);
  text-decoration: none;
  margin-right: 18px;
  transition: color 0.15s;
}
footer a:hover { color: var(--buff-light); }
footer .disclaimer {
  border-top: 1px solid rgba(217, 222, 232, 0.1);
  padding-top: 20px;
  color: rgba(217, 222, 232, 0.55);
  font-size: 11px;
  line-height: 1.6;
}

/* ═══ GOOGLE PLACES ═══ */
.pac-container {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-family: 'Instrument Sans', sans-serif;
  margin-top: 4px;
}
.pac-item {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}
.pac-item:hover { background: var(--cream); }
.pac-item-query { font-size: 14px; color: var(--navy); }

/* ═══ DESKTOP ═══ */
@media (min-width: 721px) {
  .step { padding: 28px 0 36px; }
  .step-card { padding: 36px 44px 32px; }
  .step-card h2 { margin-bottom: 8px; }
  .step-card .lede { margin-bottom: 22px; }

  section.step[data-step="4"] .step-card { max-width: 880px; }
  .ownership-layout {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 28px;
    align-items: start;
    margin-top: 4px;
  }
  .ownership-map .map-block { aspect-ratio: 4 / 3; }

  .choice-grid.cols-3 .choice {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 16px 12px;
  }
  .choice-grid.cols-3 .choice .icon {
    width: 38px;
    height: 38px;
    background: none;
  }
  .choice-grid.cols-3 .choice .icon svg { width: 32px; height: 32px; }
  .choice-grid.cols-3 .choice .content { align-items: center; gap: 2px; }
  .choice-grid.cols-3 .choice .title { font-size: 15px; }
  .choice-grid.cols-3 .choice .desc { font-size: 12px; }
  .choice-grid.cols-3 .choice.selected .icon { background: none; }
  .choice-grid.cols-3 .choice.selected .icon svg { filter: none; }

  section.step[data-step="7"] .step-card {
    max-width: 920px;
    padding: 24px 36px 20px;
  }
  section.step[data-step="7"] .step-eyebrow { margin-bottom: 10px; }
  .reveal-layout {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 32px;
    align-items: start;
    margin-top: 4px;
  }
  .reveal-layout .reveal-figures { margin: 10px 0 0; }

  .match-includes {
    display: block;
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
  }
  .match-includes li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px 0;
    font-size: 12px;
    color: var(--charcoal);
    line-height: 1.4;
    border-bottom: 1px solid var(--line-light);
  }
  .match-includes li:last-child { border-bottom: none; }
  .match-includes li::before {
    content: '✓';
    color: var(--sage);
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
    line-height: 1.3;
  }

  section.step[data-step="7"] .field { margin-bottom: 8px; }
  section.step[data-step="7"] .field label { margin-bottom: 5px; font-size: 10px; }
  section.step[data-step="7"] .field input { padding: 10px 14px; font-size: 15px; }
  section.step[data-step="7"] .btn-row { margin-top: 12px; }
  section.step[data-step="7"] .btn { padding: 12px 20px; font-size: 14px; }
  section.step[data-step="7"] .reassurance { font-size: 10px; margin-top: 8px; }
}

/* ═══ MOBILE ═══ */
@media (max-width: 720px) {
  .step { padding: 20px 0 60px; }
  .step-card { padding: 28px 22px 24px; }

  .topbar { padding: 10px 0; }
  .topbar .medallion { width: 28px; height: 28px; }
  .topbar .name { font-size: 15px; white-space: normal; }
  .topbar .stepper { min-width: 90px; gap: 0; }
  .topbar .step-label { display: none; }
  .topbar .bar { height: 2px; }

  .disclosure { display: none; }

  .trust-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 10px 16px;
    background: var(--white);
    border-top: 1px solid var(--line-light);
    box-shadow: 0 -2px 8px rgba(13, 19, 45, 0.06);
  }
  .trust-bar-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
  }
  .trust-sep { display: none; }
  .trust-item { font-size: 11px; }

  /* Add bottom padding to body so content isn't hidden behind fixed bar */
  .step { padding-bottom: 100px; }

  .how-it-works { flex-direction: column; gap: 10px; margin-top: 20px; }
  .how-divider { display: none; }

  .figure-tile { padding: 14px 10px 12px; }
  .figure-tile .icon { margin-bottom: 6px; }
  .figure-tile .icon svg { width: 22px; height: 22px; }
  .figure-tile .label { font-size: 9px; margin-bottom: 4px; }

  .form-heading { font-size: 17px; }
  .choice-grid.cols-3 { grid-template-columns: 1fr; }
  .contact-fields { grid-template-columns: 1fr; }
  footer .foot-grid { grid-template-columns: 1fr; gap: 18px; }
}
