/* ============================================================
   invoice-generator.com.au — global styles
   ============================================================ */

:root {
  --accent: #10715a;
  --accent-dark: #0a5843;
  --accent-light: #e7f5f0;
  --ink: #17252e;
  --ink-soft: #44545f;
  --ink-faint: #7b8a94;
  --line: #dde5e9;
  --line-soft: #ecf1f4;
  --paper: #ffffff;
  --bg: #f2f5f7;
  --danger: #c0392b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(23, 37, 46, 0.08), 0 8px 28px rgba(23, 37, 46, 0.07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, 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;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--accent); }

/* ---------- header / nav ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.brand svg { flex: 0 0 auto; }

.brand .tld { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 4px; }

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 7px;
}

.site-nav a:hover { background: var(--line-soft); color: var(--ink); }

.site-nav a.active { color: var(--accent); font-weight: 600; }

@media (max-width: 780px) {
  .site-header .inner { height: auto; flex-wrap: wrap; padding: 10px 16px 6px; }
  .site-nav { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
  .site-nav a { white-space: nowrap; padding: 5px 10px 5px 0; font-size: 13.5px; }
}

/* ---------- hero ---------- */

.hero {
  max-width: 860px;
  margin: 0 auto;
  padding: 44px 20px 8px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.15;
  margin: 0 0 14px;
  letter-spacing: -0.9px;
}

.hero .sub {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--ink-soft);
  margin: 0 auto;
  max-width: 640px;
}

.hero .trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-top: 18px;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--ink-faint);
  font-weight: 500;
}

.hero .trust li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 700;
  margin-right: 6px;
}

/* ---------- generator layout ---------- */

.generator {
  max-width: 1240px;
  margin: 28px auto 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 980px) {
  .generator { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- invoice paper ---------- */

.invoice-paper {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4.5vw, 48px);
  min-width: 0;
}

.invoice-paper input,
.invoice-paper textarea,
.invoice-paper select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 6px 8px;
  width: 100%;
  transition: border-color 0.12s, background 0.12s;
}

.invoice-paper input:hover,
.invoice-paper textarea:hover {
  background: #f6f9fa;
  border-color: var(--line-soft);
}

.invoice-paper input:focus,
.invoice-paper textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 113, 90, 0.12);
}

.invoice-paper textarea { resize: vertical; min-height: 60px; }

.invoice-paper ::placeholder { color: #a5b2ba; opacity: 1; }

/* top row */

.inv-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.logo-drop {
  width: 200px;
  height: 92px;
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
  flex: 0 0 auto;
}

.logo-drop:hover, .logo-drop.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
}

.logo-drop img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-drop:not(.has-logo) img { display: none; }

.logo-drop .logo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(23, 37, 46, 0.65);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: none;
}

.logo-drop.has-logo .logo-remove { display: block; }
.logo-drop.has-logo .logo-hint { display: none; }

.inv-title-block { text-align: right; flex: 1 1 260px; min-width: 220px; }

.inv-title-block .doc-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: right;
  text-transform: uppercase;
  color: var(--ink);
  padding: 2px 8px;
}

.inv-number-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--ink-soft);
}

.inv-number-row label { font-size: 14px; font-weight: 600; white-space: nowrap; }

.inv-number-row input { width: 130px; text-align: right; }

/* parties + meta */

.inv-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 26px;
}

@media (max-width: 640px) {
  .inv-parties { grid-template-columns: 1fr; }
}

.field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-faint);
  margin: 0 0 5px 2px;
}

.inv-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 18px;
  margin-bottom: 28px;
}

/* items table */

.items-table { width: 100%; border-collapse: collapse; }

.items-table thead th {
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 9px 10px;
  text-align: left;
}

.items-table thead th:first-child { border-radius: 6px 0 0 6px; }
.items-table thead th:last-child { border-radius: 0 6px 6px 0; }

.items-table th.col-qty, .items-table td.col-qty { width: 88px; }
.items-table th.col-rate, .items-table td.col-rate { width: 130px; }
.items-table th.col-amount, .items-table td.col-amount { width: 130px; text-align: right; }
.items-table th.col-del, .items-table td.col-del { width: 34px; }

.items-table tbody td {
  padding: 4px 4px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

.items-table td.col-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-soft);
  padding-right: 10px;
  white-space: nowrap;
}

