/* Rediall marketing site: the Book a demo page (book-demo.html). The pitch
   at left, the three-step form in a card at right; stacked below 900px.
   Uses the site tokens, so both themes follow. Loads after theme.css. */

.demo-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
  padding-block: clamp(48px, 8vw, 104px);
}

.demo-intro {
  position: sticky;
  top: calc(var(--header-h, 64px) + 40px);
  display: grid;
  justify-items: start;
  gap: 20px;
}

.demo-intro .label {
  margin: 0;
}

.demo-lede {
  max-width: 420px;
  margin: 0;
  font-size: var(--fs-lede);
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--text);
}

.demo-points {
  display: grid;
  gap: 0;
  width: min(100%, 420px);
  margin: 4px 0 8px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.demo-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-small, 0.875rem);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.demo-points li::before {
  content: "";
  flex: none;
  width: 10px;
  height: 6px;
  margin-top: -3px;
  border-left: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------- the card ---------- */

.demo-card {
  padding: clamp(24px, 3.4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  box-shadow: var(--shadow-frag);
}

.demo-card-title {
  font-size: var(--fs-h3);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.df-progress {
  display: flex;
  gap: 8px;
  margin: 16px 0 28px;
}

.df-progress i {
  position: relative;
  width: 44px;
  height: 3px;
  border-radius: 2px;
  background: var(--line-strong);
  overflow: hidden;
}

/* each bar fills from the left as its step is reached */
.df-progress i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms var(--ease-out);
}

.df-progress i.is-on::after {
  transform: none;
}

.df fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* without JS every step shows; with JS one at a time */
.df:not(.is-stepped) fieldset + fieldset {
  margin-top: 32px;
}

.df legend {
  margin-bottom: 18px;
  padding: 0;
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--muted);
}

.df-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
}

.df-wide {
  grid-column: 1 / -1;
}

.df-field {
  display: grid;
  gap: 7px;
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.df-field b,
.df-check b {
  font-weight: 500;
  color: var(--accent);
}

.df-field small {
  font-size: var(--fs-micro);
  font-weight: 400;
  color: var(--muted);
}

.df :is(input, select, textarea) {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--surface);
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition:
    border-color 150ms var(--ease),
    background-color 150ms var(--ease);
}

.df textarea {
  min-height: 112px;
  resize: vertical;
}

.df select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.df :is(input, select, textarea):focus-visible {
  outline: none;
  border-color: var(--focus);
  background-color: var(--paper);
}

.df :is(input, select, textarea):user-invalid {
  border-color: #d14343;
}

.df-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-small, 0.875rem);
  line-height: 1.45;
  color: var(--text);
}

.df-check input {
  flex: none;
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--ink);
}

.df-check a {
  color: inherit;
  text-underline-offset: 3px;
}

.df-trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.df-status {
  min-height: 1.4em;
  margin: 20px 0 0;
  font-size: var(--fs-small, 0.875rem);
  color: var(--text);
}

.df-status:empty {
  min-height: 0;
  margin: 0;
}

.df-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.df-actions .btn {
  height: 40px;
  padding: 0 20px;
}

.df-actions [data-back] {
  margin-right: auto;
}

.df-done {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 12px 0 4px;
  outline: none;
}

.df-done h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 1.6rem + 1.4vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.df-done p {
  margin: 0;
  color: var(--text);
}

@media (max-width: 900px) {
  .demo-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo-intro {
    position: static;
  }
}

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

/* steps travel the way you go; the thanks rises in */
@media (prefers-reduced-motion: no-preference) {
  .df[data-dir] fieldset:not([hidden]) {
    animation: df-in 220ms var(--ease-out) both;
  }

  .df[data-dir="back"] {
    --df-dir: -1;
  }

  .df-done:not([hidden]) {
    animation: df-rise 300ms var(--ease-out) both;
  }
}

@keyframes df-in {
  from {
    opacity: 0;
    translate: calc(var(--df-dir, 1) * 12px) 0;
  }
}

@keyframes df-rise {
  from {
    opacity: 0;
    translate: 0 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .df :is(input, select, textarea),
  .df-progress i::after {
    transition: none;
  }
}
