/* E-Solar free quote. The page is a day: --rise runs 0 (night, first
   question) to 1 (daylight, contact details). The sky shrinks, the sun climbs
   the horizon, and the daylight warms from orange-tinted dawn to white. */
:root {
  --black: #000000;
  --ink: #141414;
  --muted: #545454;          /* 7.5:1 on daylight */
  --sky-muted: #cfcac2;      /* 12:1 on black */
  --orange: #f26522;
  --amber: #ffb347;
  --action: #c94d12;         /* filled orange with white text, 4.6:1 */
  --action-press: #a83f0d;
  --day: #fffdf9;
  --dawn: #fde9dc;
  --rule: rgba(0, 0, 0, 0.14);
  --rule-sky: rgba(255, 255, 255, 0.18);
  --error: #b3261e;
  --display: Manrope, system-ui, sans-serif;
  --text: "Nunito Sans", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sky-h: calc(42vh - var(--rise) * 20vh);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--black); }
body {
  color: var(--ink);
  font: 400 17px/1.45 var(--text);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
button, input, textarea { font: inherit; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; }
.sky :focus-visible { outline-color: var(--amber); }
.sr { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- the day ---------------------------------------------------------- */
.day { min-height: 100dvh; display: flex; flex-direction: column; }

.sky {
  position: relative;
  background: var(--black);
  color: #fff;
  min-height: var(--sky-h);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.sky-inner { padding: calc(env(safe-area-inset-top) + 20px) 20px 44px; }
.brand { display: inline-block; margin-bottom: 22px; }
.brand img { display: block; width: 132px; height: auto; }
.intro h1 { font-size: 32px; font-weight: 800; line-height: 1.08; max-width: 14ch; }
.lede { margin: 10px 0 0; max-width: 40ch; color: var(--sky-muted); font-size: 16px; }
.intro.gone { display: none; }

/* Answers stay in the sky. Each chip goes back to its question. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 6px 12px 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 999px;
  background: transparent; color: #fff; font-size: 14px; line-height: 1.2; cursor: pointer;
  animation: rise .35s var(--ease) both;
}
.chip svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--amber); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chip .pen { stroke: #fff; opacity: .7; width: 13px; height: 13px; }
.chip:hover { border-color: var(--amber); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* The horizon: one orange line the whole width, the sun on it. The sun's
   x position and height above the line follow --rise. */
.horizon {
  position: relative; height: 0; border-top: 2px solid var(--orange);
  box-shadow: 0 6px 30px -6px rgba(242, 101, 34, 0.55);
}
.sun {
  position: absolute; left: calc(14% + var(--rise) * 62%);
  bottom: calc(-16px + var(--rise) * 18px);
  width: 32px; height: 32px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, var(--amber), var(--orange) 70%);
  box-shadow: 0 0 0 6px rgba(242, 101, 34, 0.18), 0 0 28px 4px rgba(242, 101, 34, 0.45);
  transition: left .6s var(--ease), bottom .6s var(--ease);
}

/* Daylight: dawn tint that fades to white as --rise grows. */
.light {
  flex: 1; position: relative;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--dawn) calc((1 - var(--rise)) * 100%), var(--day)) 0, var(--day) 220px);
  padding: 28px 20px calc(env(safe-area-inset-bottom) + 16px);
  display: flex; flex-direction: column;
}
.wizard { flex: 1; }
.step { animation: rise .25s var(--ease) both; }
.step h2 { font-size: 24px; font-weight: 800; line-height: 1.15; }
.qhint { margin: 8px 0 0; color: var(--muted); font-size: 15px; min-height: 22px; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.4; }

