/* Bail Me. Dark, calm, one accent. 8pt spacing, 24px page gutter, Instrument Sans 400/500 (Harmony brand font). */

:root {
  --bg: #0e0d12;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.09);
  --hairline: rgba(255, 255, 255, 0.08);
  --fg: #f5f4f7;
  --fg-2: rgba(245, 244, 247, 0.62);
  --fg-3: rgba(245, 244, 247, 0.4);
  --accent: #d4ff4f;
  --accent-ink: #0f1206;
  --danger: #ff6b5c;
  --ok: #5ee39a;
  --r-lg: 28px;
  --r-md: 20px;
  --gutter: 24px;
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); overscroll-behavior: none; }
body {
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overflow-x: hidden;
}
/* Soft plum-to-amber haze at the top, like the reference wallet screen. */
body::before {
  content: ""; position: fixed; inset: -20% -30% auto -30%; height: 60vh; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60% 55% at 30% 20%, rgba(120, 70, 140, 0.35), transparent 70%),
    radial-gradient(45% 45% at 85% 10%, rgba(214, 120, 70, 0.22), transparent 70%);
  filter: blur(20px);
}
.app {
  position: relative; z-index: 1;
  max-width: 430px; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: 12px var(--gutter) 32px;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button:disabled { opacity: .45; cursor: default; }

/* ---------- type ---------- */
.hero { margin: 32px 0 0; }
.greet { font-size: 17px; font-weight: 500; color: var(--fg-2); letter-spacing: -.01em; }
h1 { font-size: 38px; line-height: 1.06; font-weight: 500; letter-spacing: -.03em; margin: 6px 0 0; }
.lead { font-size: 15px; line-height: 1.55; color: var(--fg-2); margin: 14px 0 0; max-width: 34ch; }
.label { font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); margin: 36px 0 12px; }
.hint { font-size: 13px; line-height: 1.5; color: var(--fg-3); margin-top: 10px; }
.error { color: var(--danger); font-size: 14px; line-height: 1.4; margin-top: 12px; min-height: 20px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; height: 48px; }
.wordmark { font-size: 15px; font-weight: 500; color: var(--fg-2); letter-spacing: -.01em; }
.circle-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--fg);
}
.circle-btn:active { background: rgba(255, 255, 255, 0.14); }

/* ---------- install banner ---------- */
.banner {
  display: flex; align-items: center; gap: 12px; margin: 0 0 8px;
  padding: 10px 6px 10px 0; border-bottom: 1px solid var(--hairline);
  font-size: 13px; line-height: 1.4; color: var(--fg-2);
}
.banner span { flex: 1; }
.banner strong { color: var(--fg); font-weight: 500; }
.banner-btn { background: var(--accent); color: var(--accent-ink); font-weight: 500; font-size: 13px; padding: 8px 14px; border-radius: 999px; }
.banner-x { width: 36px; height: 36px; border-radius: 50%; color: var(--fg-3); font-size: 22px; line-height: 1; }

/* ---------- grouped lists (how it works, personas) ---------- */
.group { background: var(--surface); border-radius: var(--r-lg); padding: 4px 0; margin: 0; list-style: none; }
.group > * + * { border-top: 1px solid var(--hairline); }
.how li { display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px; font-size: 14px; line-height: 1.5; color: var(--fg-2); }
.how strong { color: var(--fg); font-weight: 500; }
.how-n { flex: 0 0 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px;
  font-size: 12px; font-weight: 500; color: var(--fg); background: var(--surface-2); }
.how + .label { margin-top: 36px; }

.row {
  width: 100%; text-align: left; display: grid; grid-template-columns: 44px 1fr 22px; gap: 16px; align-items: center;
  padding: 16px 18px; border-radius: 0;
}
.row:first-child { border-radius: calc(var(--r-lg) - 4px) calc(var(--r-lg) - 4px) 0 0; }
.row:last-child { border-radius: 0 0 calc(var(--r-lg) - 4px) calc(var(--r-lg) - 4px); }
.row:active { background: rgba(255, 255, 255, 0.04); }
.row .ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--fg); transition: background .15s, color .15s; }
.row .ico svg { width: 20px; height: 20px; }
.row .t { display: block; font-size: 16px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; }
.row .s { display: block; font-size: 13.5px; line-height: 1.45; color: var(--fg-2); margin-top: 2px; }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.22); display: grid; place-items: center; transition: border-color .15s, background .15s; }
.radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-ink); transform: scale(0); transition: transform .15s; }
.row[aria-pressed="true"] .ico { background: var(--accent); color: var(--accent-ink); }
.row[aria-pressed="true"] .radio { border-color: var(--accent); background: var(--accent); }
.row[aria-pressed="true"] .radio::after { transform: scale(1); }

