/* Water Services Inc. design system (shared with sds.water-services.us).
   Same file in vendors, treatment and wastewater: static/style.css */
:root {
  --navy: #0047ab;
  --navy-2: #0066cc;
  --teal: #00a0e3;
  --teal-dark: #0077c8;
  --gold: #c9a227;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #d5dde6;
  --paper: #f4f8fb;
  --white: #ffffff;
  --ok: #166534;
  --ok-bg: #dcfce7;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --off: #475569;
  --off-bg: #e2e8f0;
  --shadow: 0 10px 30px rgba(0, 71, 171, 0.08);
  --radius: 14px;
  font-family: "Source Sans 3", "Segoe UI", Calibri, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); }
body { min-height: 100vh; }
a { color: var(--navy); }

/* ---------- Header (identical to SDS) ---------- */
.topbar {
  background: #ffffff;
  color: var(--navy);
  padding: 14px 28px 12px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 18px rgba(0,71,171,.10);
  border-bottom: 4px solid var(--teal);
}
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.brand { display: flex; gap: 16px; align-items: center; }
.brand-logo {
  height: 64px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  display: block;
  background: #fff;
}
.brand h1 { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.brand p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.top-shop { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.top-shop-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 720px) {
  .top-shop { order: 3; flex-basis: 100%; }
}

/* ---------- Buttons (identical to SDS) ---------- */
a.btn-ghost, button, .btn {
  appearance: none; border: 0; cursor: pointer;
  border-radius: 10px; padding: 10px 14px;
  font: inherit; font-weight: 650; font-size: .92rem;
  text-decoration: none; display: inline-block;
}
.btn-ghost { background: #e8f4fc; color: var(--navy); border: 1px solid #b9d8f0; }
.btn-ghost:hover { background: #d5ecfa; }
.btn-navy { background: var(--navy); color: white; }
.btn-navy:hover { filter: brightness(1.08); }
.btn-teal { background: var(--teal); color: white; }
.btn-outline { background: white; color: var(--navy); border: 1px solid var(--line); }
/* App buttons without an SDS class: submit = navy, .btn.secondary = outline */
button[type="submit"]:not([class]) { background: var(--navy); color: white; }
button[type="submit"]:not([class]):hover { filter: brightness(1.08); }
.btn.secondary, button.secondary { background: white; color: var(--navy); border: 1px solid var(--line); }

/* ---------- Layout ---------- */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 22px 18px 60px;
}
.hero {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 18px;
  margin-bottom: 18px;
}
.hero h2 { margin: 0 0 8px; color: var(--navy); font-size: 1.45rem; }
.hero p { margin: 0; color: var(--muted); line-height: 1.45; }
.hero p + p { margin-top: 8px; }

/* ---------- Cards (SDS: navy title bar + body) ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 16px;
  padding: 16px 18px 18px;
}
.card > h2, .card > h3:first-child {
  margin: -16px -18px 16px;
  padding: 14px 18px;
  background: var(--navy);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.card > p:first-child { margin-top: 0; }
.card > p:last-child { margin-bottom: 0; }
.card-body { padding: 16px 18px 18px; }
.card p, .card li { line-height: 1.45; }

/* ---------- Forms (SDS inputs and labels) ---------- */
label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
input[type="text"], input[type="email"], input[type="search"], input[type="url"],
input[type="tel"], input[type="number"], input:not([type]), select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  font-size: 1rem;
  letter-spacing: normal;
  text-transform: none;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
}
input[type="file"] {
  width: 100%; padding: 9px 10px; border: 1px dashed var(--line); border-radius: 9px;
  background: #fff; font: inherit; font-size: .92rem; text-transform: none; letter-spacing: normal; font-weight: 400; color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid #93c5fd;
  border-color: var(--navy-2);
}
textarea { min-height: 72px; resize: vertical; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.muted { color: var(--muted); font-size: .9rem; }

/* Grids: SDS .form-grid, plus the designers' .grid.two and .params */
.form-grid, .grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.grid { display: grid; gap: 12px 14px; }
.grid.three { grid-template-columns: 1fr 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.params { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 12px; }
/* Lab-value labels carry units (mg/L, ng/L), so keep their case */
.params label { text-transform: none; letter-spacing: 0; font-size: .82rem; }
/* Vendors: inputs nested inside their label */
label > input, label > textarea, label > select { margin-top: 5px; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 900px) {
  .params, .grid.three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .form-grid, .grid.two, .grid.three, .params { grid-template-columns: 1fr; }
  .brand-logo { height: 52px; }
}

/* ---------- Messages (SDS .msg / .empty) ---------- */
.flash, .msg.show {
  display: block;
  background: var(--warn-bg);
  border: 1px solid #ead38a;
  color: #5b4308;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 12px;
  font-size: .92rem;
}
.flashes { list-style: none; margin: 0 0 12px; padding: 0; }
.flashes li { border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: .92rem; background: var(--off-bg); color: var(--off); }
.flashes li.ok, .flashes li.success { background: var(--ok-bg); color: var(--ok); }
.flashes li.err, .flashes li.error, .flashes li.danger { background: #fee2e2; color: #991b1b; }
.flashes li.warning { background: var(--warn-bg); color: var(--warn); }
.err { color: #991b1b; }
.ok { color: var(--ok); }

/* ---------- Tables and badges ---------- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid #e8edf3; vertical-align: top; }
th { font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-ok, .badge.pass { background: var(--ok-bg); color: var(--ok); }
.badge-pend, .badge.exceed { background: var(--warn-bg); color: var(--warn); }

/* Designer report: treatment-train units */
.train { counter-reset: step; }
.unit { border-left: 3px solid var(--teal); padding: 8px 0 8px 14px; margin: 12px 0; }
.unit h3 { margin: 0 0 4px; font-size: 1rem; color: var(--navy); }
.unit p { margin: 4px 0; }

/* ---------- Footer (SDS .foot) ---------- */
.foot, .footer {
  margin-top: 28px;
  text-align: center;
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.5;
}
.foot a, .footer a { color: var(--navy); }
.foot .fine, .footer .fine { display: block; margin-top: 6px; font-size: .78rem; }

/* Honeypot: visually and assistively hidden */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
