/* QNSET service pages: Details (.qd) and the request form (.qr). Builds on
   qx.css. Each service wears the brand colour it has on the Services page,
   carried as --c by .qd-c--{colour} (Models/ServiceColours.cs). */

.qd-c--red { --c: var(--qx-red); }
.qd-c--purple { --c: var(--qx-purple); }
.qd-c--blue { --c: var(--qx-blue); }
.qd-c--white { --c: var(--qx-ink); }

/* ---------- Shared bits ---------- */

.qd-back {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: clamp(2rem, 6vh, 3.5rem);
  font-family: var(--qx-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--qx-faint);
  text-decoration: none;
  opacity: 0;
  animation: qx-fade 0.8s ease 0.1s forwards;
  transition: color 0.2s ease;
}

.qd-back svg {
  transition: transform 0.4s var(--qx-ease);
}

.qd-back:hover {
  color: var(--qx-ink);
}

.qd-back:hover svg {
  transform: translateX(-4px);
}

.qd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 14px var(--c);
}

.qd-h2 {
  margin: 0;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* ---------- Details: hero ---------- */

.qd-hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(2.5rem, 8vh, 5rem) clamp(4rem, 10vh, 6.5rem);
}

/* a ring in the service colour with a light travelling around it */
.qd-ring {
  position: absolute;
  z-index: -1;
  top: clamp(-22rem, -30vw, -12rem);
  right: clamp(-24rem, -18vw, -8rem);
  width: clamp(30rem, 62vw, 56rem);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  border-radius: 50%;
  box-shadow:
    0 0 80px -20px color-mix(in srgb, var(--c) 45%, transparent),
    inset 0 0 120px -50px color-mix(in srgb, var(--c) 50%, transparent);
  pointer-events: none;
  opacity: 0;
  animation: qx-fade 1.8s ease 0.3s forwards, qd-spin 28s linear infinite;
}

.qd-ring::before {
  content: '';
  position: absolute;
  top: -4px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 18px 4px color-mix(in srgb, var(--c) 70%, transparent);
}

.qd-kicker {
  opacity: 0;
  animation: qx-fade 0.8s ease 0.15s forwards;
}

.qd-title {
  max-width: 16ch;
  font-size: clamp(2.6rem, 6.6vw, 6.25rem);
}

/* ---------- Details: sections ---------- */

.qd-section {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: 2rem clamp(3rem, 7vw, 7rem);
  align-items: start;
  padding-block: clamp(4rem, 10vh, 7rem);
  border-top: 1px solid var(--qx-line);
}

.qd-side {
  position: sticky;
  top: 6rem;
}

.qd-features {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--qx-line);
}

.qd-feature {
  position: relative;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  align-items: baseline;
  padding: clamp(1.15rem, 2.4vw, 1.6rem) 0.25rem;
  border-bottom: 1px solid var(--qx-line);
}

/* the service colour draws along each row as it comes in */
.qd-feature::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 40%;
  height: 1px;
  background: linear-gradient(90deg, var(--c), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.3s var(--qx-ease) calc(var(--d, 0ms) + 0.25s);
}

.qd-feature.is-in::after,
html:not(.qx-js) .qd-feature::after {
  transform: scaleX(1);
}

.qd-feature-num {
  font-family: var(--qx-mono);
  font-size: 0.78rem;
  color: var(--c);
}

.qd-feature-text {
  font-size: clamp(1.2rem, 2.1vw, 1.75rem);
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -0.02em;
  transition: transform 0.7s var(--qx-ease);
}

.qd-feature:hover .qd-feature-text {
  transform: translateX(0.5rem);
}

.qd-fit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.qd-fit-card {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: start;
  gap: 0.85rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  overflow: hidden;
  border: 1px solid var(--qx-line);
  border-radius: 1.5rem;
  background: var(--qx-surface);
}

.qd-fit-card--yes {
  border-color: color-mix(in srgb, var(--c) 40%, transparent);
}

.qd-fit-card--yes::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(28rem circle at 100% 0%, color-mix(in srgb, var(--c) 16%, transparent), transparent 65%);
}

.qd-fit-label {
  margin: 0;
  font-family: var(--qx-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--qx-faint);
}

.qd-fit-title {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.qd-fit-text {
  margin: 0;
  line-height: 1.6;
  color: var(--qx-muted);
}

.qd-fit-text a,
.qr-note a,
.qr-check a,
.qr-warn a {
  color: var(--qx-ink);
  text-decoration-color: color-mix(in srgb, var(--c) 70%, transparent);
  text-underline-offset: 3px;
}

.qd-fit-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--qx-ink);
  text-decoration: none;
}

