/* ReceiptForge — global stylesheet */
:root {
  --brand-1: #4f46e5;
  --brand-2: #06b6d4;
  --brand-grad: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-soft-2: #f1f5f9;
  --success: #16a34a;
  --warn: #f59e0b;
  --danger: #dc2626;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand-1); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 16px;
}
.brand { display: inline-flex; align-items: center; }
.brand img { height: 36px; width: auto; }
.brand:hover { text-decoration: none; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--ink-2);
  padding: 8px 12px; border-radius: 8px;
  font-weight: 500; font-size: 14.5px;
}
.nav a:hover { background: var(--bg-soft-2); text-decoration: none; color: var(--ink); }
.nav .cta {
  background: var(--brand-grad); color: #fff; font-weight: 600;
  padding: 9px 16px; border-radius: 10px;
}
.nav .cta:hover { opacity: .92; }
.menu-toggle {
  display: none; background: transparent; border: 0;
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
}
.menu-toggle:hover { background: var(--bg-soft-2); }
.menu-toggle span {
  display: block; width: 20px; height: 2px; background: var(--ink);
  margin: 4px auto; border-radius: 2px; transition: .2s;
}

@media (max-width: 860px) {
  .nav { position: absolute; top: 68px; left: 0; right: 0; background: #fff;
    flex-direction: column; align-items: stretch; padding: 8px 16px 16px;
    border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px; border-radius: 10px; }
  .nav .cta { text-align: center; margin-top: 6px; }
  .menu-toggle { display: inline-flex; flex-direction: column; justify-content: center; }
}

/* Hero */
.hero {
  position: relative;
  padding: 88px 0 64px;
  background:
    radial-gradient(900px 480px at 90% -10%, rgba(6,182,212,.18), transparent 60%),
    radial-gradient(900px 480px at -10% 10%, rgba(79,70,229,.18), transparent 60%),
    linear-gradient(180deg, #fbfdff 0%, #ffffff 60%);
  overflow: hidden;
}
.hero h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.05; letter-spacing: -0.02em;
  margin: 14px 0 18px; font-weight: 800;
}
.hero h1 .grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead {
  font-size: clamp(16px, 1.8vw, 19px);
  color: var(--ink-2); max-width: 720px; margin: 0 auto 28px;
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.hero .eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(22,163,74,.15); }
.hero-inner { text-align: center; position: relative; z-index: 1; }
.hero-cta { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hero-trust {
  margin-top: 36px; display: flex; gap: 28px; flex-wrap: wrap; justify-content: center;
  color: var(--muted); font-size: 13.5px;
}
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 15px; padding: 12px 22px;
  border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .15s ease;
}
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 8px 20px rgba(79,70,229,.25); }
.btn-primary:hover { transform: translateY(-1px); text-decoration: none; box-shadow: 0 12px 24px rgba(79,70,229,.32); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--bg-soft); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--bg-soft-2); text-decoration: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13.5px; border-radius: 10px; }

/* Section */
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.section-head h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.01em; line-height: 1.15; margin: 0 0 12px; font-weight: 800;
}
.section-head p { color: var(--ink-2); font-size: 17px; margin: 0; }
.kicker {
  text-transform: uppercase; letter-spacing: .14em; font-size: 12px;
  font-weight: 700; color: var(--brand-1); margin-bottom: 8px; display: inline-block;
}

/* Tools grid */
.tools-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.tool-card {
  display: flex; flex-direction: column; gap: 12px;
  background: #fff; padding: 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  text-decoration: none; color: inherit;
  position: relative; overflow: hidden;
}
.tool-card::before {
  content: ""; position: absolute; inset: 0;
  background: var(--brand-grad); opacity: 0; transition: opacity .2s;
  height: 3px; bottom: auto;
}
.tool-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-lg);
  border-color: transparent; text-decoration: none;
}
.tool-card:hover::before { opacity: 1; }
.tool-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(79,70,229,.10), rgba(6,182,212,.10));
  color: var(--brand-1);
}
.tool-card h3 { margin: 0; font-size: 17px; font-weight: 700; }
.tool-card p { margin: 0; color: var(--muted); font-size: 14px; }
.tool-card .arrow { color: var(--brand-1); font-weight: 700; font-size: 14px; margin-top: auto; }

/* Features */
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px;
}
.feature .ico {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(79,70,229,.10), rgba(6,182,212,.10));
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brand-1); margin-bottom: 14px;
}
.feature h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.feature p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

/* How it works */
.steps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px; counter-reset: step;
}
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; position: relative;
}
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-grad); color: #fff; font-weight: 800;
  margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.step p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

