/* Invoicely — free client-side invoice generator. Self-contained styles, no
   external font/CDN. Design language: clean white ledger paper, ink type, a
   single trustworthy blue accent, a tactile two-pane builder (form + live
   invoice preview). */

:root {
  --ink: #14161c;
  --ink-soft: #4b4f5a;
  --ink-faint: #868c99;
  --paper: #f6f7f9;
  --card: #ffffff;
  --line: #e8eaef;
  --line-strong: #d7dbe3;
  --blue: #2563eb;
  --blue-ink: #1d4ed8;
  --blue-wash: #eaf0ff;
  --green: #15a06a;
  --green-wash: #e7f8f0;
  --shadow-sm: 0 1px 2px rgba(20, 22, 28, 0.06), 0 1px 3px rgba(20, 22, 28, 0.05);
  --shadow-md: 0 6px 20px -6px rgba(20, 22, 28, 0.14), 0 2px 6px rgba(20, 22, 28, 0.06);
  --shadow-lg: 0 18px 48px -18px rgba(37, 99, 235, 0.30), 0 8px 20px -10px rgba(20, 22, 28, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --max: 1080px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(1100px 520px at 50% -280px, rgba(37, 99, 235, 0.10), transparent 70%),
    radial-gradient(820px 420px at 100% 0, rgba(21, 160, 106, 0.06), transparent 60%);
  background-repeat: no-repeat;
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---- Header --------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 249, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .dot { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, var(--blue), #5b8bff); box-shadow: var(--shadow-sm); display: inline-block; }
.nav { display: flex; gap: 18px; font-size: 14.5px; font-weight: 600; }
.nav a { color: var(--ink-soft); }
.nav a:hover { color: var(--blue-ink); text-decoration: none; }
@media (max-width: 640px) { .nav { display: none; } }

/* ---- Hero ----------------------------------------------------------- */
.hero { padding: 52px 0 8px; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--blue-ink); background: var(--blue-wash); padding: 5px 12px; border-radius: 999px; margin-bottom: 16px;
}
h1 { font-size: clamp(2rem, 5.2vw, 3rem); line-height: 1.06; letter-spacing: -0.035em; margin: 0 0 14px; font-weight: 820; }
.lede { max-width: 660px; margin: 0 auto; font-size: 1.13rem; color: var(--ink-soft); }

/* ---- Tool: two-pane builder ---------------------------------------- */
.tool { margin: 28px auto 8px; }
.inv-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 880px) { .inv-grid { grid-template-columns: 1fr; } }

.inv-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 22px 22px 26px;
}
.inv-sec { font-size: 12.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); margin: 22px 0 10px; }
.inv-sec:first-child { margin-top: 4px; }
.inv-row { display: flex; flex-wrap: wrap; gap: 12px; }
.inv-row > .inv-field { flex: 1 1 140px; min-width: 0; }
.inv-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.inv-lab { font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-faint); }
.inv-field input, .inv-field textarea, .inv-field select {
  font: inherit; font-size: 15px; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: 9px 11px; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.inv-field textarea { resize: vertical; line-height: 1.5; }
.inv-field input:focus, .inv-field textarea:focus, .inv-field select:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}
.inv-logo { display: flex; flex-direction: column; gap: 6px; }
.inv-logo input[type="file"] { font-size: 13px; padding: 7px; }
.inv-logo-clear { align-self: flex-start; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--blue-ink); background: none; border: none; cursor: pointer; padding: 0; }
.inv-logo-clear:hover { text-decoration: underline; }

