/* /web/book-demo/: intro on the left, a request card on the right that turns into a Spock message once sent. */

.bd {
    --bd-ink: #1d1d1f; --bd-body: #424245; --bd-muted: #6e6e73; --bd-hair: rgba(29, 29, 31, 0.12);
    --bd-blue: #0f69ff; --bd-blue-deep: #0b5be0; --bd-red: #d92d20; --bd-green: #16a34a;
    --bd-ease: cubic-bezier(0.22, 1, 0.36, 1);
    position: relative; overflow-x: clip;
    margin-top: calc(-1 * var(--nav-h, 64px)); padding: calc(var(--nav-h, 64px) + 72px) 0 120px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Lato, sans-serif;
    color: var(--bd-ink); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    background:
        radial-gradient(55% 45% at 12% 8%, rgba(15, 105, 255, 0.14) 0%, rgba(15, 105, 255, 0) 70%),
        radial-gradient(45% 40% at 92% 22%, rgba(164, 87, 255, 0.12) 0%, rgba(164, 87, 255, 0) 70%),
        radial-gradient(55% 40% at 60% 100%, rgba(61, 214, 201, 0.14) 0%, rgba(61, 214, 201, 0) 70%),
        #fbfbfd;
}
.bd * { box-sizing: border-box; }
.bd-wrap {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 72px; align-items: start;
    max-width: 1120px; margin: 0 auto; padding: 0 24px;
}

