/* ==========================================================================
   Demo vote (demo/*.php, 2026-10-28) — the pieces the real voter screens do not
   have. Loaded AFTER login-design.css (sign-in, PIN) or ballotsheet-design.css
   (ballot, review, receipt), whose tokens it reuses. Classes prefixed dm-.
   ========================================================================== */
:root { --dm-strip-h: 40px; }

/* ---- the "practice election" strip on top of every demo screen ------------ */
.dm-strip {
  position: relative; z-index: 40;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--dm-strip-h); padding: 6px 16px;
  padding-top: calc(6px + env(safe-area-inset-top));
  background: repeating-linear-gradient(-45deg, #fff3d6 0 14px, #fcebc2 14px 28px);
  border-bottom: 1px solid #ecd28f;
  color: #5d3c00;
  font: 600 12.5px/1.35 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.dm-strip__tag {
  flex: none; padding: 3px 9px; border-radius: 999px;
  background: #b26a00; color: #fff;
  font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.dm-strip__txt { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-strip__more { display: none; }
.dm-strip__exit {
  flex: none; color: #7a4a00; font-weight: 800; white-space: nowrap;
  text-decoration: underline; text-decoration-color: rgba(122, 74, 0, .4); text-underline-offset: 3px;
}
.dm-strip__exit:before { content: "·"; display: inline-block; margin-right: 10px; color: #b48a3a; text-decoration: none; }
.dm-strip__exit:hover { color: #3d2600; text-decoration-color: currentColor; }
@media (min-width: 900px) { .dm-strip__more { display: inline; } }

/* the sign-in shell fills the screen under the strip, not past it */
.dm .lg-page { min-height: calc(100vh - var(--dm-strip-h)); min-height: calc(100dvh - var(--dm-strip-h)); }
@media (min-width: 992px) {
  .dm .lg-hero { min-height: calc(100vh - var(--dm-strip-h)); min-height: calc(100dvh - var(--dm-strip-h)); }
  .dm .lg-panel-top a { display: inline-block; }
}

/* ---- demo voter slip (sign-in card) ---------------------------------------- */
.dm-slip {
  position: relative; margin: 0 0 16px;
  border: 1.5px dashed #b4cbbb; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #fbfdf9, #eff6f1);
}
.dm-slip__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 14px; background: #0b4a30; color: #d9f5e2;
  font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
.dm-slip__spec { color: #f2c14e; }
.dm-slip__body { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.dm-slip__txt { min-width: 0; }
.dm-slip__k { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--lg-muted); }
.dm-slip__v {
  display: block; margin-top: 3px;
  font: 800 21px/1.1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em;
  color: var(--lg-brand-ink);
}
.dm-slip__use {
  flex: none; height: 40px; padding: 0 14px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--lg-brand); background: #fff; color: var(--lg-brand-deep);
  font: inherit; font-size: 12.5px; font-weight: 800;
  transition: background .15s;
}
.dm-slip__use:hover { background: var(--lg-green-soft); }
.dm-slip__use:focus-visible { outline: 3px solid rgba(20, 164, 77, .4); outline-offset: 2px; }

/* ---- PIN card note + the on-screen text message ----------------------------- */
.dm-note {
  display: flex; gap: 10px; align-items: flex-start;
  margin: -6px 0 16px; padding: 10px 12px; border-radius: 12px;
  background: var(--lg-amber-soft); color: #6a4a0c;
  font-size: 12.5px; font-weight: 600; line-height: 1.45;
}
.dm-note svg { flex: none; width: 18px; height: 18px; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linejoin: round; }
.dm-note__btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; font-weight: 800; color: #7a4a00; text-decoration: underline; text-underline-offset: 2px;
}

.dm-sms {
  position: fixed; z-index: 1000; left: 50%; top: calc(10px + env(safe-area-inset-top));
  width: min(420px, calc(100% - 20px));
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 12px 12px 14px; border-radius: 18px;
  background: rgba(250, 250, 250, .95);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .3), 0 0 0 1px rgba(0, 0, 0, .06);
  color: #111; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  opacity: 0; pointer-events: none; transform: translate(-50%, -140%);
  transition: transform .45s cubic-bezier(.2, .9, .25, 1.12), opacity .3s;
}
.dm-sms.is-in { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
@media (min-width: 992px) {
  .dm-sms { left: auto; right: 22px; top: calc(var(--dm-strip-h) + 16px); transform: translateX(130%); }
  .dm-sms.is-in { transform: none; }
}
.dm-sms__app {
  flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(180deg, #5cf07c, #15b83f);
}
.dm-sms__app svg { width: 22px; height: 22px; fill: #fff; }
.dm-sms__body { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.38; }
.dm-sms__top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: #6b6b6b; }
.dm-sms__top b { color: #111; font-size: 13.5px; letter-spacing: .02em; }
.dm-sms__msg { display: block; margin-top: 2px; }
.dm-sms__pin {
  padding: 0 4px; border-radius: 6px; background: #e3f6e9; color: #06301f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: .12em;
}
.dm-sms__note { display: block; margin-top: 5px; font-size: 11.5px; font-weight: 600; color: #8a6d1f; }
.dm-sms__btns { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.dm-sms__fill {
  height: 32px; padding: 0 13px; border: 0; border-radius: 999px; cursor: pointer;
  background: #14a44d; color: #fff; font: inherit; font-size: 12.5px; font-weight: 700;
}
.dm-sms__fill:hover { background: #0e8a46; }
.dm-sms__x { order: -1; width: 26px; height: 26px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: rgba(0, 0, 0, .07); }
.dm-sms__x svg { width: 12px; height: 12px; stroke: #444; stroke-width: 2.6; fill: none; stroke-linecap: round; }
.dm-sms button:focus-visible { outline: 3px solid rgba(20, 164, 77, .45); outline-offset: 2px; }

/* ---- receipt + sample results (done.php) ------------------------------------ */
.dm-done .tk-card, .dm-results, .dm-cta { max-width: 720px; }
.dm-results { margin: 40px auto 0; scroll-margin-top: 110px; }
.dm-res-head { text-align: center; margin-bottom: 18px; }
.dm-kicker { display: block; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--bt-brand-deep); }
.dm-res-head h2, .dm-cta h2 { margin: 6px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.dm-res-head p, .dm-cta p { margin: 8px auto 0; max-width: 560px; font-size: 13.5px; font-weight: 600; line-height: 1.55; color: #4c554f; }

.dm-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 4px; }
.dm-tile { min-width: 0; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--bt-line); box-shadow: var(--bt-shadow); }
.dm-tile__k { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--bt-muted); }
.dm-tile b { display: block; margin-top: 4px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.dm-tile b small { font-size: 12.5px; font-weight: 700; color: var(--bt-muted); letter-spacing: 0; }
.dm-tile__sub { display: block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--bt-muted); }
.dm-tile.is-you { background: var(--bt-green-soft); border-color: #bfe5cb; }
.dm-tile.is-you b { color: var(--bt-brand-deep); }
@media (max-width: 559px) {
  .dm-tiles { grid-template-columns: 1fr 1fr; }
  .dm-tile:first-child { grid-column: 1 / -1; }
}

.dm-bar { display: block; height: 6px; margin-top: 8px; border-radius: 99px; background: #e6ede8; overflow: hidden; }
.dm-bar i { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: #9db8a7; }
.dm-tile .dm-bar i, .dm-row.is-win .dm-bar i { background: linear-gradient(90deg, #19b85c, var(--bt-brand-deep)); }
.dm-row.is-no .dm-bar i { background: linear-gradient(90deg, #e46a6a, var(--bt-red)); }

.dm-res { margin-top: 12px; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--bt-line); box-shadow: var(--bt-shadow); }
.dm-res__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.dm-res__head h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.dm-chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--bt-green-soft); color: var(--bt-brand-deep); font-size: 11.5px; font-weight: 800; }
.dm-chip.is-warn { background: var(--bt-amber-soft); color: var(--bt-amber); }
.dm-res__meta { margin: 4px 0 0; font-size: 12px; font-weight: 600; color: var(--bt-muted); }
.dm-res__rows { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.dm-row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 8px 12px 8px 8px; border-radius: 12px; border: 1px solid var(--bt-line);
}
.dm-row.is-win { border-color: #bfe5cb; background: #f6fcf8; }
.dm-row.is-mine { border-color: #b9b0dc; box-shadow: 0 0 0 1px #b9b0dc; }
.dm-row__photo .bt-photo { border-radius: 8px; }
.dm-row__name { display: block; font-size: 14.5px; font-weight: 800; line-height: 1.25; }
.dm-row__yn { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 5px; background: var(--bt-ink); color: #fff; font-size: 11px; letter-spacing: .06em; vertical-align: 1px; }
.dm-row.is-no .dm-row__yn { background: var(--bt-red); }
.dm-row__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.dm-row__tags:empty { display: none; }
.dm-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 800; }
.dm-tag.is-win { background: var(--bt-brand); color: #fff; }
.dm-tag.is-mine { background: #eeeaf9; color: var(--bt-stamp); }
.dm-tag svg { width: 11px; height: 13px; stroke: currentColor; stroke-width: 3.4; fill: none; transform: rotate(-8deg); }
.dm-row__num { text-align: right; font-variant-numeric: tabular-nums; }
.dm-row__num b { display: block; font-size: 17px; font-weight: 800; }
.dm-row__num small { font-size: 11.5px; font-weight: 700; color: var(--bt-muted); }
.dm-res__you { margin: 10px 0 0; font-size: 12.5px; font-weight: 700; color: var(--bt-amber); }
@media (min-width: 560px) {
  .dm-res { padding: 20px 22px; }
  .dm-row { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; }
  .dm-row__num b { font-size: 19px; }
}

.dm-cta {
  margin: 28px auto 0; padding: 28px 20px; border-radius: 20px; text-align: center; color: #fff;
  background: radial-gradient(420px 220px at 85% 0%, rgba(158, 240, 180, .16), transparent 70%), linear-gradient(150deg, #052a1c, #0b4a30 55%, #127a4b);
  box-shadow: 0 24px 50px rgba(5, 42, 28, .22);
}
.dm-cta .dm-kicker { color: #9ef0b4; }
.dm-cta h2 { color: #fff; }
.dm-cta p { color: rgba(255, 255, 255, .84); }
.dm-cta__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.dm-cta .tk-btn { margin-top: 0; }
.dm-cta .tk-btn.is-ghost { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
.dm-cta .tk-btn.is-ghost:hover { background: rgba(255, 255, 255, .18); }
@media (max-width: 480px) { .dm-cta__btns .tk-btn { flex: 1 1 100%; } }
@media (min-width: 768px) {
  .dm-res-head h2, .dm-cta h2 { font-size: 28px; }
  .dm-cta { padding: 36px 32px; }
}
@media (prefers-reduced-motion: reduce) { .dm-sms { transition: none; } }
