/* site.css — AjoAutomate public website.
   Palette and visual language follow the interactive mockup (WhatsApp greens,
   card-based layout, Inter). The /ledger and /setup pages keep their own styles. */

:root {
  --wa-green: #128C7E;
  --wa-green-dark: #075E54;
  --green-text: #0f7a6d;
  --green-soft: #e3f3ee;
  --green-line: #b9dfd5;
  --ground: #f4f9f6;
  --surface: #ffffff;
  --ink: #0f1f1b;
  --ink-2: #2f4a43;
  --muted: #5f7a73;
  --line: #d7e6e0;
  --paid: #1a7f4e;
  --pending: #b8860b;
  --chat-ground: #e5ede7;
  --chat-in: #ffffff;
  --chat-out: #d9fdd3;
  --chat-time: #7a8d86;
  --shadow: 0 10px 30px rgba(7, 94, 84, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green-text: #3fc4ae;
    --green-soft: #113029;
    --green-line: #1f5a4e;
    --ground: #0c1714;
    --surface: #142420;
    --ink: #e8f3ef;
    --ink-2: #c3d7d0;
    --muted: #8fa9a1;
    --line: #25403a;
    --paid: #4fc98a;
    --pending: #e0b44a;
    --chat-ground: #0f1d19;
    --chat-in: #1c2f2a;
    --chat-out: #1f4a3d;
    --chat-time: #8fa9a1;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --green-text: #3fc4ae;
  --green-soft: #113029;
  --green-line: #1f5a4e;
  --ground: #0c1714;
  --surface: #142420;
  --ink: #e8f3ef;
  --ink-2: #c3d7d0;
  --muted: #8fa9a1;
  --line: #25403a;
  --paid: #4fc98a;
  --pending: #e0b44a;
  --chat-ground: #0f1d19;
  --chat-in: #1c2f2a;
  --chat-out: #1f4a3d;
  --chat-time: #8fa9a1;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
}

a { color: var(--green-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--wa-green-dark); }
:focus-visible { outline: 3px solid var(--wa-green); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0; }
p + p { margin-top: 1em; }
strong { font-weight: 600; }
code, .cmd {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--green-soft);
  color: var(--green-text);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  white-space: nowrap;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.prose { max-width: 68ch; }
.prose h2 { margin-top: 2.2rem; margin-bottom: 0.7rem; }
.prose h3 { margin-top: 1.6rem; margin-bottom: 0.4rem; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0.6em 0; }
.prose li + li { margin-top: 0.35em; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 0.55em 0.7em; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.table-scroll { overflow-x: auto; }

.eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--green-text);
  margin-bottom: 0.8rem;
}
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; letter-spacing: -0.01em; }
.brand svg { width: 30px; height: 30px; display: block; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 0.95rem;
  padding: 8px 12px; border-radius: 999px;
}
.nav a:hover { background: var(--green-soft); color: var(--green-text); }
.nav a[aria-current="page"] { background: var(--green-soft); color: var(--green-text); font-weight: 600; }
.nav .btn { margin-left: 6px; }
.nav a.btn-primary { background: var(--wa-green); color: #fff; font-weight: 600; }
.nav a.btn-primary:hover { background: var(--wa-green-dark); color: #fff; }
.menu-toggle { display: none; }

@media (max-width: 720px) {
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface); color: var(--ink); cursor: pointer;
  }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 16px 16px;
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; border-radius: 10px; }
  .nav .btn { margin: 8px 0 0; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 0.98rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer; line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn-primary { background: var(--wa-green); color: #fff; }
.btn-primary:hover { background: var(--wa-green-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--green-text); border-color: var(--green-line); }
.btn-secondary:hover { background: var(--green-soft); color: var(--wa-green-dark); }
.btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6rem; }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: 2rem; }
.section-head p { margin-top: 0.7rem; color: var(--ink-2); }
.section.tint { background: var(--surface); }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 72px; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 1rem; }
.hero .lede { font-size: 1.2rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 1.6rem; padding: 0; list-style: none; font-size: 0.92rem; color: var(--muted); }
.hero-facts li::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--wa-green); margin-right: 8px; vertical-align: 2px; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- WhatsApp chat panel ---------- */
.phone {
  background: var(--chat-ground);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--line);
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}
.phone-top {
  display: flex; align-items: center; gap: 10px;
  background: var(--wa-green-dark); color: #fff; padding: 12px 14px;
}
.phone-top .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none;
}
.phone-top .avatar svg { width: 22px; height: 22px; }
.phone-top .name { font-weight: 600; font-size: 0.95rem; line-height: 1.2; }
.phone-top .sub { font-size: 0.72rem; opacity: 0.85; }
.phone-top .verified { margin-left: 4px; font-size: 0.7rem; background: rgba(255,255,255,0.18); padding: 1px 6px; border-radius: 999px; }
.chat { padding: 14px 12px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; }
.chat .day { align-self: center; font-size: 0.7rem; color: var(--chat-time); background: var(--surface); padding: 3px 10px; border-radius: 999px; margin-bottom: 4px; }
.msg { max-width: 86%; padding: 8px 11px 6px; border-radius: 10px; line-height: 1.45; color: var(--ink); position: relative; }
.msg.in { background: var(--chat-in); align-self: flex-start; border-top-left-radius: 3px; }
.msg.out { background: var(--chat-out); align-self: flex-end; border-top-right-radius: 3px; }
.msg .t { display: block; text-align: right; font-size: 0.66rem; color: var(--chat-time); margin-top: 4px; }
.msg .who { display: block; font-size: 0.72rem; font-weight: 700; color: var(--green-text); margin-bottom: 2px; }
.msg .wa-btn {
  display: block; margin: 8px -11px -6px; padding: 9px 0 8px; border-top: 1px solid var(--line);
  text-align: center; color: var(--green-text); font-weight: 600; font-size: 0.85rem;
}
.msg .wa-btn + .wa-btn { margin-top: 0; }
.msg .link { font-family: var(--mono); font-size: 0.74rem; word-break: break-all; color: var(--green-text); }
.chat .form {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; align-self: flex-start; max-width: 86%;
}
.chat .form .label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.chat .form dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 6px 0 0; font-size: 0.8rem; }
.chat .form dt { color: var(--muted); }
.chat .form dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.chat-caption { text-align: center; font-size: 0.8rem; color: var(--muted); margin-top: 12px; }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.card h3 { font-size: 1.05rem; }
.card p { color: var(--ink-2); font-size: 0.97rem; }
.card .icon {
  width: 40px; height: 40px; border-radius: 12px; background: var(--green-soft); color: var(--green-text);
  display: grid; place-items: center; margin-bottom: 6px;
}
.card .icon svg { width: 22px; height: 22px; }
.card.deep { background: var(--wa-green-dark); border-color: var(--wa-green-dark); color: #fff; }
.card.deep h3, .card.deep p { color: #fff; }
.card.deep .icon { background: rgba(255,255,255,0.14); color: #fff; }

/* ---------- Steps (a real sequence) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: step; }
.step {
  display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px;
}
.step .n {
  counter-increment: step;
  width: 44px; height: 44px; border-radius: 50%; background: var(--wa-green); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums;
}
.step .n::before { content: counter(step); }
.step h3 { margin-bottom: 4px; }
.step p { color: var(--ink-2); font-size: 0.97rem; }
.step .side { font-size: 0.82rem; color: var(--muted); margin-top: 6px; }

/* ---------- Ledger-style rows (echo of the real /ledger page) ---------- */
.ledger { display: grid; gap: 8px; }
.ledger .row {
  background: var(--surface); border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08); display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.ledger .paid { color: var(--paid); font-weight: 600; }
.ledger .pending { color: var(--pending); font-weight: 600; }
.ledger .amt { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; }

/* ---------- Notice / honesty panel ---------- */
.notice {
  border-left: 4px solid var(--wa-green); background: var(--green-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 16px 20px; color: var(--ink);
}
.notice strong { color: var(--green-text); }
.notice.warn { border-left-color: var(--pending); background: color-mix(in srgb, var(--pending) 12%, var(--surface)); }

/* ---------- Two-column feature ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------- Definition list (contact) ---------- */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; }
.dl dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; padding-top: 4px; }
.dl dd { margin: 0; }
@media (max-width: 520px) { .dl { grid-template-columns: 1fr; gap: 2px 0; } .dl dd { margin-bottom: 12px; } }

/* ---------- FAQ ---------- */
.faq details { border-top: 1px solid var(--line); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--green-text); font-weight: 700; flex: none; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 10px; color: var(--ink-2); max-width: 68ch; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--wa-green-dark); color: #fff; padding: 56px 0; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.85); }
.cta-band .btn-primary { background: #fff; color: var(--wa-green-dark); }
.cta-band .btn-primary:hover { background: var(--green-soft); color: var(--wa-green-dark); }
.cta-band .btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,0.45); }
.cta-band .btn-secondary:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: 0.9rem; color: var(--muted); background: var(--surface); }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--green-text); text-decoration: underline; }
.site-footer .legal { margin-top: 12px; font-size: 0.82rem; }
@media (max-width: 720px) { .site-footer .wrap { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- Document pages ---------- */
.doc-head { padding: 56px 0 28px; border-bottom: 1px solid var(--line); background: var(--surface); }
.doc-head .meta { margin-top: 0.8rem; color: var(--muted); font-size: 0.9rem; }
.doc-body { padding: 40px 0 72px; }
.doc-body .prose p, .doc-body .prose li { color: var(--ink-2); }
.doc-body .prose h2 { color: var(--ink); }

.placeholder { border: 1px dashed var(--pending); color: var(--pending); background: color-mix(in srgb, var(--pending) 8%, var(--surface)); padding: 2px 8px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; }