/* line items */
.inv-items { display: flex; flex-direction: column; gap: 8px; }
.inv-item { display: grid; grid-template-columns: 1fr 56px 78px 84px 28px; gap: 7px; align-items: center; }
.inv-item input { font: inherit; font-size: 14px; border: 1.5px solid var(--line-strong); border-radius: 8px; padding: 8px 9px; width: 100%; background: #fff; }
.inv-item input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.inv-item-qty, .inv-item-rate { text-align: right; }
.inv-item-amt { font-size: 13.5px; font-weight: 700; color: var(--ink); text-align: right; white-space: nowrap; }
.inv-item-del { background: none; border: none; color: var(--ink-faint); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; border-radius: 6px; }
.inv-item-del:hover { color: #e5484d; background: #fdecec; }
.inv-add { align-self: flex-start; margin-top: 4px; padding: 8px 14px; font-size: 13.5px; }

.inv-actions { display: flex; gap: 10px; margin-top: 24px; }
.btn { font: inherit; font-weight: 700; font-size: 15px; border: none; cursor: pointer; border-radius: var(--radius-sm); padding: 12px 20px; transition: transform .08s ease, box-shadow .15s ease, background .15s ease; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--blue), #4f82ff); box-shadow: var(--shadow-lg); }
.btn-primary:hover { background: linear-gradient(135deg, #1f57e0, #3f74ff); }
.btn-primary:focus-visible { outline: 3px solid rgba(37,99,235,.4); outline-offset: 2px; }
.btn-ghost { color: var(--blue-ink); background: var(--blue-wash); }
.btn-ghost:hover { background: #dde7ff; }

/* preview */
.inv-preview-col { position: sticky; top: 84px; }
@media (max-width: 880px) { .inv-preview-col { position: static; } }
.inv-preview-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 8px 2px; }
.inv-paper {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 30px 30px 34px; font-size: 13px; color: var(--ink);
  min-height: 420px;
}
.pv-top { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.pv-brand { display: flex; gap: 12px; align-items: flex-start; max-width: 60%; }
.pv-logo { max-width: 110px; max-height: 56px; object-fit: contain; }
.pv-from strong { font-size: 15px; }
.pv-muted { color: var(--ink-faint); font-size: 12px; line-height: 1.5; }
.pv-title { text-align: right; }
.pv-title h2 { margin: 0 0 8px; font-size: 26px; letter-spacing: 0.04em; color: var(--blue-ink); font-weight: 820; }
.pv-meta div { display: flex; gap: 14px; justify-content: flex-end; font-size: 12px; }
.pv-meta span { color: var(--ink-faint); }
.pv-meta b { min-width: 72px; text-align: right; }
.pv-billto { margin: 22px 0 8px; }
.pv-billto strong { display: block; font-size: 14px; margin-top: 2px; }
.pv-table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.pv-table th { text-align: left; font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); border-bottom: 1.5px solid var(--line-strong); padding: 7px 4px; }
.pv-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pv-table .r { text-align: right; white-space: nowrap; }
.pv-totals { margin: 14px 0 0; margin-left: auto; max-width: 260px; }
.pv-tot-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; color: var(--ink-soft); }
.pv-grand { border-top: 1.5px solid var(--line-strong); margin-top: 4px; padding-top: 9px; font-size: 16px; font-weight: 800; color: var(--ink); }
.pv-notes { margin-top: 22px; border-top: 1px dashed var(--line-strong); padding-top: 12px; font-size: 12.5px; }
.pv-notes div { color: var(--ink-soft); margin-top: 3px; }

/* ---- Prose / SEO body ---------------------------------------------- */
.prose { margin: 46px auto; max-width: 760px; }
.prose h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 38px 0 12px; }
.prose h3 { font-size: 1.12rem; margin: 24px 0 6px; }
.prose p, .prose li { color: var(--ink-soft); }
.faq dt { font-weight: 700; margin-top: 20px; color: var(--ink); }
.faq dd { margin: 6px 0 0; color: var(--ink-soft); }

/* steps (HowTo) */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 14px 0; max-width: 760px; }
.steps li { position: relative; padding: 4px 0 14px 44px; color: var(--ink-soft); }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue-wash); color: var(--blue-ink); font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

/* ---- Card grid (hub) ------------------------------------------------ */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 22px 0 30px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); transition: transform .14s ease, box-shadow .18s ease, border-color .14s ease; color: inherit; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); text-decoration: none; }
.card .emoji { font-size: 26px; display: block; margin-bottom: 10px; }
.card h3 { margin: 0 0 6px; font-size: 1.14rem; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.card .vol { display: inline-block; margin-top: 12px; font-size: 12.5px; font-weight: 700; color: var(--blue-ink); background: var(--blue-wash); padding: 3px 9px; border-radius: 999px; }

/* ---- Related strip -------------------------------------------------- */
.related { margin: 40px 0; }
.related h2 { font-size: 1.05rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.chip { font-size: 14.5px; font-weight: 600; border: 1.5px solid var(--line-strong); border-radius: 999px; padding: 8px 15px; background: #fff; color: var(--ink); }
.chip:hover { border-color: var(--blue); color: var(--blue-ink); text-decoration: none; }

/* ---- Footer --------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 30px 0 44px; font-size: 14px; color: var(--ink-faint); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--ink-soft); font-weight: 600; }

.noscript { margin: 24px auto; padding: 14px 18px; border-radius: var(--radius-sm); background: #fff6ec; border: 1px solid #f3d9b3; color: #7a5418; font-size: 14.5px; }

@media print {
  .site-header, .site-footer, .inv-form, .hero, .prose, .related, .inv-preview-label, .noscript { display: none !important; }
  body { background: #fff; }
  .inv-grid { display: block; }
  .inv-paper { box-shadow: none; border: none; padding: 0; }
}
