/* ════════════════════════════════════════════════════════════
   wallet.css — SXDWallet mobile app styles
   SXDWallet · 2026
   Requires: base.css (tokens + reset)
════════════════════════════════════════════════════════════ */

/* ── App shell ───────────────────────────────────────────── */
html, body {
  height: 100%; background: var(--dark);
  font-family: var(--body-font); color: var(--text); overflow: hidden;
}
#app {
  display: flex; align-items: center; justify-content: center;
  height: 100vh;
  background: radial-gradient(ellipse at 30% 0%, #0d2b12, var(--dark) 60%);
}
#phone {
  width: min(390px, 100vw); height: min(844px, 100vh);
  background: var(--d2); border-radius: min(44px, 0px);
  overflow: hidden; position: relative;
  display: flex; flex-direction: column;
  box-shadow: 0 40px 120px rgba(0,0,0,.8);
}
@media (max-width: 430px) {
  #app   { align-items: flex-start; }
  #phone { border-radius: 0; height: 100vh; width: 100vw; }
}

/* ── Screens ─────────────────────────────────────────────── */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.screen.active { opacity: 1; pointer-events: all; }
.statusbar {
  height: 44px; display: flex; align-items: center;
  justify-content: space-between; padding: 0 24px; flex-shrink: 0;
}
.stime  { font-family: var(--font); font-size: 15px; font-weight: 600; }
.sicons { font-size: 12px; }

/* ── Loading screen ──────────────────────────────────────── */
#s-loading {
  background: var(--dark); justify-content: center;
  align-items: center; gap: 14px; z-index: 100;
}
.spin {
  width: 38px; height: 38px;
  border: 3px solid var(--border); border-top-color: var(--g);
  border-radius: 50%; animation: spin .8s linear infinite;
}

/* ── Splash ──────────────────────────────────────────────── */
#s-splash {
  background: var(--dark); justify-content: center;
  align-items: center; padding: 0 40px;
}
.sp-globe { font-size: 80px; margin-bottom: 14px; animation: float 3s ease-in-out infinite; }
.sp-logo  { font-family: var(--font); font-size: 50px; font-weight: 800; color: var(--g); letter-spacing: -2px; }
.sp-sub   { font-size: 13px; color: var(--muted); margin-top: 6px; letter-spacing: 3px; text-transform: uppercase; }
.sp-tag   { margin-top: 22px; font-size: 16px; color: var(--text); text-align: center; line-height: 1.7; max-width: 260px; }
.sp-btns  { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 36px; }
.sp-back  { margin-top: 16px; font-size: 12px; color: var(--muted); text-align: center; cursor: pointer; }
.sp-back span { color: var(--g); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  background: var(--g); color: #000; border: none;
  border-radius: 50px; padding: 16px;
  font-family: var(--font); font-size: 16px; font-weight: 700;
  cursor: pointer; width: 100%; transition: all .2s;
}
.btn:active { background: var(--g2); transform: scale(.99); }
.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1.5px solid var(--border); border-radius: 50px; padding: 14px;
  font-family: var(--font); font-size: 15px; cursor: pointer;
  width: 100%; transition: all .2s;
}
.btn-ghost:active { border-color: var(--g); color: var(--g); }

/* ── Register / Login ────────────────────────────────────── */
#s-reg, #s-login { background: var(--d2); }
.sh {
  padding: 16px 24px 8px; display: flex;
  align-items: center; gap: 12px; flex-shrink: 0;
}
.back-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); border: none; color: var(--text);
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sh-title  { font-family: var(--font); font-size: 20px; font-weight: 700; }
.fbody     { padding: 18px 24px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 13px; }
.flabel    { font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 5px; }
.finput {
  width: 100%; background: var(--card); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 14px 16px; color: var(--text);
  font-family: var(--body-font); font-size: 16px; outline: none; transition: all .2s;
}
.finput:focus       { border-color: var(--g); background: var(--c2); }
.finput::placeholder { color: var(--muted); }
.form-link          { text-align: center; font-size: 12px; color: var(--muted); }
.form-link span     { color: var(--g); cursor: pointer; }

/* ── Country dropdown ────────────────────────────────────── */
.country-select-wrap { position: relative; }
.country-search {
  width: 100%; background: var(--card); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 13px 16px; color: var(--text);
  font-family: var(--body-font); font-size: 15px; outline: none; transition: all .2s; cursor: pointer;
}
.country-search:focus       { border-color: var(--g); background: var(--c2); }
.country-search::placeholder { color: var(--muted); }
.country-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--card); border: 1.5px solid var(--g);
  border-radius: 14px; max-height: 220px; overflow-y: auto;
  z-index: 200; display: none; box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.country-dropdown.open { display: block; }
