/* VaultOS mobile — customer app
   Custom palette/type — NOT iOS system. Reads as a real consumer product.
*/

:root {
  /* Brand */
  --m-ink-0: #0a0c12;          /* deepest */
  --m-ink-1: #11141d;          /* page bg dark */
  --m-ink-2: #1a1f2c;          /* card */
  --m-ink-3: #242a3a;          /* hover/inset */
  --m-ink-4: #2f3648;          /* divider strong */
  --m-line: rgba(255,255,255,0.07);
  --m-line-2: rgba(255,255,255,0.12);

  --m-tx-1: #f4f5f8;
  --m-tx-2: #a4abbd;
  --m-tx-3: #6b7388;

  --m-accent: #4f46e5;
  --m-accent-2: #7c6cff;
  --m-accent-soft: rgba(79,70,229,0.16);
  --m-accent-glow: 0 0 0 6px rgba(124,108,255,0.18);

  --m-cyan: #22d3ee;
  --m-emerald: #10b981;
  --m-amber: #f59e0b;
  --m-rose: #ef4444;

  --m-radius: 18px;
  --m-radius-sm: 12px;
  --m-radius-lg: 28px;
}

/* The mobile screens live INSIDE iPhone frames; treat the device's interior
   as the page bg via .m-page on the root content node. */

.m-page {
  width: 100%; height: 100%;
  background: var(--m-ink-1);
  color: var(--m-tx-1);
  font-family: "Geist", -apple-system, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  letter-spacing: -0.01em;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
  padding-top: 62px; /* clear iOS frame's status bar + dynamic island */
}

.m-page.light {
  --m-ink-1: #f6f7fa;
  --m-ink-2: #ffffff;
  --m-ink-3: #eef0f5;
  --m-ink-4: #e3e7ef;
  --m-line: rgba(15,18,28,0.06);
  --m-line-2: rgba(15,18,28,0.12);
  --m-tx-1: #11141d;
  --m-tx-2: #4a5067;
  --m-tx-3: #8089a1;
}

/* Status bar slot (above content, below dynamic island) */
.m-statusbar {
  height: 54px; flex-shrink: 0;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 28px 6px;
  font-size: 15px; font-weight: 600;
  font-feature-settings: "tnum";
  color: var(--m-tx-1);
}
.m-statusbar .ind { display: flex; align-items: center; gap: 4px; }

/* Content scroll region */
.m-scroll {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 0 18px 100px;
}
.m-scroll.no-pad { padding: 0; }

.m-scroll::-webkit-scrollbar { width: 0; }

/* Header for non-tabbar screens */
.m-header {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 18px 14px;
}
.m-header h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; flex: 1; }
.m-iconbtn {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--m-ink-2); border: 1px solid var(--m-line);
  color: var(--m-tx-1); cursor: pointer;
  transition: background 120ms;
}
.m-iconbtn:hover { background: var(--m-ink-3); }
.m-iconbtn.ghost { background: transparent; border-color: transparent; }

/* Cards */
.m-card {
  background: var(--m-ink-2);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  padding: 16px;
}
.m-card.flat { padding: 0; overflow: hidden; }
.m-card.glow {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 12px 32px -16px rgba(79,70,229,0.55),
    0 0 0 1px rgba(124,108,255,0.25);
}

/* Tab bar */
.m-tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 16px 26px;
  background: linear-gradient(to top, var(--m-ink-1) 60%, transparent);
  display: flex; justify-content: space-between; align-items: center;
  z-index: 30;
}
.m-tabbar .tabs {
  flex: 1;
  display: flex; justify-content: space-around; align-items: center;
  background: var(--m-ink-2);
  border: 1px solid var(--m-line);
  border-radius: 99px;
  padding: 6px;
  height: 56px;
  backdrop-filter: blur(20px);
}
.m-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  height: 100%;
  font-size: 10.5px;
  color: var(--m-tx-2);
  border-radius: 99px;
  cursor: pointer;
  font-weight: 500;
  position: relative;
}
.m-tab[data-active="true"] {
  color: var(--m-tx-1);
  background: var(--m-accent);
  color: white;
}
.m-tab[data-active="true"] svg { stroke: white; }

