@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* ─── TOKENS ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;
  --bg:      #0C0C0E;
  --bg2:     #141416;
  --bg3:     #1C1C1F;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.13);
  --ink:     #F0EFE9;
  --muted:   #88877F;
  --accent:  #B8FF57;
  --accent2: #57C8FF;
  --success: #B8FF57;
  --warning: #FFB347;
  --error:   #FF6B4A;
  --serif:   'Instrument Serif', Georgia, serif;
  --sans:    'DM Sans', system-ui, sans-serif;
  font-family: var(--sans);
}

/* ─── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

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

a { color: var(--accent2); }

button, input, select { font: inherit; }

small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

/* ─── TOPBAR ─────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 0.5px solid var(--border);
  background: rgba(12,12,14,0.92);
  padding: 16px clamp(18px, 4vw, 48px);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #0C0C0E;
  font-size: 14px;
  font-weight: 700;
}

nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

nav a {
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  padding: 7px 12px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

nav a:hover {
  color: var(--ink);
  background: rgba(255,255,255,0.05);
}

.nav-cta {
  background: var(--accent);
  color: #0C0C0E;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.nav-cta:hover { opacity: 0.85; }

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
button,
.button-primary {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0.5px solid var(--border2);
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  padding: 0 18px;
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

button:hover,
.button-primary:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0C0C0E;
  font-weight: 600;
}

.button-primary:hover {
  background: #c8ff6e;
  border-color: #c8ff6e;
  color: #0C0C0E;
}

button.secondary {
  background: rgba(184,255,87,0.08);
  border-color: rgba(184,255,87,0.25);
  color: var(--accent);
}

button.secondary:hover {
  background: rgba(184,255,87,0.14);
  border-color: rgba(184,255,87,0.45);
}

button.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

button.ghost:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border2);
  color: var(--ink);
}

/* ─── MAIN GRID ──────────────────────────────────────────────────────────── */
main {
  display: grid;
  gap: 0;
  padding-bottom: 64px;
}

/* ─── HERO ───────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(320px,440px);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  min-height: 80vh;
  padding: clamp(56px, 8vw, 96px) clamp(18px, 4vw, 48px) 56px;
}

.hero-copy { max-width: 560px; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: var(--muted);
  flex-shrink: 0;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(44px, 6vw, 68px);
  font-weight: 400;
  line-height: 1.07;
  letter-spacing: -1px;
  margin-bottom: 22px;
  color: var(--ink);
}

h1 em {
  font-style: italic;
  color: var(--accent);
}

h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
  color: var(--ink);
}

h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 0;
  color: var(--ink);
}

.hero-sub {
  font-size: 17px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.65;
  max-width: 460px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.proof-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proof-strip span {
  border: 0.5px solid var(--border2);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 400;
}

/* ─── HERO VISUAL ────────────────────────────────────────────────────────── */
.hero-visual {
  position: relative;
}

.audit-window {
  border: 0.5px solid var(--border2);
  border-radius: 20px;
  background: var(--bg2);
  overflow: hidden;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg3);
  padding: 12px 16px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-r { background: #FF5F57; }
.dot-y { background: #FFBD2E; }
.dot-g { background: #28CA41; }

.window-bar strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  font-family: monospace;
}

.audit-window-body { padding: 22px; }

.hero-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #28CA41;
  flex-shrink: 0;
}

.savings-hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.savings-big {
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
}

.savings-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.savings-annual-badge {
  background: rgba(184,255,87,0.1);
  border: 0.5px solid rgba(184,255,87,0.28);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  white-space: nowrap;
}

.preview-tool-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.preview-tool-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg3);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  gap: 12px;
}

.preview-tool-name { font-size: 13px; font-weight: 500; }
.preview-tool-action { font-size: 12px; color: var(--muted); margin-top: 2px; }