.country-opt {
  padding: 11px 16px; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; gap: 10px; transition: background .1s;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.country-opt:last-child        { border-bottom: none; }
.country-opt:active,
.country-opt:hover             { background: var(--c2); }
.country-opt.selected          { color: var(--g); font-weight: 600; }
.country-opt-flag              { font-size: 20px; flex-shrink: 0; }
.country-opt-name              { flex: 1; }
.country-opt-code              { font-size: 11px; color: var(--muted); font-family: monospace; }

/* ── Home screen ─────────────────────────────────────────── */
#s-home    { background: var(--d2); }
.home-top  { padding: 10px 20px 0; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.greet-txt { font-size: 12px; color: var(--muted); }
.user-name { font-family: var(--font); font-size: 19px; font-weight: 700; margin-top: 1px; }
.chain-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--card); border: none; color: var(--text);
  font-size: 17px; cursor: pointer;
}

/* ── Balance card ────────────────────────────────────────── */
.bal-card {
  margin: 12px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, #0d2b12, #183d1f 50%, #0a1f0d);
  border: 1px solid rgba(0,200,83,.2); padding: 20px 22px;
  position: relative; overflow: hidden; flex-shrink: 0;
}
.bal-card::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(0,200,83,.04);
}
.bal-lbl  { font-size: 10px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.bal-amt  { font-family: var(--font); font-size: 38px; font-weight: 800; color: var(--g); letter-spacing: -2px; margin: 4px 0 2px; line-height: 1; }
.bal-sym  { font-size: 16px; color: var(--muted); }
.bal-fiat { font-size: 13px; color: var(--muted); margin-top: 4px; }
.bal-addr {
  font-size: 9px; color: rgba(255,255,255,.18); margin-top: 10px;
  font-family: monospace; word-break: break-all; cursor: pointer; transition: color .2s;
}
.bal-addr:active { color: var(--g); }
.eye-btn  { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; }

/* ── Quick actions ───────────────────────────────────────── */
.sec-title {
  font-family: var(--font); font-size: 13px; font-weight: 700;
  padding: 0 20px; margin-bottom: 8px; flex-shrink: 0;
  color: var(--muted); text-transform: uppercase; letter-spacing: 1px;
}
.qa-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 8px; padding: 0 16px; margin-bottom: 14px; flex-shrink: 0;
}
.qa-item {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 12px 6px 10px;
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; cursor: pointer; transition: all .15s;
}
.qa-item:active { background: var(--c2); border-color: var(--g); }
.qa-ico { font-size: 20px; }
.qa-lbl { font-size: 9px; color: var(--muted); text-align: center; font-weight: 500; }

