/**
 * VerifyHuman public demo presentation — demo-v2
 *
 * Scoped entirely to `body.vh-demo` so it cannot affect any other surface.
 * Deliberately standalone: this file does NOT import or depend on
 * verification-shell.css (production hosted shell), custom.css, or
 * design-system-v2.css. Brand values are copied, not referenced, so a demo
 * tweak can never edit a production surface.
 *
 * Covers only what the four marketing demos need: page shell, product header,
 * customer-application card, verification card + camera frame, step states,
 * result card, example response, product switcher, disclosure footer.
 */

body.vh-demo {
    /* Brand tokens copied from the application palette. */
    --d-accent: #0079F2;
    --d-accent-hover: #0066CC;
    --d-accent-soft: #E6F3FF;
    --d-ok: #10B981;
    --d-ok-soft: #D1FAE5;

    --d-ink: #111827;
    --d-ink-2: #374151;
    --d-muted: #6b7280;
    --d-line: #e5e7eb;
    --d-line-soft: #f3f4f6;
    --d-surface: #ffffff;
    --d-ground: #f7f8fa;

    --d-radius: 12px;
    --d-radius-sm: 8px;
    --d-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);

    --d-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
              'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    --d-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

    background: var(--d-ground);
    color: var(--d-ink);
    font-family: var(--d-font);
    -webkit-font-smoothing: antialiased;
    margin: 0;
    min-height: 100vh;
}

body.vh-demo *,
body.vh-demo *::before,
body.vh-demo *::after { box-sizing: border-box; }

/* ── Page shell ─────────────────────────────────────────────────────────── */

.vh-demo__shell {
    max-width: 740px;
    margin: 0 auto;
    padding: 0 16px 56px;
}

.vh-demo__topbar {
    border-bottom: 1px solid var(--d-line);
    background: var(--d-surface);
    margin-bottom: 32px;
}

.vh-demo__topbar-inner {
    max-width: 740px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vh-demo__logo { display: flex; align-items: center; text-decoration: none; }
.vh-demo__logo img { height: 26px; width: auto; display: block; }

.vh-demo__tag {
    font-size: .75rem;
    font-weight: 600;
    color: var(--d-accent);
    background: var(--d-accent-soft);
    border-radius: 999px;
    padding: 4px 11px;
    white-space: nowrap;
}

/* ── Product header ─────────────────────────────────────────────────────── */

.vh-demo__head { margin-bottom: 26px; }

.vh-demo__title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 4px;
    color: var(--d-ink);
}

.vh-demo__tagline {
    font-size: 1rem;
    font-weight: 550;
    color: var(--d-accent);
    margin: 0 0 10px;
}