.qd-fit-link svg {
  transition: transform 0.5s var(--qx-ease);
}

.qd-fit-link:hover svg {
  transform: translateX(4px);
}

.qd-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-block: clamp(4rem, 10vh, 6rem) clamp(6rem, 14vh, 9rem);
  border-top: 1px solid var(--qx-line);
}

.qd-end-title {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.035em;
}

/* ---------- Request: layout ---------- */

.qr-layout {
  display: grid;
  grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
  gap: clamp(3rem, 6vw, 6rem);
  align-items: start;
  padding-block: clamp(2.5rem, 8vh, 5rem) clamp(6rem, 14vh, 9rem);
}

.qr-summary {
  position: sticky;
  top: 6rem;
}

.qr-title {
  margin: 0;
  font-size: clamp(2.4rem, 4.4vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
  opacity: 0;
  animation: qx-fade-up 1s var(--qx-ease) 0.2s forwards;
}

.qr-lead {
  margin: 1.25rem 0 0;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--qx-muted);
  opacity: 0;
  animation: qx-fade-up 0.9s var(--qx-ease) 0.35s forwards;
}

.qr-includes {
  display: grid;
  gap: 0.55rem;
  margin: 2rem 0 0;
  padding: 1.5rem 0 0;
  list-style: none;
  border-top: 1px solid var(--qx-line);
  opacity: 0;
  animation: qx-fade 1s ease 0.55s forwards;
}

.qr-includes li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: rgba(244, 244, 247, 0.78);
}

.qr-includes li::before {
  content: '';
  flex: none;
  width: 0.65rem;
  height: 2px;
  margin-bottom: 0.3em;
  border-radius: 1px;
  background: var(--c);
}

.qr-note {
  margin: 1.75rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--qx-line);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--qx-faint);
  opacity: 0;
  animation: qx-fade 1s ease 0.7s forwards;
}

.qr-card {
  position: relative;
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--qx-line);
  border-radius: 1.75rem;
  background: rgba(13, 13, 19, 0.72);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.85);
  opacity: 0;
  animation: qx-fade-up 1s var(--qx-ease) 0.3s forwards;
}

.qr-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c), transparent);
  transform: scaleX(0);
  animation: qx-grow-x 1.3s var(--qx-ease) 0.8s forwards;
}

.qr-missing {
  display: grid;
  justify-items: start;
  gap: 1.5rem;
  padding-block: clamp(5rem, 14vh, 9rem);
}

/* ---------- Request: form ---------- */

.qr-step {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.qr-step + .qr-step {
  margin-top: 2.25rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--qx-line);
}

/* floated so the legend lays out like a heading instead of sitting on the
   fieldset's top border */
.qr-step-head {
  float: left;
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin-bottom: 1.35rem;
  padding: 0;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.qr-step-head + * {
  clear: both;
}

.qr-step-num {
  font-family: var(--qx-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--c);
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1rem;
}

.qr-step > .qr-field + .qr-grid {
  margin-top: 1.1rem;
}

.qr-field {
  display: grid;
  align-content: start;
  gap: 0.45rem;
}

.qr-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(244, 244, 247, 0.85);
}

.qr-optional {
  margin-left: 0.35rem;
  font-family: var(--qx-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--qx-faint);
}

.qr-input {
  width: 100%;
  height: 2.9rem;
  padding: 0 0.95rem;
  border: 1px solid rgba(244, 244, 247, 0.12);
  border-radius: 0.75rem;
  background: rgba(244, 244, 247, 0.035);
  color: var(--qx-ink);
  font: inherit;
  font-size: 0.98rem;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, background-color 0.2s ease;
}

.qr-input::placeholder {
  color: rgba(244, 244, 247, 0.3);
}

.qr-input:hover {
  border-color: rgba(244, 244, 247, 0.22);
}

.qr-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--c) 85%, transparent);
  background: color-mix(in srgb, var(--c) 6%, transparent);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--c) 16%, transparent),
    0 0 24px -6px color-mix(in srgb, var(--c) 50%, transparent);
}

.qr-textarea {
  height: auto;
  min-height: 8.5rem;
  padding-block: 0.8rem;
  line-height: 1.55;
  resize: vertical;
}

.qr-input.input-validation-error {
  border-color: rgba(255, 45, 74, 0.7);
}

.qr-error {
  font-size: 0.84rem;
  line-height: 1.4;
  color: #ff8a9b;
}

.qr-error.field-validation-valid {
  display: none;
}

