/* ============ AutoEstimate Pro design system ============ */
:root {
  --graphite: #0b0f14;        /* deep hero background */
  --graphite-2: #0e1420;      /* raised dark panel */
  --graphite-3: #16202f;      /* dark card border zone */
  --ink: #10161f;             /* body text on light */
  --ink-soft: #4b5563;
  --ink-faint: #8a94a3;
  --surface: #f6f8fa;         /* light section background */
  --panel: #ffffff;
  --line: #e4e9ef;
  --line-dark: #1e2a3c;
  --blue: #2f6bff;            /* precision electric blue */
  --blue-deep: #1e4fd6;
  --blue-glow: rgba(47, 107, 255, .35);
  --amber: #ffa426;           /* controlled signal orange */
  --green: #16a34a;
  --red: #dc2626;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 34px rgba(11, 15, 20, .10);
  --shadow-lg: 0 24px 70px rgba(11, 15, 20, .16);
  --font-display: "Manrope", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--ink); background: var(--surface); line-height: 1.6; font-size: 16px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.02em; font-weight: 800; }
.num, td.money, .money { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-soft); }
.small { font-size: .86rem; }
.tag { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.tag::before { content: ""; width: 22px; height: 2px; background: var(--blue); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: .95rem; padding: 13px 26px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; white-space: nowrap; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 24px var(--blue-glow); }
.btn-primary:hover { background: var(--blue-deep); box-shadow: 0 12px 30px var(--blue-glow); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.28); }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.06); }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.btn-dark-ghost { background: transparent; color: var(--ink); border-color: #cfd7e1; }
.btn-dark-ghost:hover { border-color: var(--ink); }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-amber { background: var(--amber); color: #201302; }

/* ---------- marketing nav ---------- */
.nav { position: sticky; top: 0; z-index: 60; transition: background .25s ease, box-shadow .25s ease; background: rgba(11,15,20,.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.nav.scrolled { background: rgba(11,15,20,.88); box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.nav-inner { display: flex; align-items: center; gap: 30px; height: 68px; }
.nav-logo { display: flex; align-items: center; gap: 11px; color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; }
.nav-logo:hover { text-decoration: none; }
.nav-logo img { width: 34px; height: 34px; border-radius: 8px; }
.nav-links { display: flex; gap: 24px; margin-left: 8px; }
.nav-links a { color: #c7d0dc; font-size: .93rem; font-weight: 600; white-space: nowrap; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-cta { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.nav-cta .signin { color: #c7d0dc; font-weight: 600; font-size: .93rem; white-space: nowrap; }
.nav-burger { display: none; margin-left: auto; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }
.announce { background: linear-gradient(90deg, #101a2e, #14233f); color: #aebedb; font-size: .85rem; text-align: center; padding: 9px 16px; }
.announce a { color: #7ea4ff; font-weight: 600; }

/* ---------- hero ---------- */
.hero { position: relative; background: var(--graphite); color: #fff; overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover; object-position: 72% center; opacity: .62; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(11,15,20,.96) 22%, rgba(11,15,20,.55) 58%, rgba(11,15,20,.25)); }
.hero-inner { position: relative; z-index: 2; padding: 110px 0 90px; max-width: 640px; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 3.9rem); margin: 18px 0 20px; }
.hero h1 .accent { color: var(--blue); }
.hero p.lede { font-size: 1.13rem; color: #b8c2d0; max-width: 560px; }
.hero-ctas { display: flex; gap: 14px; margin: 30px 0 14px; flex-wrap: wrap; }
.hero .micro { color: #7c8798; font-size: .84rem; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(47,107,255,.14); border: 1px solid rgba(47,107,255,.4); color: #9db9ff; font-size: .8rem; font-weight: 600; padding: 6px 14px; border-radius: 999px; }

/* ---------- sections ---------- */
.section { padding: 88px 0; }
.section.dark { background: var(--graphite); color: #fff; }
.section.dark .muted { color: #97a3b4; }
.section.tint { background: #eef2f7; }
.sec-head { max-width: 660px; margin-bottom: 48px; }
.sec-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 14px 0 14px; }
.sec-head p { color: var(--ink-soft); font-size: 1.05rem; }
.section.dark .sec-head p { color: #97a3b4; }
.grid { display: grid; gap: 22px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card h3 { font-size: 1.06rem; margin: 12px 0 8px; }
.card p { color: var(--ink-soft); font-size: .92rem; }
.card .ico { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; background: #eaf0ff; color: var(--blue); border-radius: 11px; font-size: 1.2rem; }
.section.dark .card { background: var(--graphite-2); border-color: var(--line-dark); }
.section.dark .card h3 { color: #fff; }
.section.dark .card p { color: #97a3b4; }
.section.dark .card .ico { background: rgba(47,107,255,.15); }
.voc { border-left: 3px solid var(--blue); padding: 14px 18px; background: var(--panel); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .96rem; color: var(--ink); font-style: italic; box-shadow: var(--shadow); }
.section.dark .voc { background: var(--graphite-2); color: #d5dce6; }

/* estimate demo table (hero + sections) */
.demo-est { background: var(--graphite-2); border: 1px solid var(--line-dark); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.demo-est .head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-dark); color: #d5dce6; font-family: var(--font-display); font-weight: 700; font-size: .9rem; }
.demo-est table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.demo-est td { padding: 9px 18px; color: #aeb9c8; border-bottom: 1px solid rgba(30,42,60,.6); }
.demo-est td:last-child { text-align: right; color: #e6ecf4; font-variant-numeric: tabular-nums; }
.demo-est .flag td { color: var(--amber); }
.demo-est .total td { font-family: var(--font-display); font-weight: 800; color: #fff; font-size: .95rem; border-bottom: 0; }
.demo-est .pill { font-size: .68rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: rgba(255,164,38,.16); color: var(--amber); margin-left: 8px; }

/* workflow steps */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: step; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.step::before { counter-increment: step; content: "0" counter(step); font-family: var(--font-display); font-weight: 800; color: var(--blue); font-size: .85rem; letter-spacing: .06em; }
.step h4 { margin: 8px 0 6px; font-size: .98rem; }
.step p { font-size: .84rem; color: var(--ink-soft); }

/* comparison reveal */
.compare-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.compare-col { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: var(--ink); }
.compare-col .col-h { padding: 14px 20px; font-family: var(--font-display); font-weight: 800; font-size: .92rem; border-bottom: 1px solid var(--line); }
.compare-col ul { list-style: none; }
.compare-col li { padding: 11px 20px; border-bottom: 1px solid #eef1f5; font-size: .89rem; display: flex; justify-content: space-between; gap: 12px; }
.compare-col li:last-child { border-bottom: 0; }
.compare-col li .money { font-weight: 600; }
.li-add { background: #f0fdf4; }
.li-add .money { color: var(--green); }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: stretch; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; display: flex; flex-direction: column; position: relative; }
.plan.popular { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,107,255,.15), var(--shadow-lg); }
.plan .pop-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--blue); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .05em; padding: 5px 14px; border-radius: 999px; }
.plan h3 { font-size: 1.15rem; }
.plan .price { font-family: var(--font-display); font-size: 2.3rem; font-weight: 800; margin: 14px 0 2px; font-variant-numeric: tabular-nums; }
.plan .price span { font-size: .95rem; color: var(--ink-faint); font-weight: 600; }
.plan ul { list-style: none; margin: 18px 0 26px; flex: 1; }
.plan li { padding: 7px 0; font-size: .9rem; color: var(--ink-soft); display: flex; gap: 9px; }
.plan li::before { content: "✓"; color: var(--green); font-weight: 800; }

/* Numbered service-flow steps (pricing, homepage, request form) */
.flow-steps { list-style: none; counter-reset: fs; display: grid; gap: 10px; margin-top: 14px; padding: 0; }
.flow-steps li { counter-increment: fs; display: flex; gap: 12px; align-items: flex-start; color: var(--ink-soft); font-size: .93rem; line-height: 1.5; }
.flow-steps li::before { content: counter(fs); flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; font-size: .78rem; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.billing-toggle { display: inline-flex; background: #e6ebf2; border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 34px; }
.billing-toggle button { border: 0; background: transparent; padding: 8px 22px; border-radius: 999px; font-family: var(--font-display); font-weight: 700; font-size: .88rem; cursor: pointer; color: var(--ink-soft); }
.billing-toggle button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* FAQ */
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 18px 22px; font-family: var(--font-display); font-weight: 700; font-size: .98rem; list-style: none; position: relative; }
.faq summary::after { content: "+"; position: absolute; right: 20px; color: var(--blue); font-size: 1.3rem; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 22px 18px; color: var(--ink-soft); font-size: .93rem; }

/* footer */
.footer { background: var(--graphite); color: #8a95a6; padding: 64px 0 40px; font-size: .88rem; }
.footer a { color: #aeb9c8; }
.footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 9px; }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 40px; }
.footer .legal { border-top: 1px solid var(--line-dark); padding-top: 24px; font-size: .8rem; color: #66707f; }

/* reveal-on-scroll */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--graphite); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: space-between; background-size: cover; background-position: center; position: relative; }
.auth-side .overlay { position: absolute; inset: 0; background: linear-gradient(160deg, rgba(11,15,20,.92), rgba(11,15,20,.65)); }
.auth-side > * { position: relative; z-index: 1; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--surface); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.7rem; margin-bottom: 8px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border: 1px solid #cfd7e1; border-radius: var(--radius-sm); font-size: .95rem; font-family: inherit; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.flash { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 16px; }
.flash.ok { background: #ecfdf3; color: #067647; border: 1px solid #a6f4c5; }
.flash.err { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; background: #eef1f5; }
.side { background: var(--graphite); color: #aeb9c8; padding: 20px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .nav-logo { margin: 4px 8px 26px; font-size: 1rem; }
.side a.item { display: flex; align-items: center; gap: 11px; color: #aeb9c8; padding: 10px 12px; border-radius: 9px; font-size: .9rem; font-weight: 600; margin-bottom: 2px; }
.side a.item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side a.item.active { background: rgba(47,107,255,.18); color: #fff; }
.side .sec-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #5b6675; margin: 18px 12px 8px; }
.side .side-foot { margin-top: auto; padding: 14px 12px 6px; font-size: .8rem; color: #5b6675; }
.main { padding: 28px 34px; min-width: 0; }
.main-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.main-head h1 { font-size: 1.5rem; }
.crumb { font-size: .82rem; color: var(--ink-faint); margin-bottom: 4px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel .p-head { padding: 16px 22px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-weight: 700; font-size: .95rem; display: flex; justify-content: space-between; align-items: center; }
.panel .p-body { padding: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.stat .k { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.stat .v { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 6px; }
.stat .d { font-size: .8rem; color: var(--ink-soft); margin-top: 2px; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; }
table.data th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafbfc; }
table.data td { padding: 12px 16px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
table.data tr:hover td { background: #f7faff; }
table.data td.money, table.data th.money { text-align: right; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.b-draft { background: #eef1f5; color: #4b5563; }
.b-sent { background: #e0eaff; color: #1e4fd6; }
.b-approved, .b-paid { background: #dcfce7; color: #15803d; }
.b-declined { background: #fee2e2; color: #b91c1c; }
.b-supplement { background: #fef0c7; color: #b54708; }
.b-invoiced { background: #ede9fe; color: #6d28d9; }
.b-closed { background: #e5e7eb; color: #374151; }
.b-pending { background: #fef0c7; color: #b54708; }
.b-unpaid { background: #fee2e2; color: #b91c1c; }
/* comparison status colors */
.b-matched { background: #eef1f5; color: #4b5563; }
.b-missing { background: #fee2e2; color: #b91c1c; }
.b-changed_hours, .b-changed_price { background: #fef0c7; color: #b54708; }
.b-added_teardown { background: #e0eaff; color: #1e4fd6; }
.b-needs_docs { background: #fde8ff; color: #a21caf; }
.b-accepted { background: #dcfce7; color: #15803d; }
.b-disputed { background: #fee2e2; color: #b91c1c; }

/* estimate builder */
.builder { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.lines-table td input, .lines-table td select { width: 100%; border: 1px solid transparent; background: transparent; padding: 6px 8px; border-radius: 6px; font-size: .87rem; font-family: inherit; }
.lines-table td input:focus, .lines-table td select:focus { border-color: var(--blue); background: #fff; outline: none; }
.totals-panel { position: sticky; top: 24px; }
.totals-panel .row { display: flex; justify-content: space-between; padding: 8px 0; font-size: .9rem; border-bottom: 1px solid #eef1f5; }
.totals-panel .row.grand { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; border-bottom: 0; padding-top: 14px; }
.warn-list { font-size: .82rem; color: #b54708; background: #fffaeb; border: 1px solid #fedf89; border-radius: var(--radius-sm); padding: 12px 16px; margin-top: 16px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.photo-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.photo-card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.photo-card .cap { padding: 8px 12px; font-size: .78rem; color: var(--ink-soft); }

/* customer approval page */
.approve-shell { max-width: 760px; margin: 0 auto; padding: 40px 20px 80px; }
.approve-head { text-align: center; margin-bottom: 30px; }
.sig-box { border: 2px dashed #cfd7e1; border-radius: var(--radius-sm); padding: 18px; text-align: center; }

/* print styles for PDF views */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .pdf-page { box-shadow: none !important; margin: 0 !important; border: 0 !important; }
}
.pdf-page { background: #fff; max-width: 820px; margin: 30px auto; padding: 48px 56px; box-shadow: var(--shadow-lg); border-radius: 6px; }
.pdf-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--graphite); padding-bottom: 20px; margin-bottom: 24px; }
.pdf-head .brand { display: flex; gap: 12px; align-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
.pdf-head .brand img { width: 40px; height: 40px; border-radius: 9px; }
table.pdf-lines { width: 100%; border-collapse: collapse; font-size: .84rem; margin: 18px 0; }
table.pdf-lines th { text-align: left; border-bottom: 2px solid var(--graphite); padding: 8px 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
table.pdf-lines td { padding: 8px 6px; border-bottom: 1px solid #e4e9ef; }
table.pdf-lines td.money, table.pdf-lines th.money { text-align: right; font-variant-numeric: tabular-nums; }

/* responsive */
@media (max-width: 1024px) {
  .g4, .plans { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .builder { grid-template-columns: 1fr; }
  .totals-panel { position: static; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0; background: var(--graphite); padding: 20px 26px; gap: 16px; border-bottom: 1px solid var(--line-dark); }
  .nav-burger { display: block; }
  .nav-cta { display: none; }
  .g2, .g3, .compare-wrap { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 70; width: 240px; transform: translateX(-100%); transition: transform .25s ease; }
  .side.open { transform: none; }
  .main { padding: 20px 16px; }
  .hero-inner { padding: 80px 0 66px; }
}
@media (max-width: 560px) {
  .g4, .plans, .steps, .stat-grid, .footer .cols { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
}