/* Intro */
.bd-eyebrow { margin: 0 0 16px; font-size: 17px; font-weight: 600; color: var(--bd-blue); }
.bd-h1 { margin: 0; font-size: 60px; line-height: 1.04; letter-spacing: -0.028em; font-weight: 700; color: var(--bd-ink); text-wrap: balance; }
.bd-lead { margin: 24px 0 0; max-width: 560px; font-size: 21px; line-height: 1.45; letter-spacing: -0.008em; color: var(--bd-body); text-wrap: pretty; }
.bd-h2 { margin: 56px 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bd-muted); }
.bd-cover { list-style: none; margin: 0; padding: 0; max-width: 560px; }
.bd-cover li { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--bd-hair); }
.bd-cover li:last-child { border-bottom: 0; }
.bd-cover h3 { margin: 0 0 4px; font-size: 17px; line-height: 1.3; letter-spacing: -0.012em; font-weight: 600; color: var(--bd-ink); }
.bd-cover p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--bd-muted); text-wrap: pretty; }
.bd-cover-icon {
    flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    background: #ffffff; box-shadow: 0 0 0 1px var(--bd-hair), 0 2px 6px -2px rgba(15, 23, 42, 0.12);
}
.bd-cover-icon svg { width: 18px; height: 18px; fill: none; stroke: var(--bd-blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bd-proof { margin: 28px 0 0; font-size: 14px; color: var(--bd-muted); }

/* Card */
.bd-card {
    position: sticky; top: calc(var(--nav-h, 64px) + 24px);
    padding: 36px 36px 32px; border-radius: 28px; background: #ffffff;
    box-shadow: 0 0 0 1px rgba(29, 29, 31, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04), 0 24px 56px -20px rgba(15, 23, 42, 0.22);
    transition: height 0.5s var(--bd-ease), box-shadow 0.4s ease;
}
.bd-card[style*="height"] { overflow: hidden; }
.bd-card.is-done { box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.18), 0 2px 4px rgba(15, 23, 42, 0.04), 0 24px 56px -20px rgba(22, 163, 74, 0.28); }
.bd-card-title { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; color: var(--bd-ink); }
.bd-card-sub { margin: 8px 0 28px; font-size: 15px; line-height: 1.5; color: var(--bd-muted); }

.bd-pane { outline: none; }
.bd-pane.is-leaving { opacity: 0; transform: translateY(-6px) scale(0.98); transition: opacity 0.22s ease, transform 0.22s ease; }
.bd-pane.is-entering { animation: bd-rise 0.55s var(--bd-ease) both; }

/* Fields */
.bd-field { margin: 0 0 22px; padding: 0; border: 0; min-width: 0; }
.bd-field label, .bd-field legend { display: block; margin: 0 0 8px; padding: 0; font-size: 14px; font-weight: 600; color: var(--bd-ink); }
.bd-field legend span { margin-left: 4px; font-weight: 400; color: var(--bd-muted); }
.bd-field input[type="email"] {
    display: block; width: 100%; height: 52px; padding: 0 16px;
    font: inherit; font-size: 17px; color: var(--bd-ink);
    background: #f5f5f7; border: 1px solid transparent; border-radius: 14px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
    -webkit-appearance: none; appearance: none;
}
.bd-field input[type="email"]::placeholder { color: #a1a1a6; }
.bd-field input[type="email"]:hover { background: #efeff2; }
.bd-field input[type="email"]:focus { outline: none; background: #ffffff; border-color: var(--bd-blue); box-shadow: 0 0 0 4px rgba(15, 105, 255, 0.16); }
.bd-field.has-error input[type="email"] { background: #fff; border-color: var(--bd-red); box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.12); }
.bd-field.is-shaking { animation: bd-shake 0.4s ease; }

.bd-error { margin: 0; max-height: 0; overflow: hidden; font-size: 14px; line-height: 1.4; color: var(--bd-red); opacity: 0; transition: max-height 0.3s var(--bd-ease), opacity 0.2s ease, margin 0.3s var(--bd-ease); }
.bd-error:not(:empty) { max-height: 60px; margin-top: 8px; opacity: 1; }
.bd-error--form:not(:empty) { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: rgba(217, 45, 32, 0.07); max-height: 120px; }

/* Team size chips */
.bd-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bd-chip { position: relative; margin: 0 !important; cursor: pointer; }
.bd-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.bd-chip span {
    display: block; padding: 10px 4px; border-radius: 12px; text-align: center;
    font-size: 14px; font-weight: 500; color: var(--bd-body);
    background: #ffffff; box-shadow: inset 0 0 0 1px var(--bd-hair);
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--bd-ease);
}
.bd-chip:hover span { box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.3); }
.bd-chip input:checked + span { color: var(--bd-blue); background: rgba(15, 105, 255, 0.07); box-shadow: inset 0 0 0 1.5px var(--bd-blue); }
.bd-chip input:active + span { transform: scale(0.96); }
.bd-chip input:focus-visible + span { outline: 2px solid var(--bd-blue); outline-offset: 2px; }

.bd-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Submit */
.bd-submit {
    position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 52px;
    margin-top: 6px; padding: 0 20px; border: 0; border-radius: 980px; cursor: pointer;
    font: inherit; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: #ffffff; background: var(--bd-blue);
    box-shadow: 0 8px 20px -8px rgba(15, 105, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: background-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s var(--bd-ease);
}
.bd-submit:hover { background: var(--bd-blue-deep); box-shadow: 0 12px 24px -10px rgba(15, 105, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.bd-submit:active { transform: scale(0.985); }
.bd-submit:focus-visible { outline: 2px solid var(--bd-blue); outline-offset: 3px; }
.bd-submit:disabled { cursor: progress; }
.bd-submit-label { transition: opacity 0.2s ease, transform 0.3s var(--bd-ease); }
.bd-spinner {
    position: absolute; width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #ffffff;
    opacity: 0; transform: scale(0.6); transition: opacity 0.2s ease, transform 0.3s var(--bd-ease);
}
.bd-card.is-sending .bd-submit-label { opacity: 0; transform: translateY(-6px); }
.bd-card.is-sending .bd-spinner { opacity: 1; transform: scale(1); animation: bd-spin 0.7s linear infinite; }
.bd-fine { margin: 14px 0 0; font-size: 13px; text-align: center; color: var(--bd-muted); }

/* Done: a Slack-style message from Spock */
.bd-msg { display: flex; gap: 12px; padding: 4px 0 24px; border-bottom: 1px solid var(--bd-hair); }
.bd-msg-avatar { flex: none; width: 40px; height: 40px; border-radius: 9px; }
.bd-msg-body { min-width: 0; font-family: Lato, -apple-system, "Segoe UI", sans-serif; }
.bd-msg-meta { margin: 0 0 4px; font-size: 15px; line-height: 1.3; color: var(--bd-muted); }
.bd-msg-meta strong { color: var(--bd-ink); font-weight: 900; }
.bd-msg-app { display: inline-block; margin: 0 4px; padding: 1px 4px; border-radius: 3px; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; color: var(--bd-muted); background: rgba(29, 29, 31, 0.07); vertical-align: 2px; }
.bd-msg-time { font-size: 12px; }
.bd-msg-title { display: flex; align-items: center; gap: 8px; margin: 6px 0 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; color: var(--bd-ink); }
.bd-msg-text { margin: 0; font-size: 16px; line-height: 1.5; color: var(--bd-body); overflow-wrap: anywhere; }
.bd-msg-text strong { color: var(--bd-ink); }
.bd-msg-status { margin: 14px 0 0; }
.bd-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 980px; font-size: 13px; font-weight: 700; color: var(--bd-green); background: rgba(22, 163, 74, 0.1); }
.bd-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.bd-check { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bd-green); }
.bd-check svg { width: 16px; height: 16px; fill: none; stroke: #ffffff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 0; }
.bd-card.is-done .bd-check { animation: bd-pop 0.55s var(--bd-ease) 0.15s both; }
.bd-card.is-done .bd-check svg { animation: bd-draw 0.45s ease-out 0.4s both; }
.bd-card.is-done .bd-msg-avatar, .bd-card.is-done .bd-msg-body > * { animation: bd-rise 0.6s var(--bd-ease) both; }
.bd-card.is-done .bd-msg-body > :nth-child(2) { animation-delay: 0.08s; }
.bd-card.is-done .bd-msg-body > :nth-child(3) { animation-delay: 0.16s; }
.bd-card.is-done .bd-msg-body > :nth-child(4) { animation-delay: 0.3s; }

.bd-next { display: flex; flex-direction: column; gap: 4px; padding: 22px 0 8px; }
.bd-next-label { margin: 0 0 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--bd-muted); }
.bd-next a { display: inline-flex; align-self: flex-start; gap: 6px; font-size: 17px; font-weight: 500; color: var(--bd-blue); text-decoration: none; }
.bd-next a span { transition: transform 0.25s var(--bd-ease); }
.bd-next a:hover { text-decoration: none; color: var(--bd-blue-deep); }
.bd-next a:hover span { transform: translateX(3px); }
.bd-reset { display: inline-block; margin-top: 14px; font-size: 14px; color: var(--bd-muted); text-decoration: underline; text-underline-offset: 3px; }
.bd-reset:hover { color: var(--bd-ink); }

/* Load-in: intro lines and the card rise in sequence */
.bd-in { animation: bd-rise 0.8s var(--bd-ease) both; animation-delay: calc(var(--d, 0) * 70ms + 60ms); }

@keyframes bd-rise  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes bd-spin  { to { transform: rotate(360deg); } }
@keyframes bd-pop   { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bd-draw  { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes bd-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

@media (max-width: 991.98px) {
    .bd { padding-top: calc(var(--nav-h, 64px) + 40px); padding-bottom: 72px; }
    .bd-wrap { grid-template-columns: minmax(0, 1fr); max-width: 620px; }
    .bd-h1 { font-size: 44px; }
    .bd-lead { font-size: 19px; }
    .bd-wrap { gap: 0; }
    .bd-intro { display: contents; }
    /* On narrow screens the form follows the pitch, then the agenda */
    .bd-eyebrow, .bd-h1, .bd-lead { order: -1; }
    .bd-card { position: relative; top: auto; order: 0; margin: 32px 0 48px; }
    .bd-h2 { order: 1; margin-top: 0; }
    .bd-cover { order: 2; }
    .bd-proof { order: 3; }
}
@media (max-width: 480px) {
    .bd-wrap { padding: 0 16px; }
    .bd-h1 { font-size: 36px; }
    .bd-card { padding: 28px 20px 24px; border-radius: 24px; }
    .bd-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .bd *, .bd *::before, .bd *::after, .bd-card { animation: none !important; transition-duration: 0.01ms !important; }
}