/* ---------- segmented control ---------- */
.seg { display: flex; padding: 4px; background: var(--surface); border-radius: 999px; }
.seg button { flex: 1; padding: 12px 0; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--fg-2); transition: background .15s, color .15s; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 500; }

/* ---------- forms ---------- */
label { display: block; font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); margin: 28px 0 10px; }
input {
  width: 100%; height: 56px; padding: 0 18px; font-size: 17px;
  background: var(--surface); border: 1px solid transparent; border-radius: 18px; outline: none; color: var(--fg);
  transition: border-color .15s, background .15s;
}
input:focus { border-color: rgba(255, 255, 255, 0.22); background: var(--surface-2); }
input::placeholder { color: var(--fg-3); }
input.code { height: 72px; font-size: 32px; font-weight: 500; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn { width: 100%; height: 56px; border-radius: 999px; font-size: 16px; font-weight: 500; letter-spacing: -.01em; display: grid; place-items: center; transition: transform .1s, background .15s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--fg); color: var(--bg); }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--surface); color: var(--fg); }
.btn.small { width: auto; height: 40px; padding: 0 16px; font-size: 14px; }
.stack { display: grid; gap: 10px; margin-top: 28px; }

/* ---------- BAIL ---------- */
.stage { margin-top: auto; padding-top: 40px; display: grid; justify-items: center; gap: 20px; }
.bail {
  position: relative; width: 172px; height: 172px; border-radius: 50%; font-family: var(--font);
  background: radial-gradient(circle at 38% 32%, #e9ff8f, var(--accent) 48%, #b5e02e);
  color: var(--accent-ink); font-size: 22px; font-weight: 500; letter-spacing: .2em; text-indent: .2em;
  box-shadow: 0 24px 60px rgba(212, 255, 79, 0.22), inset 0 -8px 20px rgba(0, 0, 0, 0.12);
  transition: transform .12s;
}
.bail::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; border: 1px solid rgba(212, 255, 79, 0.18); }
.bail:active { transform: scale(.96); }
.bail:disabled { filter: saturate(.3) brightness(.7); box-shadow: none; }
@media (prefers-reduced-motion: no-preference) {
  .bail::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(212, 255, 79, 0.5); animation: ripple 2.4s ease-out infinite; }
  @keyframes ripple { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.45); opacity: 0; } }
}
.caption { font-size: 13.5px; color: var(--fg-2); text-align: center; }
.caption strong { color: var(--fg); font-weight: 500; }

/* ---------- active call ---------- */
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 0; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.digits { font-size: 76px; line-height: 1; font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin: 14px 0 12px; }
.status { font-size: 15px; line-height: 1.5; color: var(--fg-2); max-width: 30ch; }
.status strong { color: var(--fg); font-weight: 500; }
.title-lg { font-size: 30px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; margin: 20px 0 10px; }
.orb { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--fg); }
.orb svg { width: 40px; height: 40px; }
.orb.live { background: var(--accent); color: var(--accent-ink); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212, 255, 79, .35); } 50% { transform: scale(1.04); box-shadow: 0 0 0 22px rgba(212, 255, 79, 0); } }
.orb.warn { color: var(--danger); }
.fb { width: 100%; margin-top: 18px; }

/* ---------- settings ---------- */
.panel { background: var(--surface); border-radius: var(--r-md); padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; }
.panel .num { font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.panel .muted { font-size: 13px; line-height: 1.45; color: var(--fg-2); margin-top: 2px; }

@media (min-width: 600px) { .app { min-height: 100vh; border-left: 1px solid var(--hairline); border-right: 1px solid var(--hairline); padding-left: 32px; padding-right: 32px; } }
