/* ── Tend Bookkeeping Official Brand Palette ── */
:root {
  --growth-green:   #189E54;
  --indigo:         #3A3F6E;
  --warm-neutral:   #F4F2ED;
  --charcoal:       #1F2933;
  --bronze:         #8A5C2E;

  --green-tint:     #EAF6EF;
  --green-mid:      #B8DFC9;
  --indigo-tint:    #EDEEF5;
  --indigo-mid:     #C0C3DC;
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--warm-neutral);
  color: var(--charcoal);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* ── Sticky header ── */
.site-header {
  background: #fff;
  border-bottom: 3px solid var(--growth-green);
  padding: 1.1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(24,158,84,0.07);
}

.site-header img { height: 40px; width: auto; }

.header-rule {
  width: 1px;
  height: 32px;
  background: var(--green-mid);
  margin: 0 0.25rem;
}

.header-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--indigo);
  letter-spacing: 0.01em;
}

/* ── Hero ── */
.hero {
  background: var(--indigo);
  color: #fff;
  padding: 3.25rem 2rem 2.75rem;
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--growth-green);
  margin-bottom: 0.75rem;
  opacity: 0.95;
}

.hero h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.875rem;
  line-height: 1.2;
}

.hero p {
  font-size: 0.93rem;
  opacity: 0.82;
  max-width: 500px;
  margin: 0 auto 1.75rem;
  line-height: 1.65;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.hero-tag {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.88);
}

/* ── TOC navigation ── */
.toc-bar {
  background: #fff;
  border-bottom: 1px solid var(--green-mid);
  padding: 0.625rem 1.5rem;
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  justify-content: center;
}

.toc-pill {
  padding: 0.28rem 0.8rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--indigo);
  background: var(--indigo-tint);
  border: 1px solid var(--indigo-mid);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.toc-pill:hover {
  background: var(--indigo);
  color: #fff;
}

/* ── Layout ── */
.page-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.25rem 5rem;
}

/* ── Section cards ── */
.s-card {
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--green-mid);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.s-head {
  background: var(--green-tint);
  border-bottom: 2px solid var(--green-mid);
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.s-icon {
  width: 32px;
  height: 32px;
  background: var(--growth-green);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  color: #fff;
}

.s-head h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--charcoal);
  margin: 0;
  letter-spacing: -0.01em;
}

.s-body {
  padding: 1.375rem 1.5rem;
}

/* ── Sub-headings inside cards ── */
.sub-heading {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--indigo);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 1.25rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--indigo-mid);
}

.sub-heading:first-child { margin-top: 0; }

/* ── Body text ── */
.body-text {
  font-size: 0.845rem;
  line-height: 1.65;
  color: #3a4550;
  margin: 0 0 0.75rem;
}

/* ── Divider ── */
.rule {
  border: none;
  border-top: 1px solid var(--green-mid);
  margin: 1.125rem 0;
}

/* ── Sign-in method cards ── */
.method-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

@media (min-width: 480px) {
  .method-grid { grid-template-columns: repeat(3, 1fr); }
}

.method-card {
  border: 1px solid var(--green-mid);
  border-radius: 5px;
  padding: 1rem;
  background: var(--warm-neutral);
  border-top: 3px solid var(--growth-green);
}

.method-icon { font-size: 1.4rem; margin-bottom: 0.4rem; }

.method-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 0.3rem;
}

.method-desc {
  font-size: 0.73rem;
  color: #5a6a78;
  line-height: 1.5;
}

