/* MyFreeInvoiceTool design system.
   Ivory base, navy ink, deep emerald accent, hairline gold rules.
   Display serif for headlines, UI sans for controls, tabular numerals for money. */

:root {
  --ivory: #faf8f4;
  --ivory-2: #f1efe9;
  --ink: #11233f;
  --body: #2c3a52;
  --muted: #6b7689;
  --emerald: #0e6b4f;
  --emerald-dark: #0a523c;
  --gold: #c8a24b;
  --hairline: #e3ded2;
  --paper: #ffffff;
  --danger: #a33b2e;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(17, 35, 63, 0.06), 0 8px 28px rgba(17, 35, 63, 0.07);
  --maxw: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.01em; }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
a { color: var(--emerald); text-decoration: none; }
a:hover { text-decoration: underline; }
small { color: var(--muted); }

.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

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

/* ---------- Site header ---------- */
.site-header {
  background: var(--ivory);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
}
.brand {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .seal {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--emerald);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-family: var(--serif);
}
.site-nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.site-nav a { color: var(--body); font-size: 14.5px; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a.cta {
  background: var(--emerald); color: #fff; padding: 8px 16px; border-radius: 999px;
  font-weight: 600;
}
.site-nav a.cta:hover { background: var(--emerald-dark); }
@media (max-width: 760px) {
  .site-nav a:not(.cta):not(.keep) { display: none; }
}

/* ---------- Buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px var(--sans);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 22px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--emerald); color: #fff; }
.btn-primary:hover { background: var(--emerald-dark); }
.btn-primary:disabled { background: #8aa89d; cursor: default; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--ivory); }
.btn-quiet { background: var(--ivory-2); color: var(--ink); border-color: var(--hairline); }
.btn-quiet:hover { border-color: var(--ink); }
.btn-sm { padding: 6px 13px; font-size: 13px; }

input, select, textarea {
  font: 400 14.5px var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 9px 11px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(14, 107, 79, 0.35);
  outline-offset: 0;
  border-color: var(--emerald);
}
label { font-size: 12.5px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 4px; }
textarea { resize: vertical; }
input[type="number"] { font-variant-numeric: tabular-nums; }
input[type="color"] { padding: 3px; height: 38px; width: 56px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--emerald); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--body); font-weight: 400; margin: 0; }

/* ---------- Gold rule & sections ---------- */
.rule-gold { border: 0; border-top: 1px solid var(--gold); margin: 0; }
.section { padding: 64px 0; }
.section.alt { background: var(--ivory-2); }

/* ---------- SEO copy blocks ---------- */
.copy { max-width: 760px; }
.copy h2 { margin-top: 1.6em; }
.copy ul { padding-left: 1.2em; }
.copy li { margin-bottom: 0.45em; }

/* FAQ */
.faq details {
  border-bottom: 1px solid var(--hairline);
  padding: 14px 0;
}
.faq summary { font-weight: 600; color: var(--ink); cursor: pointer; font-size: 16.5px; }
.faq details p { margin: 10px 0 4px; color: var(--body); }

/* ---------- Trust line ---------- */
.trustline {
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  font-size: 13.5px; color: var(--muted);
  align-items: center;
}
.trustline span::before { content: "✓ "; color: var(--emerald); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #c6cedd;
  margin-top: 80px;
  padding: 56px 0 32px;
  font-size: 14px;
}
.site-footer a { color: #e8ebf2; }
.site-footer h4 { color: #fff; font-family: var(--serif); font-size: 15px; margin: 0 0 12px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-apps {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: 40px; padding-top: 26px;
}
.apps-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 12px;
}
.app-card {
  display: flex; gap: 11px; align-items: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.app-card:hover { text-decoration: none; border-color: var(--gold); background: rgba(255, 255, 255, 0.08); }
.app-card .app-seal {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--emerald); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; margin-top: 1px;
}
.app-card strong { display: block; font-family: var(--serif); font-size: 15px; color: #fff; line-height: 1.25; }
.app-card small { display: block; color: #93a0b5; font-size: 12.5px; line-height: 1.35; margin-top: 3px; }
.apps-note { margin: 14px 0 0; color: #93a0b5; font-size: 12.5px; }
.apps-note::before { content: "✓ "; color: var(--emerald); font-weight: 700; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: 28px; padding-top: 22px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  color: #93a0b5; font-size: 13px;
}

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  background: var(--ink); color: #fff;
  padding: 12px 22px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
  max-width: min(92vw, 480px);
  text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Utility ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.mt-0 { margin-top: 0; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
