/* AClickFlow proposals. Calm and readable: off-white paper with a faint grid, near-black
   type, and the AClickFlow orange used only for numbers, labels and the main button.
   (The loud orange poster look stays on aclickflow.com; a proposal is for reading.) */

:root {
  --orange: #ff4f1f;          /* the brand orange, keep exact */
  --orange-text: #d63a0f;     /* darker orange for small text, so it stays readable on paper */
  --ink: #120d0a;
  --paper: #f7f6f1;
  --card: #fbfaf6;
  --muted: rgba(18, 13, 10, 0.68);
  --line: rgba(18, 13, 10, 0.12);
  --display: 'Archivo Black', 'Arial Black', Impact, sans-serif;
  --body: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--paper);
  /* faint 48px grid, like graph paper */
  background-image:
    linear-gradient(rgba(18, 13, 10, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 13, 10, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
[hidden] { display: none !important; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 40px; } }

.mono, .label, .num, .days { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- Logo: "ACLICK" with "FLOW" in orange, like a stamp ---------- */
.logo { font-family: var(--display); font-size: 1rem; letter-spacing: 0.01em; color: var(--ink); }
.logo em { font-style: normal; color: var(--orange); }
.logo--box { display: inline-block; background: var(--ink); color: #fff; padding: 8px 14px; font-size: 1.375rem; }

/* ---------- Top bar (hidden in print and PDF) ---------- */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; background: rgba(247, 246, 241, 0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar a { text-decoration: none; }
.bar__cta { font-weight: 700; font-size: 0.9375rem; color: var(--orange-text); white-space: nowrap; }
@media (min-width: 720px) { .bar { padding: 14px 40px; } }

/* ---------- Sections ---------- */
section { padding: 72px 0; border-top: 1px solid var(--line); }
@media (min-width: 720px) { section { padding: 104px 0; } }

.cover { border-top: 0; min-height: calc(100svh - 56px); display: flex; align-items: center; text-align: center; }
.cover .wrap { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.cover h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); line-height: 1.02; letter-spacing: -0.035em; max-width: 14ch; }
.cover__desc { font-size: clamp(1.0625rem, 2.4vw, 1.3125rem); max-width: 36em; color: var(--muted); }
.cover__for { margin-top: 24px; }

.letter__body { border-left: 3px solid var(--orange); padding-left: 20px; max-width: 36em; display: grid; gap: 1em; font-size: 1.125rem; }

.label { color: var(--muted); margin-bottom: 14px; }
.label b { color: var(--orange-text); font-weight: 500; }
h2 { font-size: clamp(2rem, 5.4vw, 3rem); line-height: 1.05; letter-spacing: -0.03em; max-width: 20ch; }
.intro { margin-top: 18px; max-width: 38em; color: var(--muted); font-size: 1.125rem; }
section > .wrap > [data-keep]:first-child { margin-bottom: 36px; }

/* Problem / solution cards */
.grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid { grid-template-columns: 1fr 1fr; gap: 20px; } }
.card { background: var(--card); border: 1px solid var(--line); padding: 28px 26px; display: grid; gap: 8px; align-content: start; }
.card h3 { font-size: 1.25rem; line-height: 1.2; }
.card p:last-child { color: var(--muted); }
.card .num { color: var(--orange-text); }
.card--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.card--dark p:last-child { color: rgba(255, 255, 255, 0.74); }
.card--dark .num { color: var(--orange); }

/* Scope and timeline rows */
.rows, .terms { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 2.5rem 1fr; gap: 4px 12px; padding: 20px 0; border-top: 1px solid var(--line); }
.rows li:last-child { border-bottom: 1px solid var(--line); }
.rows .num { color: var(--orange-text); padding-top: 5px; }
.rows h3 { font-size: 1.125rem; line-height: 1.3; }
.rows p { color: var(--muted); margin-top: 4px; }
.rows--time .days { grid-column: 2; justify-self: start; margin-top: 8px; border: 1px solid var(--line); background: var(--card); padding: 4px 10px; }
@media (min-width: 720px) {
  .rows--time li { grid-template-columns: 2.5rem 1fr auto; }
  .rows--time .days { grid-column: 3; grid-row: 1; margin-top: 0; align-self: start; }
}

/* Price */
.price { background: var(--card); border: 1px solid var(--line); }
.price__row { display: flex; justify-content: space-between; gap: 16px; padding: 18px 24px; border-top: 1px solid var(--line); }
.price__row:first-child { border-top: 0; font-weight: 700; }
.price__row span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.price__row--sub { color: var(--muted); }
.price__row--total { background: var(--ink); color: #fff; font-weight: 700; font-size: 1.375rem; padding: 22px 24px; }

/* Terms */
.terms { display: grid; gap: 22px; }
.terms h3 { font-size: 1rem; display: flex; gap: 10px; align-items: baseline; }
.terms .num { color: var(--orange-text); }
.terms p { color: var(--muted); font-size: 0.9375rem; margin-top: 4px; max-width: 44em; }

/* ---------- Acceptance and signatures ---------- */
.sign-grid { display: grid; gap: 28px; }
@media (min-width: 720px) { .sign-grid { grid-template-columns: 1fr 1fr; gap: 40px; } }
.party { display: grid; gap: 10px; align-content: start; }
.party > .mono { color: var(--muted); }
.party__name { font-weight: 700; }
.party__date { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.sig {
  display: grid; place-items: center; width: 100%; height: 132px; padding: 10px;
  background: var(--card); border: 1.5px dashed rgba(18, 13, 10, 0.32);
  font: 500 1rem var(--body); color: var(--orange-text); cursor: pointer;
}
.sig img { max-height: 112px; max-width: 100%; width: auto; height: auto; }
.sig--done { padding: 4px; }
.sig--done img { max-height: 124px; }
.sig--done, .sig:not([data-empty]) { border-style: solid; border-color: var(--line); cursor: default; }
.sig:not([data-empty]):not(.sig--done) { cursor: pointer; }
.date-box { font: 500 1rem var(--body); color: var(--orange-text); background: none; border: 0; border-bottom: 1.5px dashed currentColor; padding: 2px 0; cursor: pointer; }
.date-box:not([data-empty]) { color: var(--ink); border-bottom-color: transparent; }

.confirm, .done { margin-top: 40px; display: grid; gap: 12px; justify-items: start; }
.hint { color: var(--muted); font-size: 0.9375rem; }
.done__tick { font-family: var(--mono); color: var(--orange-text); text-transform: uppercase; letter-spacing: 0.06em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 0 28px; border: 0; border-radius: 0;
  background: var(--orange); color: var(--ink); font: 700 1.0625rem var(--body);
  text-decoration: none; cursor: pointer;
}
.btn:hover:not(:disabled) { background: #ff6a40; }
.btn:disabled { background: rgba(18, 13, 10, 0.12); color: rgba(18, 13, 10, 0.45); cursor: not-allowed; }
.btn--small { min-height: 44px; padding: 0 18px; font-size: 0.9375rem; }
@media (max-width: 719px) { .confirm .btn, .done .btn { width: 100%; } }
.link { background: none; border: 0; padding: 8px 4px; font: 500 0.9375rem var(--body); color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.foot { padding: 32px 0 48px; color: var(--muted); font-size: 0.9375rem; border-top: 1px solid var(--line); }

/* ---------- Signature pad (pop-up) ---------- */
.pad { width: min(560px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.pad::backdrop { background: rgba(18, 13, 10, 0.55); }
.pad canvas { display: block; width: 100%; height: 200px; margin: 14px 0; background: #fff; border: 1px solid var(--line); touch-action: none; cursor: crosshair; }
.pad__actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.pad__actions .link:first-child { margin-right: auto; }

/* ---------- "Signing..." screen ---------- */
.process { position: fixed; inset: 0; z-index: 20; background: var(--paper); display: grid; place-items: center; padding: 16px; }
.process[hidden] { display: none; }
.process__inner { width: min(520px, 100%); display: grid; gap: 24px; }
.process__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-family: var(--mono); font-size: 0.875rem; }
.process__steps li::before { content: '> '; color: var(--orange-text); }
.process__steps li.is-done::after { content: '  ✓'; color: var(--orange-text); }
.process__next { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 22px; }
.process__next[hidden] { display: none; }
.process__next .mono { color: var(--orange-text); }
.process__big { font-size: 1.75rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }

/* ---------- Confirmation and home pages ---------- */
.confirmed { min-height: 100svh; display: flex; align-items: center; padding: 48px 0; }
.confirmed .wrap { display: grid; gap: 20px; justify-items: start; }
.confirmed h1 { font-size: clamp(2.25rem, 7vw, 3.75rem); line-height: 1.04; letter-spacing: -0.035em; max-width: 16ch; }
.confirmed .intro { margin-top: 0; }
.sign-off { font-weight: 700; }

/* ---------- PDF capture: the cloned page used for the PDF hides the buttons ---------- */
.pdf [data-ui] { display: none !important; }
.pdf body { background-image: none; }
.pdf .cover { min-height: 1560px; }
/* html2canvas draws text a few pixels lower than the browser does; extra space keeps lines apart */
.pdf .cover .wrap { gap: 30px; }
.pdf .intro { margin-top: 28px; }
.pdf section > .wrap > [data-keep]:first-child { margin-bottom: 48px; }
.pdf .card { gap: 12px; }
.pdf section:not(.cover) { padding: 56px 0; }

/* ---------- Print (if someone uses Ctrl/Cmd+P) ---------- */
@media print {
  [data-ui], .bar { display: none !important; }
  body { background: #fff; }
  section { padding: 40px 0; break-inside: auto; }
  [data-keep] { break-inside: avoid; }
  .cover { min-height: 90vh; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
