/* ============================================================
   mSamex Earn — shared styles
   Brand v3 "Modern Exchange": Charcoal anchor, ONE punch color (Mint).
   Geist + Geist Mono. No gradients. No emoji. Mobile-first (390px).
   ============================================================ */

:root {
  /* Surfaces */
  --bg:        #0B0E11;
  --surface:   #14181E;
  --elevated:  #1C2127;
  --line:      #252A33;
  --line-soft: #1A1E25;

  /* Brand accent — singular */
  --mint:      #00D68F;
  --mint-deep: #00B377;
  --mint-08:   rgba(0, 214, 143, 0.08);
  --mint-12:   rgba(0, 214, 143, 0.12);
  --mint-18:   rgba(0, 214, 143, 0.18);
  --mint-25:   rgba(0, 214, 143, 0.25);

  /* Text */
  --ink:       #0B0E11;
  --snow:      #FFFFFF;
  --dim:       rgba(255, 255, 255, 0.72);
  --mute:      #8B95A3;
  --faint:     rgba(255, 255, 255, 0.46);

  /* Semantic */
  --down:      #F6465D;
  --warn:      #F0B90B;

  /* Type */
  --font: 'Geist', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'JetBrains Mono', monospace;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;

  /* Safe areas */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);

  --tabbar-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--snow);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { overflow-x: hidden; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; }
::selection { background: var(--mint); color: var(--ink); }

.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.up { color: var(--mint); }
.down { color: var(--down); }
.muted { color: var(--mute); }
.dim { color: var(--dim); }

/* ---- App shell ---- */
.shell {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* ============================================================
   LOGO / WORDMARK
   ============================================================ */
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand .mesh { flex-shrink: 0; }
.wordmark {
  font-family: var(--font);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 19px;
  line-height: 1;
  color: var(--snow);
}
.wordmark .s { color: var(--mint); }
.earn-pill {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mint);
  border: 1px solid var(--mint-25);
  background: var(--mint-08);
  padding: 3px 7px;
  border-radius: 6px;
  line-height: 1;
}

/* ============================================================
   HEADER (sticky, glassy)
   ============================================================ */
.hdr {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--sat)) 18px 12px;
  background: rgba(11, 14, 17, 0.78);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}

/* ============================================================
   BUTTONS / PILLS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 13px 20px;
  min-height: 46px;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.975); }
.btn-primary { background: var(--mint); color: var(--ink); }
.btn-primary:hover { background: var(--mint-deep); }
.btn-ghost { background: transparent; color: var(--snow); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--mute); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 9px 16px; font-size: 13.5px; }
.btn-lg { min-height: 52px; padding: 15px 24px; font-size: 16px; }
.btn:disabled { opacity: 0.4; pointer-events: none; }

/* ---- Eyebrow / kicker ---- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mint);
  background: var(--mint-08);
  border: 1px solid var(--mint-25);
  padding: 6px 11px;
  border-radius: 999px;
}
.kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mute);
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---- Section primitives ---- */
.sec { padding: 56px 18px; position: relative; }
.sec + .sec { border-top: 1px solid var(--line); }
.sec-head { margin-bottom: 28px; }
.h2 {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(28px, 8vw, 40px);
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 14px 0 12px;
  text-wrap: balance;
}
.lede { font-size: 15.5px; line-height: 1.55; color: var(--dim); margin: 0; text-wrap: pretty; }
.fine { font-size: 12.5px; color: var(--mute); line-height: 1.55; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.card-pad { padding: 18px; }

/* ---- Coin / chain badges ---- */
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tok-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--dim);
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px 5px 6px;
}
.tok-dot { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; color: #fff; flex-shrink: 0; }
.dot-usdt { background: #26A17B; }
.dot-usdc { background: #2775CA; }
.dot-bsc  { background: #F0B90B; color: #1a1a1a; }
.dot-eth  { background: #627EEA; }
.dot-ton  { background: #0098EA; }

/* ============================================================
   BOTTOM TAB BAR (app)
   ============================================================ */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; z-index: 70;
  width: 100%; max-width: 460px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(11, 14, 17, 0.9);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid var(--line);
  padding-bottom: var(--sab);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  min-height: var(--tabbar-h);
  background: none; border: none;
  color: var(--mute);
  font-family: var(--font);
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.01em;
  transition: color .15s ease;
}
.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tab.is-active { color: var(--mint); }
.tab.is-active svg { stroke: var(--mint); }

/* ============================================================
   BOTTOM SHEET / MODAL
   ============================================================ */
.scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(5, 7, 10, 0.66);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 90;
  width: 100%; max-width: 460px;
  transform: translateX(-50%) translateY(100%);
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 8px 18px calc(20px + var(--sab));
  max-height: 92vh; max-height: 92dvh;
  overflow-y: auto;
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 -24px 60px rgba(0,0,0,0.5);
}
.sheet.is-open { transform: translateX(-50%) translateY(0); }
.sheet-grab { width: 38px; height: 4px; border-radius: 999px; background: var(--line); margin: 8px auto 14px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sheet-title { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.sheet-sub { font-size: 13px; color: var(--mute); margin: 4px 0 0; }
.sheet-close {
  background: var(--elevated); border: 1px solid var(--line);
  color: var(--dim); width: 34px; height: 34px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}

/* ---- Form bits ---- */
.field-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); display: block; margin-bottom: 8px; }
.amount-input {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 14px 16px;
}
.amount-input input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  color: var(--snow);
  font-family: var(--mono); font-weight: 500;
  font-size: 26px; letter-spacing: -0.02em;
}
.amount-input .cur { font-family: var(--mono); font-size: 14px; color: var(--mute); }
.amount-input input::placeholder { color: var(--faint); }

/* range slider */
input[type=range].rng {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 999px;
  background: var(--elevated);
  outline: none; margin: 18px 0 6px;
}
input[type=range].rng::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--mint); border: 4px solid var(--bg);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  cursor: pointer;
}
input[type=range].rng::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--mint); border: 4px solid var(--bg); cursor: pointer;
}