.vh-demo__lede {
    font-size: .95rem;
    line-height: 1.6;
    color: var(--d-muted);
    margin: 0;
    max-width: 62ch;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */

.vh-demo__card {
    background: var(--d-surface);
    border: 1px solid var(--d-line);
    border-radius: var(--d-radius);
    box-shadow: var(--d-shadow);
    overflow: hidden;
    margin-bottom: 18px;
}

.vh-demo__card-head {
    padding: 13px 20px;
    border-bottom: 1px solid var(--d-line);
    background: var(--d-line-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.vh-demo__card-title {
    font-size: .88rem;
    font-weight: 650;
    color: var(--d-ink-2);
    margin: 0;
}

/* Small "the customer's app" cue on the scenario card. */
.vh-demo__card-chrome {
    font-size: .72rem;
    color: var(--d-muted);
    font-weight: 500;
    white-space: nowrap;
}

.vh-demo__card-body { padding: 20px; }

/* ── Scenario form (inert — presentation only) ──────────────────────────── */

.vh-demo__field { margin-bottom: 14px; }
.vh-demo__field:last-child { margin-bottom: 0; }

.vh-demo__row {
    display: flex;
    gap: 12px;
}
.vh-demo__row > .vh-demo__field { flex: 1 1 0; min-width: 0; }

.vh-demo__label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--d-ink-2);
    margin-bottom: 5px;
}

.vh-demo__input,
.vh-demo__select {
    width: 100%;
    font-family: inherit;
    font-size: .92rem;
    color: var(--d-ink);
    background: var(--d-surface);
    border: 1px solid var(--d-line);
    border-radius: var(--d-radius-sm);
    padding: 10px 12px;
    line-height: 1.4;
}

.vh-demo__select { appearance: auto; }

.vh-demo__input::placeholder { color: #b6bcc6; }

.vh-demo__input:focus-visible,
.vh-demo__select:focus-visible {
    outline: none;
    border-color: var(--d-accent);
    box-shadow: 0 0 0 3px rgba(0, 121, 242, .14);
}

.vh-demo__hint {
    font-size: .76rem;
    color: var(--d-muted);
    margin: 5px 0 0;
}

/* ── Verification prompt block inside the customer app ──────────────────── */

.vh-demo__gate {
    border: 1px solid var(--d-line);
    border-radius: var(--d-radius-sm);
    background: #fcfdff;
    padding: 16px;
    margin-top: 18px;
}

.vh-demo__gate-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.vh-demo__gate-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--d-accent-soft);
    color: var(--d-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
}

.vh-demo__gate-title {
    font-size: .92rem;
    font-weight: 650;
    margin: 0 0 2px;
    color: var(--d-ink);
}

.vh-demo__gate-sub {
    font-size: .82rem;
    color: var(--d-muted);
    margin: 0;
    line-height: 1.5;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.vh-demo__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.2;
    /* Touch-friendly on mobile. */
    min-height: 44px;
    padding: 11px 20px;
    border-radius: var(--d-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .12s ease, border-color .12s ease;
}

.vh-demo__btn--primary {
    background: var(--d-accent);
    color: #fff;
}
.vh-demo__btn--primary:hover:not(:disabled) { background: var(--d-accent-hover); color: #fff; }

.vh-demo__btn--ghost {
    background: var(--d-surface);
    color: var(--d-ink-2);
    border-color: var(--d-line);
}
.vh-demo__btn--ghost:hover:not(:disabled) { background: var(--d-line-soft); }

.vh-demo__btn--block { width: 100%; }

.vh-demo__btn:disabled { opacity: .5; cursor: not-allowed; }

.vh-demo__btn:focus-visible {
    outline: 2px solid var(--d-accent);
    outline-offset: 2px;
}

.vh-demo__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* ── Step rail ──────────────────────────────────────────────────────────── */

.vh-demo__steps {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.vh-demo__step {
    flex: 1 1 0;
    min-width: 0;
    font-size: .72rem;
    font-weight: 600;
    color: var(--d-muted);
    text-align: center;
}

.vh-demo__step-dot {
    height: 3px;
    border-radius: 2px;
    background: var(--d-line);
    margin-bottom: 7px;
}

.vh-demo__step.is-active { color: var(--d-accent); }
.vh-demo__step.is-active .vh-demo__step-dot { background: var(--d-accent); }

.vh-demo__step.is-done { color: var(--d-ok); }
.vh-demo__step.is-done .vh-demo__step-dot { background: var(--d-ok); }

.vh-demo__step-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Camera / verification frame ────────────────────────────────────────── */

.vh-demo__frame {
    position: relative;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    aspect-ratio: 3 / 4;
    border-radius: var(--d-radius);
    overflow: hidden;
    background: #0f1115;
}

.vh-demo__frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Mirror the local preview — matches how people expect a selfie view. */
    transform: scaleX(-1);
    display: block;
}

/* Oval guide drawn purely in CSS. Decorative: it never reads the video. */
.vh-demo__frame-guide {
    position: absolute;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    width: 62%;
    aspect-ratio: 3 / 4;
    border: 2px solid rgba(255, 255, 255, .72);
    border-radius: 50%;
    pointer-events: none;
    transition: border-color .25s ease;
}

.vh-demo__frame.is-detected .vh-demo__frame-guide { border-color: var(--d-ok); }

.vh-demo__frame-status {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    background: rgba(17, 24, 39, .82);
    color: #fff;
    border-radius: var(--d-radius-sm);
    padding: 9px 12px;
    font-size: .8rem;
    font-weight: 550;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.35;
}

.vh-demo__frame-status .vh-demo__pulse {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    opacity: .85;
}

.vh-demo__frame.is-detected .vh-demo__frame-status .vh-demo__pulse { background: var(--d-ok); opacity: 1; }

/* Camera-unavailable fallback: same frame, neutral illustration instead of video. */
.vh-demo__frame-fallback {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px 20px 72px;
    text-align: center;
    background: linear-gradient(180deg, #1b2028 0%, #0f1115 100%);
    color: rgba(255, 255, 255, .78);
}

.vh-demo__frame.is-fallback .vh-demo__frame-fallback { display: flex; }
.vh-demo__frame.is-fallback video { display: none; }

.vh-demo__frame-fallback-icon { font-size: 1.5rem; opacity: .65; }
.vh-demo__frame-fallback-text { font-size: .8rem; line-height: 1.5; margin: 0; }

.vh-demo__privacy {
    font-size: .76rem;
    color: var(--d-muted);
    text-align: center;
    margin: 14px auto 0;
    max-width: 44ch;
    line-height: 1.55;
}

/* ── Document step (static placeholder — never the camera) ──────────────── */

.vh-demo__doc {
    position: relative;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    aspect-ratio: 8 / 5;
    border-radius: var(--d-radius);
    border: 1px solid var(--d-line);
    background: var(--d-line-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.vh-demo__doc svg { width: 78%; height: auto; display: block; }

.vh-demo__doc-scan {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--d-accent);
    opacity: 0;
    box-shadow: 0 0 12px rgba(0, 121, 242, .8);
}

.vh-demo__doc.is-scanning .vh-demo__doc-scan {
    opacity: .9;
    animation: vh-demo-scan 1.6s ease-in-out infinite;
}

@keyframes vh-demo-scan {
    0%   { top: 8%; }
    50%  { top: 88%; }
    100% { top: 8%; }
}

@media (prefers-reduced-motion: reduce) {
    .vh-demo__doc.is-scanning .vh-demo__doc-scan { animation: none; top: 50%; }
}

.vh-demo__doc-status {
    font-size: .85rem;
    font-weight: 550;
    color: var(--d-ink-2);
    text-align: center;
    margin: 14px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ── Result ─────────────────────────────────────────────────────────────── */

.vh-demo__result-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--d-line);
}

.vh-demo__result-mark {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--d-ok-soft);
    color: var(--d-ok);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.vh-demo__result-title {
    font-size: 1.05rem;
    font-weight: 680;
    margin: 0;
    letter-spacing: -.01em;
}

.vh-demo__result-sub {
    font-size: .82rem;
    color: var(--d-muted);
    margin: 1px 0 0;
}

.vh-demo__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.vh-demo__fact {
    flex: 1 1 180px;
    min-width: 0;
    border: 1px solid var(--d-line);
    border-radius: var(--d-radius-sm);
    padding: 11px 14px;
    background: #fcfdff;
}

.vh-demo__fact-k {
    font-size: .7rem;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--d-muted);
    margin: 0 0 3px;
}

.vh-demo__fact-v {
    font-size: .9rem;
    font-weight: 650;
    color: var(--d-ink);
    margin: 0;
    overflow-wrap: anywhere;
}

.vh-demo__fact-v--pass { color: var(--d-ok); letter-spacing: .02em; }
.vh-demo__fact-v--mono { font-family: var(--d-mono); font-size: .82rem; font-weight: 600; }

/* Signal groups (VerifyTrust) and delivery rows share one row treatment. */
.vh-demo__group-title {
    font-size: .74rem;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--d-muted);
    margin: 0 0 8px;
}

.vh-demo__rows {
    border: 1px solid var(--d-line);
    border-radius: var(--d-radius-sm);
    overflow: hidden;
    margin-bottom: 18px;
}

.vh-demo__rows:last-child { margin-bottom: 0; }

.vh-demo__row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--d-line);
    font-size: .86rem;
}

