/* CalcAndEarn — shared theme
   Light, professional. Accent: deep teal #0f766e. Text: slate.
   Vanilla CSS, no frameworks. Mobile-first. */

:root {
  --accent: #0f766e;
  --accent-dark: #0b5e57;
  --accent-soft: #e6f4f2;
  --ink: #1e293b;
  --ink-soft: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-card: #ffffff;
  --success: #15803d;
  --radius: 10px;
  --max: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: 2rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin-top: 1.6em; }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 16px;
}
.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo .mark {
  display: inline-block;
  width: 12px; height: 12px;
  background: var(--accent);
  border-radius: 3px;
  margin-right: 8px;
}
.logo span.accent { color: var(--accent); }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .95rem;
  padding: 8px 12px;
  border-radius: 6px;
}
.main-nav a:hover { color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.main-nav a.active { color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 56px 0 48px;
}
.hero h1 { font-size: 2.4rem; max-width: 640px; }
.hero h1 .accent { color: var(--accent); }
.hero p.lede { font-size: 1.15rem; max-width: 640px; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  cursor: pointer;
  font-size: 1rem;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn.ghost {
  background: #fff;
  color: var(--accent);
  border-color: var(--accent);
}
.btn.ghost:hover { background: var(--accent-soft); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* ---------- sections ---------- */
section.block { padding: 40px 0; }
section.block + section.block { border-top: 1px solid var(--line); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

/* ---------- tool grid ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.tool-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-card:hover { border-color: var(--accent); }
.tool-card h3 { margin: 0; font-size: 1.1rem; }
.tool-card h3 a { color: var(--ink); }
.tool-card h3 a:hover { color: var(--accent); }
.tool-card p { margin: 0; font-size: .95rem; flex: 1; }
.badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
  align-self: flex-start;
}
.badge.live { background: #dcfce7; color: var(--success); }
.badge.soon { background: #f1f5f9; color: var(--muted); }
.tool-card .cta { font-weight: 700; font-size: .95rem; margin-top: 4px; }

/* ---------- prose / faq ---------- */
.prose { max-width: 760px; }
.prose ul { color: var(--ink-soft); }
.prose li { margin-bottom: .35em; }
.faq { max-width: 760px; }
.faq details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: #fff;
}
.faq summary { font-weight: 700; cursor: pointer; color: var(--ink); }
.faq details p { margin: .6em 0 0; }
.trust {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.trust div { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.trust h3 { margin: 0 0 6px; }
.trust p { margin: 0; font-size: .95rem; }

/* ---------- footer ---------- */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 40px 0 28px;
  margin-top: 48px;
}
.site-footer a { color: #e2e8f0; }
.site-footer .cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}
.site-footer h4 { color: #fff; margin: 0 0 10px; font-size: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; font-size: .95rem; }
.site-footer .fine {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid #1e293b;
  font-size: .85rem;
  color: #94a3b8;
}

/* ---------- invoice tool ---------- */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 24px;
}
@media (min-width: 960px) {
  .tool-layout { grid-template-columns: 420px 1fr; align-items: start; }
  .invoice-form { position: sticky; top: 76px; }
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: #fff;
  margin-bottom: 20px;
}
.panel h2 { font-size: 1.1rem; margin: 0 0 14px; }
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 4px;
  color: var(--ink);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.hint { font-size: .85rem; color: var(--muted); margin-top: 4px; }

.items-table { width: 100%; border-collapse: collapse; }
.items-table th {
  text-align: left;
  font-size: .85rem;
  color: var(--muted);
  padding: 6px 6px;
  border-bottom: 1px solid var(--line);
}
.items-table td { padding: 6px; vertical-align: top; }
.items-table input {
  width: 100%;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: .92rem;
}
.items-table .col-desc { width: 44%; }
.items-table .col-qty, .items-table .col-rate { width: 15%; }
.items-table .col-amt { width: 18%; text-align: right; font-weight: 600; white-space: nowrap; }
.items-table .row-amt { padding-top: 14px; }
.btn-small {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
}
.btn-small:hover { background: var(--accent-soft); }
.btn-danger {
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 4px 10px;
  font-weight: 700;
  cursor: pointer;
}
.btn-danger:hover { background: #fef2f2; }
.totals { margin-top: 12px; }
.totals .line {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: .95rem;
}
.totals .line.grand {
  border-top: 2px solid var(--ink);
  margin-top: 6px;
  padding-top: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
}

/* ---------- invoice preview ---------- */
.invoice-preview-wrap h2 { font-size: 1.1rem; margin: 0 0 14px; }
.invoice-paper {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 32px;
  font-size: .95rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}
.invoice-paper .inv-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.invoice-paper .inv-head .biz-name { font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.invoice-paper .inv-head .biz-meta { color: var(--muted); font-size: .88rem; white-space: pre-line; }
.invoice-paper .inv-title { text-align: right; }
.invoice-paper .inv-title .big { font-size: 1.6rem; font-weight: 800; letter-spacing: .06em; color: var(--accent); }
.invoice-paper .inv-title .num { color: var(--ink-soft); font-size: .9rem; }
.invoice-paper .inv-parties { display: flex; gap: 24px; margin-bottom: 20px; }
.invoice-paper .inv-parties > div { flex: 1; }
.invoice-paper .inv-parties .lbl { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.invoice-paper .inv-parties .who { font-weight: 700; color: var(--ink); }
.invoice-paper .inv-parties .addr { white-space: pre-line; color: var(--ink-soft); font-size: .9rem; }
.invoice-paper table.inv-items { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.invoice-paper table.inv-items th {
  background: var(--bg-soft);
  text-align: left;
  padding: 8px 10px;
  font-size: .85rem;
  border-bottom: 2px solid var(--line);
  color: var(--ink);
}
.invoice-paper table.inv-items th.num, .invoice-paper table.inv-items td.num { text-align: right; }
.invoice-paper table.inv-items td { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.invoice-paper .inv-totals { margin-left: auto; width: 260px; }
.invoice-paper .inv-totals .line { display: flex; justify-content: space-between; padding: 4px 0; }
.invoice-paper .inv-totals .line.grand {
  border-top: 2px solid var(--ink);
  margin-top: 6px;
  padding-top: 8px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
}
.invoice-paper .inv-notes { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.invoice-paper .inv-notes .lbl { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.invoice-paper .inv-notes p { margin: 0; white-space: pre-line; }
.invoice-paper .inv-foot { margin-top: 24px; text-align: center; color: var(--muted); font-size: .88rem; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  h1 { font-size: 1.7rem; }
  .hero { padding: 36px 0 32px; }
  .hero h1 { font-size: 1.9rem; }
  .invoice-paper { padding: 20px 16px; }
  .invoice-paper .inv-head { flex-direction: column; }
  .invoice-paper .inv-title { text-align: left; }
  .invoice-paper .inv-parties { flex-direction: column; }
  .items-table .col-desc { width: 38%; }
}

/* ---------- print: only the invoice ---------- */
@media print {
  body { background: #fff; }
  .site-header, .site-footer, .invoice-form, .toolbar,
  .no-print, main > .wrap > h1, main > .wrap > .lede, main > .wrap > section { display: none !important; }
  .tool-layout { display: block; margin: 0; }
  .invoice-preview-wrap { margin: 0; }
  .invoice-preview-wrap h2 { display: none; }
  .invoice-paper { border: none; box-shadow: none; padding: 0; }
  @page { margin: 14mm; }
}
