/* Shared styles for all leadgen tools. Brand colors arrive via CSS vars
   (--primary, --accent) set per-page in base.html. */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1f2a44;
  --accent: #4f46e5;
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #1a202c;
  --muted: #64748b;
  --border: #e2e8f0;
  --pass: #16a34a;
  --warn: #d97706;
  --fail: #dc2626;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* Header / footer */
.site-header { background: var(--primary); color: #fff; }
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; padding-bottom: 14px; gap: 12px; flex-wrap: wrap;
}
.brand { color: #fff; text-decoration: none; display: flex; flex-direction: column; }
.brand-logo { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.3px; }
.brand-tag { font-size: 0.72rem; opacity: 0.75; }
.site-footer { margin-top: 56px; padding: 28px 0 40px; color: var(--muted); font-size: 0.85rem; }
.site-footer a { color: var(--muted); }
.fineprint { font-size: 0.75rem; margin-top: 6px; opacity: 0.8; }

/* Buttons & forms */
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: 0;
  padding: 13px 26px; border-radius: 9px; font-size: 1rem; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: filter .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }
.btn-outline { background: transparent; border: 1.5px solid rgba(255,255,255,.6); }
.btn-block { width: 100%; text-align: center; }
input[type=text], input[type=url], input[type=email], input[type=number], input[type=tel] {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--border);
  border-radius: 9px; font-size: 1rem; background: #fff; color: var(--text);
}
input:focus { outline: 2px solid var(--accent); border-color: transparent; }
label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 5px; }
.field { margin-bottom: 16px; }
.error-box {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  padding: 12px 16px; border-radius: 9px; margin-bottom: 18px; font-size: 0.92rem;
}