/* Buttons */
.m-btn {
  height: 52px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--m-ink-3); color: var(--m-tx-1);
  border: 1px solid var(--m-line-2);
  font: inherit; font-weight: 500; font-size: 15px;
  padding: 0 16px;
  cursor: pointer;
  transition: 120ms;
}
.m-btn.primary {
  background: var(--m-accent); color: white;
  border-color: rgba(124,108,255,0.5);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 8px 16px -8px rgba(79,70,229,0.7);
}
.m-btn.primary:hover { background: #5d54ec; }
.m-btn.full { width: 100%; }
.m-btn.lg { height: 60px; font-size: 16px; border-radius: 16px; }
.m-btn.danger { background: var(--m-rose); color: white; border-color: rgba(255,255,255,0.2); }
.m-btn.ghost  { background: transparent; border-color: var(--m-line); color: var(--m-tx-1); }

/* Pills / chips */
.m-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500;
  padding: 4px 9px; border-radius: 99px;
  background: var(--m-ink-3); color: var(--m-tx-2);
  border: 1px solid var(--m-line);
}
.m-pill.ok { background: color-mix(in oklab, var(--m-emerald) 18%, transparent); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
.m-pill.warn { background: color-mix(in oklab, var(--m-amber) 18%, transparent); color: #fcd34d; border-color: rgba(245,158,11,0.3); }
.m-pill.bad { background: color-mix(in oklab, var(--m-rose) 18%, transparent); color: #fca5a5; border-color: rgba(239,68,68,0.3); }
.m-pill.cyan { background: color-mix(in oklab, var(--m-cyan) 18%, transparent); color: #67e8f9; border-color: rgba(34,211,238,0.3); }
.m-pill.live::before {
  content: ""; width: 6px; height: 6px; border-radius: 99px;
  background: var(--m-emerald);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--m-emerald) 60%, transparent);
  animation: m-pulse 1.4s infinite;
}
@keyframes m-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--m-emerald) 60%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* List rows */
.m-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--m-line);
}
.m-row:last-child { border-bottom: none; }
.m-row .ic {
  width: 36px; height: 36px; border-radius: 11px;
  background: var(--m-ink-3);
  display: grid; place-items: center; flex-shrink: 0;
}
.m-row .body { flex: 1; min-width: 0; }
.m-row .body .t { font-size: 14.5px; font-weight: 500; }
.m-row .body .s { font-size: 12.5px; color: var(--m-tx-2); margin-top: 2px; font-feature-settings: "tnum"; }
.m-row .end { font-size: 13px; color: var(--m-tx-2); font-feature-settings: "tnum"; text-align: right; }