/* Tiles: white, hairline black, big icon. Chosen = black. */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; max-width: 640px; }
.tiles[data-n="2"] .tile { aspect-ratio: auto; min-height: 112px; }
.tiles[data-n="3"] .tile:last-child, .tiles[data-n="5"] .tile:last-child { grid-column: 1 / -1; aspect-ratio: auto; min-height: 72px; flex-direction: row; gap: 14px; justify-content: flex-start; padding-left: 20px; }
.tiles[data-n="3"] .tile:last-child svg, .tiles[data-n="5"] .tile:last-child svg { width: 32px; height: 32px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  aspect-ratio: 1 / 1; min-height: 120px; padding: 12px 10px; margin: 0;
  border: 1px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink);
  font-weight: 700; font-size: 16px; line-height: 1.2; text-align: center; cursor: pointer;
  box-shadow: 0 2px 6px rgba(20, 20, 20, 0.06);
  transition: background-color .15s, color .15s, transform .12s, box-shadow .15s;
}
.tile svg { width: 48px; height: 48px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile span { display: flex; align-items: center; min-height: 38px; }
@media (hover: hover) { .wizard:not(.no-hover) .tile:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -6px rgba(20, 20, 20, 0.25); } }
.tile:active { transform: scale(.97); }
.tile[aria-current="true"] { background: var(--black); color: #fff; border-color: var(--black); }
.tile[aria-current="true"] svg { stroke: var(--amber); }

/* Bands (the power bill) are tiles too, but a single column of rows. */
.tiles.rows { grid-template-columns: 1fr; gap: 10px; }
.tiles.rows .tile { aspect-ratio: auto; min-height: 60px; flex-direction: row; justify-content: space-between; padding: 0 18px; }
.tiles.rows .tile span { min-height: 0; }
.tiles.rows .tile b { font-family: var(--display); font-size: 18px; }

/* Footer: Back, progress, count. Always present so nothing jumps. */
.foot { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin-top: 26px; min-height: 44px; }
.back { grid-column: 1; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 8px 10px 8px 4px; background: none; border: 0; border-radius: 6px; color: var(--ink); font-weight: 700; cursor: pointer; }
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.back[hidden] + .progress { grid-column: 1 / 3; }
.progress { grid-column: 2; display: flex; gap: 5px; height: 6px; }
.progress i { flex: 1; border-radius: 3px; background: var(--rule); transition: background-color .25s; }
.progress i.done { background: var(--ink); }
.progress i.now { background: var(--orange); }
.count { grid-column: 3; margin: 0; font-size: 14px; color: var(--muted); white-space: nowrap; }

/* ---- details ---------------------------------------------------------- */
.details { display: grid; gap: 16px; max-width: 560px; }
.details h2 { margin-bottom: -4px; }
.lead { margin: 0; }
.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f { display: grid; gap: 6px; position: relative; }
label { font-weight: 700; font-size: 15px; }
label .opt { font-weight: 400; color: var(--muted); }
input, textarea {
  width: 100%; padding: 12px 14px; margin: 0;
  border: 1px solid #6b6b6b; border-radius: 8px; background: #fff; color: var(--ink);
  font-size: 17px; appearance: none;
}
textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.err input, .err textarea { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.msg { font-size: 14px; color: var(--error); min-height: 20px; }
.form-error { margin: 0; padding: 12px 14px; border: 1px solid var(--error); border-radius: 8px; color: var(--error); font-weight: 700; }
.sug { list-style: none; margin: 0; padding: 0; position: absolute; left: 0; right: 0; top: 100%; z-index: 10; background: #fff; border: 1px solid #6b6b6b; border-top: 0; border-radius: 0 0 8px 8px; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.25); }
.sug li { padding: 10px 14px; cursor: pointer; font-size: 16px; }
.sug li:hover, .sug li[aria-selected="true"] { background: var(--black); color: #fff; }
.sug .s { display: block; font-size: 14px; opacity: .8; }
.more { border: 1px solid var(--rule); border-radius: 8px; padding: 0 14px; }
.more summary { padding: 12px 0; cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
.more summary::-webkit-details-marker { display: none; }
/* The fold's chevron, drawn as an SVG in the ink colour. */
.more summary::before { content: ''; width: 14px; height: 14px; background: var(--ink); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .15s; }
.more[open] summary::before { transform: rotate(90deg); }
.more .f { padding: 2px 0 14px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.send {
  min-height: 56px; padding: 14px 22px; border: 0; border-radius: 10px;
  background: var(--action); color: #fff; font-weight: 800; font-size: 18px; font-family: var(--display); cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(201, 77, 18, 0.6);
}
.send:hover { background: var(--action-press); }
.send[disabled] { opacity: .6; cursor: default; }
.fine { margin: -4px 0 0; font-size: 13px; color: var(--muted); }

/* ---- thanks ----------------------------------------------------------- */
.thanks { max-width: 560px; display: grid; gap: 16px; }
.thanks h2 { display: flex; align-items: center; gap: 12px; }
.thanks h2 svg { width: 38px; height: 38px; flex: none; fill: var(--amber); stroke: var(--black); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.thanks p { margin: 0; }
.up { display: grid; gap: 12px; padding: 18px; border: 1px dashed #6b6b6b; border-radius: 12px; background: #fff; }
.up h3 { font-size: 18px; }
.pick-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pick { position: relative; display: inline-flex; align-items: center; min-height: 48px; padding: 10px 18px; border: 2px solid var(--black); border-radius: 8px; background: var(--black); color: #fff; font-weight: 700; cursor: pointer; }
.pick.alt { background: #fff; color: var(--ink); }
.pick:has(input:focus-visible) { outline: 3px solid var(--action); outline-offset: 3px; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.up-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.up-list li { display: flex; justify-content: space-between; gap: 12px; }
.up-list .ok { color: #1f6f2e; font-weight: 700; }
.up-list .bad { color: var(--error); font-weight: 700; }
.up-status { font-size: 15px; min-height: 22px; }

/* ---- the uploads step (before the details) ----------------------------- */
.uploads { max-width: 560px; display: grid; gap: 18px; }
.uploads .qhint { margin-top: 0; }
.uploads .up { background: #fff; }
.send.next { width: auto; min-width: 180px; }
.skip { background: none; border: 0; padding: 8px 4px; min-height: 44px; color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.uploads .pick-row { align-items: center; }
.awards { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .sky, .sun, .tile, .progress i { transition: none; }
  .step, .chip { animation: none; }
}

/* ---- tablet: one row of tiles, more sky ------------------------------- */
@media (min-width: 640px) {
  .sky-inner, .light { padding-left: 32px; padding-right: 32px; }
  .intro h1 { font-size: 40px; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 720px; }
  .tiles[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles[data-n="3"] .tile:last-child, .tiles[data-n="5"] .tile:last-child { grid-column: auto; aspect-ratio: 1 / 1; flex-direction: column; justify-content: center; padding-left: 10px; gap: 10px; }
  .tiles[data-n="3"] .tile:last-child svg, .tiles[data-n="5"] .tile:last-child svg { width: 48px; height: 48px; }
  .tiles[data-n="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 900px; }
  .tiles.rows { grid-template-columns: 1fr 1fr; max-width: 640px; }
  .tiles.rows .tile { aspect-ratio: auto; }
}

/* ---- desktop: night on the left, day on the right, one horizon -------- */
@media (min-width: 1024px) {
  :root { --sky-h: auto; }
  .day { flex-direction: row; min-height: 100dvh; }
  /* The sky is pinned to the viewport, so the horizon stays at 66vh however
     long the daylight column scrolls. */
  .sky { flex: 0 0 38%; height: 100dvh; min-height: 0; position: sticky; top: 0; align-self: flex-start; justify-content: flex-start; }
  .sky-inner { padding: 36px 40px 0; }
  .intro h1 { font-size: 44px; }
  .intro.gone { display: block; }
  .chips { margin-top: 28px; }
  /* The horizon crosses the whole page: it is drawn on .day, under both. */
  .sky .horizon { position: absolute; left: 0; right: 0; top: 66%; }
  .light { flex: 1; padding: 40px 56px; justify-content: center; }
  /* The horizon's echo across the daylight column, lifted while a form or
     the thank-you is up so no field sits on the line. */
  .light::before {
    content: ''; position: absolute; left: 0; right: 0; top: 66%; height: 0;
    border-top: 2px solid var(--orange); opacity: .55; pointer-events: none;
  }
  .day.form .light::before { display: none; }
  .wizard, .details, .thanks { position: relative; z-index: 1; }
  /* The question sits on the horizon, not at the top of an empty panel. */
  .wizard { display: flex; flex-direction: column; justify-content: center; padding-bottom: 8vh; }
  .details, .thanks { margin: auto 0; }
  .step h2 { font-size: 30px; }
  .tiles { max-width: 760px; }
  .foot { max-width: 760px; }
  .sun { left: calc(20% + var(--rise) * 60%); }
}

/* Calculator receipt stays visible through the questions and contact step. */
.estimate-summary{max-width:680px;margin:0 0 28px;padding:16px 0;border-block:1px solid var(--rule);font-size:16px}
.estimate-summary summary{min-height:44px;cursor:pointer;font-weight:800;align-content:center}
.estimate-summary p{max-width:65ch;line-height:1.55}
.estimate-lines{white-space:pre-line;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
#estimate-status{max-width:65ch;margin-bottom:24px}
