/* Trials & Demos (automation-trials-demos.html), sitemap 4.8: the qualifying form, built as a step form
   (format, platforms, details) inside one white card. js/trials-steps.js shows one step at a time; without
   it all three steps stack and the form still submits. Runs on main.svp.trd for the service-page shell; the
   details panel is the site's .form, the FAQ is pin.css .faq and the Why PinnacleQM band is
   about-page.css .abx-stats. This file adds the step headings, the format tickets and the platform
   picker. Choices are native radio and checkbox inputs, styled through :has(). Tokens from pin.css; motion is hover and focus only.
   Responsive rules sit directly after the base rules they change (see README, CSS ordering). */

.trd {
  --trd-ground: var(--white);
}


/* ---------- the step form card ---------- */

.trd-wiz {
  --trd-ground: var(--white);
  --trd-step: 1;
  scroll-margin-top: calc(var(--hdr-h) + 24px);
  padding: clamp(24px, 4vw, 52px);
  border-radius: var(--r-panel);
  border: 1px solid var(--tint-12);
  background: var(--white);
  box-shadow: var(--svp-shadow-lg);
}

/* Progress: three numbered steps over a track whose magenta fill grows a third per step. */
.trd-stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-2);
}

.trd-stepper__btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}

.trd-stepper__btn:disabled {
  cursor: default;
}

.trd-stepper__no {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid var(--tint-24);
  background: var(--white);
  font-family: var(--ff-head);
  font-size: 1rem;
  font-weight: 700;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.trd-stepper__t {
  font-size: var(--fs-card);
  font-weight: 700;
  line-height: 1.3;
}

.trd-stepper__item[data-state="current"] .trd-stepper__no {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 10px 20px -10px rgba(0, 32, 96, 0.7);
}

.trd-stepper__item[data-state="current"] .trd-stepper__t {
  color: var(--ink);
}

/* A finished step shows a tick in place of its number. */
.trd-stepper__item[data-state="done"] .trd-stepper__no {
  border-color: var(--magenta);
  background: var(--magenta);
  color: transparent;
}

.trd-stepper__item[data-state="done"] .trd-stepper__no::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 8px;
  width: 8px;
  height: 14px;
  border-right: 2.5px solid var(--white);
  border-bottom: 2.5px solid var(--white);
  transform: rotate(45deg);
}

.trd-stepper__item[data-state="done"] .trd-stepper__t {
  color: var(--ink);
}

@media (hover: hover) and (pointer: fine) {
  .trd-stepper__btn:not(:disabled):hover .trd-stepper__t {
    color: var(--accent-text);
  }
}

.trd-progress {
  overflow: hidden;
  height: 4px;
  margin: 20px 0 clamp(28px, 4vw, 44px);
  border-radius: 4px;
  background: var(--tint-08);
}

.trd-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky) 0%, var(--blue) 50%, var(--magenta) 100%);
  transform: scaleX(calc(var(--trd-step) / 3));
  transform-origin: left center;
  transition: transform 420ms var(--ease);
}

/* ---------- one step ---------- */

.trd-pane {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.trd-pane[hidden] {
  display: none;
}

.trd-pane__head {
  margin-bottom: clamp(24px, 3vw, 36px);
}

.trd-pane__count {
  display: block;
  margin-bottom: 8px;
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.trd-pane__h {
  margin: 0;
  font-family: var(--ff-head);
  font-size: var(--fs-h2);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--ink);
}

.trd-pane__h:focus {
  outline: none;
}

.trd-pane__head p {
  margin: 10px 0 0;
  max-width: 60ch;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink-soft);
}

/* What the visitor chose, repeated on the last step so it can be checked before sending. */
.trd-summary {
  display: inline-block;
  margin: 14px 0 0;
  padding: 8px 14px;
  border-radius: var(--r-chip);
  background: var(--tint-08);
  font-size: var(--fs-card);
  font-weight: 700;
  color: var(--ink);
}