.vh-demo__row-item:last-child { border-bottom: none; }

.vh-demo__row-k { color: var(--d-ink-2); font-weight: 550; min-width: 0; }

.vh-demo__row-v {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--d-ok);
    font-weight: 600;
    white-space: nowrap;
}

.vh-demo__row-note {
    color: var(--d-muted);
    font-weight: 500;
    font-size: .78rem;
}

/* ── Example simulated response ─────────────────────────────────────────── */

.vh-demo__example { margin-top: 18px; }

.vh-demo__example > summary {
    cursor: pointer;
    font-size: .8rem;
    font-weight: 650;
    color: var(--d-ink-2);
    padding: 9px 12px;
    border: 1px solid var(--d-line);
    border-radius: var(--d-radius-sm);
    background: var(--d-line-soft);
    list-style: none;
}

.vh-demo__example > summary::-webkit-details-marker { display: none; }
.vh-demo__example > summary::before { content: '\25B8'; margin-right: 8px; color: var(--d-muted); }
.vh-demo__example[open] > summary::before { content: '\25BE'; }

.vh-demo__example pre {
    margin: 10px 0 0;
    padding: 14px 16px;
    background: #111827;
    color: #e6edf6;
    border-radius: var(--d-radius-sm);
    font-family: var(--d-mono);
    font-size: .8rem;
    line-height: 1.6;
    /* Never let the payload push the page sideways on mobile. */
    overflow-x: auto;
    max-width: 100%;
    white-space: pre;
}

.vh-demo__example-note {
    font-size: .74rem;
    color: var(--d-muted);
    margin: 8px 0 0;
    line-height: 1.55;
}

/* When a note is followed by another section (VerifyTrust's trust-signals
   caption sits above "What your application receives"), keep them apart. */
.vh-demo__example-note + .vh-demo__group-title { margin-top: 20px; }

/* ── Product switcher ───────────────────────────────────────────────────── */

.vh-demo__explore { margin-top: 30px; }

.vh-demo__explore-title {
    font-size: .74rem;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--d-muted);
    margin: 0 0 10px;
}

.vh-demo__explore-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.vh-demo__explore-item {
    display: block;
    padding: 12px 14px;
    border: 1px solid var(--d-line);
    border-radius: var(--d-radius-sm);
    background: var(--d-surface);
    text-decoration: none;
    transition: border-color .12s ease, background-color .12s ease;
}

.vh-demo__explore-item:hover { border-color: var(--d-accent); background: #fcfdff; }

.vh-demo__explore-name {
    display: block;
    font-size: .85rem;
    font-weight: 650;
    color: var(--d-ink);
    margin-bottom: 2px;
}

.vh-demo__explore-desc {
    display: block;
    font-size: .73rem;
    color: var(--d-muted);
    line-height: 1.4;
}

.vh-demo__explore-item.is-current {
    border-color: var(--d-accent);
    background: var(--d-accent-soft);
}
.vh-demo__explore-item.is-current .vh-demo__explore-name { color: var(--d-accent-hover); }

/* ── Disclosure footer ──────────────────────────────────────────────────── */

.vh-demo__foot {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--d-line);
    font-size: .78rem;
    color: var(--d-muted);
    line-height: 1.6;
}

.vh-demo__foot a { color: var(--d-muted); text-decoration: underline; }
.vh-demo__foot a:hover { color: var(--d-accent); }

/* ── Utilities ──────────────────────────────────────────────────────────── */

.vh-demo__center { text-align: center; }
[hidden] { display: none !important; }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .vh-demo__shell { padding-bottom: 40px; }

    .vh-demo__title { font-size: 1.45rem; }

    .vh-demo__row { flex-direction: column; gap: 0; }
    .vh-demo__row > .vh-demo__field { margin-bottom: 14px; }

    .vh-demo__card-body { padding: 16px; }
    .vh-demo__card-head { padding: 12px 16px; }

    .vh-demo__explore-grid { grid-template-columns: repeat(2, 1fr); }

    .vh-demo__frame { max-width: 100%; }

    .vh-demo__actions > .vh-demo__btn { width: 100%; }

    .vh-demo__topbar-inner { padding: 12px 16px; }
    .vh-demo__tag { font-size: .7rem; padding: 3px 9px; }
}

@media (max-width: 400px) {
    .vh-demo__step-label { font-size: .66rem; }
}
