:root {
  --canvas: #F5F1E6;
  --panel: #FFFEFA;
  --ink: #292A28;
  --muted: #626158;
  --subtle: #626158;
  --line: #DED8CB;
  --line-strong: #987627;
  --yellow: #E4C875;
  --yellow-hover: #D2B665;
  --yellow-soft: #F4E9C9;
  --green: #25724a;
  --error: #9c304b;
  --shadow: 0 16px 38px rgba(41, 42, 40, .055);
  --radius-lg: 20px;
  --radius-md: 13px;
  --radius-sm: 9px;
  --border-soft: #DED8CB;
  --border-control: #92866E;
  --focus-ring: #8A6A1D;
  --radius-card: 18px;
  --radius-control: 11px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; }
body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.page-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 16px 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-name {
  display: grid;
  gap: 1px;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1;
}

.brand-name small {
  color: var(--muted);
  font-size: .45rem;
  font-weight: 700;
  letter-spacing: .15em;
}

.form-card {
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.form-head {
  padding: 30px 28px 24px;
  border-bottom: 1px solid var(--border-soft);
}

.head-meta, .action-row, .summary-row, .result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

[hidden] { display: none !important; }
.head-meta {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.step-kicker { color: var(--muted); }
.step-counter { color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-track {
  height: 4px;
  margin-bottom: 23px;
  overflow: hidden;
  border-radius: 99px;
  background: #E9E3D6;
}

.progress-value {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--yellow);
  transition: width .2s ease;
}

.form-head h1 {
  max-width: 560px;
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 4.6vw, 2.2rem);
  font-weight: 650;
  line-height: 1.13;
  letter-spacing: -.025em;
}

.form-head p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: .94rem;
}

.form-body { padding: 26px; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend, .field > span:first-child {
  display: block;
  margin-bottom: 11px;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 650;
}

.choice-grid, .choice-stack { display: grid; gap: 12px; }
.choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.service-step-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.service-step-fields { min-width: 0; }
.service-gallery { min-width: 0; margin: 0; }
.gallery-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 138px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  background: var(--canvas);
  cursor: zoom-in;
}
.gallery-stage:hover { border-color: var(--line-strong); }
.gallery-stage img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.gallery-stage-hint {
  position: absolute;
  right: 9px;
  bottom: 9px;
  padding: 4px 8px;
  border-radius: 99px;
  color: #fff;
  background: rgba(23, 24, 25, .78);
  font-size: .75rem;
  font-weight: 750;
}
.gallery-footer { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 10px; }
.gallery-counter { color: var(--muted); font-size: .825rem; white-space: nowrap; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; min-width: 0; width: 100%; }
.gallery-thumb {
  min-width: 0;
  width: 100%;
  height: 56px;
  padding: 2px;
  overflow: hidden;
  border: 1px solid var(--border-control);
  border-radius: 7px;
  background: var(--panel);
}
.gallery-thumb:hover { border-color: var(--line-strong); }
.gallery-thumb.is-active { border-color: var(--line-strong); box-shadow: 0 0 0 2px var(--yellow-soft); }
.gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery-dialog {
  width: min(92vw, 1040px);
  max-width: none;
  max-height: 92vh;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .3);
}
.gallery-dialog::backdrop { background: rgba(15, 17, 18, .74); }
.gallery-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.gallery-dialog-header h2 { margin: 0; font-size: 1.1rem; }
.gallery-dialog-help { margin: 3px 0 0; color: var(--muted); font-size: .875rem; }
.gallery-dialog-close {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 750;
  background: var(--panel);
}
.gallery-dialog-close:hover { background: var(--yellow-soft); }
.gallery-dialog > img { display: block; width: 100%; max-height: calc(92vh - 100px); margin: 0 auto; border-radius: var(--radius-md); object-fit: contain; }

.choice-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 16px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  color: var(--ink);
  text-align: left;
  background: var(--panel);
  transition: border-color .16s ease, background .16s ease;
}

.choice-card:hover { border-color: var(--line-strong); }
.choice-card.selected {
  border-color: var(--line-strong);
  background: var(--yellow-soft);
}

