:root {
  /* --accent and --accent-text are replaced by the business's settings. */
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #5b6470;
  --border: #d6dae0;
  --error-bg: #fdecec;
  --error-text: #8a1c1c;
  --info-bg: #e8f1fd;
  --info-text: #17365d;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

[hidden] { display: none !important; }

/* Buttons show their own pressed state, so skip the phone's tap flash. */
button, label { -webkit-tap-highlight-color: transparent; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.status,
.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.status { text-align: center; color: var(--muted); padding-top: 48px; }

.start {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
}

.start h1 { margin: 0 0 8px; font-size: 1.5rem; line-height: 1.25; }

.start p { margin: 0 auto 24px; max-width: 34em; color: var(--muted); }

.start .quote-page { margin: 12px auto 0; }

/* On its own line under the question, and padded so it's as easy to tap
   as a button. */
.quote-page a {
  display: block;
  width: fit-content;
  margin: 0 auto;
  padding: 10px 2px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.quote-page a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.stage {
  position: relative;
  display: flex;
  justify-content: center;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.stage canvas { display: block; }

/* One finger scrolls the page over the photo; two fingers zoom the photo,
   not the page (see zoom.js). */
.stage canvas { touch-action: pan-x pan-y; }

/* Zoom buttons, laid over the bottom right corner of the photo. */
.zoom-controls {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 6px;
}

.zoom-button {
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font: inherit;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.zoom-button.fit { font-size: 0.9375rem; }

.zoom-button:disabled { opacity: 0.35; cursor: default; }

.zoom-button:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }

/* Zoomed in with nothing being traced or edited, a mouse drags the photo. */
.stage.zoomed:not(.tracing):not(.editing) canvas { cursor: grab; }

.loupe {
  position: absolute;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

/* While tracing, or with a line selected, a finger on the photo draws or
   drags instead of scrolling the page. */
.stage.tracing canvas { touch-action: none; cursor: crosshair; }
.stage.editing canvas { touch-action: none; }

.hint {
  margin: 12px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

/* Front and side photo tabs and the time of day, on one row above the
   photo, with a thin line between them. Their buttons are a little smaller
   than elsewhere so both fit on a phone. */
.view-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.view-bar .segment { padding-left: 10px; padding-right: 10px; font-size: 0.875rem; }

.bar-divider {
  align-self: stretch;
  width: 1px;
  margin: 6px 0;
  background: var(--muted);
  opacity: 0.45;
}

@media (max-width: 380px) {
  .view-bar .segment { padding-left: 8px; padding-right: 8px; }
  .view-bar { gap: 6px; }
}

@media (max-width: 340px) {
  .view-bar .segment { padding-left: 7px; padding-right: 7px; font-size: 0.8125rem; }
  .view-bar { gap: 4px; }
}

.segment.add { color: var(--accent); font-weight: 600; }

.segment:disabled { opacity: 0.6; cursor: not-allowed; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.button {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Under the photo, a filled button looked like a selected tab (Front, Day),
   so the main action there (Add lights, Done, Finish line) has a dotted
   outline in the accent color instead: it stands out without looking
   already picked. The outline is a pixel thicker than other buttons', so
   the padding is a pixel less to keep the button the same size. */
#editor .toolbar .button.primary {
  background: var(--surface);
  color: var(--accent);
  border: 2px dotted var(--accent);
  padding: 9px 13px;
}

.button:disabled { opacity: 0.6; cursor: not-allowed; }

/* On the smallest phones, slightly narrower buttons keep the drawing and
   editing tools on one row, so the spacing slider stays on screen. */
@media (max-width: 360px) {
  .toolbar .button { padding-left: 10px; padding-right: 10px; }
  #editor .toolbar .button.primary { padding-left: 9px; padding-right: 9px; }
  .toolbar { gap: 6px; }
}

@media (max-width: 340px) {
  .toolbar .button { padding-left: 7px; padding-right: 7px; font-size: 0.9375rem; }
  #editor .toolbar .button.primary { padding-left: 6px; padding-right: 6px; }
  .toolbar { gap: 5px; }
}

.cta { display: block; width: 100%; margin-top: 12px; }

.picture-view h2 { margin: 0 0 12px; font-size: 1.25rem; }

.picture-view img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: #000;
}

.picture { margin: 0; }

.picture + .picture { margin-top: 20px; }

.picture h3 { margin: 0 0 8px; font-size: 1.0625rem; }

.picture .button { margin-top: 8px; }

.button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.options {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  gap: 14px;
}

.option-heading { display: block; margin: 0 0 8px; font-weight: 600; }

.slider {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.slider-ends {
  display: flex;
  justify-content: space-between;
  margin: -4px 0 8px;
  font-size: 0.875rem;
  color: var(--muted);
}

.option-heading span { font-weight: 400; color: var(--muted); }

.option-subheading { margin: 10px 0 6px; font-size: 0.875rem; color: var(--muted); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }

.button.small { min-height: 40px; padding: 6px 14px; margin-top: 12px; font-size: 0.9375rem; }

.button.small[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.custom-pattern {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.option-note { margin: 0 0 8px; font-size: 0.9375rem; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}

.chip-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.swatch:disabled { opacity: 0.4; cursor: not-allowed; }

.swatch {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.swatch[aria-pressed="true"] {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.swatch:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.segments {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.segment {
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.segment:first-child { border-left: 0; }

.segment[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.segment:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
}

.toggle input { width: 22px; height: 22px; accent-color: var(--accent); }

.lead-form {
  margin-top: 24px;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.lead-form h2 { margin: 0 0 4px; font-size: 1.25rem; line-height: 1.3; }

.field { margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }

.field > label, .field > legend { display: block; margin-bottom: 6px; font-weight: 600; padding: 0; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"] {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  /* 16px or more stops iPhones zooming in when a box is tapped. */
  font: inherit;
  font-size: 16px;
}

.field input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }

.field input[aria-invalid="true"] { border-color: var(--error-text); }

.field-error { margin: 6px 0 0; color: var(--error-text); font-size: 0.9375rem; }

.budget-choices { display: grid; gap: 8px; }

.budget-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.budget-choice input { width: 22px; height: 22px; accent-color: var(--accent); }

.budget-choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

#lead-consent { margin: 18px 0 0; }

.lead-form .cta { margin-top: 12px; }

.lead-sent p { margin: 8px 0 0; }

.lead-sent:focus { outline: none; }

.message {
  margin: 12px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--error-bg);
  color: var(--error-text);
}

.message.info {
  background: var(--info-bg);
  color: var(--info-text);
}
