/* ============================================================
   Wallet App — Light Theme
   Clean, fluid, refined
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* ── CSS Variables ── */
:root {
  --accent:       #2563EB;
  --accent2:      #3B82F6;
  --accent-glow:  #2563EB25;
  --accent-dim:   #2563EB0F;

  /* Light palette */
  --bg:           #F8FAFF;
  --bg2:          #F1F5FD;
  --surface:      #FFFFFF;
  --surface2:     #F4F7FD;
  --surface3:     #EBF0FA;
  --border:       #E4EAF4;
  --border2:      #D5DFEF;

  /* Text */
  --text:         #0F172A;
  --text2:        #475569;
  --muted:        #94A3B8;

  /* Status */
  --success:      #16A34A;
  --danger:       #DC2626;
  --warning:      #D97706;

  /* Typography */
  --font-head:    'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Shape */
  --radius:       16px;
  --radius-sm:    10px;
  --radius-full:  999px;

  /* Safe area */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Shadows — key to a polished light theme */
  --shadow-xs:  0 1px 2px #0F172A08;
  --shadow-sm:  0 2px 8px #0F172A0C, 0 1px 2px #0F172A06;
  --shadow-md:  0 4px 16px #0F172A0E, 0 2px 4px #0F172A08;
  --shadow-lg:  0 8px 32px #0F172A12, 0 4px 8px #0F172A08;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html {
  height: 100%;
  height: -webkit-fill-available;
  overflow: hidden;
  font-size: 16px;
}

body {
  height: 100%;
  height: -webkit-fill-available;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  position: fixed;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* ── Screen wrapper ── */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

/* ── Scrollable content ── */
.scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Smooth momentum scrolling */
  scroll-behavior: smooth;
}
.scroll-area::-webkit-scrollbar { display: none; }

/* ── Status bar ── */
.status-bar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  background: var(--bg);
}
.status-time {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-head);
}
.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text);
}

/* ── Nav bar ── */
.nav-bar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  position: relative;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, transform .15s;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
}
.nav-back:active {
  background: var(--surface3);
  transform: scale(.93);
}
.nav-back svg { width: 18px; height: 18px; color: var(--text); }
.nav-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
}

/* ── Background — subtle light texture instead of dark mesh ── */
.bg-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-mesh::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, #2563EB08 0%, transparent 65%);
  top: -150px;
  right: -120px;
  animation: orb-drift 10s ease-in-out infinite alternate;
}
.bg-mesh::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, #6366F108 0%, transparent 65%);
  bottom: -100px;
  left: -100px;
  animation: orb-drift 13s ease-in-out infinite alternate-reverse;
}
@keyframes orb-drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(24px, 32px) scale(1.08); }
}

/* ── Buttons ── */
.btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  /* Smooth spring-like press */
  transition: transform .18s cubic-bezier(.34,1.56,.64,1),
              opacity .15s ease,
              box-shadow .2s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-appearance: none;
}
/* Subtle top-light shimmer */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #ffffff20 0%, transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}
.btn:active { transform: scale(.96); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #4F46E5 100%);
  color: #fff;
  box-shadow: 0 4px 20px #2563EB30, 0 1px 3px #2563EB20;
}
.btn-primary:active {
  box-shadow: 0 2px 8px #2563EB25;
}

.btn-outline {
  background: var(--surface);
  border: 1.5px solid var(--border2);
  color: var(--text2);
  box-shadow: var(--shadow-xs);
}
.btn-outline:active { background: var(--surface2); }

.btn-ghost {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #B91C1C);
  color: #fff;
  box-shadow: 0 4px 16px #DC262625;
}

/* ── Input ── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.input-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .7px;
  text-transform: uppercase;
}
.input-field {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius);
  padding: 13px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  box-shadow: var(--shadow-xs);
  -webkit-appearance: none;
}
.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-xs);
}
.input-field::placeholder { color: var(--muted); }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

/* ── Seed phrase grid ── */
.seed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px;
}
.seed-word {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-xs);
}
.seed-num {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  width: 16px;
  flex-shrink: 0;
}
.seed-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-head);
  letter-spacing: .2px;
}