.choice-copy { min-width: 0; }
.choice-card strong { display: block; margin-bottom: 2px; font-size: .93rem; font-weight: 650; }
.choice-card small { display: block; color: var(--muted); font-size: .875rem; line-height: 1.45; }
.choice-mark {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  border: 1px solid var(--border-control);
  border-radius: 50%;
  background: var(--panel);
}

.choice-card.selected .choice-mark {
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: inset 0 0 0 4px var(--yellow);
}

.field { display: block; }
.field + .field, .field + fieldset, fieldset + .field, fieldset + fieldset { margin-top: 20px; }
.voltage-field { margin-top: 20px; }

input[type="text"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 1px solid var(--border-control);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--panel);
}

input::placeholder, textarea::placeholder { color: var(--muted); }
input[type="text"]:hover, input[type="tel"]:hover, input[type="number"]:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 22px, calc(100% - 13px) 22px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

textarea { min-height: 94px; resize: vertical; }
.helper { display: block; margin-top: 8px; color: var(--subtle); font-size: .875rem; }
.privacy-note, .edit-note { margin: 16px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.45; }
.unit-input { position: relative; }
.unit-input input { padding-right: 103px; }
.unit-suffix {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
  transform: translateY(-50%);
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  color: var(--subtle);
  font-size: .76rem;
  text-transform: lowercase;
}

.or-divider::before, .or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.file-drop {
  display: block;
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed var(--border-control);
  border-radius: var(--radius-control);
  background: var(--panel);
  cursor: pointer;
}

.file-drop:hover { border-color: var(--line-strong); }
.file-drop:focus-within { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.file-drop strong { display: block; margin-bottom: 4px; font-size: .9rem; font-weight: 650; }
.file-drop small { display: block; margin-bottom: 12px; color: var(--muted); font-size: .875rem; }
.upload-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--ink);
  background: var(--yellow);
  font-size: .76rem;
  font-weight: 700;
}
.file-drop:hover .upload-button { background: var(--yellow-hover); }

.file-name {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.remove-file {
  margin: 8px 0 0;
  padding: 4px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: .8125rem;
  text-decoration: underline;
  cursor: pointer;
}
.remove-file:hover { color: var(--ink); }
.remove-file:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.error-message {
  min-height: 20px;
  margin: 17px 0 0;
  color: var(--error);
  font-size: .875rem;
}

.action-row { align-items: stretch; margin-top: 2px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 700;
  transition: border-color .16s ease, background .16s ease;
}

.btn:hover { border-color: var(--line-strong); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { min-width: 150px; color: var(--ink); background: var(--yellow); }
.btn.primary:hover { background: var(--yellow-hover); }
.btn.ghost { color: var(--muted); border-color: var(--border-control); background: transparent; }
.btn.ghost:hover { color: var(--ink); background: var(--canvas); }

.result-view { padding: 24px; }
.summary {
  margin-top: 0;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-control);
}

.summary-row {
  align-items: flex-start;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.summary-row:last-child { border-bottom: 0; }
.summary-row span { color: var(--muted); font-size: .875rem; font-weight: 550; }
.summary-row strong { min-width: 0; max-width: 65%; font-size: .9375rem; font-weight: 650; text-align: right; overflow-wrap: anywhere; white-space: pre-wrap; }
.result-actions { align-items: stretch; margin-top: 18px; }
.result-actions .btn { flex: 1; }
.result-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 15px;
  color: var(--subtle);
  font-size: .875rem;
}

.optional { color: var(--subtle); font-weight: 500; }
.honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.restart-button { display: flex; margin: 16px auto 0; }
.noscript-message { max-width: 720px; margin: 20px auto; padding: 16px; }
[aria-invalid="true"] { border-color: var(--error); }
#step-title:focus { outline: none; }

.result-meta svg { flex: 0 0 auto; width: 15px; height: 15px; color: var(--green); }

@media (min-width: 640px) {
  .page-shell { padding: 28px 20px 52px; }
  .topbar { margin-bottom: 36px; }
  .form-head, .form-body, .result-view { padding-left: 36px; padding-right: 36px; }
  .form-head { padding-top: 34px; padding-bottom: 27px; }
  .form-body, .result-view { padding-top: 30px; padding-bottom: 30px; }
  .field-grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .field-grid.two .field + .field { margin-top: 0; }
}

@media (min-width: 760px) {
  .service-step-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: start; gap: 24px; }
  .service-gallery[data-gallery-service="solar"] .gallery-stage { height: auto; aspect-ratio: 16 / 9; }
  .service-gallery[data-gallery-service="pattern"] .gallery-stage { width: min(100%, 260px); height: auto; aspect-ratio: 3 / 4; margin-inline: auto; }
  .gallery-footer { grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 8px; }
  .gallery-thumbs { gap: 8px; }
  .gallery-thumb { height: 60px; }
}