.items-table .col-qty input, .items-table .col-rate input { text-align: right; }

.row-del {
  border: none;
  background: none;
  color: var(--ink-faint);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
  line-height: 1;
}

.row-del:hover { color: var(--danger); background: #fdf0ee; }

.add-item {
  margin-top: 12px;
  border: 1.5px dashed var(--line);
  background: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}

.add-item:hover { border-color: var(--accent); background: var(--accent-light); }

/* totals */

.inv-bottom {
  display: flex;
  gap: 32px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.inv-notes { flex: 1 1 300px; min-width: 240px; display: flex; flex-direction: column; gap: 16px; }

.totals { flex: 0 1 320px; min-width: 260px; margin-left: auto; }

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.totals-row .t-label { flex: 1; white-space: nowrap; }

.totals-row .t-input {
  display: flex;
  align-items: center;
  gap: 4px;
}

.totals-row input { width: 84px; text-align: right; }

.totals-row select {
  width: auto;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  padding: 4px 4px;
  border-radius: 6px;
}

.totals-row .t-value {
  min-width: 96px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.totals-row.grand {
  border-top: 2px solid var(--ink);
  margin-top: 6px;
  padding-top: 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.totals-row.balance {
  background: var(--accent-light);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-dark);
}

.tax-inline { display: flex; align-items: center; gap: 6px; }

.tax-inline input[type="text"] { width: 64px; text-align: left; }
.tax-inline input[type="number"] { width: 64px; }

/* ---------- side panel ---------- */

.side-panel { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 980px) { .side-panel { position: static; } }

.panel-card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-card h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

.panel-field { margin-bottom: 12px; }
.panel-field:last-child { margin-bottom: 0; }

.panel-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.panel-field select,
.panel-field input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}

.panel-field select:focus, .panel-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 113, 90, 0.12);
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 10px;
}

.check-field input { accent-color: var(--accent); width: 16px; height: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 9px;
  border: none;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost {
  background: #fff;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
}

.btn-ghost:hover { border-color: var(--ink-faint); color: var(--ink); }

.btn-row { display: flex; flex-direction: column; gap: 9px; }

/* ATO compliance checklist */

.ato-check ul { list-style: none; padding: 0; margin: 0; }

.ato-check li {
  position: relative;
  padding: 5px 0 5px 26px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.ato-check li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: #fff;
}

.ato-check li.ok::before {
  content: "✓";
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ato-check li.ok { color: var(--ink); }

.ato-check li.na { opacity: 0.55; }

.ato-check li.na::before { background: var(--line-soft); }

.ato-check .check-note {
  display: block;
  font-size: 11.5px;
  color: var(--ink-faint);
}

.ato-check li.todo .check-note { color: #a05c12; }

.autosave-note {
  font-size: 12px;
  color: var(--ink-faint);
  text-align: center;
  margin: 4px 0 0;
}

/* InvoiceSonic promo */

.sonic-card {
  background: linear-gradient(135deg, #0d2b23 0%, #17252e 100%);
  color: #fff;
}

.sonic-card h2 { color: #7fd6bf; }

.sonic-card p { font-size: 13.5px; color: #c3d2cd; margin: 0 0 12px; line-height: 1.5; }

.sonic-card .btn {
  background: #fff;
  color: var(--accent-dark);
  font-size: 14px;
  padding: 10px 16px;
}

.sonic-card .btn:hover { background: #e7f5f0; }

.sonic-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(23, 37, 46, 0.22);
  padding: 18px;
  animation: sonic-in 0.35s ease;
}

@keyframes sonic-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.sonic-toast .st-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-dark);
  margin-bottom: 6px;
}

.sonic-toast .st-head .tick {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; flex: 0 0 auto;
}

.sonic-toast p { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }

.sonic-toast .btn { font-size: 14px; padding: 10px 16px; text-decoration: none; }

.sonic-toast .st-close {
  position: absolute;
  top: 8px; right: 10px;
  border: none; background: none;
  font-size: 18px; color: var(--ink-faint);
  cursor: pointer; padding: 4px;
}

.sonic-toast .st-close:hover { color: var(--ink); }

@media (max-width: 980px) {
  .sonic-toast { bottom: 86px; }
}

/* mobile floating download */

.mobile-download {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  z-index: 40;
}

@media (max-width: 980px) {
  .mobile-download { display: block; }
  body.has-tool { padding-bottom: 76px; }
}

/* ---------- content / SEO sections ---------- */

.content {
  max-width: 820px;
  margin: 64px auto 0;
  padding: 0 20px;
}

.content h2 {
  font-size: clamp(24px, 3.4vw, 30px);
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin: 46px 0 14px;
}

.content h3 { font-size: 20px; margin: 30px 0 10px; letter-spacing: -0.3px; }

.content p, .content li { color: var(--ink-soft); font-size: 16.5px; }

.content ul, .content ol { padding-left: 24px; }

.content li { margin-bottom: 8px; }

.content strong { color: var(--ink); }

.content .lead { font-size: 18px; }

/* feature grid */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.feature-grid li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0;
}

.feature-grid .f-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

.feature-grid h3 { font-size: 16px; margin: 0 0 6px; }

.feature-grid p { font-size: 14.5px; margin: 0; }

/* steps */

.steps { counter-reset: step; padding: 0; list-style: none; margin: 24px 0; }

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 52px;
  margin: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps li strong { display: block; color: var(--ink); font-size: 16.5px; margin-bottom: 2px; }

/* comparison table */

.compare-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); border-radius: var(--radius); }

.compare { width: 100%; border-collapse: collapse; background: var(--paper); font-size: 14.5px; min-width: 560px; }

.compare th, .compare td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); }