/* ── Steps ── */
.step-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.step-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.step-num {
  width: 24px;
  height: 24px;
  min-width: 24px;
  background: var(--indigo);
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.step-copy {
  font-size: 0.845rem;
  line-height: 1.6;
  color: #3a4550;
}

/* ── Feature tiles ── */
.tile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

@media (min-width: 480px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
}

.tile {
  border-left: 3px solid var(--growth-green);
  background: var(--warm-neutral);
  border-radius: 0 5px 5px 0;
  padding: 0.875rem 1rem;
}

.tile-heading {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 0.3rem;
}

.tile p, .tile li {
  font-size: 0.76rem;
  color: #5a6a78;
  line-height: 1.55;
}

.tile ul {
  list-style: none;
  padding: 0;
  margin: 0.3rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.tile li::before {
  content: "— ";
  color: var(--growth-green);
  font-weight: 700;
}

/* ── Callouts ── */
.callout {
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  line-height: 1.6;
  margin-top: 1rem;
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
}

.callout-mark { font-size: 0.95rem; flex-shrink: 0; margin-top: 1px; }

.callout.note {
  background: var(--green-tint);
  border: 1px solid var(--green-mid);
  color: #1a3d28;
}

.callout.caution {
  background: #FFF8EE;
  border: 1px solid #E8C97A;
  color: #5a3e00;
}

/* ── FAQ ── */
.faq-item {
  border: 1px solid var(--green-mid);
  border-radius: 5px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.faq-btn {
  width: 100%;
  text-align: left;
  padding: 0.875rem 1.125rem;
  font-size: 0.845rem;
  font-weight: 600;
  background: var(--warm-neutral);
  color: var(--charcoal);
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s;
}

.faq-btn:hover { background: var(--green-tint); }
.faq-arrow {
  font-size: 0.65rem;
  color: var(--growth-green);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.faq-item.open .faq-arrow { transform: rotate(180deg); }

.faq-body {
  display: none;
  padding: 0.875rem 1.125rem 1rem;
  font-size: 0.82rem;
  color: #3a4550;
  line-height: 1.65;
  border-top: 1px solid var(--green-mid);
  background: #fff;
}

.faq-item.open .faq-body { display: block; }

/* ── App download buttons ── */
.dl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 0.875rem;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
  border: 1.5px solid var(--indigo);
  color: var(--indigo);
  background: #fff;
}

.dl-btn:hover { opacity: 0.75; }

.dl-btn.primary {
  background: var(--growth-green);
  color: #fff;
  border-color: var(--growth-green);
}

/* ── Error / troubleshoot blocks ── */
.err-block {
  border-radius: 4px;
  border-left: 3px solid var(--bronze);
  background: #FBF7F3;
  padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
}

.err-heading {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--bronze);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

.err-block ul, .err-block p {
  font-size: 0.78rem;
  color: #5a4a3a;
  line-height: 1.6;
  margin: 0;
}

.err-block ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.err-block li::before {
  content: "• ";
  color: var(--bronze);
  font-weight: 700;
}

/* ── Footer ── */
.site-footer {
  background: var(--indigo);
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 1.75rem 2rem;
  font-size: 0.78rem;
  line-height: 1.7;
}

.site-footer strong { color: #fff; }

.site-footer a {
  color: #A8DFB8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Anchor offset ── */
.anchor { scroll-margin-top: 72px; }

/* ── Print / PDF styles ── */
@media print {
  /* Remove sticky header */
  .site-header { position: static; box-shadow: none; }

  /* Remove nav pills */
  .toc-bar { display: none; }

  /* Compact the hero so it doesn't dominate page 1 */
  .hero { padding: 1.5rem 2rem !important; }

  /* Expand all FAQ items */
  .faq-body { display: block !important; }
  .faq-arrow { display: none; }
  .faq-btn { cursor: default; background: var(--warm-neutral) !important; }

  /* Allow section CARDS to split across pages (removes the large blank gaps).
     Keep avoid only on individual atomic units that shouldn't orphan. */
  .s-card { break-inside: auto; page-break-inside: auto; }
  .s-head  { break-after: avoid; page-break-after: avoid; }
  .step-row { break-inside: avoid; page-break-inside: avoid; }
  .tile     { break-inside: avoid; page-break-inside: avoid; }
  .err-block { break-inside: avoid; page-break-inside: avoid; }
  .method-card { break-inside: avoid; page-break-inside: avoid; }
  .callout  { break-inside: avoid; page-break-inside: avoid; }
  .faq-item { break-inside: avoid; page-break-inside: avoid; }

  /* Reduce margins so pages fill better */
  .page-body { padding: 1rem 1.25rem 1rem; }
  .s-card { margin-bottom: 1rem; }
  .s-body { padding: 1rem 1.25rem; }

  /* Keep footer together on one line */
  .site-footer { 
    break-inside: avoid !important; 
    page-break-inside: avoid !important;
    break-before: avoid !important;
    page-break-before: avoid !important;
    padding: 0.75rem 1.5rem !important;
    margin-top: 0.25rem;
    font-size: 0.78rem;
  }

  /* Tighten bottom */
  html, body { height: auto !important; min-height: 0 !important; }

  /* Sign-in image: constrained to fit on page 1 with method cards above it,
     centered, and page 2 forced to start at "Requesting a Magic Link" */
  #signin-img {
    max-height: 230px;
    width: auto;
    max-width: 100%;
    display: block;
    margin: 0.75rem auto;
  }

  /* Financials image: avoid splitting mid-image, but don't always force a new page.
     The wrapper prevents the image being sliced; it will naturally flow to the next
     page only if there isn't enough room — no unnecessary blank pages. */
  .img-wrap {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #financials-img {
    max-width: 100%;
    display: block;
    margin: 0.5rem 0;
  }

  /* Force page 2 to start at "Requesting a Magic Link" */
  #magic-link-heading {
    break-before: page;
    page-break-before: always;
  }

  /* Hide the rule that would otherwise float at the top of page 2 */
  #rule-before-magic-link { display: none; }

  /* Keep images from bleeding off the page */
  .screenshot { max-width: 100% !important; }

  /* Preserve background colors in print */
  body { background: white !important; color: #1F2933 !important; }
  .hero,
  .s-head, .callout, .err-block, .tile, .method-card, .upload-zone {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ── Signin image — centered on screen and in print ── */
#signin-img {
  display: block;
  margin: 1rem auto;
  max-width: 85%;
}
.screenshot {
  display: block;
  width: 100%;
  max-width: 680px;
  height: auto;
  border-radius: 5px;
  border: 1px solid var(--green-mid);
  margin: 0.875rem 0;
}

.screenshot-caption {
  font-size: 0.7rem;
  color: #7a8a98;
  margin-top: -0.375rem;
  margin-bottom: 0.875rem;
  font-style: italic;
}

/* ── Upload drag-drop zone (visual reference) ── */
.upload-zone {
  border: 2px dashed var(--growth-green);
  border-radius: 6px;
  background: var(--green-tint);
  padding: 1.5rem 1.25rem;
  text-align: center;
  margin: 0.875rem 0;
}

.upload-zone-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }

.upload-zone-text {
  font-size: 0.8rem;
  color: var(--charcoal);
  font-weight: 600;
}

.upload-zone-sub {
  font-size: 0.72rem;
  color: #5a7a68;
  margin-top: 0.2rem;
}
