/* Funnel step one, the before / after slider: layout of the step inside the
   quiz. Brand tokens, buttons and quiz controls come from styles.css. The
   stage takes whatever height the screen has left, so the step fits one
   screen on desktops and most phones. */
:root {
  --cmp-frame-line: #cfd8da;
  --cmp-frame-shadow: #1d2e3214;
  --cmp-field-line: #6f858a;
  --cmp-error: #a33b2c;
  --cmp-example: #7a4d00;
  --cmp-example-bg: #fdefd0;
  --cmp-live: #1e7b46;
  --cmp-chip-line: #9fb0b3;
  --cmp-region-fill: #ccac6633;
  --cmp-grip-shadow: #1d2e3240;
}
.quiz-dialog.step-compare .quiz-workspace {
  max-width: 1240px;
  margin-top: 14px;
  padding-bottom: 8px;
}
.quiz-dialog.step-compare .quiz-navigation {
  margin-bottom: 12px;
}
.quiz-dialog.step-compare .quiz-card {
  padding: 20px 28px 0;
}
.quiz-dialog.step-compare .quiz-controls {
  min-height: 0;
  margin-top: 12px;
  padding: 12px 0 14px;
}
.compare-step [hidden] {
  display: none;
}
/* The line under the quiz: on this step the name is looked up on Google. */
.quiz-dialog.step-compare .quiz-privacy-local,
.quiz-dialog.step-details .quiz-privacy-local,
.quiz-dialog:not(.step-compare):not(.step-details) .quiz-privacy-search {
  display: none;
}
/* The first step: the name and the business, side by side on wide screens. */
.details-head .quiz-question {
  font-size: 38px;
  line-height: 1.05;
}
.details-head .quiz-question em {
  font-size: 1.14em;
}
.details-head .question-hint {
  max-width: 560px;
  margin-top: 8px;
}
.details-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  max-width: 760px;
  margin-top: 26px;
}
/* The search step shows whose results these are; the name is changed on the step before. */
.compare-shown {
  margin: 0;
  justify-self: end;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  text-align: right;
}
.compare-shown b {
  font-weight: 600;
  color: var(--ink);
}
.compare-change {
  margin-left: 8px;
  font-size: 13px;
  color: #35585b;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.compare-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  gap: 12px 40px;
  align-items: center;
}
.compare-head .quiz-question {
  font-size: 38px;
  line-height: 1.05;
}
.compare-head .quiz-question em {
  font-size: 1.14em;
}
.compare-head .question-hint {
  max-width: none;
  margin-top: 6px;
  font-size: 14px;
}
/* Floating label: it rests inside the empty field and rises onto the border.
   One focus indicator replaces the site default outline. */
.compare-field {
  position: relative;
}
.compare-field input {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 1px solid var(--cmp-field-line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 16px;
}
@media (prefers-reduced-motion: no-preference) {
  .compare-field input {
    transition: border-color var(--motion-fast) ease;
  }
}
.compare-field input:hover {
  border-color: var(--ink);
}
.compare-field input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  box-shadow: none;
}
.compare-field input[aria-invalid="true"] {
  border-color: var(--cmp-error);
}
.compare-field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 100px var(--white) inset;
}
.compare-field label {
  position: absolute;
  left: 11px;
  top: 0;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  transform-origin: left center;
}
@media (prefers-reduced-motion: no-preference) {
  .compare-field label {
    transition:
      transform var(--motion-ui) var(--motion-ease),
      color var(--motion-fast) ease;
  }
}
.compare-field label::before {
  content: "";
  position: absolute;
  inset: calc(50% - 9px) 0;
  z-index: -1;
  background: var(--white);
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .compare-field label::before {
    transition: opacity var(--motion-fast) ease;
  }
}
.compare-field input:focus + label,
.compare-field input:not(:placeholder-shown) + label,
.compare-field input:-webkit-autofill + label {
  transform: translateY(-28px) scale(0.78);
  color: var(--ink);
}
.compare-field input:focus + label::before,
.compare-field input:not(:placeholder-shown) + label::before,
.compare-field input:-webkit-autofill + label::before {
  opacity: 1;
}

