/* Customer job page — white-label. Calm, light, generous; the client's brand
   colour drives the accents via --brand-*. No Builds by Leo styling: this is
   the homeowner's window into their own job, in their builder's colours. */

:root {
  --brand-primary: #3D5A73;
  --brand-on-primary: #FFFFFF;
  --brand-bg: #F7F8FA;
  --brand-surface: #FFFFFF;
  --brand-text: #21262B;
  --brand-muted: #5C6670;
  --brand-line: #E4E8EC;
  --brand-radius: 12px;
  --ok: #1F8A4C;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--brand-bg);
  color: var(--brand-text);
  font: 400 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  padding-bottom: 96px; /* room for the sticky call bar */
}
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--brand-primary); outline-offset: 2px; }

#app { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.loading, .noscript { text-align: center; color: var(--brand-muted); padding: 48px 16px; }

/* Header */
.biz {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 0 14px; border-bottom: 1px solid var(--brand-line);
}
.biz-name { font-weight: 700; font-size: 1.05rem; }
.biz-phone {
  color: var(--brand-primary); font-weight: 700; text-decoration: none;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.job-head { padding: 22px 0 6px; }
.job-title { margin: 0 0 4px; font-size: 1.6rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
.job-address { margin: 0 0 10px; color: var(--brand-muted); }
.job-dates { margin: 0; color: var(--brand-text); font-size: 0.98rem; }
.job-dates strong { font-weight: 700; }

.banner-done {
  margin: 14px 0 0; padding: 12px 16px; border-radius: var(--brand-radius);
  background: #E8F5EE; color: #14532D; font-weight: 600;
}

/* Progress */
.progress { margin: 22px 0 8px; }
.progress-track { display: flex; gap: 4px; }
.progress-seg { flex: 1; height: 10px; border-radius: 5px; background: var(--brand-line); }
.progress-seg.done { background: var(--brand-primary); }
.progress-seg.current { background: var(--brand-primary); opacity: 0.45; }
.progress-caption { margin: 10px 0 0; font-size: 0.95rem; color: var(--brand-muted); }
.progress-caption strong { color: var(--brand-text); }

.stage-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.stage-item { display: flex; align-items: center; gap: 10px; font-size: 0.98rem; color: var(--brand-muted); }
.stage-item .tick {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  border: 2px solid var(--brand-line); color: transparent; font-size: 13px; font-weight: 700;
}
.stage-item.done { color: var(--brand-text); }
.stage-item.done .tick { background: var(--brand-primary); border-color: var(--brand-primary); color: var(--brand-on-primary); }
.stage-item.current { color: var(--brand-text); font-weight: 700; }
.stage-item.current .tick { border-color: var(--brand-primary); color: var(--brand-primary); }

/* Timeline */
.timeline-title { margin: 30px 0 12px; font-size: 1.15rem; font-weight: 800; }
.updates { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.update {
  background: var(--brand-surface); border: 1px solid var(--brand-line);
  border-radius: var(--brand-radius); overflow: hidden;
}
.update-photo-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.update-photo-btn img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.update-body { padding: 14px 16px 14px; }
.update-meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.update-stage {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand-primary); background: color-mix(in srgb, var(--brand-primary) 10%, white);
  padding: 3px 8px; border-radius: 4px;
}
.update-date { color: var(--brand-muted); font-size: 0.85rem; }
.update-text { margin: 0; white-space: pre-wrap; }
.no-updates { color: var(--brand-muted); background: var(--brand-surface); border: 1px dashed var(--brand-line); border-radius: var(--brand-radius); padding: 20px; text-align: center; }

/* Sticky call bar */
.call-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--brand-surface); border-top: 1px solid var(--brand-line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.call-btn {
  display: block; max-width: 640px; margin: 0 auto;
  background: var(--brand-primary); color: var(--brand-on-primary);
  text-align: center; text-decoration: none;
  font-size: 1.1rem; font-weight: 700;
  padding: 16px; border-radius: var(--brand-radius);
}

/* Error state */
.page-error { text-align: center; padding: 64px 16px; }
.page-error h1 { font-size: 1.4rem; margin: 0 0 8px; }
.page-error p { color: var(--brand-muted); margin: 0; }

/* Footer credit (config flag in customer.js) */
.credit { text-align: center; color: var(--brand-muted); font-size: 0.8rem; padding: 28px 0 8px; }

/* Lightbox */
#lightbox { border: 0; padding: 0; background: rgba(10, 12, 14, 0.96); max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
#lightbox::backdrop { background: rgba(10, 12, 14, 0.96); }
#lightbox img { width: 100vw; height: 100vh; object-fit: contain; touch-action: pan-y; }
.lb-close, .lb-nav {
  position: fixed; z-index: 2; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.12); color: #fff;
  width: 48px; height: 48px; border-radius: 50%;
  font-size: 26px; line-height: 1; display: grid; place-items: center;
}
.lb-close { top: 14px; right: 14px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