/* ── Transactions ────────────────────────────────────────── */
.tx-list { flex: 1; overflow-y: auto; padding: 0 12px 90px; }
.tx-item { display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 12px; margin-bottom: 4px; cursor: pointer; transition: background .1s; }
.tx-item:active { background: var(--card); }
.tx-ico  { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.tx-ico.in   { background: rgba(0,200,83,.1); }
.tx-ico.out  { background: rgba(255,82,82,.1); }
.tx-ico.mine { background: rgba(255,214,0,.1); }
.tx-det  { flex: 1; min-width: 0; }
.tx-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-memo { font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-time { font-size: 10px; color: var(--muted); margin-top: 1px; }
.tx-val  { font-family: var(--font); font-size: 14px; font-weight: 700; text-align: right; flex-shrink: 0; }
.tx-val.in   { color: var(--g); }
.tx-val.out  { color: var(--red); }
.tx-val.mine { color: var(--gold); }

/* ── Bottom nav ──────────────────────────────────────────── */
.bnav {
  height: 72px; background: var(--d3); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 4px 4px; flex-shrink: 0; position: relative; z-index: 10; position: relative; z-index: 10;
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 8px 14px; border-radius: 12px; transition: all .15s;
}
.nav-btn.active { color: var(--g); }
.nav-ico { font-size: 20px; }
.nav-lbl { font-size: 9px; font-weight: 500; }

/* ── Send screen ─────────────────────────────────────────── */
#s-send { background: var(--d2); }
.recipient-card {
  margin: 0 16px 10px; background: var(--card); border-radius: 14px;
  padding: 13px; display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; cursor: pointer;
  border: 1.5px solid var(--border); transition: border-color .2s;
}
.recipient-card:active { border-color: var(--g); }
.rec-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--g), #004d20);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font); font-weight: 700; font-size: 14px;
  color: #fff; flex-shrink: 0;
}
.rec-name  { font-weight: 600; font-size: 14px; }
.rec-phone { font-size: 11px; color: var(--muted); margin-top: 1px; }
.amt-display {
  font-family: var(--font); font-size: 46px; font-weight: 800; color: var(--g);
  text-align: center; padding: 14px 16px; min-height: 86px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: -1px;
}
.memo-input {
  margin: 0 16px 8px; background: var(--card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 10px 14px; color: var(--text);
  font-family: var(--body-font); font-size: 13px; outline: none;
  width: calc(100% - 32px); flex-shrink: 0; transition: border-color .2s;
}
.memo-input:focus       { border-color: var(--g); }
.memo-input::placeholder { color: var(--muted); }
.numpad  { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; padding: 6px 16px; flex-shrink: 0; }
.numkey  {
  background: var(--card); border: 1px solid var(--border); border-radius: 13px;
  height: 56px; font-family: var(--font); font-size: 20px; font-weight: 600;
  color: var(--text); cursor: pointer; transition: all .12s;
}
.numkey:active { background: var(--c2); }
.send-wrap { padding: 6px 16px 10px; flex-shrink: 0; }

/* ── Contacts ────────────────────────────────────────────── */
#s-contacts    { background: var(--d2); }
.search-wrap   { padding: 0 16px 10px; flex-shrink: 0; }
.c-list        { flex: 1; overflow-y: auto; padding: 0 12px 90px; }
.c-item        { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer; transition: background .12s; margin-bottom: 2px; }
.c-item:active { background: var(--card); }
.c-av   { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font); font-weight: 700; font-size: 16px; color: #fff; flex-shrink: 0; }
.c-name  { font-weight: 500; font-size: 14px; }
.c-phone { font-size: 11px; color: var(--muted); margin-top: 1px; }
.add-contact-box { padding: 12px 16px; flex-shrink: 0; }

/* ── Blockchain Explorer ─────────────────────────────────── */
#s-exp    { background: var(--d2); }
.exp-body { flex: 1; overflow-y: auto; padding: 0 14px 90px; }
.stat-card { background: var(--card); border-radius: 14px; padding: 13px; margin-bottom: 10px; border: 1px solid var(--border); }
.stat-row  { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.03); }
.stat-row:last-child { border: none; }
.stat-k { font-size: 11px; color: var(--muted); }
.stat-v { font-size: 12px; font-weight: 500; text-align: right; font-family: monospace; color: var(--text); max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk-item       { background: var(--card); border-radius: 12px; padding: 11px; margin-bottom: 6px; border: 1px solid var(--border); cursor: pointer; transition: border-color .15s; }
.blk-item:active { border-color: var(--g); }
.blk-top  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.blk-idx  { font-family: var(--font); font-size: 13px; font-weight: 700; color: var(--g); }
.blk-badge { display: inline-flex; padding: 3px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; }
.blk-badge.ok      { background: rgba(0,200,83,.1);  color: var(--g); }
.blk-badge.genesis { background: rgba(255,214,0,.1); color: var(--gold); }
.blk-hash { font-size: 9px; color: var(--muted); font-family: monospace; margin-bottom: 3px; }
.blk-info { font-size: 11px; color: var(--muted); }
.mine-btn {
  background: linear-gradient(135deg, var(--g), #007a30); color: #000;
  border: none; border-radius: 12px; padding: 14px;
  font-family: var(--font); font-size: 14px; font-weight: 700;
  cursor: pointer; width: 100%; margin-bottom: 12px; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.mine-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── PIN overlay ─────────────────────────────────────────── */
#pin-ov {
  position: absolute; inset: 0;
  background: rgba(10,15,13,.96); backdrop-filter: blur(10px);
  z-index: 50; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  opacity: 0; pointer-events: none; transition: all .28s;
}
#pin-ov.show { opacity: 1; pointer-events: all; }
.pin-lock  { font-size: 46px; }
.pin-title { font-family: var(--font); font-size: 22px; font-weight: 700; }
.pin-desc  { font-size: 13px; color: var(--muted); text-align: center; max-width: 250px; line-height: 1.5; }
.dots-row  { display: flex; gap: 13px; }
.dot       { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); transition: all .18s; }
.dot.lit   { background: var(--g);   border-color: var(--g); }
.dot.err   { background: var(--red); border-color: var(--red); }
.pin-pad   { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; width: 276px; }
.pkey {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  height: 58px; font-family: var(--font); font-size: 22px; font-weight: 600;
  color: var(--text); cursor: pointer; transition: all .12s;
}
.pkey:active  { background: var(--c2); }
.pin-cancel   { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; margin-top: 4px; }

/* ── Success overlay ─────────────────────────────────────── */
#succ-ov {
  position: absolute; inset: 0; background: rgba(10,15,13,.97); z-index: 60;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 11px;
  opacity: 0; pointer-events: none; transition: all .28s;
}
#succ-ov.show { opacity: 1; pointer-events: all; }
.succ-ring {
  width: 88px; height: 88px; border-radius: 50%;
  background: rgba(0,200,83,.1); border: 3px solid var(--g);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; animation: pulse 1.5s ease-in-out infinite;
}
.succ-amt  { font-family: var(--font); font-size: 32px; font-weight: 800; color: var(--g); letter-spacing: -1px; text-align: center; padding: 0 20px; }
.succ-lbl  { font-size: 14px; color: var(--muted); }
.succ-to   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.succ-done { margin-top: 14px; background: var(--g); color: #000; border: none; border-radius: 50px; padding: 14px 44px; font-family: var(--font); font-size: 16px; font-weight: 700; cursor: pointer; }

/* ── Toast ───────────────────────────────────────────────── */
#toast {
  position: absolute; bottom: 88px; left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: var(--c2); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 18px; font-size: 13px;
  opacity: 0; transition: all .26s; pointer-events: none;
  z-index: 100; max-width: 310px; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok   { border-color: var(--g);    color: var(--g); }
#toast.er   { border-color: var(--red);  color: var(--red); }
#toast.warn { border-color: var(--gold); color: var(--gold); }

/* ── Settings ────────────────────────────────────────────── */
#s-settings     { background: var(--d2); }
.settings-scroll { flex: 1; overflow-y: auto; padding: 0 16px 90px; }
.settings-section { margin-bottom: 20px; }
.settings-section-title {
  font-family: var(--font); font-size: 11px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 10px; padding: 0 4px;
}
.settings-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 8px;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 12px;
}
.settings-item:active       { border-color: var(--g); background: var(--c2); }
.settings-item-ico          { font-size: 22px; flex-shrink: 0; width: 36px; text-align: center; }
.settings-item-info         { flex: 1; }
.settings-item-title        { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.settings-item-desc         { font-size: 11px; color: var(--muted); line-height: 1.5; }
.settings-item-arrow        { color: var(--muted); font-size: 14px; flex-shrink: 0; }
.settings-item.done .settings-item-title { color: var(--g); }

/* SXD number card */
.afc-card {
  background: linear-gradient(135deg, #0d2b12, #183d1f);
  border: 1px solid rgba(0,200,83,.25); border-radius: 16px;
  padding: 16px; margin-bottom: 20px; text-align: center;
}
.afc-card-label  { font-size: 10px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px; }
.afc-card-number { font-family: var(--font); font-size: 22px; font-weight: 800; color: var(--g); letter-spacing: 2px; margin-bottom: 4px; }
.afc-card-short  { font-size: 12px; color: var(--muted); }
.afc-card-copy   { margin-top: 10px; background: rgba(0,200,83,.1); border: 1px solid rgba(0,200,83,.2); border-radius: 8px; padding: 7px 16px; font-size: 12px; color: var(--g); cursor: pointer; display: inline-block; }

/* 6-dot PIN extension */
.dots-row-6 { display: flex; gap: 10px; }
.dot6       { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--muted); transition: all .18s; flex-shrink: 0; }
.dot6.lit   { background: var(--g);   border-color: var(--g); }
.dot6.err   { background: var(--red); border-color: var(--red); }

/* Quick limit buttons */
.quick-limit-btn {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 12px;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  color: var(--text); cursor: pointer; transition: all .15s; width: 100%;
}
.quick-limit-btn:active { background: var(--c2); border-color: var(--gold); color: var(--gold); }

/* Modal overlay */
#modal-ov {
  position: absolute; inset: 0;
  background: rgba(10,15,13,.92); backdrop-filter: blur(8px);
  z-index: 200; display: flex; align-items: center;
  justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: all .25s;
}

/* PWA banner */
#pwa-banner { position: absolute; bottom: 72px; left: 0; right: 0; z-index: 20; display: none; }
#pwa-banner.show { display: block; }
.pwa-wrap {
  background: linear-gradient(135deg, #0d2b12, #1a3d20);
  border-top: 2px solid #00C853; padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.6);
}
.pwa-icon  { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(135deg, #00C853, #004d20); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.pwa-info  { flex: 1; min-width: 0; }
.pwa-title { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; color: #E8F5E9; }
.pwa-sub   { font-size: 11px; color: #6B9E74; margin-top: 2px; }
.pwa-btn   { background: #00C853; color: #000; border: none; border-radius: 50px; padding: 10px 18px; font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.pwa-x     { background: none; border: none; color: #6B9E74; font-size: 20px; cursor: pointer; padding: 4px 8px; flex-shrink: 0; }
.pwa-ios   { background: rgba(0,200,83,.08); border-top: 1px solid rgba(0,200,83,.2); padding: 10px 20px; font-size: 12px; color: #6B9E74; text-align: center; line-height: 1.6; }

/* Scrollbar */
::-webkit-scrollbar       { width: 2px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }