/* Rebuilt from the E2-S1/E2-S2 design handoff (design/design-handoff/).
   Every colour, font family and radius is a --pk-* custom property set by
   app.js from config.json — this file contains structure and type scale
   only, no brand values, no hex. Until config loads the page is a blank
   skeleton, so the var() fallbacks below are keywords, not colours.

   Brand rules encoded here:
   - brand primary is a FILL: it only ever appears as background/border,
     with ink text on top (--pk-text-primary), never as a text colour;
   - hard offset shadows (0 2px 0 ink) + 2px ink borders — decal feel;
   - Barlow Condensed (via --pk-font-display) for headings + prices only;
   - every control ≥44px tall, 3px ink focus ring with 2px offset. */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Sections get display:flex below, which would defeat the hidden attribute
   the step navigation relies on — keep [hidden] authoritative. */
[hidden] {
  display: none !important;
}

:root {
  --shadow-raise: 0 2px 0 var(--pk-brand-ink);
  --shadow-press: 0 1px 0 var(--pk-brand-ink);
  --shadow-pop: 0 3px 0 var(--pk-brand-ink);
}

body {
  font-family: var(--pk-font-body, system-ui, sans-serif);
  font-size: 17px;
  line-height: 1.5;
  background: var(--pk-surface-page);
  color: var(--pk-text-primary);
  min-height: 100vh;
}

:is(button, input, textarea) {
  font-family: inherit;
}

:is(a, button, input, textarea):focus-visible {
  outline: 3px solid var(--pk-border-strong, currentColor);
  outline-offset: 2px;
}

/* Step headings receive programmatic focus for screen readers only —
   no visible ring on non-interactive elements. */
h1:focus {
  outline: none;
}

/* ---- page frame: single column, rail appears ≥860px ---- */

.page {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.rail {
  display: none;
}

.flow {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 860px) {
  .rail {
    display: flex;
    width: 280px;
    flex: none;
    flex-direction: column;
    gap: 24px;
    padding-top: 8px;
    position: sticky;
    top: 24px;
  }
  /* .flow prefix so this outranks the base .mob-head display below */
  .flow .mob-head {
    display: none;
  }
}

/* ---- logo decal: yellow sticker, ink border, hard shadow ---- */

.decal {
  align-self: flex-start;
  background: var(--pk-brand-primary);
  border: 2px solid var(--pk-border-strong);
  box-shadow: var(--shadow-pop);
  border-radius: var(--pk-radius-control);
  padding: 8px 14px;
  font: 700 26px/1 var(--pk-font-display, inherit);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--pk-text-primary);
}

.decal-sm {
  box-shadow: var(--shadow-raise);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 18px;
}

/* ---- mobile header ---- */

.mob-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mob-note {
  font-size: 13px;
  line-height: 1.4;
  color: var(--pk-text-secondary);
  text-align: right;
  white-space: pre-line;
}

/* ---- desktop rail ---- */

.rail-title {
  font: 700 22px/1.2 var(--pk-font-display, inherit);
  text-transform: uppercase;
}

.rail-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rail-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  font-size: 15px;
  color: var(--pk-text-secondary);
}

.rail-steps .mark {
  width: 28px;
  height: 28px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--pk-radius-pill);
  background: var(--pk-surface-sunken);
  border: 2px solid var(--pk-border-subtle);
  font-size: 14px;
  font-weight: 700;
}

.rail-steps li.done,
.rail-steps li.current {
  color: var(--pk-text-primary);
}

.rail-steps li.current {
  font-weight: 700;
}

.rail-steps li.done .mark {
  background: var(--pk-brand-primary);
  border-color: var(--pk-border-strong);
}

.rail-steps li.current .mark {
  background: var(--pk-brand-ink);
  border-color: var(--pk-border-strong);
  color: var(--pk-text-inverse);
}

.rail-trust {
  border-top: 1px solid var(--pk-border-subtle);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rail-reviews {
  font-size: 15px;
  font-weight: 700;
}

.rail-note {
  font-size: 14px;
  line-height: 1.5;
  color: var(--pk-text-secondary);
}

/* ---- progress ---- */

.prog-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress {
  display: flex;
  gap: 6px;
}

.progress span {
  flex: 1;
  height: 6px;
  border-radius: var(--pk-radius-pill);
  background: var(--pk-surface-sunken);
  transition: background 0.2s;
}

.progress span.on {
  background: var(--pk-brand-primary);
}

.prog-label,
.lbl {
  font: 600 11px/1.2 var(--pk-font-mono, monospace);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pk-text-secondary);
}

/* ---- card ---- */

