/* Funnel end: the result screen kept to one screen, and the "Your free
   report" step. Brand tokens, buttons, fields and quiz controls come from
   styles.css, quiz.css and the step-one field styles in compare.css. */

/* Progress: one quiet bar above the card, no numbers. The quiz sets --progress. */
.quiz-navigation {
  margin: 0 16px 22px;
}
/* "Your report is ready", when it finished while the visitor was on another step. */
.quiz-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -8px 16px 16px;
  padding: 10px 14px;
  border: 1px solid var(--gold-border);
  border-radius: 10px;
  background: #faf6ec;
  font-size: 14px;
  color: var(--ink);
}
.quiz-notice:empty {
  display: none;
}
.quiz-notice .icon {
  width: 16px;
  height: 16px;
  color: var(--gold-deep);
}
.quiz-notice button {
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.quiz-progress {
  --progress: 0%;
  position: relative;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: #dde5e6;
}
.quiz-progress-fill {
  position: absolute;
  inset: 0;
  width: var(--progress);
  border-radius: 99px;
  background: var(--gold-border);
}
@media (prefers-reduced-motion: no-preference) {
  .quiz-progress-fill {
    transition: width var(--motion-reveal) var(--motion-ease);
  }
}
.quiz-mobile-progress {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
/* Under the bar, the step's name: not on the steps whose heading already says it. */
.quiz-dialog.step-compare .quiz-mobile-progress,
.quiz-dialog.showing-result .quiz-mobile-progress,
.quiz-dialog.step-report .quiz-mobile-progress {
  display: none;
}
@media (forced-colors: active) {
  .quiz-progress {
    height: 6px;
    border: 1px solid CanvasText;
  }
  .quiz-progress-fill {
    background: Highlight;
    forced-color-adjust: none;
  }
}

/* The result screen: the brief scrolls inside a fixed-height list, so the
   whole screen fits about 600px of card at desktop sizes. */
.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 24px;
}
.result-panel .result-kicker {
  margin-bottom: 8px;
}
.result-panel .result-title {
  font-size: 32px;
}
.result-panel .result-intro {
  margin-top: 6px;
}
.result-focus-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 340px;
  margin: 6px 0 0;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}
