/* TradeQuoteKit shared stylesheet
   Dark utility-tool aesthetic: #101418 bg, #e8e6e1 text, #9aa3ad muted, #e8a33d amber accent */

:root {
  --bg: #101418;
  --bg-raised: #171c22;
  --bg-inset: #0c0f12;
  --text: #e8e6e1;
  --muted: #9aa3ad;
  --accent: #e8a33d;
  --accent-dark: #b97c1e;
  --line: #2a313a;
  --paper: #ffffff;
  --paper-text: #14181c;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

img { max-width: 100%; }

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

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

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

.lede { color: var(--muted); font-size: 1.1rem; max-width: 46em; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  gap: 16px;
}
.brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand span { color: var(--accent); }
.brand:hover { text-decoration: none; }
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  align-items: center;
}
.main-nav a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
  white-space: nowrap;
}
.main-nav a:hover { color: var(--text); background: var(--bg-raised); text-decoration: none; }
.main-nav a.nav-cta {
  color: #14100a;
  background: var(--accent);
  font-weight: 700;
}
.main-nav a.nav-cta:hover { background: #f2b254; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 1rem;
  cursor: pointer;
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--line);
    padding: 10px 20px 16px;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .main-nav a { display: block; padding: 10px 12px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #14100a; }
.btn-primary:hover { background: #f2b254; }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--muted); }
.btn-small { padding: 8px 14px; font-size: 0.9rem; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-tight { padding: 36px 0; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; }
.hero h1 { font-size: 2.6rem; max-width: 18em; }
.hero .lede { margin-bottom: 1.6em; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 640px) { .hero h1 { font-size: 2rem; } }

/* ---------- Steps ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  counter-reset: step;
}
.steps li {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: block;
  width: 34px;
  height: 34px;
  line-height: 34px;
  text-align: center;
  border-radius: 50%;
  background: var(--accent);
  color: #14100a;
  font-weight: 800;
  margin-bottom: 12px;
}
.steps h3 { margin-bottom: 0.3em; }
.steps p { margin: 0; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Trade link blocks ---------- */
.trade-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.trade-links a {
  display: block;
  padding: 14px 18px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
}
.trade-links a:hover { border-color: var(--accent); text-decoration: none; }
.trade-links a span { display: block; font-size: 0.85rem; color: var(--muted); font-weight: 400; }
@media (max-width: 760px) { .trade-links { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .trade-links { grid-template-columns: 1fr; } }

/* ---------- Pro band / CTA boxes ---------- */
.pro-band {
  background: linear-gradient(135deg, #1c2027, #14181d);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.pro-band h2 { margin-bottom: 0.2em; }
.pro-band p { margin: 0; color: var(--muted); max-width: 34em; }

.cta-box {
  background: var(--bg-raised);
  border: 1px solid var(--accent-dark);
  border-radius: 10px;
  padding: 24px 28px;
  margin: 32px 0;
}
.cta-box h2 { margin-bottom: 0.3em; }
.cta-box p { color: var(--muted); margin-bottom: 1em; }

/* ---------- FAQ ---------- */
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 0;
  color: var(--accent);
  font-weight: 800;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 10px 0 4px; color: var(--muted); }

/* ---------- Tool layout ---------- */
.tool-intro { padding: 40px 0 8px; }
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 28px;
  align-items: start;
  padding: 24px 0 56px;
}
@media (max-width: 900px) { .tool-grid { grid-template-columns: 1fr; } }

.tool-form fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 18px 8px;
  margin: 0 0 18px;
  background: var(--bg-raised);
}
.tool-form legend {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0 8px;
  color: var(--accent);
}
.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="date"],
.field textarea {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 9px 11px;
  font-size: 0.95rem;
  font-family: inherit;
}
.field input:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 70px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .field-row { grid-template-columns: 1fr; } }

.items-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.items-table th {
  text-align: left;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 6px;
}
.items-table td { padding: 4px 4px; vertical-align: top; }
.items-table input {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 9px;
  font-size: 0.92rem;
}
.items-table .col-qty { width: 72px; }
.items-table .col-price { width: 100px; }
.items-table .col-total { width: 92px; text-align: right; font-variant-numeric: tabular-nums; padding-top: 12px; color: var(--muted); }
.items-table .col-del { width: 40px; }
.row-del {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 6px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.row-del:hover { color: #e86a5a; border-color: #e86a5a; }

.privacy-note {
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 18px;
}

/* ---------- A4 sheet preview ---------- */
.sheet-wrap { position: sticky; top: 82px; }
@media (max-width: 900px) { .sheet-wrap { position: static; } }
.sheet {
  background: var(--paper);
  color: var(--paper-text);
  border-radius: 4px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  padding: 40px 38px;
  font-size: 0.86rem;
  line-height: 1.5;
  min-height: 640px;
}
.sheet h2 { font-size: 1.5rem; margin: 0; }
.sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 2px solid #14181c;
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.sheet-biz { max-width: 60%; }
.sheet-biz .biz-name { font-weight: 800; font-size: 1.1rem; }
.sheet-biz div { white-space: pre-line; }
.sheet-logo { max-width: 130px; max-height: 70px; width: auto; height: auto; margin-bottom: 6px; display: none; }
.sheet-meta { text-align: right; font-size: 0.85rem; }
.sheet-meta table { margin-left: auto; border-collapse: collapse; }
.sheet-meta td { padding: 1px 0 1px 12px; text-align: right; }
.sheet-meta td:first-child { color: #555; text-align: left; }
.sheet-to { margin-bottom: 18px; }
.sheet-to .to-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: #555; margin-bottom: 2px; }
.sheet-to div { white-space: pre-line; }
.sheet table.lines { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.sheet table.lines th {
  text-align: left;
  border-bottom: 1px solid #14181c;
  padding: 5px 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sheet table.lines td { padding: 6px; border-bottom: 1px solid #ddd; vertical-align: top; }
.sheet table.lines .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet-totals { margin-left: auto; width: 250px; border-collapse: collapse; }
.sheet-totals td { padding: 3px 6px; }
.sheet-totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet-totals .grand td {
  border-top: 2px solid #14181c;
  font-weight: 800;
  font-size: 1.05rem;
  padding-top: 7px;
}
.sheet-notes { margin-top: 26px; font-size: 0.82rem; color: #333; }
.sheet-notes .notes-label { font-weight: 700; color: #14181c; margin-bottom: 2px; }
.sheet-notes div { white-space: pre-line; }
.placeholder { color: #9a9a9a; }

.sheet-actions { margin-top: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sheet-actions .hint { font-size: 0.85rem; color: var(--muted); }

/* ---------- Tips / checklist ---------- */
.tips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tips li { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.tips h3 { font-size: 1rem; margin-bottom: 0.3em; }
.tips p { margin: 0; color: var(--muted); font-size: 0.92rem; }
@media (max-width: 760px) { .tips { grid-template-columns: 1fr; } }

.checklist { list-style: none; margin: 0 0 1em; padding: 0; }
.checklist li {
  padding: 9px 0 9px 34px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 13px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  border-radius: 3px;
}

/* ---------- Breadcrumbs ---------- */
.crumbs { font-size: 0.85rem; color: var(--muted); padding: 18px 0 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

/* ---------- Download row ---------- */
.download-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; }

/* ---------- Cross links ---------- */
.cross-links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.cross-links h3 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.cross-links ul { list-style: none; margin: 0; padding: 0; }
.cross-links li { margin-bottom: 8px; }
@media (max-width: 700px) { .cross-links { grid-template-columns: 1fr; } }

/* ---------- Template index grouping ---------- */
.trade-group { margin-bottom: 34px; }
.trade-group h2 { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.trade-group ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.trade-group a {
  display: block;
  padding: 12px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
}
.trade-group a:hover { border-color: var(--accent); text-decoration: none; }
@media (max-width: 760px) { .trade-group ul { grid-template-columns: 1fr; } }

/* ---------- Pricing ---------- */
.price-card {
  border: 1px solid var(--accent-dark);
  background: var(--bg-raised);
  border-radius: 12px;
  padding: 30px;
  max-width: 560px;
}
.price-card .price { font-size: 2.4rem; font-weight: 800; }
.price-card .price span { font-size: 1rem; color: var(--muted); font-weight: 400; }
.tick-list { list-style: none; margin: 0 0 1.2em; padding: 0; }
.tick-list li { padding: 6px 0 6px 30px; position: relative; }
.tick-list li::before {
  content: "\2713";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 800;
}

/* ---------- Legal pages ---------- */
.legal h2 { margin-top: 1.6em; }
.legal p, .legal li { max-width: 46em; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 30px;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 26px;
}
.footer-grid h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.6em; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: var(--text); }
.footer-credit { border-top: 1px solid var(--line); padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Print: only the sheet, black on white ----------
   Everything outside the sheet is removed from layout with display:none
   (visibility:hidden would keep its height and produce blank pages). */
@media print {
  html, body {
    background: #fff;
    height: auto;
    min-height: 0;
  }
  .site-header, .site-footer { display: none !important; }
  main > *:not(.tool-grid) { display: none !important; }
  .tool-grid { display: block; padding: 0; }
  .tool-form, .sheet-actions { display: none !important; }
  .sheet-wrap { position: static; }
  #sheet {
    position: static;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
  }
  @page { margin: 16mm; }
}