/* The row above the stage: how to use the slider, centred over the line at
   rest, and on the right, over the before side, what that side is showing. */
.compare-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 36px;
  margin: 14px 0 8px;
}
.compare-drag {
  grid-column: 2;
  font-size: 13px;
  color: var(--muted);
}
.compare-drag-long {
  display: none;
}
.compare-source {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.compare-source:empty {
  visibility: hidden;
}
.compare-source::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.compare-source[data-state="example"] {
  background: var(--cmp-example-bg);
  color: var(--cmp-example);
}
.compare-source[data-state="live"]::before {
  background: var(--cmp-live);
}
@media (prefers-reduced-motion: no-preference) {
  .compare-source[data-state="loading"]::before {
    animation: cmp-pulse 900ms ease-in-out infinite alternate;
  }
}
@keyframes cmp-pulse {
  from {
    opacity: 0.2;
  }
  to {
    opacity: 1;
  }
}

/* The stage. --pos is how much of "with us" is revealed, in percent from the
   left: the page starts on "without us" and the line uncovers the real one. */
.ba {
  --pos: 0%;
  position: relative;
  container-type: inline-size;
  height: clamp(250px, calc(100dvh - 528px), 640px);
  border: 1px solid var(--cmp-frame-line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 2px 14px var(--cmp-frame-shadow);
}
.ba-after,
.ba-before {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.ba-before {
  background: var(--white);
  clip-path: inset(0 0 0 var(--pos));
}
/* Slightly wider than the stage: trims a sign-in button the crop cut in half. */
.ba-scroll {
  position: absolute;
  top: 0;
  left: 0;
  width: 101.3%;
}
@media (prefers-reduced-motion: no-preference) {
  .ba-scroll {
    transition: transform var(--motion-reveal) var(--motion-ease);
  }
}
.ba-scroll img {
  display: block;
  width: 100%;
  height: auto;
}
.ba-regions {
  position: absolute;
  inset: 0;
}
.ba-region {
  position: absolute;
  border: 3px solid var(--gold-deep);
  border-radius: 12px;
  background: var(--cmp-region-fill);
}
/* The line sits exactly on the reveal edge. Only the grip is held inside the
   frame at both ends, so it can always be seen and grabbed. */
.ba-handle {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ba-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 3px;
  margin-left: -1.5px;
  background: var(--ink);
}
.ba-grip {
  position: absolute;
  top: 50%;
  left: clamp(24px, var(--pos), calc(100% - 24px));
  width: 44px;
  height: 44px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 2px 10px var(--cmp-grip-shadow);
  translate: -50% -50%;
}
.ba-grip::before,
.ba-grip::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border: solid var(--white);
  border-width: 2px 2px 0 0;
}
.ba-grip::before {
  left: 9px;
  transform: translateY(-50%) rotate(-135deg);
}
.ba-grip::after {
  right: 9px;
  transform: translateY(-50%) rotate(45deg);
}
@media (prefers-reduced-motion: no-preference) {
  .ba.is-snapping .ba-before {
    transition: clip-path var(--motion-reveal) var(--motion-ease);
  }
  .ba.is-snapping .ba-handle::before,
  .ba.is-snapping .ba-grip {
    transition: left var(--motion-reveal) var(--motion-ease);
  }
  /* The intro sweep is slower and eases both ways. */
  .ba.is-intro .ba-before {
    transition: clip-path 1100ms cubic-bezier(0.45, 0, 0.2, 1);
  }
  .ba.is-intro .ba-handle::before,
  .ba.is-intro .ba-grip {
    transition: left 1100ms cubic-bezier(0.45, 0, 0.2, 1);
  }
}
/* A real range input covers the stage: pointer, touch and arrow keys all move the divider. */
.ba-range {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y;
}
.ba:has(.ba-range:focus-visible) .ba-grip {
  outline: 3px solid var(--gold-deep);
  outline-offset: 3px;
}
.ba-caption {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 3;
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  line-height: 1.45;
  pointer-events: none;
}
/* Stays in the page when empty, so screen readers keep announcing it. */
.ba-caption:empty {
  opacity: 0;
}

.compare-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 12px;
}
.compare-moves {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.compare-move {
  min-height: 40px;
  padding: 7px 14px;
  border: 1px solid var(--cmp-chip-line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
@media (prefers-reduced-motion: no-preference) {
  .compare-move {
    transition:
      background-color var(--motion-fast) ease,
      border-color var(--motion-fast) ease,
      color var(--motion-fast) ease;
  }
}
.compare-move-short {
  display: none;
}
.compare-move:hover {
  border-color: var(--ink);
  background: var(--soft);
}
.compare-move[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}
.compare-step .form-error {
  min-height: 0;
  padding: 0;
}
.compare-step .form-error:not(:empty) {
  margin-top: 8px;
}

/* Short desktop screens: the head and the status row tighten, and the stage takes the space. */
@media (max-height: 860px) and (min-width: 761px) {
  .compare-head .question-hint {
    display: none;
  }
  .compare-drag-short {
    display: none;
  }
  .compare-drag-long {
    display: inline;
  }
  .compare-head .quiz-question {
    font-size: 32px;
  }
  .compare-status {
    min-height: 30px;
    margin: 10px 0 6px;
  }
  .quiz-dialog.step-compare .quiz-controls {
    margin-top: 8px;
    padding: 10px 0 12px;
  }
  .compare-foot {
    margin-top: 8px;
  }
  .ba {
    height: clamp(250px, calc(100dvh - 450px), 640px);
  }
}
@media (max-width: 760px) {
  .quiz-dialog.step-compare .quiz-workspace {
    margin-top: 0;
  }
  .quiz-dialog.step-compare .quiz-navigation {
    margin: 12px 0 8px;
  }
  .quiz-dialog.step-compare .quiz-mobile-progress {
    display: none;
  }
  .quiz-dialog.step-compare .quiz-card {
    padding: 0;
  }
  .quiz-dialog.step-compare .quiz-controls {
    margin-top: 10px;
    padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  }
  .compare-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .compare-shown {
    justify-self: start;
    text-align: left;
  }
  .details-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-top: 18px;
  }
  .details-head .quiz-question {
    font-size: 32px;
  }
  .compare-head .question-hint {
    display: none;
  }
  .ba-scroll {
    width: 100%;
  }
  .ba-caption {
    right: 8px;
    bottom: 8px;
    left: 8px;
    font-size: 13px;
  }
  .compare-foot {
    margin-top: 8px;
  }
  .compare-moves {
    display: grid;
    grid-template-columns: repeat(5, auto);
    justify-content: space-between;
    gap: 6px;
    width: 100%;
  }
  .compare-move {
    min-height: 44px;
    padding: 7px 10px;
    font-size: 13px;
  }
  .compare-move-full {
    display: none;
  }
  .compare-move-short {
    display: inline;
  }
}
@media (forced-colors: active) {
  .compare-move[aria-pressed="true"] {
    outline: 2px solid Highlight;
  }
  .ba-region {
    border-color: Highlight;
  }
  .ba-handle::before {
    background: CanvasText;
  }
}

/* A label under the grip, so the line reads as something to drag. */
.ba-handle::after {
  content: "Drag";
  position: absolute;
  top: calc(50% + 30px);
  left: clamp(24px, var(--pos), calc(100% - 24px));
  padding: 3px 10px;
  border: 2px solid var(--white);
  border-radius: 99px;
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  translate: -50% 0;
}
@media (prefers-reduced-motion: no-preference) {
  .ba.is-snapping .ba-handle::after {
    transition: left var(--motion-reveal) var(--motion-ease);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .ba.is-intro .ba-handle::after {
    transition: left 1100ms cubic-bezier(0.45, 0, 0.2, 1);
  }
}

/* The two sides, named above the frame: the founder's page on the left, the visitor's on the right. */
.compare-status {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.compare-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.compare-side {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  padding: 7px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  line-height: 1.35;
}
.compare-side b {
  font-size: 13px;
  font-weight: 700;
}
.compare-side-yours {
  background: var(--white);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--cmp-chip-line);
  text-align: right;
}
