/* =========================================================
   48-hour demo — the bar on top of every page, the WhatsApp simulation and the lock screen.
   Only loaded on the demo deployment (functions/_middleware.js adds it when DEMO_MODE=1).
   ========================================================= */
:root { --demo-h: 48px; }
html.has-demo-bar body { padding-top: var(--demo-h) !important; }
html.has-demo-bar .topbar, html.has-demo-bar .site-header, html.has-demo-bar .pp-top { top: var(--demo-h) !important; }
html.has-demo-bar .sidebar { top: var(--demo-h) !important; }
@media (min-width: 1024px) { html.has-demo-bar .sidebar { inset: var(--demo-h) auto 0 0 !important; } }

.demo-bar {
    position: fixed; inset: 0 0 auto 0; height: var(--demo-h); z-index: 2000;
    display: flex; align-items: center; gap: 10px; padding: 0 12px;
    background: linear-gradient(90deg, #0B1220, #16213A); color: #F8FAFC;
    font: 600 13px/1.2 system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif; direction: rtl;
    box-shadow: 0 2px 14px rgba(2, 6, 23, .28);
}
.demo-bar .db-tag { flex: none; padding: 4px 9px; border-radius: 999px; background: var(--primary, #2F5BEA); color: #fff; font-size: 11.5px; letter-spacing: .02em; }
.demo-bar .db-time { flex: none; display: inline-flex; align-items: center; gap: 6px; color: #CBD5E1; white-space: nowrap; }
.demo-bar .db-time b { color: #fff; font-variant-numeric: tabular-nums; }
.demo-bar .db-time.soon b { color: #FCA5A5; }
.demo-bar .db-roles { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .08); margin-inline-start: auto; }
.demo-bar .db-roles button { border: 0; background: transparent; color: #E2E8F0; font: inherit; padding: 6px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.demo-bar .db-roles button:hover { background: rgba(255, 255, 255, .1); }
.demo-bar .db-roles button.on { background: #fff; color: #0B1220; }
.demo-bar .db-roles button[disabled] { opacity: .6; cursor: progress; }
.demo-bar .db-cta { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; background: #25D366; color: #052E16; text-decoration: none; font-weight: 700; white-space: nowrap; }
.demo-bar .db-cta:hover { filter: brightness(1.05); }
.demo-bar .db-s { display: none; }
@media (max-width: 760px) {
    .demo-bar { gap: 6px; padding: 0 8px; font-size: 12px; }
    .demo-bar .db-tag, .demo-bar .db-l { display: none; }
    .demo-bar .db-s { display: inline; }
    .demo-bar .db-roles button { padding: 6px 8px; }
    .demo-bar .db-cta { padding: 8px 10px; }
}
@media (max-width: 480px) { .demo-bar .db-cta .db-s { display: none; } .demo-bar .db-cta { padding: 8px 9px; } .demo-bar .db-roles button { padding: 6px 6px; } .demo-bar .db-time { font-size: 11.5px; } }

/* simulated WhatsApp / lock screen */
.demo-modal { position: fixed; inset: 0; z-index: 2100; display: grid; place-items: center; padding: 16px; background: rgba(2, 6, 23, .55); backdrop-filter: blur(4px); direction: rtl; }
.demo-modal .dm-card { width: min(440px, 100%); max-height: 86vh; overflow: auto; background: var(--surface, #fff); color: var(--text, #0F172A); border-radius: 22px; padding: 22px; box-shadow: 0 30px 80px rgba(2, 6, 23, .4); font-family: inherit; }
.demo-modal h3 { margin: 0 0 6px; font-size: 18px; }
.demo-modal p { margin: 0 0 12px; color: var(--muted, #64748B); line-height: 1.6; }
.demo-modal .wa-preview { white-space: pre-wrap; background: #E7FFDB; color: #111B21; border-radius: 14px 14px 4px 14px; padding: 12px 14px; font-size: 14px; line-height: 1.65; box-shadow: 0 1px 1px rgba(0,0,0,.08); unicode-bidi: plaintext; }
.demo-modal .wa-to { font-size: 12.5px; color: var(--muted, #64748B); margin: 0 0 8px; }
.demo-modal .dm-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.demo-modal .dm-actions > * { flex: 1; text-align: center; }
.demo-lock { position: fixed; inset: 0; z-index: 2200; display: grid; place-items: center; padding: 18px; background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--primary, #2F5BEA) 35%, #0B1220), #0B1220 70%); color: #fff; direction: rtl; text-align: center; }
.demo-lock .dl-card { width: min(480px, 100%); }
.demo-lock .dl-ico { font-size: 54px; }
.demo-lock h2 { margin: 10px 0 8px; font-size: 26px; }
.demo-lock p { color: #CBD5E1; line-height: 1.7; margin: 0 0 22px; }
.demo-lock .db-cta { display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px; border-radius: 999px; background: #25D366; color: #052E16; font-weight: 800; text-decoration: none; font-size: 16px; }