/* segmented pills */
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-item {
  flex: 1; min-width: fit-content;
  text-align: center;
  background: var(--bg); border: 1px solid var(--line);
  color: var(--dim);
  border-radius: var(--r-sm);
  padding: 10px 8px;
  font-family: var(--font); font-weight: 600; font-size: 13px;
  transition: all .14s ease;
}
.seg-item small { display: block; font-family: var(--mono); font-weight: 400; font-size: 9.5px; color: var(--mute); margin-top: 3px; letter-spacing: 0.04em; }
.seg-item.is-active { border-color: var(--mint); background: var(--mint-08); color: var(--snow); }
.seg-item.is-active small { color: var(--mint); }

/* capacity / progress bar */
.cap { height: 6px; border-radius: 999px; background: var(--elevated); overflow: hidden; }
.cap > span { display: block; height: 100%; background: var(--mint); border-radius: 999px; }
.cap.warn > span { background: var(--warn); }

/* ---- QR ---- */
.qr {
  background: #fff; padding: 12px; border-radius: var(--r-sm);
  width: 180px; height: 180px; margin: 0 auto;
}
.qr svg { width: 100%; height: 100%; }

/* ---- Glow backdrops ---- */
.glow { position: absolute; border-radius: 50%; filter: blur(60px); pointer-events: none; z-index: 0; }
.glow-mint { background: var(--mint-12); }

/* ---- utility ---- */
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.stack > * + * { margin-top: 12px; }
.hide-desktop { display: initial; }

/* ============================================================
   CONNECT-WALLET (shared by Landing sheet + App gate)
   ============================================================ */
.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wallet-opt {
  display: flex; align-items: center; gap: 11px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 14px 13px;
  text-align: left; color: var(--snow);
  transition: border-color .14s ease, background .14s ease;
}
.wallet-opt:hover { border-color: var(--mute); }
.wallet-opt:active { background: var(--elevated); }
.wallet-ic { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font); font-weight: 700; font-size: 14px; color: #fff; }
.wallet-opt strong { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.wallet-opt > span { display: flex; flex-direction: column; min-width: 0; }
.wallet-opt > span > span { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--mute); margin-top: 2px; letter-spacing: 0.04em; }
.wallet-opt.span2 { grid-column: 1 / -1; }
.connect-note { display: flex; gap: 9px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; background: var(--mint-08); border: 1px solid var(--mint-25); border-radius: var(--r-sm); }
.connect-note svg { width: 16px; height: 16px; color: var(--mint); flex-shrink: 0; margin-top: 1px; }
.connect-note p { margin: 0; font-size: 12px; color: var(--dim); line-height: 1.5; }

/* ============================================================
   DESKTOP (≥980px) — center the phone-width app on a stage
   ============================================================ */
@media (min-width: 980px) {
  .hide-desktop { display: none; }
}
