/* Caliper -- the website's own pages: the shop front, signing in, the
   account, the terms, and JT's desk.

   NOT THE CHECKER. The checker is a separate program with its own
   stylesheet, built from checker/src/app/styles.css: a light "price book"
   look, because its reports get printed and read at a desk (DECISIONS.md).
   These pages are the other face -- the one a stranger meets -- and follow
   the JTS family: dark ground, the hub's type and pills from shopfront.css,
   and one accent, the canary yellow a pricing person reaches for when they
   mark a line in a price book.

   Everything the shop-front kit already styles (buttons, panels, headings,
   the family strip) is left to it; this file holds the base and Caliper's
   own pieces, prefixed cp-. */

:root {
  --bg:        #0f1216;
  --surface:   #171b21;
  --surface-2: #1e242c;
  --line:      #2b323c;
  --ink:       #e9eef5;
  --dim:       #9aa6b6;
  --accent:    #f6e27f;           /* canary: the highlighter */
  --on-accent: #14181d;
  --pencil:    #ef7a6f;           /* the red pencil, lifted to read on dark */
  --good:      #6fd08f;
  --warn:      #e2a13c;
  --bad:       #e8615f;
  --steel:     #2f4858;           /* Caliper's card on the hub */
  --r:         12px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0 22px 90px;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.top {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
  width: fit-content;
}
.jts-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-weight: 700; }
.say-btn {
  margin-left: auto;
  color: var(--dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 12px;
}
/* The header's link out to the hub. Defined here as well as in
   shopfront.css so the pages that are NOT the shop front -- the desk --
   still lay their header out properly (unsized, its hexagon fills the page). */
.sf-nav { margin-left: auto; display: flex; align-items: center; gap: 8px;
          flex-wrap: wrap; justify-content: flex-end; }
.sf-nav a { color: var(--dim); text-decoration: none; font-size: 14px; }
.sf-nav .sf-tools { display: inline-flex; align-items: center; gap: 7px; }
.sf-nav .sf-tools svg { width: 16px; height: 16px; }
.cog {
  margin-left: 6px;
  text-decoration: none;
  font-size: 19px;
  color: var(--dim);
  padding: 2px 6px;
}
.cog:hover { color: var(--ink); }

main { max-width: 1180px; margin: 0 auto; }

h1, h2, h3 { line-height: 1.15; text-wrap: balance; }
.lead { font-size: 17px; max-width: 62ch; }
.tiny { font-size: 12.5px; }
.dim { color: var(--dim); }
.num, .n { font-variant-numeric: tabular-nums; }
.n { text-align: right; white-space: nowrap; }

.pagehead { margin: 26px 0 10px; }
.pagehead h1 { margin: 0 0 4px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 22px;
  margin: 18px 0;
}
.card h2 { margin: 0 0 10px; font-size: 20px; }
.card h3 { margin: 18px 0 4px; font-size: 16px; }

/* ---- forms --------------------------------------------------------------- */
.fld { display: flex; flex-direction: column; gap: 5px; margin: 0 0 14px; }
.fld-label { font-weight: 600; font-size: 14px; }
.fld-label i { font-style: normal; color: var(--dim); font-weight: 400; }
.fld-in { display: flex; }
.fld-note { color: var(--dim); font-size: 13.5px; margin: 4px 0 14px; max-width: 62ch; }
.fld-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 0 16px; }

input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input:not([type]), select, textarea {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  font: inherit;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .go {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  border-radius: 9px;
  padding: 10px 18px;
  font: 600 15px/1.2 inherit;
  text-decoration: none;
  cursor: pointer;
}
button.quiet {
  background: none;
  color: var(--dim);
  border: 1px solid var(--line);
}
.linkish { color: var(--dim); text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--ink); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* A robot trap: people never see it, so only a robot fills it in. */
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- messages ------------------------------------------------------------ */
.warn {
  border-left: 4px solid var(--warn);
  background: rgba(226, 161, 60, .1);
  padding: 10px 14px;
  border-radius: 6px;
  margin: 0 0 14px;
}
.warn.bad { border-color: var(--bad); background: rgba(232, 97, 95, .1); }
.warn.good { border-color: var(--good); background: rgba(111, 208, 143, .1); }
.notice {
  max-width: 1180px;
  margin: 8px auto;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 14px;
}
.notice.warn-line { border-color: var(--warn); }

/* ---- tables -------------------------------------------------------------- */
.scroll { overflow-x: auto; }
.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 600; }

