:root {
  color-scheme: light;
  --ink: #16182b;
  --muted: #5c6178;
  --paper: #f4f6fa;
  --panel: #ffffff;
  --line: #dfe3ec;
  --brand: #26246b;
  --brand-dark: #1a1850;
  --accent: #3f9bd9;
  --alert: #b54708;
  --good: #13795b;
  --shadow: 0 18px 45px rgba(22, 24, 43, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(38, 36, 107, 0.08), rgba(63, 155, 217, 0.08)),
    var(--paper);
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 22px;
}

.app-shell {
  min-height: 100vh;
  padding: 28px;
}

.landing-shell {
  display: grid;
  place-items: center;
}

.workspace,
.upload-page {
  width: min(1160px, 100%);
  margin: 0 auto;
}

.upload-page {
  display: grid;
  justify-items: center;
  text-align: center;
}

.brand-logo {
  height: 52px;
  width: auto;
  margin-bottom: 22px;
}

.report-logo {
  display: block;
  height: 34px;
  width: auto;
  margin: 4px 0 14px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-line {
  display: inline-block;
}

.hero-copy {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.upload-card {
  display: grid;
  gap: 18px;
  width: min(680px, 100%);
  margin-top: 34px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.upload-zone {
  display: grid;
  gap: 10px;
  place-items: center;
  min-height: 180px;
  padding: 30px;
  border: 1.5px dashed #c3cbe0;
  border-radius: 8px;
  background: #fbfcff;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.upload-zone.large {
  min-height: 230px;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  border-color: var(--brand);
  background: #eef2f8;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-zone strong {
  font-size: 24px;
}

.upload-zone span,
.privacy-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.privacy-note {
  margin: 16px 0 0;
}

.primary-button,
.secondary-button,
.primary-link,
.secondary-link {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.primary-button,
.primary-link {
  color: #fff;
  background: var(--brand);
}

.primary-button:hover,
.primary-link:hover {
  background: var(--brand-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.secondary-button,
.secondary-link {
  color: var(--brand-dark);
  border-color: #c3cbe0;
  background: #eef2f8;
}

.wide-button {
  width: 100%;
}

.full {
  width: 100%;
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 20px 0 24px;
}

.report-header h1 {
  font-size: clamp(30px, 3.6vw, 46px);
  white-space: nowrap;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: none;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.report-panel,
.contact-panel {
  padding: 24px;
}

.contact-panel {
  position: sticky;
  top: 20px;
}

.contact-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.contact-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.score-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: 8px;
  background: #eef2f8;
}

.score-card p {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.score-card strong {
  font-size: 42px;
  line-height: 1;
}

.score-pill {
  white-space: nowrap;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--brand-dark);
  background: #e3e9f4;
  font-weight: 800;
}

.score-pill.hot {
  color: #fff;
  background: var(--alert);
}

.score-pill.warm {
  color: #16182b;
  background: var(--accent);
}

.score-pill.good {
  color: #fff;
  background: var(--good);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.metrics div {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metrics span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metrics strong {
  font-size: 22px;
}

.insight-block {
  margin-top: 24px;
}

.section-note {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

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

.breakdown-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.breakdown-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.breakdown-item strong {
  display: grid;
  gap: 6px;
  font-size: 20px;
}

.breakdown-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.breakdown-formula {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.comparison-table {
  display: grid;
  gap: 14px;
}

/* Summary: current vs Ezybill vs saving */
.cmp-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cmp-sum {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.cmp-sum-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.cmp-sum strong {
  font-size: 26px;
  line-height: 1.1;
}

.cmp-sum strong small {
  margin-left: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.cmp-sum-sub {
  color: var(--muted);
  font-size: 13px;
}

.cmp-sum--ezybill {
  border-color: #c3cbe0;
  background: #eef2f8;
}

.cmp-sum--save {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.cmp-sum--save .cmp-sum-label,
.cmp-sum--save .cmp-sum-sub,
.cmp-sum--save strong small {
  color: rgba(255, 255, 255, 0.85);
}

/* Breakdown: where the saving comes from */
.cmp-bd {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.cmp-bd-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}

.cmp-bd-row + .cmp-bd-row {
  border-top: 1px solid var(--line);
}

.cmp-bd-row > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cmp-bd-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.cmp-bd-label {
  font-weight: 700;
}

.cmp-bd-head {
  color: var(--brand-dark);
  background: #eef2f8;
  font-size: 13px;
  font-weight: 800;
}

.cmp-bd-row--muted {
  color: var(--muted);
}

.cmp-save.pos {
  color: var(--good);
  font-weight: 800;
}

.cmp-save.neg {
  color: var(--alert);
  font-weight: 800;
}

.cmp-passthrough,
.cmp-na {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* Optional extra-discount callout */
.cmp-extra {
  padding: 14px 16px;
  border: 1px dashed #c9a63a;
  border-radius: 10px;
  background: #fdf7e6;
}

.cmp-extra-head {
  margin-bottom: 6px;
  color: #7a5c00;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cmp-extra p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.cmp-empty {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  line-height: 1.55;
}

/* "What this is costing you" — money-first, marketing-led findings */
.findings-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.findings-list li {
  position: relative;
  margin: 0;
  padding: 12px 14px 12px 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.5;
}

.findings-list li::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.findings-list li:first-child {
  border-color: #f0c98a;
  background: #fff7ea;
  font-size: 16px;
}

.findings-list li:first-child::before {
  background: var(--alert);
}

.findings-list strong {
  color: var(--brand-dark);
}

.findings-list li:first-child strong {
  color: var(--alert);
}

ul {
  margin: 0;
  padding-left: 20px;
}

li {
  margin: 8px 0;
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--brand-dark);
  box-shadow: var(--shadow);
}

@media (max-width: 920px) {
  .report-header {
    display: block;
  }

  .report-header .primary-link {
    margin-top: 18px;
  }

  .report-grid {
    grid-template-columns: 1fr;
  }

  .contact-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 16px;
  }

  .report-header h1 {
    white-space: normal;
    font-size: clamp(28px, 8vw, 40px);
  }

  .upload-card,
  .report-panel,
  .contact-panel {
    padding: 18px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .breakdown-grid {
    grid-template-columns: 1fr;
  }

  .cmp-summary {
    grid-template-columns: 1fr;
  }

  .cmp-bd-head {
    display: none;
  }

  .cmp-bd-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 6px;
  }

  .cmp-bd-label {
    grid-column: 1 / -1;
  }

  .score-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ---- Conversion-oriented report: savings hero, trust strip, offer ---- */
.header-cta {
  align-self: center;
  white-space: nowrap;
}

.save-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 16px;
  padding: 26px 28px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: var(--shadow);
}

.save-hero--muted {
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
}

.save-hero-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

.save-hero-amount {
  display: block;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 900;
  line-height: 1;
}

.save-hero-amount small {
  margin-left: 6px;
  font-size: 0.34em;
  font-weight: 700;
  opacity: 0.85;
}

.save-hero-sub {
  display: block;
  margin-top: 10px;
  font-size: 15px;
  opacity: 0.9;
}

.save-hero-rate {
  text-align: right;
}

.save-hero-rate-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
}

.save-hero-rate-value {
  font-size: 22px;
  font-weight: 800;
}

.save-hero-rate-value s {
  opacity: 0.6;
}

.save-hero-rate-value em {
  font-style: normal;
  color: #bfe0f6;
}

.save-hero--muted .save-hero-rate-value em {
  color: var(--accent);
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.trust-strip li {
  position: relative;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
}

.trust-strip li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--good);
  font-weight: 900;
}

.metrics--three {
  margin-top: 0;
  margin-bottom: 4px;
}

.offer-card {
  padding: 18px 20px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--sky-dark, #2f82ba));
  box-shadow: var(--shadow);
}

.offer-tag {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  opacity: 0.9;
}

.offer-rate {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 900;
}

.offer-body {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  opacity: 0.96;
}

.offer-body strong { font-weight: 800; }

.breakdown-details > summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  color: var(--brand-dark);
  list-style: none;
}

.breakdown-details > summary::-webkit-details-marker { display: none; }

.breakdown-details > summary::before {
  content: "▸ ";
  color: var(--muted);
}

.breakdown-details[open] > summary::before { content: "▾ "; }

.contact-fineprint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

/* ---- Lead form ---- */
.lead-form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.lead-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.lead-form input,
.lead-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
}

.lead-form textarea { resize: vertical; }

.lead-form input:focus,
.lead-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(38, 36, 107, 0.12);
}

.lead-form .primary-button { margin-top: 4px; }

.lead-thanks {
  margin-top: 18px;
  padding: 18px;
  border-radius: 10px;
  background: #eef2f8;
  border: 1px solid var(--line);
}

.lead-thanks strong { font-size: 16px; }
.lead-thanks p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }

.lead-promo {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(63,155,217,0.16), rgba(38,36,107,0.12));
  border: 1px solid #c3cbe0;
  color: var(--ink) !important;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
}
.lead-promo strong { color: var(--brand); }

/* Contact module reveals only after the visitor has scrolled into the value. */
.contact-panel {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.contact-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .contact-panel { transition: opacity 0.2s ease; transform: none; }
}