/* Hero + cards */
.hero { text-align: center; padding: 56px 0 30px; }
.hero h1 { font-size: 2.2rem; line-height: 1.2; color: var(--primary); letter-spacing: -0.5px; }
.hero .subhead { max-width: 620px; margin: 14px auto 0; color: var(--muted); font-size: 1.08rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 26px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.card + .card { margin-top: 18px; }
.tool-form { max-width: 560px; margin: 26px auto 0; display: flex; gap: 10px; }
.tool-form input { flex: 1; }
.checklist { list-style: none; margin-top: 18px; }
.checklist li { padding: 7px 0 7px 30px; position: relative; color: var(--text); }
.checklist li::before { content: "✓"; position: absolute; left: 4px; color: var(--pass); font-weight: 800; }
.section-title { font-size: 1.35rem; color: var(--primary); margin-bottom: 12px; }
.trust-note { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 12px; }

/* Score display */
.score-hero { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.score-ring {
  width: 130px; height: 130px; border-radius: 50%; flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; background: var(--primary);
}
.score-ring b { font-size: 2.7rem; line-height: 1; }
.score-ring span { font-size: 0.78rem; opacity: .8; }
.grade-line { font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.catbar { margin: 9px 0; min-width: 240px; }
.catbar .label { display: flex; justify-content: space-between; font-size: 0.85rem; font-weight: 600; }
.catbar .bar { height: 9px; background: var(--border); border-radius: 5px; overflow: hidden; margin-top: 3px; }
.catbar .bar i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }

/* Findings */
.category-block { margin-top: 30px; }
.category-block h2 {
  font-size: 1.25rem; color: var(--primary);
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid var(--border); padding-bottom: 8px; margin-bottom: 6px;
}
.category-desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 14px; }
.finding {
  background: var(--card); border: 1px solid var(--border);
  border-left: 5px solid var(--muted); border-radius: 10px;
  padding: 14px 18px; margin-bottom: 10px;
}
.finding.pass { border-left-color: var(--pass); }
.finding.fail.critical { border-left-color: var(--fail); }
.finding.fail.warning { border-left-color: var(--warn); }
.finding.fail.info { border-left-color: var(--muted); }
.finding .head { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.finding .pts { color: var(--muted); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.finding .why, .finding .fixit { font-size: 0.9rem; color: #475569; margin-top: 6px; }
.finding .fixit b, .finding .why b { color: var(--primary); }
.finding .detail { font-size: 0.82rem; color: var(--muted); font-style: italic; margin-top: 4px; }
.badge {
  font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  padding: 2px 9px; border-radius: 10px; margin-left: 8px; vertical-align: middle;
}
.badge.pass { background: #dcfce7; color: #14532d; }
.badge.fail { background: #fee2e2; color: #7f1d1d; }
.badge.partial { background: #fef3c7; color: #78350f; }

/* Gate / teaser */
.gate {
  border: 2px solid var(--accent); border-radius: 14px; background: var(--card);
  padding: 30px; margin-top: 30px; text-align: center;
}
.gate h2 { color: var(--primary); font-size: 1.4rem; }
.gate p { color: var(--muted); margin: 8px 0 18px; }
.gate form { max-width: 420px; margin: 0 auto; text-align: left; }
.blur-preview { filter: blur(6px); pointer-events: none; user-select: none; opacity: .7; }

/* CTA band */
.cta-band {
  background: var(--primary); color: #fff; border-radius: 14px;
  padding: 32px; text-align: center; margin-top: 36px;
}
.cta-band h3 { font-size: 1.4rem; margin-bottom: 8px; }
.cta-band p { opacity: .85; max-width: 560px; margin: 0 auto 18px; }

/* ROI calculator */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 26px; }
.result-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 0.95rem; }
.result-line b { white-space: nowrap; }
.result-big { font-size: 1.7rem; font-weight: 800; color: var(--fail); }
.result-big.recover { color: var(--pass); }
.math-note { font-size: 0.8rem; color: var(--muted); margin-top: 12px; }

/* Stat grid (case economics) */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.stat { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--bg); }
.stat.highlight { border-color: var(--accent); background: var(--card); box-shadow: 0 0 0 1px var(--accent) inset; }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); display: block; }
.stat-num { font-size: 1.7rem; font-weight: 800; color: var(--primary); display: block; margin-top: 2px; }
.stat.highlight .stat-num { color: var(--accent); }
.stat-note { font-size: 0.72rem; color: var(--muted); }
.data-table.sensitivity th { text-align: center; }
.data-table.sensitivity td { text-align: center; font-weight: 600; }
.data-table.sensitivity td.cell-good { background: #e7f6ec; color: #1a6b39; }
.data-table.sensitivity td.cell-bad { background: #fdeaea; color: #9b2c2c; }

/* Data tables (waste grader) */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: var(--card); font-size: 0.85rem; }
.data-table th, .data-table td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.data-table th { background: var(--bg); color: var(--primary); font-size: 0.78rem; text-transform: uppercase; letter-spacing: .4px; }
.data-table td.examples { color: var(--muted); font-size: 0.8rem; max-width: 320px; }
.code-list {
  width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: 9px; background: #fff; color: var(--text); margin-bottom: 10px;
}
.steps { margin: 14px 0 6px 22px; }
.steps li { padding: 4px 0; }

/* Prominent note (consent caveat etc.) */
.note-box {
  background: #fffbeb; border: 1.5px solid #f59e0b; color: #78350f;
  border-radius: 12px; padding: 16px 20px; margin-top: 22px; font-size: 0.95rem;
}
.note-box b { color: #92400e; }

/* Proposal generator (internal) */
select.select-input {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--border);
  border-radius: 9px; font-size: 1rem; background: #fff; color: var(--text);
}
textarea.code-list { resize: vertical; }
.service-row {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px;
  border-bottom: 1px dashed var(--border); font-weight: 400; cursor: pointer;
}
.service-row:last-child { border-bottom: 0; }
.service-row input { margin-top: 5px; }
.service-body small { display: block; color: var(--muted); }
.service-price { color: var(--accent); font-weight: 700; margin-left: 6px; }
.proposal-list { list-style: none; }
.proposal-list li { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.proposal-list .muted { color: var(--muted); font-size: 0.85rem; }

/* Tool index */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 30px; }
.tool-card { text-decoration: none; color: inherit; display: block; }
.tool-card h3 { color: var(--primary); margin-bottom: 6px; }
.tool-card p { color: var(--muted); font-size: 0.9rem; }
.tool-card .go { color: var(--accent); font-weight: 700; font-size: 0.9rem; display: inline-block; margin-top: 10px; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
  .tool-form { flex-direction: column; }
  .calc-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .score-hero { justify-content: center; text-align: center; }
  .catbar { min-width: 100%; }
}