.trd-summary:empty {
  display: none;
}

.trd-error {
  margin: var(--s-2) 0 0;
  font-size: var(--fs-card);
  font-weight: 700;
  color: var(--accent-text);
}

.trd-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  margin-top: clamp(28px, 4vw, 40px);
  padding-top: clamp(20px, 3vw, 28px);
  border-top: 1px solid var(--tint-12);
}

.trd-nav > :only-child {
  margin-left: auto;
}

.trd-back {
  border-color: var(--tint-24);
  background: var(--white);
  color: var(--ink);
}

.trd-back:hover {
  border-color: var(--navy);
}

/* Without the script every step shows, so the step-only controls hide. */
.trd-wiz:not(.is-steps) .trd-stepper,
.trd-wiz:not(.is-steps) .trd-progress,
.trd-wiz:not(.is-steps) [data-next],
.trd-wiz:not(.is-steps) [data-back] {
  display: none;
}

.trd-wiz:not(.is-steps) .trd-pane + .trd-pane {
  margin-top: var(--s-5);
}

@media (max-width: 640px) {
  .trd-stepper__btn {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .trd-stepper__t {
    font-size: var(--fs-meta);
  }
  .trd-nav {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .trd-nav .btn {
    width: 100%;
  }
}

/* The real radio and checkbox inputs stay in the tab order; the card is their visible face. */
.trd-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

/* ---------- step 1: format tickets ---------- */

/* Labels hold only phrasing content, so titles and copy are spans styled as blocks. */

.trd-tickets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-3);
}

.trd-ticket {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  border-radius: var(--r-tile);
  border: 1px solid var(--tint-12);
  background: var(--white);
  color: var(--ink);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.trd-ticket__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px 26px 24px;
}

.trd-ticket__tag {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: var(--r-chip);
  background: var(--tint-08);
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.trd-ticket__t {
  display: block;
  margin: 8px 0 0;
  font-family: var(--ff-head);
  font-size: var(--fs-title-l);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.trd-ticket__d {
  display: block;
  margin: 0;
  font-size: var(--fs-card);
  line-height: 1.6;
  color: var(--ink-soft);
  transition: color var(--dur) var(--ease);
}

/* The stub below the perforation: a dashed rule with two notches cut into the card edges. The notches
   are circles in the section's ground colour, half clipped by the card's overflow. */
.trd-ticket__stub {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 18px 26px 22px;
  border-top: 2px dashed var(--tint-24);
  font-size: var(--fs-card);
  font-weight: 700;
  line-height: 1.4;
  transition: border-color var(--dur) var(--ease);
}

.trd-ticket__stub::before,
.trd-ticket__stub::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--trd-ground);
  box-shadow: inset 0 0 0 1px var(--tint-12);
}

.trd-ticket__stub::before {
  left: -12px;
}

.trd-ticket__stub::after {
  right: -12px;
}

.trd-ticket__stub span {
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color var(--dur) var(--ease);
}

/* Selection mark, drawn in CSS: an empty ring, then a magenta disc with a white tick. */
.trd-check {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid var(--tint-24);
  background: var(--white);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.trd-check::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 7px;
  height: 12px;
  border-right: 2.5px solid var(--white);
  border-bottom: 2.5px solid var(--white);
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.trd-ticket:has(.trd-input:checked) {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--on-navy);
  box-shadow: 0 2px 6px rgba(0, 32, 96, 0.08), 0 30px 60px -30px rgba(0, 32, 96, 0.6);
}

.trd-ticket:has(.trd-input:checked) .trd-ticket__d,
.trd-ticket:has(.trd-input:checked) .trd-ticket__stub span {
  color: var(--on-navy-mut);
}

.trd-ticket:has(.trd-input:checked) .trd-ticket__tag {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-deep);
}

.trd-ticket:has(.trd-input:checked) .trd-ticket__stub {
  border-top-color: rgba(255, 255, 255, 0.3);
}

