/* public/css/mobile/offline-chrome.css
 * DCM offline chrome REDESIGN — offline status bar + offline PIN gate.
 *
 * Loaded AFTER offline.css (see head.ejs) so the rules below intentionally
 * WIN over offline.css's original `.dcm-offline-pill` floating-chip recipe —
 * same selector, later cascade position, no !important needed. offline.css
 * itself is left untouched (it still defines `.offline-disabled` and
 * `.dcm-pending-badge`, which this file does not touch).
 *
 * Two pieces:
 *  1. `.dcm-offline-pill` — was a small centered floating chip that only said
 *     "Offline". Redesigned into a full-width status bar docked directly
 *     under `.dcm-topbar`, with an icon + real copy. The element/id/role
 *     contract (`#dcm-offline-pill`, `role="status"`, shown via
 *     `body.dcm-offline`) is unchanged — only its look. Copy lives in the
 *     inner `#dcm-offline-pill-text` span (see shell.ejs), not the
 *     container's textContent.
 *  2. `.dcm-gate__*` — the offline PIN screen (offlineUnlock.js), rebuilt
 *     around a NATIVE `inputmode="numeric"` input instead of the old custom
 *     on-screen keypad (`.dcm-pinpad__*`, left in dcm.css unused/dead).
 *
 * Token-driven (ADR-030) — no hardcoded brand hex anywhere in this file.
 */

/* ---------- 1. Offline status bar (overrides offline.css's floating chip) ---------- */

.dcm-offline-pill {
  display: none;
  position: fixed;
  bottom: calc(var(--dcm-bottomnav-h) + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  transform: none;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--dcm-warning);
  /* Same 14% recipe as --dcm-warning-wash, mixed onto the opaque chrome
   * surface instead of transparent — the bar sits fixed over scrolling page
   * content, so a translucent wash would read as a faint smudge rather than
   * an integrated bar. This keeps the same warning-tint language while
   * staying legible (and opaque) in both light and dark mode. */
  background: color-mix(in srgb, var(--dcm-warning) 14%, var(--dcm-surface));
  border: none;
  border-top: 1px solid var(--dcm-warning);
  border-radius: 0;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
  min-height: 40px;
  z-index: 20;
  pointer-events: none;
}

body.dcm-offline .dcm-offline-pill {
  display: flex;
}

.dcm-offline-pill__icon {
  display: inline-flex;
  flex: 0 0 auto;
  line-height: 0;
}

.dcm-offline-pill__text {
  line-height: 1.3;
}

.dcm-offline-pill__pending {
  font-weight: 600;
  opacity: 0.85;
}

/* ---------- 2. Offline PIN gate (native numeric input) ---------- */

/* Full-screen centered overlay, matching the regular login screen's
 * composition (branded backdrop + centered card). #dcm-profile renders the
 * gate in normal document flow otherwise, so :has() promotes the whole
 * container to a fixed overlay only while the gate markup is present. */
#dcm-profile:has(.dcm-gate) {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  /* Same brand gradient as body's login backdrop (dcm.css `body { background:
   * var(--dcm-page-gradient) }`) — mirrored here directly since body already
   * carries other page chrome underneath this overlay. */
  background: var(--dcm-page-gradient);
}

.dcm-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dcm-gate__back {
  align-self: flex-start;
  margin: 0 0 8px;
  padding: 6px 4px;
  font-size: 15px;
  color: var(--dcm-accent);
  background: none;
  border: none;
  cursor: pointer;
}

.dcm-gate__card {
  width: 100%;
  max-width: 360px;
  padding: 28px 24px;
  text-align: center;
}

/* Login-matching depth (mirrors .dcm-login__card in login.css) — lifts the
 * card off the brand-gradient overlay backdrop above. */
.dcm-gate__card {
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.dark-mode .dcm-gate__card {
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.dcm-gate__logo {
  display: block;
  max-width: 160px;
  max-height: 64px;
  width: auto;
  height: auto;
  margin: 0 auto 16px;
}

.dcm-gate__heading {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--dcm-text);
}

.dcm-gate__copy {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--dcm-muted);
}

.dcm-gate__who {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--dcm-text);
}

.dcm-gate__pin {
  display: block;
  width: 100%;
  height: 60px;
  padding: 0 0 0 20px;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 14px;
  color: var(--dcm-text);
  background: var(--dcm-surface-2);
  border: 1px solid var(--dcm-border);
  border-radius: 12px;
  outline: none;
  caret-color: var(--dcm-accent);
}

.dcm-gate__pin:focus { border-color: var(--dcm-accent); }

.dcm-gate__error {
  min-height: 20px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dcm-danger);
}

