/* ============================================================
   Fundraise Tap — HIGH-FIDELITY design system  (v2)
   Brand: Bricolage Grotesque · #143b63 · white
   Tokens transcribed from 09_hifi_prototype_instructions.md
   ============================================================ */

:root {
  /* colour */
  --primary:        #143b63;
  --primary-hover:  #0e2e4f;
  --primary-soft:   #e8eef5;
  --bg:             #ffffff;
  --surface:        #f7f8fa;
  --border:         #e2e6ec;
  --text:           #143b63;
  --text-muted:     #5c6877;
  --text-subtle:    #8a93a0;
  --success:        #1e9e5c;
  --success-soft:   #e6f4ec;
  --warning:        #d89a1f;
  --warning-soft:   #fbf2df;
  --error:          #c53a3a;
  --error-soft:     #f9e9e9;
  --info:           #3370b7;
  --info-soft:      #e9f0f8;

  /* radius */
  --r-sm: 6px;
  --r-card: 12px;
  --r-modal: 16px;

  /* elevation */
  --el-card:  0 1px 2px rgba(20,59,99,.08);
  --el-pop:   0 4px 14px rgba(20,59,99,.12);
  --el-modal: 0 8px 24px rgba(20,59,99,.18);

  --font: "Bricolage Grotesque", "Helvetica Neue", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

/* ---------------- type ---------------- */
.t-display { font-size: 48px; line-height: 56px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.t-h1 { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.t-h2 { font-size: 24px; line-height: 32px; font-weight: 600; margin: 0; }
.t-h3 { font-size: 20px; line-height: 28px; font-weight: 500; margin: 0; }
.t-bodyl { font-size: 18px; line-height: 28px; font-weight: 400; margin: 0; }
.t-body { font-size: 16px; line-height: 24px; font-weight: 400; margin: 0; }
.t-sm { font-size: 14px; line-height: 20px; font-weight: 400; margin: 0; }
.t-cap { font-size: 12px; line-height: 16px; font-weight: 500; margin: 0; }
.mono { font-family: var(--mono); font-size: 13px; line-height: 20px; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-subtle); }

/* ---------------- buttons ---------------- */
.btn {
  font-family: var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; padding: 12px 22px;
  font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .14s, border-color .14s, color .14s, transform .04s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #fff; color: var(--primary); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--primary); background: var(--surface); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #a82f2f; }
.btn.block { width: 100%; }
.btn.lg { padding: 16px 26px; font-size: 16px; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }

/* ---------------- inputs ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label { font-size: 14px; font-weight: 500; color: var(--text); }
.field .hint { font-size: 12px; color: var(--text-subtle); }
.input {
  font-family: var(--font); border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: var(--r-sm); padding: 12px 14px; font-size: 15px; width: 100%; transition: border-color .14s, box-shadow .14s;
}
.input::placeholder { color: var(--text-subtle); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input.error { border-color: var(--error); }
textarea.input { resize: none; min-height: 90px; line-height: 1.5; }
.input-currency { position: relative; }
.input-currency .cur { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-weight: 600; }
.input-currency .input { padding-left: 30px; }

/* ---------------- cards ---------------- */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--el-card); }
.card.flat { box-shadow: none; }
.card.soft { background: var(--surface); box-shadow: none; }
.hr { height: 1px; background: var(--border); border: 0; margin: 0; }

/* ---------------- badges / pills ---------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.badge.b-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.b-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge.b-error { background: var(--error-soft); color: var(--error); border-color: transparent; }
.badge.b-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.b-primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------- placeholders (logo / QR / NFC) ---------------- */
.ph {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; color: var(--text-subtle);
  font-family: var(--mono); font-size: 11px; text-align: center; overflow: hidden;
}
.ph.logo { border-style: dashed; }
.ph-qr {
  width: 116px; height: 116px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background-image:
    linear-gradient(45deg, var(--primary) 25%, transparent 25%),
    linear-gradient(-45deg, var(--primary) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--primary) 75%),
    linear-gradient(-45deg, transparent 75%, var(--primary) 75%);
  background-size: 14px 14px; background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  opacity: .9;
}

/* icon button circle */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--text-muted); cursor: pointer; }
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.icon-btn svg { width: 20px; height: 20px; }

/* avatar */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 13px; }