.card {
  background: var(--pk-surface-card);
  border: 1px solid var(--pk-border-subtle);
  border-radius: var(--pk-radius-card);
  padding: 20px;
}

.card section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.back {
  align-self: flex-start;
  min-height: 44px;
  padding: 0 8px;
  margin: -6px 0 -10px -8px;
  background: none;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--pk-text-secondary);
  cursor: pointer;
}

.back:hover {
  color: var(--pk-text-primary);
}

.card h1 {
  font: 700 28px/1.15 var(--pk-font-display, inherit);
  text-transform: uppercase;
}

.sub {
  font-size: 15px;
  line-height: 1.45;
  color: var(--pk-text-secondary);
  margin-top: -8px;
}

/* ---- fields ---- */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 15px;
  font-weight: 600;
}

label .optional {
  font-weight: 400;
  color: var(--pk-text-secondary);
}

input[type='date'],
input[type='text'],
input[type='email'],
input[type='tel'] {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: var(--pk-surface-card);
  border: 1.5px solid var(--pk-border-subtle);
  border-radius: var(--pk-radius-control);
  font-size: 17px;
  color: var(--pk-text-primary);
}

textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--pk-surface-card);
  border: 1.5px solid var(--pk-border-subtle);
  border-radius: var(--pk-radius-control);
  font-size: 16px;
  line-height: 1.4;
  color: var(--pk-text-primary);
  resize: vertical;
}

:is(input, textarea).invalid {
  background: var(--pk-feedback-error-surface);
  border-color: var(--pk-feedback-error);
}

.hint {
  font-size: 13px;
  line-height: 1.4;
  color: var(--pk-text-secondary);
}

.err {
  display: none;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--pk-feedback-error);
}

.err.show {
  display: block;
}

/* ---- radio-cards (job types, zones, durations, servicing) ----
   Real buttons with aria-pressed; selected = yellow fill + ink border +
   hard shadow. Yellow stays a fill — the text on it is ink. */

.choices,
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice {
  min-height: 48px;
  padding: 12px;
  text-align: left;
  background: var(--pk-surface-card);
  border: 1.5px solid var(--pk-border-subtle);
  border-radius: var(--pk-radius-control);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  color: var(--pk-text-primary);
  font-size: 15px;
  font-weight: 700;
}

.choice:hover {
  border-color: var(--pk-border-strong);
}

.choice.sel {
  background: var(--pk-brand-primary);
  border: 2px solid var(--pk-border-strong);
  padding: 11px;
  box-shadow: var(--shadow-raise);
}

.choice small {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 400;
  color: var(--pk-text-secondary);
}

.choices .choice {
  min-height: 88px;
  padding: 14px 12px;
  justify-content: flex-start;
}

.choices .choice.sel {
  padding: 13px 11px;
}

.choices .choice .choice-name {
  font: 700 18px/1.1 var(--pk-font-display, inherit);
  text-transform: uppercase;
}

.zone-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zone-list .choice {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 16px;
  min-height: 48px;
  padding: 0 14px;
}

.zone-list .choice.sel {
  padding: 0 13px;
  font-weight: 700;
}

/* ---- unit list + steppers ---- */

.unit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.unit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--pk-surface-card);
  border: 1.5px solid var(--pk-border-subtle);
  border-radius: var(--pk-radius-control);
}

.unit-row.has-qty {
  background: color-mix(in srgb, var(--pk-brand-primary) 6%, var(--pk-surface-card));
  border-color: var(--pk-border-strong);
}

.unit-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 600;
}

.unit-name small {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 400;
  color: var(--pk-text-secondary);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.stepper button {
  width: 44px;
  height: 44px;
  border-radius: var(--pk-radius-control);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  color: var(--pk-text-primary);
}

.stepper .dec {
  background: var(--pk-surface-card);
  border: 2px solid var(--pk-border-strong);
  box-shadow: var(--shadow-raise);
}

.stepper .dec:disabled {
  border-color: var(--pk-border-subtle);
  box-shadow: none;
  color: color-mix(in srgb, var(--pk-text-secondary) 55%, var(--pk-surface-card));
  cursor: default;
}

.stepper .inc {
  background: var(--pk-brand-primary);
  border: 2px solid var(--pk-border-strong);
  box-shadow: var(--shadow-raise);
}

.stepper :is(.inc, .dec):not(:disabled):active {
  box-shadow: var(--shadow-press);
  transform: translateY(1px);
}

.stepper .qty {
  font: 700 22px/1 var(--pk-font-display, inherit);
  min-width: 26px;
  text-align: center;
}

/* ---- buttons ---- */

.btn {
  width: 100%;
  height: 52px;
  padding: 0 24px;
  border: 2px solid var(--pk-border-strong);
  border-radius: var(--pk-radius-control);
  box-shadow: var(--shadow-raise);
  font-size: 17px;
  font-weight: 700;
  color: var(--pk-text-primary);
  cursor: pointer;
}

.btn:active {
  box-shadow: var(--shadow-press);
  transform: translateY(1px);
}

.btn-primary {
  background: var(--pk-brand-primary);
}

.btn-primary:hover {
  background: var(--pk-brand-primary-pressed);
}

.btn-secondary {
  height: 48px;
  background: var(--pk-surface-card);
}

.btn-secondary:hover {
  background: var(--pk-surface-sunken);
}

.btn-text {
  min-height: 44px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--pk-text-secondary);
  cursor: pointer;
  border-radius: 6px;
}

