/* ============================================================
   Neptune ROI Calculator — styles
   Palette lifted from the original site (style.scss).
   ============================================================ */
:root {
  --blu: #0088ce;
  --blu2: #0188ce;
  --pur: #6673b6;
  --grad: linear-gradient(120deg, #6673b6, #0188ce);
  --grad-rev: linear-gradient(120deg, #0188ce, #6673b6);
  --dk: #010c49;
  --gr-blu: #51626f;
  --xlt: #edf7fd;
  --lt-blu: #e2f4fd;
  --sp-line: #e6e8e9;
  --grn: #009b74;
  --lt-grn: #ddf0e5;
  --red: #dc3a48;
  --pink: #fbedee;
  --amber: #c9781a;
  --amber-bg: #fdf4e6;
  --amber-line: #f0dcbd;
  --ink-soft: #5a6b78;
  --radius: 22px;
  --field-border: #cdd8e2;
  --shadow: 0 18px 50px rgba(1, 12, 73, 0.13);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Open Sans", -apple-system, system-ui, "Segoe UI", sans-serif;
  color: var(--dk);
  background: #eaeff4;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; }
a { color: var(--blu); }

/* visible focus everywhere (keyboard accessibility) */
:focus-visible { outline: 3px solid #7fc4ec; outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 26px 18px 90px; }

/* ---------- App shell ---------- */
.app { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
header.bar {
  background: var(--grad); color: #fff; display: flex; align-items: center;
  justify-content: space-between; padding: 18px 30px; gap: 16px;
}
header.bar img { height: 32px; display: block; }
header.bar .title { font-weight: 700; font-size: 16px; letter-spacing: .3px; }
header.bar .restart {
  color: #fff; font-size: 13px; text-decoration: none; border: 1px solid rgba(255, 255, 255, .55);
  padding: 7px 16px; border-radius: 30px; background: transparent; cursor: pointer; font: inherit; font-weight: 600;
}
header.bar .restart:hover { background: rgba(255, 255, 255, .16); }

/* Country selector (header, beside "Start over") + helper note.
   Country-specific UI added for multi-region (US / Canada) support. */
header.bar .title { margin-right: auto; }
header.bar .country-picker { display: flex; align-items: center; }
header.bar .country-select {
  color: #fff; font: inherit; font-weight: 600; font-size: 13px;
  border: 1px solid rgba(255, 255, 255, .55); border-radius: 30px;
  padding: 7px 34px 7px 16px; background-color: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
header.bar .country-select:hover { background-color: rgba(255, 255, 255, .16); }
header.bar .country-select option { color: #0a1f44; }
.country-note {
  font-size: 10px; color: #000; margin: 0; padding: 8px 30px;
  background: #f5f8fc; border-bottom: 1px solid #e6eef7;
}

/* ---------- Stepper ---------- */
.stepper { display: flex; gap: 2px; padding: 18px 22px 6px; flex-wrap: wrap; border-bottom: 1px solid var(--sp-line); list-style: none; margin: 0; }
.stepper li { flex: 1 1 auto; min-width: 130px; }
.stepper .st {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 10px; cursor: pointer;
  border-radius: 10px; background: transparent; border: none; font: inherit; text-align: left;
}
.stepper .st:hover { background: var(--xlt); }
.stepper .num {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; background: #e4eaf0; color: var(--gr-blu); transition: .2s;
}
.stepper .lbl { font-size: 13px; font-weight: 600; color: var(--gr-blu); }
.stepper .st[aria-current="step"] .num { background: var(--grad); color: #fff; box-shadow: 0 4px 10px rgba(1, 136, 206, .35); }
.stepper .st[aria-current="step"] .lbl { color: var(--dk); }
.stepper .st.done .num { background: var(--grn); color: #fff; }

/* ---------- Panels ---------- */
.panel { display: none; padding: 34px 40px 6px; }
.panel.show { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
h1.step-title { font-size: 30px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.5px; }
.step-sub { color: var(--gr-blu); font-size: 15px; margin: 0 0 24px; max-width: 74ch; }

/* Centered single-column layout (Utility & Approaches steps) */
.panel.centered > h1.step-title,
.panel.centered > .step-sub,
.panel.centered > .q { max-width: 640px; margin-left: auto; margin-right: auto; }
.panel.centered .field { max-width: 460px; }

/* ---------- Questions ---------- */
.q { display: grid; grid-template-columns: 40px 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--sp-line); }
.q:first-of-type { border-top: none; padding-top: 6px; }
.q .qn { width: 34px; height: 34px; border-radius: 50%; background: var(--lt-blu); color: var(--blu); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.qbody { min-width: 0; }
.qlabel { display: block; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.hint { color: var(--gr-blu); font-size: 13px; margin: 0 0 12px; }

/* ---------- Inputs ---------- */
.field { max-width: 440px; }
input[type="text"], input[type="number"], select {
  width: 100%; font: inherit; font-size: 16px; color: var(--dk); padding: 12px 14px;
  border: 1.5px solid var(--field-border); border-radius: 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--blu); box-shadow: 0 0 0 3px rgba(1, 136, 206, .15); }
select {
  appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%230088ce'%3E%3Cpath d='M3 5l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.affix { position: relative; }
.affix .pfx, .affix .sfx { position: absolute; top: 50%; transform: translateY(-50%); color: var(--gr-blu); font-weight: 700; pointer-events: none; }
.affix .pfx { left: 6px; } .affix.has-pfx input { padding-left: 26px; margin-top:1px; }
.affix .sfx { right: 14px; } .affix.has-sfx input { padding-right: 30px; }

.readout {
  margin-top: 16px; background: var(--xlt); border: 1px solid var(--lt-blu); border-radius: 14px;
  padding: 14px 18px; display: flex; align-items: baseline; justify-content: space-between; max-width: 440px; gap: 12px;
}
.readout .rl { font-weight: 700; color: var(--gr-blu); font-size: 14px; }
.readout .rv { font-weight: 800; font-size: 22px; color: var(--blu); }
.note-retro { background: var(--pink); color: var(--red); border-radius: 12px; padding: 10px 14px; font-size: 13px; font-weight: 600; margin-top: 12px; max-width: 560px; }

/* ---------- Cost cards ---------- */
.cost-card { border: 1px solid var(--sp-line); border-radius: 16px; padding: 4px 20px 14px; margin: 16px 0; }
.cost-card > h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .7px; color: var(--gr-blu); margin: 16px 0 4px; }
.crow { display: grid; grid-template-columns: 1.6fr 1fr 1.1fr 1fr; gap: 14px; align-items: end; padding: 12px 0; border-top: 1px dashed var(--sp-line); }
.crow:first-of-type { border-top: none; }
.crow .cl { font-weight: 700; font-size: 15px; }
.crow .cl small { display: block; font-weight: 400; color: var(--gr-blu); font-size: 12px; }
.subh { font-size: 11px; font-weight: 700; color: var(--gr-blu); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.crow .cost-out { font-weight: 800; color: var(--blu); font-size: 17px; text-align: right; }
.qty-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--xlt); border: 1px solid var(--lt-blu); border-radius: 10px; padding: 11px 12px; font-weight: 700; color: var(--dk); }
.qty-chip .auto { font-size: 10px; font-weight: 700; color: var(--blu); background: #fff; border-radius: 6px; padding: 1px 6px; }
.rm-btn { border: none; background: var(--pink); color: var(--red); font-weight: 800; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 16px; line-height: 1; }
.rm-btn:hover { background: #f6d6da; }

.total-bar { display: flex; justify-content: space-between; align-items: center; background: var(--dk); color: #fff; border-radius: 14px; padding: 14px 22px; margin-top: 12px; }
.total-bar.green { background: var(--grn); }
.total-bar .tv { font-size: 22px; font-weight: 800; }
.add-row { margin-top: 8px; background: var(--lt-blu); color: var(--blu); border: 1px dashed var(--blu); border-radius: 12px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.add-row:hover { background: #d3ecfb; }

/* Annual costs (step 4) — sectioned cards with Quantity × Per-unit rows */
.edit-note { font-size: 14px; color: var(--gr-blu); background: var(--lt-blu); border-left: 3px solid var(--blu); border-radius: 8px; padding: 10px 14px; margin: 4px 0 16px; }
.ann-card { border: 1px solid var(--sp-line); border-radius: 14px; padding: 16px 18px 14px; margin-bottom: 20px; background: #fff; }
.ann-card .cost-section-label { border-bottom: none; margin-top: 0; padding-top: 0; }
.qty-table .cost-col { text-align: right; font-weight: 700; color: var(--blu); white-space: nowrap; }
.qty-table thead th.cost-col { color: var(--gr-blu); }
.qty-table .ann-qty { width: 110px; }
.qty-table .cell .affix input.ann-unit { width: 90px; }

/* ---------- Annual matrix ---------- */
.matrix { width: 100%; border-collapse: collapse; margin-top: 8px; }
.matrix th, .matrix td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--sp-line); vertical-align: middle; }
.matrix .act { width: 40px; text-align: center; padding-left: 2px; padding-right: 2px; }
.matrix .act .rm-btn { margin: 0 auto; }
.matrix thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--gr-blu); }
.matrix thead th.col { text-align: center; }
.matrix thead th.col.prop { color: var(--grn); }
.matrix td.name { font-weight: 700; }
.matrix td.cell { width: 150px; }
.matrix td.cell .affix input { padding: 9px 10px 9px 24px; font-size: 15px; }
.matrix tfoot td { font-weight: 800; border-top: 2px solid var(--sp-line); border-bottom: none; }
.matrix tfoot td.col { text-align: center; color: var(--blu); }
.matrix tfoot td.col.prop { color: var(--grn); }
.matrix .name input { font-weight: 700; padding: 8px 10px; }

/* ---------- Summary ---------- */
.recap { background: var(--xlt); border-radius: 14px; padding: 14px 18px; font-size: 14px; color: var(--gr-blu); margin-bottom: 22px; }
.recap b { color: var(--dk); }
.cmp { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 26px; }
.cmp th, .cmp td { padding: 15px 16px; text-align: right; font-size: 16px; }
.cmp thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--gr-blu); border-bottom: 2px solid var(--sp-line); }
.cmp thead th.metric { text-align: left; }
.cmp thead th.prop { color: var(--grn); }
.cmp tbody td { border-bottom: 1px solid var(--sp-line); }
.cmp tbody td.metric { text-align: left; font-weight: 700; }
.cmp .base { color: var(--gr-blu); font-weight: 700; }
.cmp .prop { color: var(--grn); font-weight: 800; }
.cmp .adv { color: #e8791e !important; font-weight: 800; }
.cmp td.base { color: #0088ce; }
.cmp .adv.neg { color: var(--red); }
.pill { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 20px; margin-left: 6px; }
.pill.green { background: var(--lt-grn); color: var(--grn); }

.chart-card { border: 1px solid var(--sp-line); border-radius: 18px; padding: 18px 20px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 8px 16px; border-radius: 30px; border: 1.5px solid var(--field-border); background: #fff; color: var(--gr-blu); transition: .15s; }
.tabs button[aria-selected="true"] { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(1, 136, 206, .3); }
.chart-host { position: relative; height: 420px; }
.chart-cap { color: var(--gr-blu); font-size: 13px; margin-top: 10px; text-align: center; }
.summary-links { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; align-items: center; }

/* ---------- Nav buttons ---------- */
.nav { display: flex; justify-content: space-between; align-items: center; padding: 24px 40px 36px; }
.btn { font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; border: none; border-radius: 30px; padding: 13px 30px; transition: transform .08s, box-shadow .15s, opacity .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-next { background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(1, 136, 206, .35); }
.btn-next:hover { background: var(--grad-rev); }
.btn-back { background: #eef2f6; color: var(--gr-blu); }
.btn-back:disabled { opacity: .4; cursor: default; }
.btn-ghost { background: transparent; color: var(--blu); padding: 10px 14px; }
.btn-ghost:hover { background: var(--xlt); }
.btn-dk { background: var(--dk); color: #fff; }

/* ---------- Modals ---------- */
.overlay { position: fixed; inset: 0; background: rgba(1, 12, 73, .55); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 20px; }
.overlay[hidden] { display: none; }
.dialog { background: #fff; border-radius: 22px; max-width: 720px; width: 100%; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.dialog .dtop { background: var(--grad); color: #fff; padding: 20px 26px; display: flex; align-items: center; justify-content: space-between; }
.dialog .dtop h2 { font-size: 20px; font-weight: 800; }
.dialog .dbody { padding: 22px 26px; overflow: auto; }
.dialog .close { background: rgba(255, 255, 255, .18); border: none; color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer; line-height: 1; }
.dialog .close:hover { background: rgba(255, 255, 255, .32); }

/* welcome */
.welcome { max-width: 560px; }
.welcome .dtop { display: block; }
.welcome .dtop img { height: 38px; margin-bottom: 16px; }
.welcome .dbody p { color: var(--gr-blu); font-size: 15px; }
.welcome .dbody ul { color: var(--gr-blu); font-size: 14px; padding-left: 20px; }

/* assumptions modal */
.assm-group { margin-bottom: 6px; }
.assm-group > .gh { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; color: var(--amber); margin: 20px 0 8px; }
.assm-group > .gh::after { content: ""; flex: 1; height: 1px; background: var(--amber-line); }
.assm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.assm { background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.assm .al { font-size: 13px; font-weight: 600; color: #6a4a16; }
.assm .ai { width: 110px; flex: 0 0 110px; }
.assm .ai input, .assm .ai select { padding: 8px 10px; font-size: 14px; border-color: var(--amber-line); }

/* payback model breakdown */
.pbm h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--blu); margin: 20px 0 6px; padding-bottom: 5px; border-bottom: 2px solid var(--lt-blu); }
.pbm table { width: 100%; border-collapse: collapse; }
.pbm td { padding: 7px 8px; border-bottom: 1px solid var(--sp-line); font-size: 13.5px; }
.pbm td.code { width: 46px; color: var(--gr-blu); font-weight: 700; }
.pbm td.val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 760px) {
  .panel, .nav { padding-left: 20px; padding-right: 20px; }
  .crow { grid-template-columns: 1fr 1fr; }
  .assm-grid { grid-template-columns: 1fr; }
  .cmp th, .cmp td { padding: 12px 8px; font-size: 14px; }
  .matrix td.cell { width: auto; }
}

/* ===================== SLIDER STYLES ===================== */
.slider-row {
  display: flex; align-items: center; gap: 14px; margin-top: 12px; max-width: 460px;
}
.range-slider {
  flex: 1; -webkit-appearance: none; appearance: none; height: 6px;
  border-radius: 6px; background: var(--lt-blu);
  border: none; padding: 0; cursor: pointer; outline: none; transition: background .15s;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px;
  border-radius: 50%; background: var(--blu); cursor: pointer;
  box-shadow: 0 2px 6px rgba(1,136,206,.4); border: 2px solid #fff; transition: transform .1s;
}
.range-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--blu);
  cursor: pointer; box-shadow: 0 2px 6px rgba(1,136,206,.4); border: 2px solid #fff;
}
.range-slider:hover::-webkit-slider-thumb { transform: scale(1.15); }
.range-slider:focus { box-shadow: 0 0 0 3px rgba(1,136,206,.18); border-radius: 6px; }
.slider-val {
  font-weight: 800; font-size: 14px; color: var(--blu); min-width: 60px; text-align: right;
}

/* ===================== INLINE ASSUMPTIONS (STEP 5) ===================== */
.assm-inline-group {
  background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 18px;
  padding: 18px 24px 20px; margin-bottom: 20px;
}
.assm-inline-header {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px;
  color: var(--amber); border-bottom: 1px solid var(--amber-line); padding-bottom: 10px; margin-bottom: 16px;
}
.assm-inline-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.assm-inline-item label.al {
  display: block; font-size: 13px; font-weight: 600; color: #6a4a16; margin-bottom: 6px;
}
.assm-inline-item input[type="text"],
.assm-inline-item select {
  width: 100%; font: inherit; font-size: 14px; color: var(--dk); padding: 9px 12px;
  border: 1.5px solid var(--amber-line); border-radius: 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
/* Dropdown chevron ONLY on real select fields (e.g. Typical meter type in service) */
.assm-inline-item select {
  padding-right: 38px;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c9781a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.assm-inline-item input:focus,
.assm-inline-item select:focus {
  outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(201,120,26,.15);
}

/* cost section labels */
.cost-section-label {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 6px 0 2px; margin-bottom: 2px; border-bottom: 1px solid var(--sp-line);
}
.baseline-section-label { color: var(--gr-blu); margin-top: 10px; }
.proposed-section-label { color: var(--grn); margin-top: 14px; }

@media (max-width: 760px) {
  .assm-inline-grid { grid-template-columns: 1fr; }
}

/* Locked assumption field (e.g. accuracy reduction when ultrasonic baseline selected) */
input:disabled {
  background: #f4f6f8;
  color: var(--gr-blu);
  cursor: not-allowed;
  border-color: #dde3e8;
}

/* ===================== DUAL CHART ROW (Excel-style side-by-side) ===================== */
.dual-charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 0;
}
.chart-card.dual { margin-bottom: 0; }
.chart-title {
  font-size: 14px; font-weight: 700; color: var(--dk);
  margin: 0 0 10px; line-height: 1.3;
}
.chart-title small { font-size: 11px; font-weight: 400; color: var(--ink-soft); }
.chart-card.dual .chart-host { height: 300px; }

@media (max-width: 820px) {
  .dual-charts-row { grid-template-columns: 1fr; }
}

/* Hint text under assumption fields (e.g. typical meter age) */
.field-hint { margin: 6px 2px 0; font-size: 12.5px; font-style: italic; color: #4a7fb5; line-height: 1.4; }
.assm .field-hint { grid-column: 1 / -1; }
i-money.ann-unit { margin-top:2px; padding-left:26px; }
