/* PoolProof — one stylesheet for the landing page and the field app.
 *
 * The look is the printed day route: a ruled sheet of stops, condensed caps like the
 * lettering on a service van, and a stamp on every pool that got serviced. Water blue,
 * chlorine white, ink rules. Nothing decorative that a route sheet would not have.
 */

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/barlow-400.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/barlow-600.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/barlow-condensed-600.woff2") format("woff2");
}

:root {
  /* Deep end of a clean pool, not the house indigo. */
  --accent: #0b4f6c;
  --accent-ink: #07384e;
  --accent-soft: #d9ecf3;
  --ink: #08222c;
  --body: #2f4a55;
  --muted: #47646f;
  --bg: #eff6f8;                /* chlorine white */
  --card: #ffffff;
  --line: #cddfe6;              /* ruled sheet line */
  --rule: #9dc0cc;              /* heavier rule, table heads */
  --done: #14653c;
  --done-soft: #ddf0e3;
  --refused: #a5201a;
  --refused-soft: #fbe4e2;
  --hold: #3b5762;              /* waiting on signal — hatched, never amber */
  --hold-soft: #e3edf1;
  --slate: #e3edf0;
  --radius: 6px;
  --font-text: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-sheet: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 1px 2px rgba(8, 34, 44, .05), 0 10px 22px -18px rgba(8, 34, 44, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.55 var(--font-text);
  color: var(--body);
  background: var(--bg);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* Condensed caps, the way a route sheet is headed. */
h1, h2, h3, h4 { font-family: var(--font-sheet); font-weight: 600; color: var(--ink); letter-spacing: .005em; }
h1 { font-size: 1.9rem; line-height: 1.15; margin: .2rem 0 .6rem; }
h2 { font-size: 1.35rem; margin: 0 0 .5rem; }
h3 { font-size: 1.05rem; margin: 0 0 .4rem; letter-spacing: .01em; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow {
  font-family: var(--font-sheet);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .76rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 .35rem;
}
.error { color: var(--refused); }
.num, .amount, code { font-variant-numeric: tabular-nums; }
code { font-size: .9em; background: var(--accent-soft); color: var(--accent-ink); padding: .05em .3em; border-radius: 3px; }
.notice { border-radius: var(--radius); padding: .55rem .75rem; font-size: .9rem; border: 1px solid; }
.notice.hold { background: var(--hold-soft); border-color: var(--hold); color: var(--hold); }
.notice.done { background: var(--done-soft); border-color: var(--done); color: var(--done); }

/* header */
header.top {
  background: var(--card);
  border-bottom: 2px solid var(--ink);
  padding: .55rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
header.top .brand {
  font-family: var(--font-sheet);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
header.top .brand span { color: var(--accent); }
header.top nav { margin-left: auto; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
header.top nav a, header.top nav .small {
  font-family: var(--font-sheet);
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
}
header.top nav .small { color: var(--muted); }
header.top form { display: inline; margin: 0; }
header.top .btn { border-bottom-color: var(--accent-ink); }

/* sync / demo banner — the top of the sheet, so it reads like a printed status line */
.syncbar {
  font-family: var(--font-sheet);
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .4rem 1rem;
  text-align: center;
  background: var(--done-soft);
  color: var(--done);
  border-bottom: 1px solid var(--line);
}
.syncbar.offline, .syncbar.pending {
  color: var(--hold);
  background: var(--hold-soft);
  background-image: repeating-linear-gradient(135deg, rgba(59, 87, 98, .12) 0 2px, transparent 2px 8px);
}
.syncbar.demo { background: var(--accent-soft); color: var(--accent-ink); }

main { max-width: 880px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
}
.card.empty { text-align: center; padding: 2rem 1rem; border-style: dashed; }

/* buttons */
.btn {
  display: inline-block;
  border: 1px solid var(--accent-ink);
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: .5rem .85rem;
  font-family: var(--font-sheet);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-ink); color: #fff; }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 0; box-shadow: 0 0 0 4px var(--accent-ink); }
.btn.ghost { background: var(--card); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent-ink); }
.btn.small { padding: .25rem .55rem; font-size: .8rem; }
.btn:disabled { opacity: .55; cursor: default; }
.icon {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 4px;
  width: 30px; height: 30px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--accent-ink);
}
.icon:hover { background: var(--accent-soft); }

/* badges — printed tags on the sheet, not pills */
.badge {
  display: inline-block;
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: .08rem .38rem;
  font-family: var(--font-sheet);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge.green { color: var(--done); background: var(--done-soft); }
.badge.hold {
  color: var(--hold);
  background: var(--hold-soft);
  background-image: repeating-linear-gradient(135deg, rgba(59, 87, 98, .14) 0 2px, transparent 2px 7px);
}
.badge.red { color: var(--refused); background: var(--refused-soft); }
.badge.grey { color: var(--muted); background: var(--slate); border-style: dashed; }
.badge.blue { color: var(--accent-ink); background: var(--accent-soft); }

/* the stamp: a pool that got serviced, dated and initialled */
.stamp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .05rem;
  transform: rotate(-3.5deg);
  border: 2px solid currentColor;
  outline: 1px solid currentColor;
  outline-offset: 2px;
  border-radius: 3px;
  padding: .2rem .55rem;
  color: var(--accent);
  font-family: var(--font-sheet);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-weight: 600;
  font-size: .86rem;
  line-height: 1.05;
  white-space: nowrap;
}
.stamp small { font-size: .64rem; letter-spacing: .15em; opacity: .85; }
.stamp.mini { font-size: .72rem; padding: .1rem .35rem; letter-spacing: .1em; }

/* route sheet: ruled rows, numbered, with the status in the right column */
ol.stops { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sheet { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .45rem .85rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-sheet);
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .83rem;
  font-weight: 600;
}
.sheet-meta { color: #cbe4ee; font-size: .74rem; letter-spacing: .08em; }
.sheet-row {
  display: grid;
  grid-template-columns: 1.9rem 1fr auto;
  gap: .7rem;
  align-items: center;
  padding: .6rem .85rem;
  border-top: 1px solid var(--line);
}
.sheet-main { min-width: 0; }
.sheet-side { display: flex; justify-content: flex-end; }
.sheet-foot {
  padding: .4rem .85rem;
  border-top: 2px solid var(--rule);
  background: #f7fbfc;
  font-family: var(--font-sheet);
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: .76rem;
  color: var(--muted);
}
.stop {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  padding: .7rem .9rem;
  border-top: 1px solid var(--line);
}
ol.stops > .stop:first-child { border-top: none; }
.stop .seq {
  min-width: 1.9rem; height: 1.6rem;
  padding: 0 .25rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg);
  color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sheet); font-weight: 600; font-size: .95rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}
.stopmain { flex: 1 1 auto; min-width: 0; }
.stopname { font-weight: 600; color: var(--ink); }
.historylink { margin-left: .5rem; }
.stopside { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; }
.reorder { display: flex; gap: .3rem; }
.stop.done .seq { background: var(--done-soft); border-color: var(--done); color: var(--done); }
.stop.skipped { color: var(--muted); }
.stop.skipped .seq { background: var(--slate); border-color: var(--muted); border-style: dashed; color: var(--muted); }
.stop.skipped .stopname { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

/* forms */
.grid { display: grid; gap: .7rem; }
.grid.two { grid-template-columns: 1fr 1fr; }
.readings-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.field {
  display: flex; flex-direction: column; gap: .25rem;
  font-family: var(--font-sheet); text-transform: uppercase; letter-spacing: .08em;
  font-size: .78rem; font-weight: 600; color: var(--muted);
}
.field input, .field select, .field textarea, select, input.share {
  font: 1rem/1.4 var(--font-text);
  color: var(--ink);
  padding: .45rem .55rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  width: 100%;
  letter-spacing: normal;
  text-transform: none;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
input.share { font-size: .85rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }

/* tables — the ruled columns of a route sheet */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .35rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.readings { table-layout: fixed; }
table.readings th {
  width: 55%;
  color: var(--muted);
  font-family: var(--font-sheet); font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; font-size: .8rem;
}
table.readings td { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
table.synclog th {
  color: var(--ink); font-family: var(--font-sheet);
  text-transform: uppercase; letter-spacing: .08em;
  font-size: .78rem; border-bottom: 2px solid var(--rule);
}
table.synclog td { font-size: .88rem; }
tr.bad td { background: var(--refused-soft); }
.readings { color: var(--ink); font-variant-numeric: tabular-nums; }

/* timeline */
.timeline-item { border-left: 3px solid var(--rule); }

/* landing */
.hero {
  background: linear-gradient(180deg, #e2f0f6 0%, var(--bg) 78%);
  border-bottom: 1px solid var(--line);
}
.hero .inner {
  max-width: 1060px; margin: 0 auto; padding: 2.6rem 1.25rem 2.2rem;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 2rem; align-items: start;
}
.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3rem);
  text-transform: uppercase;
  letter-spacing: .015em;
  line-height: 1.02;
  max-width: 20ch;
  margin: .3rem 0 .7rem;
}
.hero p.lede { font-size: 1.08rem; color: var(--body); max-width: 46ch; }
.cta { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-top: 1.1rem; }
.pillrow { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0 0; padding: 0; list-style: none; }
.pillrow li {
  background: var(--card); border: 1px solid var(--rule); border-radius: 3px;
  padding: .2rem .5rem; font-size: .8rem; color: var(--body);
  font-family: var(--font-sheet); text-transform: uppercase; letter-spacing: .06em;
}
section.band { padding: 2.4rem 1.25rem; }
section.band .inner { max-width: 1060px; margin: 0 auto; }
section.band.rule-top { border-top: 1px solid var(--line); background: var(--card); }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.shots figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.shots img { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--line); }
.shots figcaption { padding: .55rem .75rem; font-size: .88rem; color: var(--body); }
.pricegrid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.25rem; align-items: start; }
.pricecard { background: var(--card); border: 2px solid var(--accent); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.pricecard .amount {
  font-family: var(--font-sheet); font-weight: 600;
  font-size: 3rem; letter-spacing: .01em; line-height: 1; color: var(--ink);
  margin: .2rem 0 .3rem;
}
.pricecard .amount small { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: .06em; }
.pricecard ul { padding-left: 1.1rem; color: var(--body); }
.legend { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; margin-top: 1rem; padding-top: .8rem; border-top: 2px solid var(--rule); }
.legend div { display: flex; align-items: baseline; gap: .45rem; font-size: .85rem; color: var(--body); }
footer.site { background: var(--ink); color: #c9dde4; padding: 1.5rem 1.25rem; }
footer.site .inner { max-width: 1060px; margin: 0 auto; display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: space-between; }
footer.site strong { font-family: var(--font-sheet); text-transform: uppercase; letter-spacing: .1em; color: #fff; }
footer.site a { color: #dfeef3; }
.legal main { max-width: 760px; }
.legal h2 { margin-top: 1.2rem; }

@media (max-width: 860px) {
  .hero .inner { grid-template-columns: 1fr; gap: 1.4rem; }
  .hero h1 { max-width: none; }
}
@media (max-width: 640px) {
  .grid.two { grid-template-columns: 1fr; }
  .pricegrid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  header.top nav { gap: .7rem; }
  .stop { flex-wrap: wrap; }
  .stopside { flex-direction: row; align-items: center; }
  main { padding: 1rem .8rem 3rem; }
  table.readings th { width: 50%; }
}