/* ---- Caliper's own pieces on the shop front ------------------------------ */
mark.hl {
  background: var(--accent);
  color: var(--on-accent);
  padding: 0 .16em;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.pencil { color: var(--pencil); }
.cp-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 16px 0 6px;
  color: var(--dim);
  font-size: 14px;
}
.cp-kicker b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* The worked example: the headline, then the rows it came from. */
.cp-example { display: grid; gap: 18px; }
.cp-headline {
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.02em;
  max-width: 24ch;
  margin: 0;
}
.cp-rows td .desc { display: block; font-weight: 600; }
.cp-rows td .who { display: block; color: var(--dim); font-size: 13px; }
.cp-rows .same { color: var(--pencil); font-weight: 600; }
.cp-rows .lost { color: var(--pencil); font-weight: 700; }
.cp-tally {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 12px;
}
.cp-tally div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
}
.cp-tally b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.cp-tally span { color: var(--dim); font-size: 13.5px; }

/* The four findings. */
.cp-finds { counter-reset: none; }
.cp-find h3 { margin: 0 0 6px; font-size: 19px; }
.cp-find p { margin: 0; }
.cp-find .tag {
  display: inline-block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 9px;
  margin: 0 0 10px;
  font-weight: 700;
}

/* How the free check works: a real sequence, so it is numbered. */
.cp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px;
            grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.cp-steps li {
  position: relative;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 44px 18px 18px;
  background: var(--surface);
}
.cp-steps li::before {
  content: counter(list-item);
  position: absolute;
  top: 12px;
  left: 18px;
  font-weight: 800;
  font-size: 20px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.cp-steps h3 { margin: 0 0 6px; font-size: 17px; }
.cp-steps p { margin: 0; color: var(--dim); }

.cp-points { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.cp-points div { border-top: 2px solid var(--steel); padding-top: 12px; }
.cp-points b { display: block; margin: 0 0 4px; }
.cp-points p { margin: 0; color: var(--dim); }

.cp-price { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.cp-price .amount { font-size: clamp(34px, 4.4vw, 52px); font-weight: 800; letter-spacing: -.02em; line-height: 1; margin: 0; }
.cp-price .amount small { font-size: 16px; font-weight: 600; color: var(--dim); letter-spacing: 0; }
.cp-price ul { margin: 12px 0 0; padding-left: 18px; }
.cp-price li { margin: 0 0 6px; }
.cp-rule { border-left: 4px solid var(--accent); padding: 10px 14px; background: var(--surface-2); border-radius: 6px; }

.cp-book { max-width: 820px; }
.cp-contact { font-size: 15px; }
.cp-contact a { font-weight: 600; }

/* ---- footer -------------------------------------------------------------- */
.foot { max-width: 1180px; margin: 60px auto 0; padding-top: 18px; border-top: 1px solid var(--line); }
.foot a { color: var(--dim); }

/* ---- JT's desk ----------------------------------------------------------- */
.desk section { margin: 26px 0; }
.desk .tbl td form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.desk .tbl select, .desk .tbl input[type=text] { width: auto; padding: 5px 8px; font-size: 13px; }
.desk .tbl button { padding: 5px 10px; font-size: 13px; }
.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill.new { border-color: var(--accent); color: var(--accent); }
.pill.paying, .pill.comped { border-color: var(--good); color: var(--good); }
.pill.lapsed, .pill.stopped, .pill.no { border-color: var(--bad); color: var(--bad); }
.made-link { word-break: break-all; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

@media (max-width: 640px) {
  body { padding: 0 14px 70px; }
  .tbl th, .tbl td { padding: 7px 6px; }
}
