/* =============================================================================
   Rocking Cube — demo.css
   Page-scoped styles for demo.html (the reference /demo request form).
   Loads after styles.css and only adds what the shared stylesheet does not
   already provide: the demo hero type scale, the request-form card, the
   program toggles and their pressed state. Nothing here is used elsewhere.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Hero — reference: section pb-20 (80px), h1 40px -> 48px at sm
   -------------------------------------------------------------------------- */
.demo-hero {
  padding-bottom: 5rem;
}

.demo-h1 {
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.03em;
}

/* Blueprint grid behind the hero, at half strength (reference opacity-50). */
.demo-grid {
  opacity: 0.5;
}

@media (min-width: 640px) {
  .demo-h1 {
    font-size: 48px;
  }
}

/* Two soft brand glows behind the hero (reference radial gradients). */
.demo-glow {
  position: absolute;
  border-radius: 9999px;
  pointer-events: none;
}
.demo-glow--a {
  top: -8rem;
  left: -8rem;
  width: 460px;
  height: 460px;
  background-image: radial-gradient(circle, rgba(104, 40, 190, 0.2), transparent 62%);
}
.demo-glow--b {
  top: 2.5rem;
  right: -6rem;
  width: 420px;
  height: 420px;
  background-image: radial-gradient(circle, rgba(124, 58, 237, 0.14), transparent 66%);
}

/* Numbered "how it works" list — reference space-y-6. */
.demo-steps {
  list-style: none;
  margin: 2.5rem 0 0; /* reference mt-10 */
  padding: 0;
}
.demo-steps > li + li {
  margin-top: 1.5rem;
}
.demo-steps span:first-child {
  padding-top: 2px;
}

/* styles.css orders .text-sm after .leading-relaxed, so the relaxed leading
   has to be restored here to match the reference's 1.625 step copy. */
.demo-steps p,
.demo-note p {
  line-height: 1.625;
}

/* -----------------------------------------------------------------------------
   Request form card — reference: rounded-xl, 1px border, white, p-6 / md:p-8
   -------------------------------------------------------------------------- */
.demo-form {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: #fff;
  padding: 24px;
  box-shadow: 0 20px 60px -45px rgba(11, 11, 12, 0.5);
}

@media (min-width: 768px) {
  .demo-form {
    padding: 32px;
  }
}

/* The one required-field marker in the design (see the fine print). */
.demo-req {
  color: var(--brand);
}

/* "Anything we should know" — a textarea, kept short so the card stays compact. */
.demo-message {
  min-height: 84px;
  resize: vertical;
}

.demo-form .form-status {
  margin-top: 12px;
}
.demo-form .form-status[data-state="pending"] {
  color: var(--muted-foreground);
}

/* -----------------------------------------------------------------------------
   Program toggles — reference: bordered checkbox rows, 2-up from sm.
   app.js writes aria-pressed / data-selected / .is-selected on click.
   -------------------------------------------------------------------------- */
.demo-programs {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

/* The group label is a <span>; make it a block so it does not add a line box
   above the grid (the reference label is display:block). */
#programs-label {
  display: block;
}

@media (min-width: 640px) {
  .demo-programs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.demo-program {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--muted-foreground);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s var(--ease-in-out), background-color 0.2s var(--ease-in-out),
    color 0.2s var(--ease-in-out);
}

.demo-program:hover {
  border-color: rgba(9, 9, 11, 0.25);
  color: var(--foreground);
}

.demo-program:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.demo-program__box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(9, 9, 11, 0.25);
  border-radius: 3px;
  background: #fff;
  color: #fff;
}

.demo-program__check {
  display: none;
}

.demo-program[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-pale);
  color: var(--foreground);
}

.demo-program[aria-pressed="true"] .demo-program__box {
  border-color: var(--brand);
  background: var(--brand);
}

.demo-program[aria-pressed="true"] .demo-program__check {
  display: block;
}

/* Full-width button on phones, intrinsic width from sm (reference sm:w-auto). */
@media (min-width: 640px) {
  .demo-form [data-booking-submit] {
    width: auto;
  }
}

/* Submit while the request is in flight (app.js sets [aria-busy]). */
.demo-form[aria-busy="true"] [data-booking-submit] {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .demo-program {
    transition: none;
  }
}

/* -----------------------------------------------------------------------------
   Embedded mode — /demo.html?embed=1, the sitewide dialog's iframe.
   Same page, same form, same app.js network contract: only the page chrome is
   hidden and the form column takes the full width. /demo without the flag is
   byte-for-byte the same layout as before.
   -------------------------------------------------------------------------- */
html[data-embed] .site-header,
html[data-embed] footer,
html[data-embed] .demo-grid,
html[data-embed] .demo-glow,
html[data-embed] [data-demo-intro] {
  display: none;
}

html[data-embed] .demo-hero {
  padding-top: 0;
  padding-bottom: 0;
}

/* Collapse the 12-column hero grid down to the form, with dialog-sized gutters. */
html[data-embed] .demo-hero > div.relative {
  display: block;
  max-width: 720px;
  padding: 20px 20px 28px;
}

@media (min-width: 768px) {
  html[data-embed] .demo-hero > div.relative {
    padding: 24px 24px 32px;
  }
}

/* The dialog already draws the card: no second border, shadow or inset padding. */
html[data-embed] .demo-form {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