@media (max-width: 520px) {
  .page-shell { padding-top: 14px; }
  .topbar { flex-wrap: wrap; margin-bottom: 21px; }
  .form-head, .form-body, .result-view { padding-left: 18px; padding-right: 18px; }
  .choice-grid { grid-template-columns: 1fr; }
  .result-actions { flex-direction: column; }
  .result-actions .btn { width: 100%; }
  .summary-row { flex-direction: column; gap: 5px; }
  .summary-row strong { max-width: 100%; text-align: left; }
  .gallery-stage { height: 136px; }
  .service-gallery[data-gallery-service="pattern"] .gallery-stage { width: min(100%, 120px); margin-inline: auto; }
  .gallery-footer { grid-template-columns: max-content minmax(0, 1fr); gap: 7px; }
  .gallery-thumbs { gap: 5px; }
  .gallery-thumb { height: 50px; }
  .gallery-dialog { width: calc(100vw - 20px); max-height: 94vh; padding: 12px; }
  .gallery-dialog > img { max-height: calc(94vh - 94px); }
}

@media (max-width: 360px) {
  .gallery-footer { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
  .gallery-counter { white-space: normal; }
  .gallery-dialog-header { flex-direction: column; }
  .gallery-dialog-header > div { min-width: 0; overflow-wrap: anywhere; }
  .gallery-dialog-close { align-self: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Entry screen only: give the brand and service choices a clearer first impression. */
.page-shell:has(.step-panel[data-step="0"]:not([hidden])) .topbar {
  justify-content: center;
  margin-bottom: 20px;
}

.page-shell:has(.step-panel[data-step="0"]:not([hidden])) .brand {
  gap: 12px;
}

.page-shell:has(.step-panel[data-step="0"]:not([hidden])) .brand-mark {
  flex-basis: 68px;
  width: 68px;
  height: 68px;
  padding: 5px;
  border: 0;
  border-radius: 0;
  background: var(--canvas);
  box-shadow: none;
}

.page-shell:has(.step-panel[data-step="0"]:not([hidden])) .brand-name {
  font-size: .92rem;
}

.page-shell:has(.step-panel[data-step="0"]:not([hidden])) .brand-name small {
  font-size: .53rem;
}

.page-shell:has(.step-panel[data-step="0"]:not([hidden])) .form-head {
  padding-top: 30px;
  padding-bottom: 14px;
  border-bottom: 0;
  text-align: center;
}

.page-shell:has(.step-panel[data-step="0"]:not([hidden])) .form-head h1 {
  max-width: none;
  margin-bottom: 12px;
  font-size: clamp(1.9rem, 6vw, 2.8rem);
}

.page-shell:has(.step-panel[data-step="0"]:not([hidden])) .form-head p {
  max-width: 460px;
  margin-inline: auto;
}

.step-panel[data-step="0"] legend {
  width: 100%;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
}

.form-card:has(.step-panel[data-step="0"]:not([hidden])) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.service-choice-grid {
  align-items: stretch;
  gap: 12px;
}

.service-choice-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 17px;
  align-items: center;
  justify-content: initial;
  gap: 13px;
  min-height: 112px;
  padding: 12px;
  border-radius: 16px;
}

.service-choice-photo {
  display: block;
  width: 84px;
  aspect-ratio: 1.2;
  overflow: hidden;
  border-radius: 11px;
  background: var(--line);
}

.service-choice-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

[data-service="solar"] .service-choice-photo img { object-position: 65% center; }
[data-service="pattern"] .service-choice-photo img { object-position: center 40%; }

.service-choice-card .choice-copy strong {
  margin-bottom: 5px;
  font-size: .97rem;
  line-height: 1.25;
}

.service-choice-card .choice-copy small {
  font-size: .78rem;
  line-height: 1.4;
}

.service-choice-card:hover {
  box-shadow: 0 8px 20px rgba(23, 24, 25, .06);
}

@media (max-width: 520px) {
  .page-shell:has(.step-panel[data-step="0"]:not([hidden])) .topbar {
    margin-bottom: 14px;
  }

  .page-shell:has(.step-panel[data-step="0"]:not([hidden])) .brand-mark {
    flex-basis: 60px;
    width: 60px;
    height: 60px;
  }

  .page-shell:has(.step-panel[data-step="0"]:not([hidden])) .form-head {
    padding-top: 22px;
    padding-bottom: 12px;
  }

  .service-choice-card {
    grid-template-columns: 76px minmax(0, 1fr) 17px;
    gap: 11px;
    min-height: 100px;
    padding: 10px;
  }

  .service-choice-photo { width: 76px; }
}

/* Discreet, readable privacy access without interrupting the form. */
.privacy-footer { margin-top: 24px; text-align: center; font-size: .8125rem; }
.privacy-footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px; color: var(--muted); text-underline-offset: 3px; }
.privacy-new-tab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.privacy-page { max-width: 760px; margin: auto; padding: 32px 20px 48px; }
.privacy-page h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); line-height: 1.15; }
.privacy-page h2 { margin-top: 28px; font-size: 1.125rem; }
.privacy-page p, .privacy-page li { line-height: 1.65; }
.privacy-page a { color: var(--ink); text-underline-offset: 3px; overflow-wrap: anywhere; }