/* ── PIN dots ── */
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 8px 0;
}
.pin-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--surface3);
  border: 2px solid var(--border2);
  transition: all .25s cubic-bezier(.34,1.56,.64,1);
}
.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.2);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.pin-dot.error {
  background: var(--danger);
  border-color: var(--danger);
  animation: shake .4s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* ── PIN keypad ── */
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 8px 28px;
}
.pin-key {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1),
              background .15s ease,
              box-shadow .15s ease;
  box-shadow: var(--shadow-sm);
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.pin-key:active {
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: scale(.9);
  box-shadow: none;
}
.pin-key .key-num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 22px;
  color: var(--text);
  line-height: 1;
}
.pin-key .key-letters {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1.5px;
  margin-top: 2px;
  font-weight: 500;
}
.pin-key.key-empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
  box-shadow: none;
}
.pin-key.key-empty:active {
  background: transparent;
  border-color: transparent;
  transform: none;
}
.pin-key.key-del {
  background: var(--surface2);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.pin-key.key-del svg { width: 22px; height: 22px; color: var(--text2); }
.pin-key.key-del:active {
  background: var(--surface3);
  transform: scale(.9);
}

/* ── Progress steps ── */
.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
}
.step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border2);
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
}
.step-dot.active {
  width: 22px;
  border-radius: 3px;
  background: var(--accent);
}
.step-dot.done {
  background: var(--success);
}

/* ── Chip ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
  box-shadow: var(--shadow-xs);
}

/* ── Alert banners ── */
.alert-banner {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.alert-warning {
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  color: #92400E;
}
.alert-danger {
  background: #FEE2E2;
  border: 1px solid #FECACA;
  color: #991B1B;
}
.alert-success {
  background: #DCFCE7;
  border: 1px solid #BBF7D0;
  color: #166534;
}
.alert-banner svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Page padding ── */
.page-pad    { padding: 0 24px; }
.page-pad-sm { padding: 0 20px; }

/* ── Screen transitions — smoother and more fluid ── */
.screen {
  animation: screen-in .32s cubic-bezier(.25,.46,.45,.94) both;
}
@keyframes screen-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.screen.slide-up {
  animation: slide-up-in .36s cubic-bezier(.25,.46,.45,.94) both;
}
@keyframes slide-up-in {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Fade-up utility (used inline in screens) ── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pop-in {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Logo lockup ── */
.app-logo-img {
  max-height: 44px;
  max-width: 180px;
  object-fit: contain;
}
.app-logo-text {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -.8px;
  color: var(--text);
}
.app-logo-text em {
  font-style: normal;
  color: var(--accent);
}

/* ── Balance display — fix oversized text ── */
.balance-amount {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 32px;          /* was likely 48px+ — reined in */
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1.1;
}
.balance-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.balance-currency {
  font-size: 16px;
  font-weight: 600;
  color: var(--text2);
  margin-left: 4px;
  vertical-align: super;
  font-family: var(--font-body);
}

/* ── Coin list rows ── */
.coin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background .15s ease;
  cursor: pointer;
}
.coin-row:last-child { border-bottom: none; }
.coin-row:active { background: var(--surface2); }
.coin-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.coin-icon img { width: 100%; height: 100%; object-fit: cover; }
.coin-info { flex: 1; min-width: 0; }
.coin-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-head);
}
.coin-network {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}
.coin-balance {
  text-align: right;
  flex-shrink: 0;
}
.coin-balance-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-head);
}
.coin-balance-fiat {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}
.coin-change-pos { color: var(--success); font-size: 11px; font-weight: 600; }
.coin-change-neg { color: var(--danger);  font-size: 11px; font-weight: 600; }

/* ── Bottom tab bar ── */
.tab-bar {
  height: 60px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  box-shadow: 0 -4px 16px #0F172A08;
  padding-bottom: var(--safe-bottom);
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 0;
  transition: opacity .15s;
  position: relative;
}
.tab-item svg { width: 22px; height: 22px; color: var(--muted); transition: color .2s, transform .2s cubic-bezier(.34,1.56,.64,1); }
.tab-item span { font-size: 10px; font-weight: 600; color: var(--muted); transition: color .2s; letter-spacing: .3px; }
.tab-item.active svg { color: var(--accent); transform: scale(1.1); }
.tab-item.active span { color: var(--accent); }
.tab-active-dot {
  position: absolute;
  top: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity .2s;
}
.tab-item.active .tab-active-dot { opacity: 1; }

/* ── Utility ── */
.mt-auto  { margin-top: auto; }
.mb-safe  { margin-bottom: max(24px, var(--safe-bottom)); }
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 12px; }
.gap-12      { gap: 12px; }
.flex-col    { display: flex; flex-direction: column; }
.w-full      { width: 100%; }
.hidden      { display: none !important; }