.preview-save {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.preview-save.green { color: var(--accent); }
.preview-save.blue  { color: var(--accent2); }
.preview-save.ok    { color: var(--muted); font-weight: 400; font-size: 12px; }

.credex-banner {
  background: rgba(87,200,255,0.06);
  border: 0.5px solid rgba(87,200,255,0.22);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.credex-banner strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent2);
  margin-bottom: 2px;
}

.credex-banner span {
  font-size: 12px;
  color: var(--muted);
}

.banner-btn {
  background: var(--accent2);
  border: none;
  border-radius: 7px;
  color: #0C0C0E;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  min-height: auto;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.banner-btn:hover {
  opacity: 0.85;
  transform: none;
  background: var(--accent2);
  border-color: var(--accent2);
  color: #0C0C0E;
}

/* ─── TOOLS STRIP ────────────────────────────────────────────────────────── */
.tools-strip {
  display: flex;
  align-items: center;
  gap: 28px;
  border-top: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
  background: var(--bg2);
  padding: 20px clamp(18px, 4vw, 48px);
}

.tools-strip-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 88px;
}

.tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-pill {
  background: var(--bg3);
  border: 0.5px solid var(--border2);
  color: var(--ink);
  font-size: 13px;
  padding: 5px 13px;
  border-radius: 20px;
}

/* ─── SIGNAL STRIP ───────────────────────────────────────────────────────── */
.signal-strip {
  display: grid;
  width: min(1200px, calc(100% - 36px));
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 2px;
  margin: 32px auto;
}

.signal-strip div {
  background: var(--bg2);
  border: 0.5px solid var(--border);
  padding: 28px 24px;
}

.signal-strip div:first-child { border-radius: 16px 0 0 16px; }
.signal-strip div:last-child  { border-radius: 0 16px 16px 0; }

.signal-strip strong {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.signal-strip span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ─── WORKSPACE ──────────────────────────────────────────────────────────── */
.workspace,
.report,
.sources {
  width: min(1200px, calc(100% - 36px));
  margin: 0 auto 24px;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0,1fr);
  gap: 16px;
  align-items: start;
}

.panel,
.tool-editor,
.report,
.sources {
  border: 0.5px solid var(--border2);
  border-radius: 16px;
  background: var(--bg2);
  padding: clamp(18px, 3vw, 28px);
}

.controls {
  position: sticky;
  top: 72px;
  display: grid;
  gap: 14px;
}

.panel-copy {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 4px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 0.5px solid var(--border2);
  border-radius: 8px;
  background: var(--bg3);
  color: var(--ink);
  padding: 9px 12px;
  transition: border-color 0.15s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,255,87,0.1);
}

select option { background: var(--bg3); }

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

/* ─── TOOL ROWS ──────────────────────────────────────────────────────────── */
.tool-rows { display: grid; gap: 10px; }

.tool-row {
  display: grid;
  grid-template-columns: 1.15fr 1.4fr 0.55fr 0.85fr 42px;
  gap: 10px;
  align-items: end;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg3);
  padding: 14px;
  transition: border-color 0.15s;
}

.tool-row:hover { border-color: var(--border2); }

.icon-button {
  width: 42px;
  padding: 0;
  background: rgba(255,107,74,0.08);
  color: var(--error);
  font-size: 17px;
  border: 0.5px solid rgba(255,107,74,0.2);
  border-radius: 8px;
  min-height: 42px;
  transition: background 0.15s, border-color 0.15s;
}

.icon-button:hover {
  background: rgba(255,107,74,0.18);
  border-color: var(--error);
  transform: none;
}

/* ─── SECTION HEADING ────────────────────────────────────────────────────── */
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.section-heading p { color: var(--muted); font-size: 15px; }

/* ─── REPORT ─────────────────────────────────────────────────────────────── */
.report-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: end;
}

.summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1.15fr 1fr 0.9fr;
  margin: 18px 0;
}

.metric {
  min-height: 110px;
  padding: 16px 18px;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg3);
}

.accent-metric {
  background: rgba(184,255,87,0.06);
  border-color: rgba(184,255,87,0.25);
}

.metric span {
  display: block;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 4px;
}