.customer-reviews { margin: 46px 0 0; padding: 34px 0 10px; border-top: 1px solid var(--line); text-align: center; }
.reviews-eyebrow { display: block; margin-bottom: 9px; color: var(--line-strong); font-size: .68rem; font-weight: 800; letter-spacing: .17em; }
.customer-reviews h2 { margin: 0 0 10px; color: var(--ink); font-size: clamp(1.55rem, 4vw, 2rem); line-height: 1.2; letter-spacing: -.035em; }
.customer-reviews > p { max-width: 490px; margin: 0 auto; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 27px 0 15px; text-align: left; }
.review-card { display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 12px 30px rgba(41, 42, 40, .035); }
.review-card-featured { grid-column: 1 / -1; padding: 30px 34px; border-color: #d6c8a7; background: #fdfaf1; }
.review-stars { margin-bottom: 14px; color: var(--line-strong); font-size: 1rem; letter-spacing: .11em; line-height: 1; }
.review-card blockquote { margin: 0; color: var(--ink); font-size: .94rem; line-height: 1.7; overflow-wrap: anywhere; }
.review-card-featured blockquote { font-size: 1.02rem; line-height: 1.72; }
.review-card figcaption { margin-top: auto; padding-top: 22px; color: var(--ink); font-size: .84rem; font-weight: 750; }
.review-card figcaption span { display: block; margin-top: 3px; color: var(--muted); font-size: .76rem; font-weight: 400; }
.reviews-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 12px; color: var(--ink); font-size: .875rem; font-weight: 650; text-underline-offset: 4px; }
.reviews-link:hover { text-decoration-thickness: 2px; }
@media (max-width: 640px) {
  .customer-reviews { margin-top: 36px; padding-top: 30px; }
  .review-grid { grid-template-columns: 1fr; }
  .review-card-featured { grid-column: auto; padding: 24px; }
  .review-card { padding: 22px; }
}