.compare thead th { background: var(--line-soft); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-soft); }

.compare td:not(:first-child) { text-align: center; }

.compare .yes { color: var(--accent); font-weight: 700; }
.compare .no { color: var(--danger); font-weight: 700; }

.compare tbody tr td:first-child { color: var(--ink-soft); }

.compare .hl { background: var(--accent-light); }

/* FAQ */

.faq details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.faq summary {
  padding: 16px 18px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after { content: "+"; font-size: 20px; color: var(--ink-faint); flex: 0 0 auto; }

.faq details[open] summary::after { content: "–"; }

.faq details p { padding: 0 18px 16px; margin: 0; font-size: 15px; }

/* callout */

.callout {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 24px 0;
}

.callout p { margin: 0; color: var(--accent-dark); font-size: 15px; }

/* cta band */

.cta-band {
  text-align: center;
  background: var(--ink);
  border-radius: var(--radius);
  padding: 44px 28px;
  margin: 56px 0 0;
}

.cta-band h2 { color: #fff; margin: 0 0 10px; }

.cta-band p { color: #b9c6cd; margin: 0 0 22px; }

.cta-band .btn { width: auto; padding: 14px 34px; }

/* ---------- about page ---------- */

.page-hero { max-width: 820px; margin: 0 auto; padding: 56px 20px 0; }

.page-hero h1 { font-size: clamp(30px, 4.6vw, 42px); letter-spacing: -0.8px; margin: 0 0 14px; }

.page-hero .sub { font-size: 18px; color: var(--ink-soft); max-width: 640px; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 80px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 36px 20px 28px;
}

.site-footer .inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.site-footer .cols { display: flex; gap: 56px; flex-wrap: wrap; }

.site-footer h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--ink-faint); margin: 0 0 10px; }

.site-footer ul { list-style: none; padding: 0; margin: 0; }

.site-footer li { margin-bottom: 7px; }

.site-footer a { color: var(--ink-soft); text-decoration: none; font-size: 14.5px; }

.site-footer a:hover { color: var(--accent); }

.site-footer .fineprint { font-size: 13px; color: var(--ink-faint); max-width: 380px; }

/* ---------- print ---------- */

@media print {
  body { background: #fff; }
  .site-header, .side-panel, .hero, .content, .site-footer, .mobile-download,
  .add-item, .row-del, .logo-drop .logo-hint, .logo-remove, .cta-band { display: none !important; }
  .generator { display: block; margin: 0; padding: 0; max-width: none; }
  .invoice-paper { box-shadow: none; border-radius: 0; padding: 0; }
  .invoice-paper input, .invoice-paper textarea { border: none !important; box-shadow: none !important; }
  .logo-drop { border: none; }
  .logo-drop:not(.has-logo) { display: none; }
}