.accent-metric span { color: var(--accent); }

.ai-summary {
  border: 0.5px solid rgba(255,179,71,0.28);
  border-left: 3px solid var(--warning);
  border-radius: 8px;
  background: rgba(255,179,71,0.04);
  padding: 16px 20px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 18px;
}

/* ─── INSIGHT CARDS ──────────────────────────────────────────────────────── */
.insight-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin: 18px 0;
}

.insight-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  min-height: 240px;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg3);
  padding: 18px;
  transition: border-color 0.15s, transform 0.15s;
}

.insight-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
}

.insight-card.has-savings {
  background: rgba(184,255,87,0.04);
  border-color: rgba(184,255,87,0.2);
}

.insight-rank {
  color: rgba(255,255,255,0.08);
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 400;
  line-height: 1;
}

.insight-card h3 {
  margin: 10px 0 6px;
  font-size: 22px;
}

.insight-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.insight-money strong {
  display: block;
  font-family: var(--serif);
  color: var(--accent);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
}

/* ─── TABLE ──────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg3);
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th, td {
  border-bottom: 0.5px solid var(--border);
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
}

th {
  background: rgba(255,255,255,0.02);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

td { font-size: 14px; line-height: 1.5; color: var(--ink); }

td strong { font-size: 15px; font-weight: 500; }

tr:last-child td { border-bottom: 0; }

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 500;
}

.savings-cell { color: var(--accent); }

.savings-cell strong {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--accent);
}

/* ─── LEAD FORM ──────────────────────────────────────────────────────────── */
.lead-form {
  display: grid;
  grid-template-columns: minmax(220px,1fr) minmax(160px,240px) minmax(140px,200px) auto;
  gap: 14px;
  align-items: end;
  margin-top: 22px;
  border: 0.5px solid rgba(87,200,255,0.2);
  border-radius: 12px;
  background: rgba(87,200,255,0.04);
  padding: 20px;
}

.lead-form-heading {
  grid-column: 1 / -1;
}

.lead-form-heading h3 {
  margin-top: 4px;
  font-size: 16px;
}

#leadStatus {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* ─── SOURCES ────────────────────────────────────────────────────────────── */
.sources {
  padding: clamp(18px, 3vw, 28px);
  margin-top: 0;
}
.pricing-date {
  font-size: 13px;
  color: var(--muted);
  align-self: center;
}

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

.source-list a {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg3);
  padding: 16px 18px;
  text-decoration: none;
  transition: border-color 0.18s, background 0.18s;
}

.source-list a:hover {
  border-color: var(--border2);
  background: rgba(255,255,255,0.03);
}

.source-list strong {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent2);   /* cyan — matches your screenshot */
}

.source-list span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── FOOTER ─────────────────────────────────────────────────────────────── */
footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 0.5px solid var(--border);
  color: var(--muted);
  padding: 24px clamp(18px, 4vw, 48px);
  font-size: 13px;
  margin-top: 32px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero,
  .workspace,
  .summary-grid,
  .lead-form,
  .source-list,
  .signal-strip,
  .insight-cards {
    grid-template-columns: 1fr;
  }

  .hero { min-height: auto; }

  .controls { position: static; }

  .tool-row {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .icon-button { width: 100%; }

  footer,
  .section-heading { flex-direction: column; }

  .tools-strip { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 560px) {
  nav { display: none; }

  h1 { font-size: 38px; }

  .field-row,
  .hero-stat-row,
  .tool-row { grid-template-columns: 1fr; }

  .hero-actions { flex-direction: column; align-items: stretch; }

  .lead-form { grid-template-columns: 1fr; }
}

/* ─── PRINT ──────────────────────────────────────────────────────────────── */
@media print {
  .topbar,
  .controls,
  .tool-editor,
  .lead-form,
  .report-actions,
  .tools-strip,
  .signal-strip,
  footer { display: none; }

  .hero { min-height: auto; padding: 20px; }

  .report {
    width: 100%;
    border: 0;
    box-shadow: none;
  }
}