/* ---------------- util ---------------- */
.row { display: flex; gap: 16px; }
.col { display: flex; flex-direction: column; }
.between { display: flex; align-items: center; justify-content: space-between; }
.center { align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.gap4{gap:4px}.gap6{gap:6px}.gap8{gap:8px}.gap12{gap:12px}.gap16{gap:16px}.gap24{gap:24px}.gap32{gap:32px}
.mt4{margin-top:4px}.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mt32{margin-top:32px}
.mb0{margin-bottom:0}.mb8{margin-bottom:8px}.mb16{margin-bottom:16px}.mb24{margin-bottom:24px}
.tc{text-align:center}.tr{text-align:right}
svg.ic { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.ic-sm { width: 16px; height: 16px; }

/* ============================================================
   MOBILE device frames
   ============================================================ */
.device-phone {
  width: 390px; height: 844px; flex: none; background: #1c2530; border-radius: 54px; padding: 13px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 24px 50px rgba(20,59,99,.22); position: relative;
}
.device-phone .screen { width: 100%; height: 100%; background: #fff; border-radius: 42px; overflow: hidden; position: relative; display: flex; flex-direction: column; }
.device-phone .notch { position: absolute; top: 13px; left: 50%; transform: translateX(-50%); width: 126px; height: 32px; background: #1c2530; border-radius: 0 0 20px 20px; z-index: 60; }
.device-tablet { width: 1280px; height: 800px; flex: none; background: #1c2530; border-radius: 28px; padding: 18px; box-shadow: 0 24px 60px rgba(20,59,99,.22); position: relative; }
.device-tablet .screen { width: 100%; height: 100%; background: #fff; border-radius: 12px; overflow: hidden; position: relative; display: flex; flex-direction: column; }
.device-tablet .cam { position: absolute; top: 50%; left: 8px; transform: translateY(-50%); width: 8px; height: 8px; border-radius: 50%; background: #3a4654; }

.statusbar { height: 50px; flex: none; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 26px 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.statusbar .sb-r { display: flex; gap: 6px; align-items: center; }
.statusbar .sb-r svg { width: 17px; height: 17px; }
.home-indicator { height: 26px; flex: none; display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; }
.home-indicator::after { content: ""; width: 134px; height: 5px; border-radius: 3px; background: var(--text); opacity: .85; }

/* mobile header bar */
.m-header { height: 56px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--border); }
.m-body { flex: 1; display: flex; flex-direction: column; overflow-y: auto; padding: 20px; gap: 16px; }
.m-body::-webkit-scrollbar { width: 0; }
.device-tablet .m-body { padding: 36px 80px; }
.ctx-banner { background: var(--primary-soft); border-radius: var(--r-sm); padding: 12px 14px; font-size: 14px; color: var(--primary); }
.ctx-banner b { font-weight: 600; }

/* preset chips */
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.device-tablet .chips { grid-template-columns: repeat(6, 1fr); }
.chip { border: 1px solid var(--border); background: #fff; border-radius: var(--r-card); padding: 18px 0; text-align: center; font-size: 20px; font-weight: 600; cursor: pointer; transition: .12s; }
.chip:hover { border-color: var(--primary); }
.chip.sel { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip.other { font-size: 15px; color: var(--text-muted); font-weight: 500; }

/* segmented */
.seg { display: flex; background: var(--surface); border-radius: 999px; padding: 4px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 11px 0; border-radius: 999px; font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: .12s; }
.seg button.on { background: #fff; color: var(--primary); box-shadow: var(--el-card); }

/* ---------------- tickbox + inline expand ---------------- */
.tick { border: 1px solid var(--border); border-radius: var(--r-card); background: #fff; overflow: hidden; transition: border-color .14s; }
.tick.on { border-color: var(--primary); }
.tick-head { display: flex; align-items: flex-start; gap: 14px; padding: 16px; cursor: pointer; user-select: none; }
.tickbox { width: 24px; height: 24px; flex: none; margin-top: 1px; border: 2px solid var(--border); border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; transition: .12s; }
.tickbox svg { width: 15px; height: 15px; opacity: 0; }
.tick.on .tickbox { background: var(--primary); border-color: var(--primary); }
.tick.on .tickbox svg { opacity: 1; }
.tick-label { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.tick-label .sub { display: block; font-size: 13px; font-weight: 400; color: var(--text-muted); margin-top: 3px; line-height: 1.35; }
.tick-amt { font-family: var(--mono); font-size: 14px; color: var(--text-muted); flex: none; white-space: nowrap; margin-top: 1px; }
.tick-i { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-subtle); flex: none; cursor: help; font-size: 13px; font-style: italic; font-weight: 600; }
.tick-i:hover { color: var(--info); border-color: var(--info); }
.tick-expand { display: none; background: var(--primary-soft); padding: 16px; border-top: 1px solid var(--border); }
.tick.on .tick-expand { display: block; }
.tick-legal { display: none; margin: 0; font-size: 12px; line-height: 1.5; color: var(--text-muted); background: var(--info-soft); border-top: 1px solid var(--border); padding: 12px 16px; }
.tick.show-info .tick-legal { display: block; }

/* NFC */
.nfc { width: 168px; height: 168px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto; position: relative; color: var(--primary); }
.nfc::before, .nfc::after { content: ""; position: absolute; border: 2px solid var(--primary-soft); border-radius: 50%; }
.nfc::before { inset: 0; }
.nfc::after { inset: 28px; border-color: var(--border); }
.nfc svg { width: 56px; height: 56px; color: var(--primary); }
.spin { width: 56px; height: 56px; border-radius: 50%; border: 5px solid var(--border); border-top-color: var(--primary); margin: 0 auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.success-check { width: 72px; height: 72px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.success-check svg { width: 36px; height: 36px; stroke-width: 2.5; }

/* menu cards */
.menu-card { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--r-card); background: #fff; cursor: pointer; text-align: left; transition: .12s; width: 100%; font-family: var(--font); }
.menu-card:hover { border-color: var(--primary); box-shadow: var(--el-card); }
.menu-card.locked { opacity: .55; cursor: default; }
.menu-card .mc-ic { width: 48px; height: 48px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.menu-card .mc-ic svg { width: 24px; height: 24px; }
.menu-card > .grow { min-width: 0; }
.menu-card .mc-t { display: block; font-size: 16px; font-weight: 600; white-space: nowrap; }
.menu-card .mc-d { display: block; font-size: 13px; color: var(--text-muted); margin-top: 2px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-card .badge { flex: none; align-self: center; font-size: 11px; padding: 3px 8px; white-space: nowrap; }
.menu-card .badge svg { width: 13px; height: 13px; }
.menu-card > .subtle { flex: none; }

/* variant switcher */
.vswitch { display: inline-flex; gap: 4px; padding: 4px; border: 1px dashed var(--info); background: var(--info-soft); border-radius: 999px; align-self: flex-start; }
.vswitch button { border: 0; background: transparent; font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--info); padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.vswitch button.on { background: var(--info); color: #fff; }
.dots { display: flex; gap: 8px; justify-content: center; }
.dots .d { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.dots .d.on { background: var(--primary); }