.btn-text:hover {
  color: var(--pk-text-primary);
}

/* ---- result ---- */

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.demo-badge {
  font: 600 10px/1 var(--pk-font-mono, monospace);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pk-text-secondary);
  background: var(--pk-surface-sunken);
  border-radius: var(--pk-radius-pill);
  padding: 6px 10px;
}

.result-date {
  font-size: 13px;
  color: var(--pk-text-secondary);
}

.range-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.range {
  font: 700 44px/1 var(--pk-font-display, inherit);
  font-variant-numeric: tabular-nums;
}

.range .gst {
  font: 400 15px/1 var(--pk-font-body, inherit);
  color: var(--pk-text-secondary);
}

.summary {
  font-size: 15px;
  line-height: 1.45;
  color: var(--pk-text-secondary);
}

.caveat {
  font-size: 14px;
  line-height: 1.5;
  color: var(--pk-text-secondary);
  border-left: 3px solid var(--pk-border-subtle);
  padding-left: 12px;
}

/* the one loud moment: the within-the-hour promise */
.promise {
  background: var(--pk-brand-primary);
  border: 2px solid var(--pk-border-strong);
  box-shadow: var(--shadow-pop);
  border-radius: var(--pk-radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--pk-text-primary);
}

.promise-head {
  font-size: 19px;
  line-height: 1.25;
  font-weight: 700;
}

.promise-body {
  font-size: 15px;
  line-height: 1.45;
}

.promise-sign {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
}

.breakdown-wrap {
  display: flex;
  flex-direction: column;
}

.breakdown-wrap .lbl {
  padding-bottom: 10px;
}

.breakdown .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--pk-surface-sunken);
}

.breakdown .row-l {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.breakdown .row-label {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
}

.breakdown .row-meta {
  font-size: 13px;
  color: var(--pk-text-secondary);
}

.breakdown .row-amt {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-top: 12px;
  border-top: 2px solid var(--pk-border-strong);
}

.total-label {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
}

.total-range {
  font: 700 20px/1 var(--pk-font-display, inherit);
  white-space: nowrap;
}

.fineprint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--pk-text-secondary);
}

.lead-note {
  background: var(--pk-surface-sunken);
  border-radius: var(--pk-radius-control);
  padding: 14px;
  font-size: 13px;
  line-height: 1.55;
}

.lead-note b {
  display: block;
  margin-bottom: 6px;
  font: 600 11px/1.2 var(--pk-font-mono, monospace);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* The lead as the owner receives it — notification-card look, never raw data. */
.lead-card {
  margin-top: 10px;
  background: var(--pk-surface-card);
  border: 2px solid var(--pk-border-strong);
  border-radius: var(--pk-radius-control);
  box-shadow: var(--shadow-raise);
  overflow: hidden;
  text-align: left;
}

.lead-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--pk-brand-primary);
  border-bottom: 2px solid var(--pk-border-strong);
}

.lead-card-title {
  font: 700 15px/1.2 var(--pk-font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--pk-text-primary);
}

.lead-card-time {
  font: 600 11px/1 var(--pk-font-mono, monospace);
  color: var(--pk-text-primary);
}

.lead-row {
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--pk-border-subtle);
  font-size: 13px;
}

.lead-row:first-of-type {
  border-top: 0;
}

.lead-label {
  flex: 0 0 84px;
  font: 600 10px/1.6 var(--pk-font-mono, monospace);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pk-text-secondary);
}

.lead-value {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.lead-strong {
  font-weight: 700;
}

/* Honeypot: parked far off-screen; humans never see or fill it. */
.hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

footer {
  font-size: 13px;
  line-height: 1.5;
  color: var(--pk-text-secondary);
  text-align: center;
  padding: 0 12px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
  .btn:active,
  .stepper :is(.inc, .dec):not(:disabled):active {
    transform: none;
  }
}
