@import "tailwindcss";

:root {
  --ink: #17362b;
  --green: #174d3a;
  --lime: #c5f04a;
  --cream: #f4f2e9;
  --paper: #fbfaf5;
  --line: #d9ddd4;
  --muted: #66756f;
  --navy: #173b50;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
button, input { font: inherit; }
button { color: inherit; }

.topbar {
  height: 76px; padding: 0 5.5vw; display: flex; align-items: center; justify-content: space-between;
  background: rgba(251, 250, 245, .95); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
}
.brand { color: var(--ink); text-decoration: none; font-size: 22px; font-weight: 800; letter-spacing: -.7px; display: flex; align-items: center; }
.brand span, .footer-brand span { color: #7eac10; }
.brand-mark { width: 33px; height: 33px; margin-right: 10px; display: grid; place-items: center; border-radius: 50%; background: var(--lime); color: var(--ink) !important; }
.stepper { display: flex; align-items: center; gap: 10px; color: #82908b; font-size: 12px; font-weight: 700; }
.stepper i { height: 1px; width: 62px; background: #cbd0cc; }
.step { display: flex; gap: 8px; align-items: center; }
.step b { border: 1px solid #bdc5c0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.step.active { color: var(--ink); }
.step.active b { background: var(--ink); color: white; border-color: var(--ink); }
.help-button { border: 1px solid #bdc5c0; width: 34px; height: 34px; border-radius: 50%; background: transparent; cursor: pointer; font-weight: 800; }

.hero { max-width: 1360px; margin: 0 auto; padding: 58px 28px 42px; display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.eyebrow { margin: 0 0 13px; font-size: 11px; letter-spacing: 2.2px; font-weight: 800; color: #517368; }
.hero h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5vw, 72px); line-height: .99; letter-spacing: -3px; font-weight: 500; }
.intro { max-width: 460px; color: #526760; font-size: 16px; line-height: 1.65; margin: 0 0 3px; }

.workspace { max-width: 1360px; margin: 0 auto; padding: 0 28px 80px; display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(330px, .72fr); gap: 20px; }
.map-card, .config-card { border: 1px solid #d1d7d1; background: var(--paper); border-radius: 17px; overflow: hidden; box-shadow: 0 16px 45px rgba(25, 55, 43, .07); }
.map-toolbar { min-height: 98px; display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; gap: 8px; padding: 10px 12px 9px 20px; align-items: center; border-bottom: 1px solid var(--line); }
.location-control { display: flex; align-items: center; gap: 12px; min-width: 0; }
.location-control > span { width: 35px; height: 35px; display: grid; place-items: center; background: #e7f4c7; border-radius: 50%; font-size: 21px; }
.location-control label { flex: 1; }
.location-control small { display: block; font-size: 9px; letter-spacing: 1.5px; font-weight: 800; color: #71817b; }
.location-control input { width: 100%; border: 0; background: transparent; padding: 3px 0; outline: none; font-weight: 700; color: var(--ink); }
.apply-location { height: 40px; padding: 0 15px; border: 0; border-radius: 9px; background: var(--ink); color: white; font-size: 11px; font-weight: 800; cursor: pointer; }
.apply-location:disabled { opacity: .6; cursor: wait; }
.locate { width: 40px; height: 40px; border: 1px solid #cbd2cc; background: white; border-radius: 9px; cursor: pointer; font-size: 18px; }
.location-state { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; min-width: 0; padding-left: 47px; color: #60716b; }
.location-state > i { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: #9ca7a2; }
.location-state.success > i { background: #6d9c18; box-shadow: 0 0 0 3px rgba(109,156,24,.12); }
.location-state.loading > i { background: #d19b24; animation: pulse 1s infinite; }
.location-state.error > i { background: #b5534d; }
.location-state span { min-width: 0; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; overflow: hidden; }
.location-state b { max-width: 48%; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.location-state small { overflow: hidden; text-overflow: ellipsis; font-size: 9px; }
@keyframes pulse { 50% { opacity: .35; } }

.aerial-map { height: 570px; position: relative; overflow: hidden; cursor: grab; background: #7c925f; isolation: isolate; touch-action: none; }
.aerial-map.drawing { cursor: crosshair; }
.aerial-map.panning { cursor: grabbing; }
.aerial-map::before {
  content: ""; position: absolute; inset: 0; opacity: .35; z-index: -1;
  background-image: radial-gradient(circle at 20% 30%, #33592e 0 6%, transparent 6.5%), radial-gradient(circle at 80% 70%, #40683b 0 8%, transparent 8.5%), linear-gradient(35deg, transparent 45%, rgba(255,255,255,.12) 45% 46%, transparent 46%);
  background-size: 160px 160px, 210px 210px, 36px 36px;
}
.satellite-layer { position: absolute; inset: 0; z-index: 3; overflow: hidden; background: #657653; pointer-events: none; }
.satellite-layer img { position: absolute; width: 257px; height: 257px; max-width: none; object-fit: cover; user-select: none; }
.map-attribution { position: absolute; right: 6px; top: 6px; z-index: 10; padding: 3px 5px; border-radius: 3px; background: rgba(255,255,255,.78); color: #31453e; font-size: 7px; pointer-events: none; }
.road { position: absolute; background: #9b9b90; box-shadow: inset 0 0 0 8px #c3bcae; opacity: .95; z-index: 0; }
.road-a { left: -5%; right: -5%; height: 80px; bottom: -25px; transform: rotate(-4deg); }
.road-b { width: 75px; top: -10%; bottom: -10%; right: -22px; transform: rotate(7deg); }
.garden { position: absolute; border: 4px solid rgba(220,225,190,.35); background: rgba(91,121,55,.42); }
.garden-a { width: 29%; height: 30%; top: 4%; left: 5%; transform: rotate(-7deg); }
.garden-b { width: 25%; height: 26%; bottom: 8%; right: 9%; transform: rotate(8deg); }
.neighbor { position: absolute; background: #b7afa3; box-shadow: inset 0 0 0 18px #77726b, 0 8px 16px rgba(0,0,0,.2); }
.neighbor-a { width: 22%; height: 16%; top: 4%; right: 18%; transform: rotate(7deg); }
.neighbor-b { width: 18%; height: 20%; bottom: 12%; left: -5%; transform: rotate(-8deg); }
.house-base { position: absolute; left: 27%; top: 23%; width: 47%; height: 49%; background: #d7c8aa; transform: rotate(-12deg); box-shadow: 0 16px 25px rgba(0,0,0,.3); }
.roof { position: absolute; top: 25%; width: 24%; height: 46%; background: repeating-linear-gradient(90deg, #4c514f 0 4px, #5b605e 4px 8px); transform: rotate(-12deg); box-shadow: inset 0 0 25px rgba(0,0,0,.35); }
.roof-left { left: 27.5%; clip-path: polygon(0 0, 100% 7%, 100% 94%, 0 100%); }
.roof-right { left: 50.5%; clip-path: polygon(0 7%, 100% 0, 100% 100%, 0 94%); filter: brightness(.83); }
.chimney { position: absolute; z-index: 2; width: 30px; height: 35px; background: #887b6c; top: 34%; left: 50%; transform: rotate(-12deg); box-shadow: 3px 4px 8px rgba(0,0,0,.45); }
.tree { position: absolute; z-index: 1; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; background: #2d6636; color: #578a45; font-size: 60px; text-shadow: 3px 4px 8px #1b4728; }
.tree-a { top: 6%; left: 8%; }.tree-b { bottom: 13%; right: 16%; }.tree-c { top: 15%; right: 4%; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; }
.roof-zone { fill: rgba(197,240,74,.25); stroke: #c5f04a; stroke-width: .7; cursor: pointer; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
.roof-zone.active { fill: rgba(197,240,74,.38); stroke-width: 1; }
.module-zone { fill: url(#solar-modules); stroke: rgba(255,255,255,.82); stroke-width: .22; pointer-events: none; }
.solar-cell { fill: #173b50; stroke: #b5d3dc; stroke-width: .18; }
.solar-cell-lines { fill: none; stroke: rgba(170,214,226,.65); stroke-width: .12; }
.handle { fill: white; stroke: #17362b; stroke-width: .45; }
.drawing-line { fill: none; stroke: #c5f04a; stroke-width: .8; stroke-dasharray: 2 1; }
.drawing-point { fill: white; stroke: #17362b; stroke-width: .4; }
.map-help { position: absolute; z-index: 10; left: 18px; bottom: 18px; width: 255px; background: rgba(251,250,245,.95); border-radius: 12px; padding: 15px; box-shadow: 0 8px 28px rgba(0,0,0,.2); }
.map-help b { display: block; font-size: 13px; }
.map-help span { display: block; color: #62716c; font-size: 11px; line-height: 1.4; margin: 5px 0 12px; }
.map-help button { width: 100%; border: 0; border-radius: 8px; padding: 10px; background: var(--ink); color: white; font-size: 12px; font-weight: 800; cursor: pointer; }
.map-help button:disabled { opacity: .6; cursor: default; }
.draw-actions { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.map-help .draw-actions .secondary { width: auto; background: #e8ebe3; color: var(--ink); }
.map-nav { position: absolute; z-index: 11; right: 15px; top: 34px; display: grid; width: 42px; border-radius: 9px; overflow: hidden; box-shadow: 0 5px 18px rgba(0,0,0,.25); }
.map-nav button { height: 40px; border: 0; border-bottom: 1px solid #d7ddd7; background: rgba(255,255,255,.94); color: var(--ink); font-size: 20px; font-weight: 700; cursor: pointer; }
.map-nav button:disabled { color: #abb4af; cursor: default; }
.map-nav small { padding: 4px 0; background: rgba(245,245,239,.94); color: #62716b; text-align: center; font-size: 7px; }
.map-scale { position: absolute; z-index: 10; bottom: 18px; right: 18px; padding: 7px 10px; border-radius: 5px; background: rgba(255,255,255,.85); color: #263c34; font-size: 9px; }
.map-scale span { display: inline-block; width: 42px; border-top: 2px solid #263c34; margin-right: 6px; vertical-align: middle; }

.config-card { padding: 26px; }
.card-heading, .results-heading { display: flex; align-items: start; justify-content: space-between; }
.card-heading h2, .results-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 30px; font-weight: 500; letter-spacing: -1px; }
.count { padding: 6px 9px; border-radius: 99px; background: #e7eadf; font-size: 11px; font-weight: 800; }
.roof-tabs { display: flex; gap: 7px; overflow-x: auto; margin: 22px 0; padding-bottom: 3px; }
.roof-tabs button { flex: 0 0 auto; min-width: 120px; border: 1px solid #d6dcd7; border-radius: 9px; padding: 9px 10px; background: transparent; display: flex; gap: 8px; text-align: left; cursor: pointer; }
.roof-tabs button.selected { background: #edf5d8; border-color: #87a83d; }
.roof-tabs b, .roof-tabs small { display: block; }
.roof-tabs b { font-size: 11px; }.roof-tabs small { color: #71807a; margin-top: 3px; font-size: 10px; }
.roof-icon { font-size: 20px; }
.empty-roofs { min-height: 360px; border: 1px dashed #c4cec6; border-radius: 12px; background: #f5f6ef; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; }
.empty-roofs > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: #e7efd4; font-size: 28px; }
.empty-roofs b { margin-top: 16px; font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.empty-roofs p { max-width: 260px; margin: 8px 0 18px; color: #708079; font-size: 11px; line-height: 1.5; }
.empty-roofs button { border: 0; border-radius: 8px; background: var(--ink); color: white; padding: 11px 16px; font-size: 11px; font-weight: 800; cursor: pointer; }
.empty-roofs button:disabled { opacity: .6; cursor: default; }
.controls { border-top: 1px solid var(--line); padding-top: 17px; }
.field-line, .range-title { display: flex; align-items: center; justify-content: space-between; }
.field-line label, .range-title label { font-size: 12px; font-weight: 800; }
.field-line div { display: flex; align-items: center; border: 1px solid #cbd2cc; border-radius: 7px; padding: 0 8px; background: white; }
.field-line input { width: 46px; border: 0; padding: 7px 2px; text-align: right; outline: none; font-weight: 700; }
.field-line span { font-size: 11px; color: #71807a; }
.range-control, .shade-control { margin-top: 24px; }
.range-title output { background: #eaf1d7; min-width: 48px; text-align: center; border-radius: 7px; padding: 5px 8px; font-size: 11px; font-weight: 800; }
input[type="range"] { width: 100%; accent-color: var(--green); margin: 13px 0 5px; }
.range-labels { display: flex; justify-content: space-between; color: #7b8984; font-size: 9px; }
.orientation { margin: 24px 0 7px; }
.compass { position: relative; width: 128px; height: 128px; border: 1px solid #cad2cc; border-radius: 50%; margin: 14px auto 5px; background: radial-gradient(circle, #eef3e3 0 28%, transparent 29%); }
.compass > span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; }
.compass button { position: absolute; z-index: 2; left: 50%; top: 50%; margin: -12px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.compass button.selected { background: var(--ink); color: white; box-shadow: 0 0 0 3px var(--lime); }
.remove { display: block; border: 1px solid #d7b7b3; background: #fff7f5; border-radius: 7px; color: #7d4744; font-size: 10px; margin-top: 20px; padding: 9px 11px; cursor: pointer; }
.delete-hint { display: block; margin-top: 7px; color: #82908b; font-size: 9px; }
.results-jump { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 22px; padding: 13px 15px; border-radius: 9px; background: var(--ink); color: white; text-decoration: none; font-size: 12px; font-weight: 800; box-shadow: 0 8px 18px rgba(23,54,43,.16); }
.results-jump span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--lime); color: var(--ink); font-size: 14px; }

.results { background: var(--ink); color: white; padding: 78px max(5.5vw, calc((100vw - 1304px)/2)); }
.results-heading { align-items: end; }
.results-heading .eyebrow { color: #aabca8; }
.results-heading h2 { font-size: clamp(36px, 4.5vw, 55px); letter-spacing: -2px; }
.data-badge { border: 1px solid rgba(255,255,255,.2); border-radius: 99px; padding: 8px 13px; font-size: 10px; color: #d4dfda; }
.data-badge i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); margin-right: 6px; }
.metrics { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); margin-top: 38px; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; overflow: hidden; }
.metric { min-height: 245px; padding: 26px; border-right: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.025); }
.metric:last-child { border: 0; }
.metric.primary { background: var(--lime); color: var(--ink); }
.metric-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--lime); font-size: 21px; }
.metric-icon.pale { background: rgba(197,240,74,.12); color: var(--lime); }
.metric p, .economics-copy p { margin: 24px 0 11px; letter-spacing: 1.7px; font-size: 9px; font-weight: 800; opacity: .78; }
.metric strong { display: block; font-family: Georgia, serif; font-weight: 400; line-height: 1; font-size: clamp(35px, 4vw, 55px); }
.metric em { display: block; font-style: normal; margin-top: 2px; font-size: 11px; font-weight: 700; }
.metric small { display: block; margin-top: 25px; padding-top: 15px; border-top: 1px solid currentColor; opacity: .55; font-size: 9px; }
.economics { display: grid; grid-template-columns: 1.05fr .95fr; gap: 60px; margin-top: 25px; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 30px; }
.economics-copy { display: flex; gap: 18px; align-items: start; }
.economics-copy p { margin-top: 3px; }
.economics h3 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 400; line-height: 1.25; }
.economics h3 span { color: var(--lime); }
.economics small { display: block; margin-top: 12px; color: #9eb0a9; font-size: 10px; }
.payback-chart { padding-top: 18px; }
.chart-line { height: 4px; background: rgba(255,255,255,.18); position: relative; border-radius: 10px; margin-top: 23px; }
.chart-line i { display: block; height: 4px; background: var(--lime); border-radius: 10px; position: relative; }
.chart-line i::after { content: ""; position: absolute; right: -6px; top: -5px; width: 14px; height: 14px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 0 6px rgba(197,240,74,.13); }
.chart-labels { display: flex; justify-content: space-between; margin-top: 14px; font-size: 9px; color: #8fa19a; }
.chart-labels b { color: var(--lime); text-align: center; font-weight: 700; }
.assumptions { margin-top: 18px; }
.assumptions > button { border: 0; background: transparent; color: #d5dfdb; font-size: 11px; text-decoration: underline; cursor: pointer; }
.assumption-fields { margin-top: 15px; padding: 20px; border-radius: 12px; background: rgba(255,255,255,.06); display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 25px; }
.assumption-fields label { font-size: 10px; color: #afc0ba; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.assumption-fields input { width: 60px; background: #f7f6ef; color: var(--ink); border: 0; border-radius: 5px; padding: 6px; }
.assumption-fields p { margin: 0; font-size: 9px; line-height: 1.5; color: #8fa19a; }

footer { padding: 35px 5.5vw; background: var(--paper); display: flex; justify-content: space-between; align-items: center; }
.footer-brand b, .footer-brand small { display: block; }
.footer-brand b { font-size: 19px; }.footer-brand small { color: #788680; font-size: 9px; margin-top: 5px; }
.footer-actions { display: flex; gap: 10px; }
.footer-actions button, .footer-actions a { padding: 11px 17px; border: 1px solid #c6cec8; border-radius: 7px; background: transparent; color: inherit; text-decoration: none; font-size: 10px; font-weight: 800; cursor: pointer; }
.footer-actions .cta { background: var(--ink); color: white; border-color: var(--ink); }

@media (max-width: 980px) {
  .stepper { display: none; }
  .hero { align-items: start; flex-direction: column; }
  .workspace { grid-template-columns: 1fr; }
  .aerial-map { height: 500px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.14); }
  .economics { grid-template-columns: 1fr; }
  .assumption-fields { grid-template-columns: 1fr 1fr; }
  .assumption-fields p { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .topbar { height: 64px; padding: 0 18px; }
  .hero { padding: 38px 18px 30px; }
  .hero h1 { font-size: 44px; }
  .workspace { padding: 0 12px 55px; }
  .map-toolbar { grid-template-columns: minmax(0, 1fr) auto; padding-left: 12px; }
  .apply-location { grid-column: 1 / 2; }
  .locate { grid-column: 2 / 3; grid-row: 2; }
  .location-state { grid-row: 3; padding-left: 0; }
  .location-state span { display: block; white-space: normal; }
  .location-state b, .location-state small { max-width: none; display: block; }
  .aerial-map { height: 440px; }
  .map-help { width: 215px; }
  .config-card { padding: 20px; }
  .results { padding: 58px 18px; }
  .results-heading { display: block; }
  .data-badge { display: inline-block; margin-top: 20px; }
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 205px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.14); }
  .metric:nth-child(3) { border-bottom: 1px solid rgba(255,255,255,.14); }
  .economics { padding: 22px; gap: 25px; }
  .assumption-fields { grid-template-columns: 1fr; }
  .assumption-fields p { grid-column: auto; }
  footer { align-items: flex-start; gap: 25px; flex-direction: column; }
}

@media print {
  .topbar, .workspace, footer, .assumptions { display: none; }
  .results { min-height: 100vh; }
}