.trd-ticket:has(.trd-input:checked) .trd-check,
.trd-pick:has(.trd-input:checked) .trd-check {
  border-color: var(--magenta);
  background: var(--magenta);
}

.trd-ticket:has(.trd-input:checked) .trd-check::after,
.trd-pick:has(.trd-input:checked) .trd-check::after {
  opacity: 1;
}

.trd-ticket:has(.trd-input:focus-visible),
.trd-pick:has(.trd-input:focus-visible) {
  outline: 3px solid var(--magenta);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .trd-ticket:not(:has(.trd-input:checked)):hover {
    transform: translateY(-4px);
    border-color: var(--tint-24);
    box-shadow: var(--svp-shadow);
  }
}

@media (max-width: 900px) {
  .trd-tickets {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-2);
  }
}

/* ---------- step 2: platform picker ---------- */

.trd-picks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--s-2);
}

.trd-pick {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  border-radius: var(--r-card);
  border: 1px solid var(--tint-12);
  background: var(--white);
  color: var(--ink);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.trd-pick__img {
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: linear-gradient(150deg, var(--blue) 0%, var(--navy) 60%, var(--navy-deep) 100%);
  color: var(--sky-deep);
}

.trd-pick__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--svp-slow);
}

.trd-pick__img svg {
  width: 40px;
  height: 40px;
}

.trd-pick__body {
  display: grid;
  gap: 2px;
  padding: 12px 14px 14px;
}

.trd-pick__t {
  font-family: var(--ff-head);
  font-size: var(--fs-title-s);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.trd-pick__d {
  font-size: var(--fs-meta);
  line-height: 1.4;
  color: var(--ink-soft);
}

/* The mark sits on the photo, so its empty state is a dark ring rather than a white one. */
.trd-pick .trd-check {
  top: 10px;
  right: 10px;
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 24, 69, 0.45);
}

.trd-pick:has(.trd-input:checked) {
  border-color: var(--magenta);
  box-shadow: 0 0 0 1px var(--magenta), var(--svp-shadow);
}

@media (hover: hover) and (pointer: fine) {
  .trd-pick:hover {
    transform: translateY(-3px);
    box-shadow: var(--svp-shadow);
  }
  .trd-pick:has(.trd-input:checked):hover {
    box-shadow: 0 0 0 1px var(--magenta), var(--svp-shadow);
  }
  .trd-pick:hover .trd-pick__img img {
    transform: scale(1.06);
  }
}

@media (max-width: 1100px) {
  .trd-picks {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .trd-picks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

/* ---------- step 3: what happens next beside the details panel ---------- */

.trd-details {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.trd-next {
  counter-reset: trd-next;
  list-style: none;
  margin: 0;
  padding: 0;
}

.trd-next li {
  counter-increment: trd-next;
  position: relative;
  display: grid;
  gap: 4px;
  padding: 0 0 28px 64px;
}

/* A numbered disc per stage, joined to the next by a dashed line. */
.trd-next li::before {
  content: counter(trd-next);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 2px solid var(--tint-24);
  background: var(--white);
  font-family: var(--ff-head);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--navy);
}

.trd-next li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 50px;
  bottom: 6px;
  width: 2px;
  background: repeating-linear-gradient(180deg, var(--tint-40) 0 6px, transparent 6px 12px);
}

.trd-next strong {
  padding-top: 10px;
  font-family: var(--ff-head);
  font-size: var(--fs-title-m);
  line-height: 1.25;
  font-weight: 700;
  color: var(--ink);
}

.trd-next span {
  font-size: var(--fs-card);
  line-height: 1.6;
  color: var(--ink-soft);
}

.trd-wiz .form__foot .btn {
  width: 100%;
}

.trd-wiz [data-enquiry-status] {
  margin: 0;
  color: var(--on-navy-mut);
}

@media (max-width: 960px) {
  .trd-details {
    grid-template-columns: minmax(0, 1fr);
  }
}