/* CTA banner */
.cta-banner {
  background: var(--brand-grad);
  color: #fff;
  border-radius: 20px;
  padding: 48px 36px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.cta-banner h2 { margin: 0 0 8px; font-size: clamp(24px, 3vw, 32px); font-weight: 800; }
.cta-banner p { margin: 0 0 22px; opacity: .92; font-size: 16px; }
.cta-banner .btn-secondary { background: #fff; color: var(--brand-1); }

/* Footer */
.site-footer {
  background: #0b1220; color: #cbd5e1; padding: 56px 0 24px; margin-top: 64px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
}
.footer-grid h4 {
  color: #fff; font-size: 14px; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .1em;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: #cbd5e1; font-size: 14.5px; }
.footer-grid a:hover { color: #fff; }
.footer-brand .brand img { filter: brightness(0) invert(1); height: 38px; }
.footer-brand p { color: #94a3b8; font-size: 14px; max-width: 320px; margin-top: 14px; }
.footer-bottom {
  border-top: 1px solid #1e293b; margin-top: 36px; padding-top: 22px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  color: #94a3b8; font-size: 13.5px; flex-wrap: wrap;
}
.socials { display: inline-flex; gap: 8px; }
.socials a {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #1e293b; color: #cbd5e1;
}
.socials a:hover { background: var(--brand-1); color: #fff; }
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* Generator (tool page) */
.tool-shell {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 28px; margin-top: 28px;
}
@media (max-width: 980px) { .tool-shell { grid-template-columns: 1fr; } }
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.panel h2 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.panel .sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink);
  border: 1px solid var(--line); background: #fff;
  border-radius: 10px; padding: 10px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}
.field textarea { min-height: 80px; resize: vertical; }
.form-actions {
  display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap;
}
.items-block { margin-top: 8px; }
.items-block .head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.items-block .head h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.item-row {
  display: grid; grid-template-columns: 1.6fr .6fr .8fr auto; gap: 8px;
  margin-bottom: 8px;
}
.item-row input {
  font: inherit; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; outline: none;
}
.item-row input:focus { border-color: var(--brand-1); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.item-row button { padding: 8px 10px; border-radius: 8px; }
@media (max-width: 520px) {
  .item-row { grid-template-columns: 1fr 1fr; }
  .item-row input:nth-child(1) { grid-column: 1 / -1; }
  .item-row button { grid-column: 1 / -1; justify-self: start; }
}

/* Preview */
.preview-wrap { position: sticky; top: 88px; }
.preview-shell {
  background: var(--bg-soft);
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 24px;
}
.preview-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; color: var(--muted); font-size: 13px;
}
.receipt {
  background: #fff; color: #111827;
  padding: 32px 32px 28px; border-radius: 12px;
  box-shadow: var(--shadow);
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  max-width: 100%;
}
.receipt h1, .receipt h2, .receipt h3 { margin: 0; }
.receipt .r-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding-bottom: 16px; border-bottom: 2px solid #111827;
}
.receipt .r-title {
  font-size: 22px; font-weight: 800; letter-spacing: -0.01em;
  text-transform: uppercase;
}
.receipt .r-org { font-weight: 700; font-size: 15px; }
.receipt .r-org small { display: block; color: #6b7280; font-weight: 400; font-size: 12px; margin-top: 2px; }
.receipt .r-meta { font-size: 12.5px; color: #4b5563; text-align: right; }
.receipt .r-section { padding: 14px 0; border-bottom: 1px solid #e5e7eb; }
.receipt .r-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.receipt .r-cols h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #6b7280; margin-bottom: 6px; font-weight: 700; }
.receipt table { width: 100%; border-collapse: collapse; margin: 6px 0; font-size: 13px; }
.receipt thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em;
  color: #6b7280; padding: 8px 6px; border-bottom: 1px solid #e5e7eb;
}
.receipt tbody td { padding: 8px 6px; border-bottom: 1px solid #f1f5f9; }
.receipt tfoot td { padding: 8px 6px; font-weight: 700; }
.receipt .r-totals {
  display: flex; justify-content: flex-end; gap: 24px; padding: 14px 0;
  font-size: 14px;
}
.receipt .r-totals .grand {
  background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 16px; font-weight: 800;
}
.receipt .r-foot {
  margin-top: 20px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  font-size: 12px; color: #6b7280;
}
.receipt .sign-block { text-align: center; min-width: 180px; }
.receipt .sign-block .line { border-top: 1px solid #111827; margin-top: 32px; padding-top: 4px; font-size: 11.5px; color: #6b7280; }
.receipt .stamp {
  display: inline-block; padding: 6px 12px; border: 2px solid var(--success); color: var(--success);
  border-radius: 6px; font-weight: 800; letter-spacing: .1em; transform: rotate(-6deg);
  font-size: 12px;
}

/* Page hero (subpages) */
.page-hero {
  padding: 64px 0 36px;
  background:
    radial-gradient(800px 360px at 90% -10%, rgba(6,182,212,.14), transparent 60%),
    radial-gradient(800px 360px at -10% 10%, rgba(79,70,229,.14), transparent 60%),
    #fbfdff;
  border-bottom: 1px solid var(--line);
}
.page-hero h1 { font-size: clamp(28px, 4vw, 42px); margin: 0 0 8px; letter-spacing: -0.01em; }
.page-hero p { color: var(--ink-2); margin: 0; font-size: 16.5px; max-width: 720px; }
.breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand-1); }

/* Content typography */
.prose h2 { font-size: 22px; margin: 28px 0 10px; }
.prose h3 { font-size: 18px; margin: 22px 0 8px; }
.prose p, .prose li { color: var(--ink-2); font-size: 15.5px; }
.prose ul { padding-left: 20px; }
.prose ul li { margin-bottom: 6px; }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details {
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px;
}
.faq summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand-1); font-weight: 800; font-size: 20px; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 0; color: var(--ink-2); }

/* Misc */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(79,70,229,.10); color: var(--brand-1);
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
}
.alert {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
  background: var(--bg-soft); font-size: 14px; color: var(--ink-2);
}
.alert strong { color: var(--ink); }

/* Print: clean receipt only */
@media print {
  body * { visibility: hidden !important; }
  .receipt, .receipt * { visibility: visible !important; }
  .receipt {
    position: absolute; left: 0; top: 0; box-shadow: none;
    width: 100%; padding: 24px;
  }
}