.result-focus-tag .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--gold-deep);
}
.result-panel .review-heading {
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px 14px;
  padding-top: 14px;
  margin-top: 14px;
}
.result-panel .review-heading h3 {
  margin-right: auto;
}
.result-panel .review-heading .plain-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 6px;
}
/* The brief: two columns of labelled answers, each with its icon. */
.result-panel .answer-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 10px 0 0;
}
.brief-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  min-height: 50px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.brief-item dt,
.brief-item dd {
  display: contents;
  margin: 0;
}
.brief-icon {
  display: grid;
  place-items: center;
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--soft);
  color: var(--ink);
}
.brief-icon .icon {
  width: 15px;
  height: 15px;
}
.brief-label {
  grid-column: 2;
  align-self: end;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.brief-value {
  grid-column: 2;
  align-self: start;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}
.brief-item button {
  grid-column: 3;
  grid-row: 1 / 3;
  min-height: 36px;
  min-width: 40px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  color: #35585b;
}
.brief-item button:hover {
  background: var(--soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.result-panel .brief-status {
  margin-top: 6px;
}
.result-panel .brief-status:empty {
  display: none;
}
/* The footer: what comes next on the left, the one gold button bottom right. */
.result-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.result-footer .result-next {
  flex: 1 1 320px;
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
.result-footer .result-next a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.result-footer .button {
  flex-shrink: 0;
  min-height: 52px;
  gap: 18px;
  font-size: 14px;
}
.quiz-dialog.showing-result .quiz-card {
  padding-bottom: 22px;
}

/* The report step: the same tight frame as step one, so the card has the
   room it needs on a 768px-high screen. */
.quiz-dialog.step-report .quiz-workspace {
  max-width: 810px;
  margin-top: 14px;
  padding-bottom: 8px;
}
.quiz-dialog.step-report .quiz-navigation {
  margin-bottom: 12px;
}
.quiz-dialog.step-report .quiz-card {
  padding: 24px 34px 18px;
}
.report-head .quiz-question {
  font-size: 33px;
}
.report-head .question-hint {
  max-width: 620px;
  margin-top: 10px;
}
.report-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  margin-top: 22px;
}
.report-fields .report-field:first-child {
  grid-column: 1 / -1;
}
.report-step .form-error {
  min-height: 0;
  padding: 0;
}
.report-step .form-error:not(:empty) {
  margin-top: 10px;
}
.report-status {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.report-status:empty {
  display: none;
}
/* While the report is written: a quiet pulse before the sentence, no numbers. */
.report-step[data-state="working"] .report-status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--gold);
  vertical-align: middle;
}
@media (prefers-reduced-motion: no-preference) {
  .report-step[data-state="working"] .report-status::before {
    animation: report-pulse 1.2s ease-in-out infinite;
  }
}
@keyframes report-pulse {
  50% {
    opacity: 0.25;
  }
}
.report-step[data-state="working"] .report-fields input {
  color: var(--muted);
}
.report-apply {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.report-apply .icon {
  width: 13px;
  height: 13px;
}

/* The finished report: its gist, and its address. The fields fold up into
   one line ("for Jayden Kang · Kang Legal Group"), so the report has the room. */
.report-step[data-state="ready"] .report-fields {
  display: none;
}
.report-step[data-state="ready"] .report-head .question-hint {
  display: none;
}
.report-for {
  display: none;
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.report-for b {
  font-weight: 600;
  color: var(--ink);
}
.report-for button {
  margin-left: 10px;
  padding: 2px 4px;
  border: 0;
  background: none;
  font-size: 13px;
  color: #35585b;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.report-step[data-state="ready"] .report-for {
  display: block;
}
.report-step[data-state="ready"] .report-status {
  display: none;
}
/* While a report is written: the stages as a checklist, the active one pulsing, done ones ticked; the status line is read, not seen. */
.report-stages {
  display: none;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.report-step[data-state="working"] .report-stages {
  display: grid;
  gap: 9px;
}
.report-step[data-state="working"] .report-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.report-step[data-state="ready"].is-opening .report-status {
  display: block;
}
.report-stages li {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}
.report-stage-mark {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid #cfd8da;
  border-radius: 50%;
  background: var(--white);
}
.report-stages li[data-state="active"] {
  color: var(--ink);
  font-weight: 600;
}
.report-stages li[data-state="active"] .report-stage-mark {
  border-color: var(--gold-deep, #bd9851);
}
@media (prefers-reduced-motion: no-preference) {
  .report-stages li[data-state="active"] .report-stage-mark {
    animation: report-stage-pulse 1.3s ease-in-out infinite;
  }
}
.report-stages li[data-state="done"] {
  color: var(--text);
}
.report-stages li[data-state="done"] .report-stage-mark {
  border-color: var(--gold-deep, #bd9851);
  background: var(--gold-deep, #bd9851);
}
.report-stages li[data-state="done"] .report-stage-mark::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.report-stage-note {
  font-weight: 400;
  color: var(--muted);
}
@keyframes report-stage-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(189, 152, 81, 0.5);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(189, 152, 81, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .report-stages li[data-state="active"] .report-stage-mark {
    animation: none;
  }
}
.report-step[data-state="ready"] .report-head .quiz-question {
  font-size: 30px;
}
.report-result {
  margin-top: 14px;
  padding: 16px 18px;
  border-left: 3px solid var(--gold);
  border-radius: 0 12px 12px 0;
  background: var(--paper);
}
.report-step[data-state="ready"] .report-result {
  margin-top: 10px;
  padding: 14px 16px;
}
.report-step[data-address="none"] .report-result {
  max-height: 46vh;
  overflow-y: auto;
}
.report-result[hidden] {
  display: none;
}
.report-headline {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  line-height: 1.3;
  color: var(--ink);
}
.report-summary {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}
.report-summary:empty {
  display: none;
}
.report-verdict {
  font-weight: 700;
  color: var(--ink);
}
.report-inside {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.report-inside:empty {
  display: none;
}
.report-company {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--white);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.report-company span {
  display: block;
}
.report-company:empty {
  display: none;
}
.report-company {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 2px 10px;
}
.report-company-icon {
  grid-row: 1 / 3;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--gold-deep);
}
.report-company b {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.report-why {
  grid-column: 2;
  margin: -4px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.report-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.report-links .button {
  min-height: 46px;
  gap: 12px;
  font-size: 14px;
}
.report-links .icon {
  width: 15px;
  height: 15px;
}
.result-footer .result-next .icon {
  width: 13px;
  height: 13px;
}
.result-panel .review-heading .icon {
  width: 14px;
  height: 14px;
}
.report-links [hidden] {
  display: none;
}
.report-share {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.report-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.report-step[data-state="ready"] .report-note {
  display: none;
}
.report-step .quiz-controls {
  margin-top: 14px;
}
.quiz-dialog.step-report .quiz-controls {
  min-height: 0;
  margin-top: 12px;
  padding: 12px 0 0;
}
.report-step .quiz-controls .button[hidden] {
  display: none;
}
.report-step .quiz-controls .button:disabled {
  cursor: progress;
  opacity: 0.75;
}

@media (max-width: 760px) {
  .quiz-navigation {
    margin: 16px 0 18px;
  }
  .result-head {
    flex-direction: column;
  }
  .result-focus-tag {
    max-width: none;
  }
  .result-panel .answer-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .brief-item {
    min-height: 48px;
  }
  /* The gold button stays on screen, as on every other step; the sentence becomes its footnote. */
  .result-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 0 max(12px, env(safe-area-inset-bottom));
    background: #ffffffed;
    backdrop-filter: blur(12px);
  }
  .result-footer .result-next {
    flex: none;
    order: 2;
    font-size: 12px;
    line-height: 1.6;
  }
  .result-footer .button {
    width: 100%;
  }
  .quiz-dialog.step-report .quiz-workspace {
    margin-top: 0;
  }
  .quiz-dialog.step-report .quiz-card {
    padding: 0;
  }
  .quiz-dialog.step-report .quiz-controls {
    padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  }
  .report-head .quiz-question {
    font-size: 29px;
  }
  .report-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    margin-top: 18px;
  }
  .report-why {
    grid-column: auto;
  }
  .report-links .button {
    flex: 1 1 100%;
  }
}

/* Name and company come from step one, so the step asks for the email only; "Change details" opens the other two fields. */
.report-step[data-details="closed"]:not([data-state="ready"]) .report-for {
  display: block;
}
.report-step[data-details="closed"] .report-fields {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 16px;
}
.report-step[data-details="closed"] .report-field:not(:nth-child(2)),
.report-step[data-details="closed"] .report-why {
  display: none;
}
.report-step[data-state="working"] .report-for button {
  display: none;
}

/* While a released report is written: a progress bar and the pages found so far (live.js). The email field folds away to make room. */
.report-step[data-state="working"] .report-fields {
  display: none;
}
.report-live[hidden],
.report-ahead[hidden] {
  display: none;
}
.report-live {
  margin-top: 12px;
}
.report-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--soft);
}
.report-progress span {
  display: block;
  width: 94%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #bd9851, #ccac66);
  transform-origin: left;
}
@media (prefers-reduced-motion: no-preference) {
  .report-progress span {
    animation: report-progress 40s cubic-bezier(0.1, 0.6, 0.3, 1) both;
  }
}
@keyframes report-progress {
  from {
    transform: scaleX(0.03);
  }
}
.report-live-title {
  margin: 10px 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.report-live-list {
  display: grid;
  gap: 4px;
  max-height: 104px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}
.report-live-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  color: var(--muted);
}
@media (prefers-reduced-motion: no-preference) {
  .report-live-list li {
    animation: report-live-in 260ms ease-out both;
  }
}
.report-live-list b {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--ink);
}
.report-live-list span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Without a store the report has no address, so the whole gist is shown here, scrolling inside its box. */
.report-step[data-address="none"] .report-summary,
.report-step[data-address="none"] .report-company span {
  display: block;
  -webkit-line-clamp: none;
  line-clamp: none;
}
.report-live-list i {
  flex: 0 0 auto;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a0611a;
}
.report-live-list li[data-read="done"] i {
  color: #2a6a3c;
}
@keyframes report-live-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.report-live-wait {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.report-ahead {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 14px;
  font-size: 12px;
  color: var(--muted);
}
.report-ahead::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ccac66;
}
@media (prefers-reduced-motion: no-preference) {
  .report-ahead::before {
    animation: report-ahead-pulse 1.2s ease-in-out infinite;
  }
}
.report-ahead[data-state="ready"] {
  color: #1f5a30;
}
.report-ahead[data-state="ready"]::before {
  background: #2a6a3c;
  animation: none;
}
@keyframes report-ahead-pulse {
  50% {
    opacity: 0.25;
  }
}
@media (max-width: 760px) {
  .report-ahead {
    display: flex;
    margin: 4px 0 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .report-progress span,
  .report-live-list li,
  .report-ahead::before {
    animation: none;
  }
}
.report-step[data-state="working"] .report-head .question-hint {
  display: none;
}
