/* Questionnaire layout and components. Colors and fonts live in theme.css. Mobile first. */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

/* progress + top line */
.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--plum);
  border-radius: inherit;
  transition: width .25s ease;
}
.topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  margin: 6px 0 4px;
}
.count { margin-left: auto; font-size: .85rem; color: var(--ink-soft); }
.back, .link {
  appearance: none;
  border: 0;
  background: none;
  padding: 10px 4px;
  margin-left: -4px;
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
  cursor: pointer;
}
.back[hidden] { display: none; }
.link { text-decoration: underline; text-underline-offset: 3px; }

/* question */
.question {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 8px 0 6px;
  outline: none;
}
.help { margin: 0 0 18px; color: var(--ink-soft); }
.question + .pills, .question + .slider, .question + .field, .question + form { margin-top: 18px; }

/* answer pills */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  appearance: none;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--pill-border);
  border-radius: var(--radius-pill);
  background: var(--pill);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.screen-single .pill { width: 100%; }              /* one answer per row reads better for single choice */
.pill:hover { background: var(--pill-hover); }
.pill[aria-pressed="true"] {
  background: var(--selected);
  border-color: var(--selected);
  color: var(--on-selected);
}
.screen-multi .pill[aria-pressed="true"]::before { content: "✓ "; }
.pill:disabled { cursor: default; }

/* primary button (matches the site's Submit button) */
.actions { margin-top: 28px; }
.button {
  appearance: none;
  display: inline-block;
  min-width: 160px;
  min-height: 52px;
  padding: 16px 28px;
  border: 0;
  border-radius: var(--radius-button);
  background: var(--plum);
  color: var(--on-plum);
  font-family: var(--font-button);
  font-weight: var(--button-weight);
  font-size: 1rem;
  letter-spacing: var(--button-tracking);
  text-transform: var(--button-case);
  cursor: pointer;
}
.button:hover { background: var(--plum-dark); }
.button:disabled { opacity: .4; cursor: not-allowed; }

/* text fields */
.field { display: block; margin-top: 16px; }
.field-label { display: block; margin-bottom: 6px; }
input[type="text"], input[type="email"], textarea, select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  background: var(--pill);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;                                  /* 16px+ stops iOS zooming on focus */
}
textarea { resize: vertical; line-height: 1.4; }
select {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
::placeholder { color: var(--ink-soft); opacity: .8; }
.row { display: grid; gap: 0 12px; }
.check { display: flex; gap: 10px; align-items: center; margin-top: 16px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--plum); }
.error { color: var(--error); margin: 12px 0 0; }
[aria-invalid="true"] { border-color: var(--error); }

/* slider */
.slider { margin-top: 28px; }
.slider input[type="range"] {
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.slider input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: var(--pill); border: 1px solid var(--pill-border); }
.slider input[type="range"]::-moz-range-track { height: 8px; border-radius: 999px; background: var(--pill); border: 1px solid var(--pill-border); }
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px; height: 32px; margin-top: -13px;
  border-radius: 50%; border: 3px solid var(--page); background: var(--plum);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.slider input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px;
  border-radius: 50%; border: 3px solid var(--page); background: var(--plum);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.ticks { display: flex; justify-content: space-between; padding: 0 15px; margin-top: -4px; }
.ticks span { width: 2px; height: 8px; background: var(--pill-border); }
.ends { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; font-size: .95rem; }
.ends span:last-child { text-align: right; }

/* results */
.results .help { margin-bottom: 20px; }
.cards { display: grid; gap: 18px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.card-best { border: 2px solid var(--plum); }
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 12px 16px;
  background: var(--card-head);
}
.slot {
  font-family: var(--font-button);
  font-weight: var(--button-weight);
  letter-spacing: var(--button-tracking);
  text-transform: uppercase;
  font-size: .8rem;
  margin-right: auto;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  font-size: .82rem;
  line-height: 1.3;
}
.badge-best { background: var(--plum); border-color: var(--plum); color: var(--on-plum); }
.card-photo { background: var(--card); display: flex; justify-content: center; padding: 8px 16px 0; }
.card-photo img { width: 100%; max-width: 200px; height: auto; aspect-ratio: 1; object-fit: contain; }
.card-body { padding: 8px 16px 18px; }
.model {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  font-size: 1.3rem;
  line-height: 1.25;
  margin: 6px 0 2px;
}
.price { font-size: 1.15rem; font-weight: 700; margin: 0 0 10px; }
.card-body p { margin: 0 0 10px; }
.note { color: var(--plum); font-style: italic; }
.caution { padding: 8px 12px; border-radius: 8px; background: var(--caution-bg); }
.addon { padding: 8px 12px; border-radius: 8px; background: var(--pill); }
.card-body a:not(.button), .talk a, .fallback a:not(.button), .preview-banner a { color: var(--ink); text-underline-offset: 3px; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 16px; }
.card-actions .button { min-width: 140px; text-align: center; text-decoration: none; }
.button-secondary { background: transparent; color: var(--plum); border: 2px solid var(--plum); }
.button-secondary:hover { background: var(--pill); }
a.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

.fallback {
  margin: 4px 0 20px;
  padding: 18px 16px;
  border-radius: 12px;
  background: var(--pill);
}
.fallback h2 { font-family: var(--font-heading); font-weight: var(--heading-weight); font-size: 1.3rem; margin: 0 0 8px; }
.fallback p { margin: 0 0 12px; }
.fallback .help { margin: 16px 0 0; }
.fallback-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.emailed:empty { display: none; }
.email-results, .emailed { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.email-results h2 { font-family: var(--font-heading); font-weight: var(--heading-weight); font-size: 1.2rem; margin: 0; }
.email-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.email-row .field { flex: 1 1 220px; }
.email-row .button { min-width: 110px; }
.form-msg { margin: 10px 0 0; min-height: 1.5em; }
.talk { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.talk p { margin: 0; }
.restart { margin-top: 18px; display: flex; gap: 10px; align-items: center; color: var(--ink-soft); }
.preview-banner { padding: 8px 12px; border-radius: 8px; background: var(--caution-bg); font-size: .9rem; }

/* focus + accessibility */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.question:focus-visible { outline: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }   /* honeypot field */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* inside the Squarespace page: let the page's own background show and drop the outer padding */
.embedded body { background: transparent; }
.embedded #app { padding-top: 8px; padding-bottom: 16px; }

@media (min-width: 560px) {
  .card { display: grid; grid-template-columns: 200px 1fr; }
  .card-head { grid-column: 1 / -1; }
  .card-photo { padding: 16px 0 16px 16px; align-items: flex-start; }
  .card-body { padding: 12px 18px 18px; }
  #app { padding-top: 32px; }
  .question { font-size: 1.85rem; }
  .row { grid-template-columns: 1fr 1fr; }
  .screen-single .pill { width: auto; min-width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
