/* Demo mode (assets/js/demo-mode.js): the switch in the top bar, the row in the
   sidebar account, the ribbon while it is on, the person picker and the veil.
   EMS tokens only: navy #2A3890 / #162063, red #BE1E2D, Lato and Oswald. The
   rest of the app is untouched; nothing here applies until demo-mode.js adds
   one of these elements. */

/* ── the switch in the top bar ────────────────────────────────────────── */
.demo-switch-tb {
  flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid #d3daf3; background: #fff; color: var(--ems-navy-deep, #162063);
  font: 700 13px/1 Lato, "Segoe UI", sans-serif;
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.demo-switch-tb:hover { border-color: var(--ems-navy, #2A3890); box-shadow: 0 6px 16px -10px rgba(22, 32, 99, .5); }
.demo-switch-tb:focus-visible { outline: 3px solid var(--ems-red, #BE1E2D); outline-offset: 2px; }
.demo-switch-tb b { font-family: var(--ems-display, Oswald, sans-serif); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 14px; }
.demo-sw-state { font-weight: 700; color: #8a93b2; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }
.demo-sw-track { position: relative; width: 32px; height: 18px; border-radius: 999px; background: #c9cfe3; transition: background .2s ease; }
.demo-sw-track i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.2, .9, .3, 1.3); }
.demo-switch-tb.is-on { background: var(--ems-navy, #2A3890); border-color: var(--ems-navy, #2A3890); color: #fff; box-shadow: 0 0 0 3px rgba(190, 30, 45, .25); }
.demo-switch-tb.is-on .demo-sw-state { color: #fff; }
.demo-switch-tb.is-on .demo-sw-track { background: var(--ems-red, #BE1E2D); }
.demo-switch-tb.is-on .demo-sw-track i { transform: translateX(14px); }
@media (max-width: 640px) {
  /* A phone's bar has room for the logo only: off, the switch lives in the
     account (sidebar); on, it shows here too, because then it matters. */
  .demo-switch-tb:not(.is-on) { display: none; }
  .demo-switch-tb { height: 32px; padding: 0 10px 0 7px; gap: 6px; }
  .demo-sw-state { display: none; }
}

/* ── the row in the sidebar account ───────────────────────────────────── */
.account .acct-demo {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 10px; padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: var(--wt-radius-sm, 8px); background: rgba(255, 255, 255, .06);
  color: #fff; font: 700 12px/1.2 Lato, "Segoe UI", sans-serif; text-align: left; cursor: pointer;
}
.account .acct-demo:hover { background: rgba(255, 255, 255, .12); }
.account .acct-demo b { margin-left: auto; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.acct-demo-dot { position: relative; flex: none; width: 26px; height: 15px; border-radius: 999px; background: rgba(255, 255, 255, .3); }
.acct-demo-dot::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.account .acct-demo.is-on { border-color: var(--ems-red, #BE1E2D); background: rgba(190, 30, 45, .22); }
.account .acct-demo.is-on .acct-demo-dot { background: var(--ems-red, #BE1E2D); }
.account .acct-demo.is-on .acct-demo-dot::after { transform: translateX(11px); }

/* ── the ribbon: never forget the demo is on ──────────────────────────── */
.demo-ribbon {
  /* Right-hand side, under the switch: the page title sits top-left, so the
     ribbon never covers it at any desktop width. */
  position: fixed; top: 64px; right: 24px; z-index: 60;
  display: inline-flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); box-sizing: border-box;
  padding: 5px 16px 6px 6px; border: 0; border-radius: 0 0 14px 14px; cursor: pointer;
  background: var(--ems-navy, #2A3890); color: #fff; font: 400 13px/1.2 Lato, "Segoe UI", sans-serif;
  border-bottom: 3px solid var(--ems-red, #BE1E2D);
  box-shadow: 0 8px 20px -10px rgba(22, 32, 99, .7); animation: demo-drop .45s cubic-bezier(.2, .9, .3, 1.2) both .15s;
}
.demo-ribbon-face { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px #fff; }
.demo-ribbon b { font-family: var(--ems-display, Oswald, sans-serif); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 12.5px; background: var(--ems-red, #BE1E2D); padding: 3px 8px; border-radius: 6px; }
.demo-ribbon span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.demo-ribbon em { font-style: normal; opacity: .82; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .35); white-space: nowrap; }
.demo-ribbon:hover { background: var(--ems-navy-deep, #162063); }
.demo-ribbon:focus-visible { outline: 3px solid var(--ems-red, #BE1E2D); outline-offset: 2px; }
@keyframes demo-drop { from { transform: translateY(-110%); } to { transform: none; } }
/* On a phone it is a slim full-width bar fixed under the (sticky) top bar, and
   the page starts below it, so it never sits on top of a heading or a button. */
@media (max-width: 640px) {
  .demo-ribbon { left: 0; right: 0; max-width: none; justify-content: center; border-radius: 0; padding: 4px 12px; font-size: 12px; animation: none; }
  .demo-ribbon em { display: none; }
  .demo-ribbon-face { width: 22px; height: 22px; }
  html.is-demo body:not(.gate) #app { margin-top: 34px; }
}
/* On the front-door screens (no top bar) it sits in the bottom-left corner,
   clear of the questions, still one tap to switch or leave. */
body.gate .demo-ribbon { top: auto !important; bottom: 16px; left: 16px; right: auto; transform: none; border-radius: 999px; border-bottom: 0; padding: 5px 14px 5px 5px; animation: none; }
body.gate .demo-ribbon em { display: none; }

/* ── the person picker ────────────────────────────────────────────────── */
.demo-dlg {
  position: fixed; inset: 0; z-index: 10000; display: flex; align-items: flex-start; justify-content: center;
  padding: max(32px, 5vh) 16px 24px; overflow-y: auto; box-sizing: border-box;
  background: rgba(14, 21, 71, 0); transition: background .2s ease;
}
.demo-dlg.is-open { background: rgba(14, 21, 71, .55); }
.demo-dlg.is-leaving { background: rgba(14, 21, 71, 0); }
.demo-card {
  width: 100%; max-width: 820px; background: #fff; border-radius: 16px; padding: 20px 22px 22px; box-sizing: border-box;
  box-shadow: 0 30px 70px rgba(14, 21, 71, .35); font-family: Lato, "Segoe UI", sans-serif; color: var(--text, #1c2333);
  border-top: 4px solid var(--ems-red, #BE1E2D);
  opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .22s ease, transform .28s cubic-bezier(.2, .9, .3, 1.1);
}
.demo-dlg.is-open .demo-card { opacity: 1; transform: none; }
.demo-dlg.is-leaving .demo-card { opacity: 0; transform: translateY(8px) scale(.98); }
.demo-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.demo-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--primary-tint, #eef1fb); border: 1px solid #d3daf3; color: var(--ems-navy, #2A3890); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.demo-x { border: 0; background: none; font-size: 16px; color: #64748b; cursor: pointer; width: 32px; height: 32px; border-radius: 8px; }
.demo-x:hover { background: #f1f3fa; color: #162063; }
.demo-card h2 { margin: 0 0 6px; font-family: var(--ems-display, Oswald, sans-serif); font-weight: 600; font-size: 22px; line-height: 1.2; color: var(--ems-navy-deep, #162063); text-transform: uppercase; letter-spacing: .01em; }
.demo-lede { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #475569; }
.demo-people { border: 0; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 760px) { .demo-people { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.demo-people legend, .demo-start legend { padding: 0; margin: 0 0 6px; font: 800 11.5px/1 Lato, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
.demo-person {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid #e2e6f2; background: #fff; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.demo-person:hover { border-color: #b9c3e4; box-shadow: 0 6px 14px rgba(22, 32, 99, .08); }
.demo-person input { position: absolute; opacity: 0; pointer-events: none; }
.demo-person-face { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #eef1fb; }
.demo-person-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.demo-person-txt b { font-size: 14px; color: #162063; }
.demo-person-txt span { font-size: 12px; line-height: 1.35; color: #64748b; }
.demo-person:has(input:checked) { border-color: var(--ems-navy, #2A3890); background: var(--primary-tint, #eef1fb); box-shadow: inset 0 0 0 1px var(--ems-navy, #2A3890); }
.demo-person:has(input:checked) .demo-person-face { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ems-red, #BE1E2D); }
.demo-person:has(input:focus-visible) { outline: 3px solid var(--ems-red, #BE1E2D); outline-offset: 2px; }
.demo-start { border: 0; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-start-o { position: relative; display: block; padding: 11px 13px; border: 1.5px solid #e2e6f2; border-radius: 12px; cursor: pointer; }
.demo-start-o:hover { border-color: #b9c3e4; }
.demo-start-o input { position: absolute; opacity: 0; pointer-events: none; }
.demo-start-o > span { display: flex; flex-direction: column; gap: 3px; }
.demo-start-o b { font-size: 14px; color: #162063; }
.demo-start-o > span > span { font-size: 12.5px; line-height: 1.4; color: #64748b; }
.demo-start-o:has(input:checked) { border-color: var(--ems-navy, #2A3890); background: var(--primary-tint, #eef1fb); box-shadow: inset 0 0 0 1px var(--ems-navy, #2A3890); }
.demo-start-o:has(input:focus-visible) { outline: 3px solid var(--ems-red, #BE1E2D); outline-offset: 2px; }
.demo-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: #f6f7fc; border: 1px dashed #c3cae0; color: #475569; font-size: 13px; line-height: 1.45; }
.demo-link { border: 0; background: none; padding: 0; font: inherit; color: var(--ems-navy, #2A3890); text-decoration: underline; cursor: pointer; }
.demo-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.demo-actions .demo-go { min-width: 130px; }
@media (max-width: 560px) {
  .demo-people, .demo-start { grid-template-columns: 1fr; }
  .demo-card { padding: 18px 16px; }
  .demo-actions button { flex: 1; }
}

/* ── "Skip to the end" on the intake (welcome.js, demo only) ──────────── */
/* Up in the logo row, so the intake below sits exactly where it always does. */
.gate-wrap { position: relative; }
.demo-skip-row { position: absolute; top: 36px; right: 18px; display: flex; }
.demo-skip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; cursor: pointer;
  border: 1px solid #d3daf3; background: #fff; color: var(--ems-navy-deep, #162063); font: 700 13px/1 Lato, "Segoe UI", sans-serif;
}
.demo-skip:hover { border-color: var(--ems-navy, #2A3890); }
.demo-skip:disabled { opacity: .6; cursor: default; }
.demo-skip-tag { background: var(--ems-red, #BE1E2D); color: #fff; border-radius: 999px; padding: 4px 9px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }

/* ── faces of the sample cast, painted over their initials ────────────── */
.demo-face { background-size: cover !important; background-position: center 30% !important; background-repeat: no-repeat !important; color: transparent !important; text-shadow: none !important; }

/* ── the transition: out with a flash, in from behind a veil ──────────── */
html.demo-tx-out body { transition: transform .55s cubic-bezier(.4, 0, .2, 1), filter .55s ease, opacity .55s ease; transform: scale(.94); filter: blur(8px) saturate(.7); opacity: .6; transform-origin: 50% 40%; }
html.demo-tx-in body { transform: scale(1.04); filter: blur(10px); transform-origin: 50% 40%; }
html.demo-tx-in.demo-tx-reveal body { transition: transform .65s cubic-bezier(.2, .8, .2, 1), filter .55s ease; transform: none; filter: none; }
.demo-veil {
  position: fixed; inset: 0; z-index: 2147483600; display: grid; place-items: center; pointer-events: all;
  background: radial-gradient(900px 600px at 50% 40%, #3a4bb0 0%, #2A3890 45%, #0e1547 100%);
  color: #fff; font-family: Lato, "Segoe UI", sans-serif; text-align: center;
  opacity: 0; transition: opacity .45s ease;
}
.demo-veil.is-out { background: radial-gradient(900px 600px at 50% 40%, #24307a 0%, #162063 50%, #070b2a 100%); }
.demo-veil.is-on { opacity: 1; }
.demo-veil.is-lift { opacity: 0; transition: opacity .6s ease .05s; }
.demo-veil-in { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px; transform: translateY(14px) scale(.96); opacity: 0; transition: transform .55s cubic-bezier(.2, .9, .3, 1.2) .12s, opacity .4s ease .12s; }
.demo-veil.is-on .demo-veil-in { transform: none; opacity: 1; }
.demo-veil.is-arrive .demo-veil-in { transition: none; }
.demo-veil.is-lift .demo-veil-in { transform: scale(1.08); opacity: 0; transition: transform .6s ease, opacity .45s ease; }
.demo-veil-face { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ems-red, #BE1E2D); }
.demo-veil-badge { padding: 6px 14px; border-radius: 999px; background: var(--ems-red, #BE1E2D); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.demo-veil-badge.is-real { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); }
.demo-veil-in b { font-family: var(--ems-display, Oswald, sans-serif); font-size: clamp(26px, 5vw, 44px); line-height: 1.1; font-weight: 600; text-transform: uppercase; letter-spacing: .01em; }
.demo-veil-in > span:last-child { font-size: 15px; opacity: .85; }
.demo-veil-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.demo-veil.is-on .demo-veil-flash { animation: demo-flash .6s ease-out both; }
@keyframes demo-flash { 0% { opacity: 0; } 25% { opacity: .85; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  html.demo-tx-out body, html.demo-tx-in body { transform: none !important; filter: none !important; transition: none !important; }
  .demo-veil, .demo-veil-in { transition-duration: .15s !important; transform: none !important; }
  .demo-veil-flash, .demo-ribbon { animation: none !important; }
}