/* Big circular state ring (for unlock screen) */
.m-ring {
  width: 240px; height: 240px;
  border-radius: 50%;
  position: relative;
  display: grid; place-items: center;
}
.m-ring .glow {
  position: absolute; inset: -40px;
  background: radial-gradient(closest-side, rgba(124,108,255,0.4), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}
.m-ring .core {
  width: 100%; height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #6c63ff, #1f1a4a 70%);
  box-shadow:
    inset 0 0 40px rgba(255,255,255,0.08),
    inset 0 0 0 1px rgba(255,255,255,0.12);
  display: grid; place-items: center;
  position: relative;
}
.m-ring .core .label {
  font-size: 12px; color: rgba(255,255,255,0.7); letter-spacing: 0.16em; text-transform: uppercase;
  margin-bottom: 6px;
}
.m-ring .core .big {
  font-size: 26px; font-weight: 600; color: white;
}

/* Scanning/pairing rings */
.m-scan-ring {
  position: absolute;
  border: 1.5px solid var(--m-accent-2);
  border-radius: 50%;
  opacity: 0;
  animation: m-scan 2.4s cubic-bezier(0.2, 0.7, 0.4, 1) infinite;
  pointer-events: none;
}
.m-scan-ring.r1 { animation-delay: 0s; }
.m-scan-ring.r2 { animation-delay: 0.6s; }
.m-scan-ring.r3 { animation-delay: 1.2s; }
@keyframes m-scan {
  0%   { inset: 50%; opacity: 0; }
  20%  { opacity: 0.7; }
  100% { inset: -30%; opacity: 0; }
}

/* Map + facility */
.m-map {
  position: relative;
  height: 240px;
  border-radius: var(--m-radius);
  overflow: hidden;
  background: #0d1322;
  border: 1px solid var(--m-line);
}
.m-map.tall { height: 360px; }
.m-map svg { width: 100%; height: 100%; display: block; }

/* PIN dots */
.m-pin-dots {
  display: flex; gap: 14px; justify-content: center;
}
.m-pin-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--m-tx-3);
  transition: 160ms;
}
.m-pin-dot.on {
  background: var(--m-accent);
  border-color: var(--m-accent);
  transform: scale(1.05);
  box-shadow: 0 0 0 4px var(--m-accent-soft);
}

.m-keypad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0 8px;
}
.m-keypad button {
  height: 64px;
  background: var(--m-ink-2);
  border: 1px solid var(--m-line);
  color: var(--m-tx-1);
  font-size: 24px; font-weight: 500;
  border-radius: 18px;
  cursor: pointer;
}
.m-keypad button.flat { background: transparent; border: none; }
.m-keypad button:hover { background: var(--m-ink-3); }

/* Wayfinding step */
.m-step {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--m-ink-2);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
}
.m-step .num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--m-accent-soft); color: var(--m-accent-2);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.m-step.active .num { background: var(--m-accent); color: white; }
.m-step .body { flex: 1; }
.m-step .t { font-size: 14px; font-weight: 500; }
.m-step .s { font-size: 12.5px; color: var(--m-tx-2); margin-top: 1px; }

/* Onboarding */
.m-onboard-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 80% 20%, rgba(124,108,255,0.45), transparent 60%),
    radial-gradient(50% 40% at 10% 60%, rgba(34,211,238,0.25), transparent 60%),
    var(--m-ink-0);
}
.m-logomark {
  width: 76px; height: 76px; border-radius: 22px;
  background: linear-gradient(140deg, var(--m-accent-2), var(--m-accent));
  display: grid; place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 12px 32px -10px rgba(79,70,229,0.55);
}

/* Section heading inside scroll */
.m-section {
  font-size: 12px; color: var(--m-tx-2); text-transform: uppercase; letter-spacing: 0.08em;
  margin: 18px 4px 8px;
  font-weight: 500;
}

/* Stack helper */
.m-stack { display: flex; flex-direction: column; gap: 12px; }
.m-stack.tight { gap: 8px; }
.m-stack.loose { gap: 18px; }
.m-row-h { display: flex; align-items: center; gap: 10px; }

/* Numeric display */
.m-num { font-feature-settings: "tnum"; letter-spacing: -0.02em; }

/* Floor plan unit cell on the wayfinding map */
.m-fp-unit {
  fill: rgba(255,255,255,0.06);
  stroke: rgba(255,255,255,0.12);
  stroke-width: 0.5;
}
.m-fp-unit.you {
  fill: var(--m-accent);
  stroke: var(--m-accent-2);
  filter: drop-shadow(0 0 12px var(--m-accent-2));
}

/* Toast */
.m-toast {
  position: absolute; left: 16px; right: 16px; bottom: 110px;
  background: rgba(20,24,36,0.92);
  border: 1px solid var(--m-line-2);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  z-index: 40;
  box-shadow: 0 16px 32px -12px rgba(0,0,0,0.5);
}