.qr-errors ul {
  margin: 0 0 1.5rem;
  padding: 0.8rem 1rem;
  list-style: none;
  border: 1px solid rgba(255, 45, 74, 0.45);
  border-radius: 0.8rem;
  background: rgba(255, 45, 74, 0.1);
  font-size: 0.9rem;
  line-height: 1.5;
  color: #ffd2d9;
}

.qr-errors.validation-summary-valid {
  display: none;
}

/* "Who is it for?" as two selectable cards */
.qr-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.qr-choice + .qr-error {
  display: block;
  margin-top: 0.6rem;
}

.qr-option {
  position: relative;
  cursor: pointer;
}

.qr-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.qr-option-box {
  position: relative;
  display: grid;
  gap: 0.2rem;
  height: 100%;
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(244, 244, 247, 0.12);
  border-radius: 1rem;
  background: rgba(244, 244, 247, 0.025);
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.3s ease;
}

.qr-option-box svg {
  margin-bottom: 0.6rem;
  color: var(--qx-faint);
  transition: color 0.25s ease;
}

/* the selection mark in the corner */
.qr-option-box::after {
  content: '';
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 1rem;
  height: 1rem;
  border: 1px solid rgba(244, 244, 247, 0.25);
  border-radius: 50%;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.qr-option-title {
  font-weight: 600;
}

.qr-option-text {
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--qx-muted);
}

.qr-option:hover .qr-option-box {
  border-color: rgba(244, 244, 247, 0.25);
}

.qr-option input:checked + .qr-option-box {
  border-color: color-mix(in srgb, var(--c) 75%, transparent);
  background: color-mix(in srgb, var(--c) 9%, transparent);
  box-shadow: 0 0 30px -12px color-mix(in srgb, var(--c) 70%, transparent);
}

.qr-option input:checked + .qr-option-box svg {
  color: var(--c);
}

.qr-option input:checked + .qr-option-box::after {
  border-color: var(--c);
  background: radial-gradient(circle, var(--c) 0 3.5px, transparent 4.5px);
  box-shadow: 0 0 10px color-mix(in srgb, var(--c) 60%, transparent);
}

.qr-option input:focus-visible + .qr-option-box {
  outline: 2px solid var(--c);
  outline-offset: 2px;
}

.qr-biz {
  margin-top: 1.25rem;
}

/* collapsed only once qx.js is running, so it can always be opened */
.qx-js .qr-biz.is-collapsed {
  display: none;
}

.qr-biz.is-opening {
  animation: qx-fade-up 0.6s var(--qx-ease);
}

.qr-biz .qr-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.qr-warn {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 45, 74, 0.45);
  border-radius: 0.8rem;
  background: rgba(255, 45, 74, 0.1);
  font-size: 0.9rem;
  line-height: 1.5;
  color: #ffd2d9;
}

.qr-warn[hidden] {
  display: none;
}

.qr-consent {
  display: grid;
  gap: 0.5rem;
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--qx-line);
}

.qr-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--qx-muted);
  cursor: pointer;
}

.qr-check input {
  flex: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.2rem 0 0;
  accent-color: var(--c);
}

.qr-submit {
  width: 100%;
  margin-top: 1.5rem;
}

.qr-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.qr-submit:disabled::before {
  display: none;
}

/* ---------- Request: sent ---------- */

.qr-done {
  display: grid;
  justify-items: start;
  gap: 1rem;
  padding-block: 1rem;
}

.qr-done-mark {
  color: var(--c);
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--c) 60%, transparent));
}

.qr-done-ring {
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: qr-draw 1s var(--qx-ease) 0.5s forwards;
}

.qr-done-tick {
  stroke-dasharray: 32;
  stroke-dashoffset: 32;
  animation: qr-draw 0.6s var(--qx-ease) 1.2s forwards;
}

.qr-done-title {
  margin: 0.5rem 0 0;
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.qr-done-text {
  max-width: 46ch;
  margin: 0 0 1rem;
  line-height: 1.6;
  color: var(--qx-muted);
}

.qr-done-text strong {
  color: var(--qx-ink);
}

@keyframes qd-spin {
  to { transform: rotate(360deg); }
}

@keyframes qr-draw {
  to { stroke-dashoffset: 0; }
}

/* ---------- Mobile ---------- */

@media (max-width: 899px) {
  .qd-section,
  .qr-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .qd-side,
  .qr-summary {
    position: static;
  }

  .qd-fit {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 639px) {
  .qr-grid,
  .qr-biz .qr-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .qr-includes {
    display: none;
  }
}

@media (max-width: 479px) {
  .qr-choice {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .qd-ring {
    opacity: 1;
    animation: none;
  }
}
