/* Book a Strategic Demonstration page: the three-step request form. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.demo-page { padding: calc(72px + var(--space-5)) 0 var(--space-7); }
.demo-grid { max-width: 1000px; margin-inline: auto; }

/* ---------- Card ---------- */
.demo-card { padding: var(--space-5) var(--space-6); background: var(--surface-100); border: 1px solid var(--line-strong); border-radius: var(--radius-xl); }

.demo-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.demo-progress li { position: relative; }
.demo-progress li::before { content: ""; position: absolute; left: 12px; right: 0; top: 5px; height: 2px; background: var(--line-strong); }
.demo-progress li:last-child::before { display: none; }
.demo-progress li.is-done::before { background: var(--accent); }
.demo-progress-btn { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 0; font: inherit; color: inherit; background: none; border: 0; cursor: default; }
.demo-progress-btn:not(:disabled) { cursor: pointer; }
.demo-progress-btn:not(:disabled):hover .mono-label { color: var(--ink); }
.demo-node { width: 12px; height: 12px; box-sizing: border-box; border: 2px solid var(--line-control); border-radius: var(--radius-full); background: var(--surface-100); transition: border-color var(--duration-node) var(--ease-standard), background-color var(--duration-node) var(--ease-standard), box-shadow var(--duration-node) var(--ease-standard); }
.demo-progress li.is-current .demo-node { border-color: var(--accent); background: var(--accent); box-shadow: var(--shadow-node); }
.demo-progress li.is-done .demo-node { border-color: var(--accent); }
.demo-progress li.is-current .mono-label { color: var(--accent-text); }
.demo-progress li.is-done .mono-label { color: var(--ink); }

/* ---------- Steps ---------- */
.demo-step { margin: 0; padding: 0; border: 0; min-width: 0; }
.demo-step[hidden] { display: none; }
.js .demo-step.is-entering { animation: stepIn var(--duration-layer) var(--ease-layer) both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* The step name is already shown, highlighted, in the progress row; the legend stays for screen readers and focus */
.demo-legend { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.demo-legend:focus { outline: none; }
.demo-step-lead { margin: 0 0 var(--space-4); font-size: 16px; line-height: 24px; color: var(--ink-muted); }

.demo-field { min-width: 0; margin-bottom: var(--space-4); }
.demo-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-4); }
.demo-field-wide { grid-column: 1 / -1; }
.demo-textarea { height: auto; min-height: 64px; padding: 8px var(--space-3); line-height: 22px; resize: vertical; }
/* The site description starts as one line and grows as it is filled in (where the browser supports it) */
.demo-textarea-grow { min-height: 40px; max-height: 136px; field-sizing: content; resize: none; }
.optional { margin-left: 6px; font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.hk-field-error .hk-input, .hk-field-error .choice, .hk-field-error .chip-radio, .hk-field-error .hk-check-input { border-color: var(--error-text); }
.hk-hint[hidden], .demo-field .hk-control[hidden] { display: none; }
.hk-check-label a, .hk-hint a { color: var(--accent-text); }

/* Decision choices: large radio cards, the selected one takes the accent */
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.choice {
  display: flex; align-items: flex-start; gap: var(--space-3); padding: 8px 14px; cursor: pointer;
  background: var(--surface-000); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  transition: border-color var(--duration-hover) var(--ease-standard), background-color var(--duration-hover) var(--ease-standard);
}
.choice:hover { border-color: var(--line-control); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice .hk-check-input { margin-top: 3px; }
.choice-text { display: grid; gap: 2px; }
.choice-q { font-size: 15px; line-height: 22px; color: var(--ink); }
.choice-name { font-family: var(--font-mono); font-size: 10px; line-height: 14px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.demo-prefill { margin: 0 0 var(--space-2); font-size: 13px; line-height: 20px; color: var(--accent-text); }

/* Role and format: radio chips (homepage .chip styling, driven by :checked) */
.role-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip-radio { position: relative; cursor: pointer; }
.chip-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chip-radio:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-radio[hidden] { display: none; }

.demo-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.demo-actions .hk-btn { text-decoration: none; }
.demo-actions .hk-btn-primary { margin-left: auto; }
.hk-btn[aria-busy="true"] { opacity: .75; cursor: progress; }

/* Error summary */
.error-summary { margin: 0 0 var(--space-6); padding: var(--space-4); background: var(--surface-200); border: 1px solid var(--line); border-left: 3px solid var(--error-text); border-radius: var(--radius-md); }
.error-summary:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.error-summary p { margin: 0 0 var(--space-2); font-weight: 600; }
.error-summary ul { margin: 0; padding-left: 1.2em; }
.error-summary a { color: var(--error-text); }

/* Summary of answers: two columns, step 1 answers on the left and step 2 answers on the right.
   Each row: label and Edit on top, the answer below (long answers are cut to two lines). */
.demo-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); grid-auto-flow: column; column-gap: var(--space-6); margin: 0 0 var(--space-4); border-top: 1px solid var(--line); }
.demo-summary div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-3); align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.demo-summary dt { font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.demo-summary dd { margin: 0; font-size: 14px; line-height: 20px; }
.demo-summary dd:last-child { grid-column: 2; grid-row: 1; }
.demo-summary dd:not(:last-child) { grid-column: 1 / -1; grid-row: 2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.demo-consent-label { display: block; }
.demo-summary button { padding: 0; font: inherit; font-size: 13px; color: var(--accent-text); background: none; border: 0; cursor: pointer; }

/* Spam trap */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Done ---------- */
.demo-done { padding: var(--space-4) 0 0; }
.demo-done:focus { outline: none; }
.demo-done-node { display: block; width: 18px; height: 18px; margin-bottom: var(--space-6); background: var(--decision-lime); border-radius: var(--radius-full); box-shadow: 0 0 0 6px var(--accent-soft); animation: nodeIn var(--duration-node) var(--ease-node) both; }
[data-theme="paper"] .demo-done-node { box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 7px var(--accent-soft); }
@keyframes nodeIn { from { transform: scale(0); } to { transform: scale(1); } }
.demo-done-title { margin: var(--space-3) 0 var(--space-4); font-family: var(--font-display); font-weight: 400; font-size: 36px; line-height: 42px; }
.demo-done-text { max-width: 600px; margin: 0 0 var(--space-4); color: var(--ink-muted); }
.demo-done-text strong { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.demo-done-ref[hidden] { display: none; }
.demo-done-ref { margin: 0; }
.demo-done .demo-actions .hk-btn-primary { margin-left: 0; }

/* ---------- Toasts ---------- */
.toast-region { position: fixed; z-index: 70; right: var(--space-5); bottom: var(--space-5); display: grid; gap: var(--space-2); width: min(420px, calc(100vw - 2 * var(--space-5))); }
.toast-region .hk-toast { animation: stepIn var(--duration-layer) var(--ease-layer) both; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .demo-page { padding-top: calc(72px + var(--space-6)); }
  .demo-card { padding: var(--space-5); }
  .demo-fields, .choice-grid { grid-template-columns: minmax(0, 1fr); }
  .demo-summary { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .demo-progress li:not(.is-current) .pg-t { display: none; }  /* numbers only, except the current step */
  .demo-actions .hk-btn { flex: 1 1 auto; }
}

/* Keep focused summaries and fields clear of the fixed nav */
.error-summary, .demo-legend, .demo-field, .demo-done { scroll-margin-top: calc(72px + var(--space-6)); }
.demo-progress[hidden], .demo-done[hidden], form[hidden] { display: none; }
