/* =====================================================================
   demo.css — the frame around the real app.

   This file used to hold ~440 lines re-creating the product's interface in
   CSS. None of that is here any more: `/demo/` is the product's own build,
   and it brings its own look. What is left is the shell that holds it.
   ===================================================================== */

.bd-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background: #0d0d0f;
  color: #f4f4f5;
  overflow: hidden;
}

/* IDLE, AND PAINTED.
   A browser does not paint what it cannot show, so `display:none`,
   `visibility:hidden` and `opacity:0` would each leave the app booted but
   undrawn — and the first frame would then be paid for after the tap, which
   is the whole wait this is meant to remove. A transform does not change
   layout: the overlay stays 100% × 100%, Flutter lays out and paints at the
   real size, and all the visitor sees is a speck in the corner behind the
   page. Opening removes the transform. */
.bd-overlay[aria-hidden="true"] {
  transform: scale(0.002);
  transform-origin: 0 0;
  pointer-events: none;
  z-index: -1;
}
.bd-overlay.is-open { transform: none; pointer-events: auto; z-index: 9999; }

/* The page behind must not scroll under an open demo. */
.bd-locked, .bd-locked body { overflow: hidden; }

.bd-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #121214;
}

/* The close button, the side switch and the light/dark toggle. Nothing else:
   a header that explains the demo is a header that does not do anything. */
.bd-x,
.bd-theme {
  appearance: none;
  flex: none;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #f4f4f5;
  border-radius: 999px;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}
.bd-theme { margin-inline-start: auto; }
.bd-theme svg { width: 19px; height: 19px; }
.bd-x:hover, .bd-theme:hover { background: rgba(255, 255, 255, 0.13); }

/* A segmented control, not two buttons: which side you are on is one answer
   with two values, and the shape should say so. */
.bd-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.bd-seg button {
  appearance: none;
  border: 0;
  background: none;
  color: #a1a1aa;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 7px 16px;
  min-height: 36px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.bd-seg button[aria-pressed="true"] {
  background: #5bd4a2;
  color: #06301f;
}

/* The chrome follows the app: a dark bar over a bright screen reads as two
   products stacked. */
.bd-overlay.is-light { background: #f2f2f7; }
.bd-overlay.is-light .bd-bar {
  background: #fff;
  border-bottom-color: rgba(0, 0, 0, 0.1);
}
.bd-overlay.is-light .bd-x,
.bd-overlay.is-light .bd-theme {
  color: #18181b;
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.04);
}
.bd-overlay.is-light .bd-seg {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}
.bd-overlay.is-light .bd-seg button { color: #52525b; }
.bd-overlay.is-light .bd-seg button[aria-pressed="true"] { color: #06301f; }
.bd-overlay.is-light .bd-frame { background: #f2f2f7; }

.bd-stage { flex: 1; min-height: 0; display: flex; }

.bd-frame {
  border: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #1a1a1a;
}

/* On a wide screen the app is still a phone app; a 430px column reads as one
   rather than stretching a bottom nav bar across a desktop. */
@media (min-width: 900px) {
  .bd-stage { justify-content: center; padding: 16px 0; }
  .bd-frame {
    width: 430px;
    max-width: 100%;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  }
}

.demo-open { cursor: pointer; }

/* =====================================================================
   The welcome card, shown only on a per-business link (`?b=<slug>`).

   It covers the whole overlay, header included: the one thing to do when
   it is up is read it, and a side switch peeking out from behind invites
   a tap that makes no sense yet. It sits over the app rather than in place
   of it, so the bundle is booting and painting the first frame while the
   visitor is still reading — dismissing it reveals an app already drawn.
   ===================================================================== */
.bd-welcome {
  position: absolute;
  inset: 0;
  z-index: 2;
  /* flex + `margin:auto` on the card, not `place-items:center`: a centred
     grid item taller than the box overflows off the TOP, where no scroll
     reaches it — and the only button would be unreachable on a short
     screen. This centres while it fits and scrolls when it does not. */
  display: flex;
  overflow: auto;
  padding: 20px;
  background: rgba(8, 8, 10, 0.82);
  backdrop-filter: blur(6px);
}

.bd-card {
  margin: auto;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
  padding: 26px 24px 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #17171a;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  text-align: start;
}

.bd-card p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; color: #d4d4d8; }
.bd-card .bd-hi {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  color: #f4f4f5;
  margin-bottom: 10px;
}
.bd-card .bd-fine { font-size: 13.5px; color: #a1a1aa; }
.bd-card p:last-of-type { margin-bottom: 20px; }

.bd-go {
  appearance: none;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  background: #5bd4a2;
  color: #06301f;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.bd-go:hover { background: #6fdcb0; }

.bd-overlay.is-light .bd-welcome { background: rgba(242, 242, 247, 0.92); }
.bd-overlay.is-light .bd-card {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}
.bd-overlay.is-light .bd-card .bd-hi { color: #09090b; }
.bd-overlay.is-light .bd-card p { color: #3f3f46; }
.bd-overlay.is-light .bd-card .bd-fine { color: #71717a; }
