/* ==========================================================================
   Aurum Markets — mobile re-skin (loaded after every page-local stylesheet)
   Goal: one black / red / white design language for all /mobile/* pages
   without touching each page's business logic.
   ========================================================================== */

:root {
  --am-bg: #05070D;
  --am-bg-2: #0A0E16;
  --am-surface: #0E1118;
  --am-surface-2: #151A24;
  --am-line: rgba(255, 255, 255, .09);
  --am-red: #E60023;
  --am-red-dark: #C4001E;
  --am-blue: #2F6BFF;
  --am-up: #16A34A;
  --am-down: #DC2626;
  --am-text: #FFFFFF;
  --am-sub: #9CA3AF;
  --am-muted: #6B7280;

  /* Legacy palette remap — most pages read these variables, so redefining
     them re-skins the whole app in one place. */
  --bg: #05070D;
  --bg1: #070A11;
  --bg2: #0E1118;
  --bg3: #151A24;
  --brd: rgba(255, 255, 255, .09);
  --t1: #FFFFFF;
  --t2: #9CA3AF;
  --t3: #6B7280;
  --bl: #2F6BFF;
  --gn: #16A34A;
  --rd: #DC2626;
  --or: #E60023;
}

html, body {
  background: var(--am-bg) !important;
  color: var(--am-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Top bar ─────────────────────────────────────────────────────────── */
.top-nav {
  background: rgba(5, 7, 13, .94) !important;
  border-bottom: 1px solid var(--am-line) !important;
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}
.top-nav .tn-title,
.top-nav .mobile-brand-name {
  font-weight: 800 !important;
  letter-spacing: -.2px;
}
.top-nav .tn-back,
.top-nav .menu-trigger,
.top-nav .tnr-btn {
  color: var(--am-text) !important;
}
.top-nav .tn-back:active,
.top-nav .menu-trigger:active,
.top-nav .tnr-btn:active {
  background: rgba(255, 255, 255, .08) !important;
  color: var(--am-red) !important;
}

/* ── Bottom navigation ───────────────────────────────────────────────── */
.btm-nav {
  background: rgba(5, 7, 13, .96) !important;
  border-top: 1px solid var(--am-line) !important;
  -webkit-backdrop-filter: saturate(160%) blur(14px) !important;
  backdrop-filter: saturate(160%) blur(14px) !important;
}
.btm-nav > a,
.btm-nav > .btm-tab {
  color: #6B7280 !important;
}
.btm-nav > a.active,
.btm-nav > .btm-tab.active {
  color: #D9EF14 !important;
}
.btm-nav .btm-tab-trade .trade-circle {
  border: 4px solid rgba(20, 22, 31, .97) !important;
  background: radial-gradient(circle at 34% 26%, #FFC24A 0%, #FF9A00 52%, #F27500 100%) !important;
  box-shadow: 0 8px 20px rgba(255, 150, 0, .42) !important;
}
.btm-nav .btm-tab-trade .trade-circle i,
.btm-nav .btm-tab-trade .trade-circle svg {
  color: #FFFFFF !important;
}
.btm-nav > .btm-tab-trade { color: #9AA0B4 !important; }
.btm-nav > .btm-tab-trade.active { color: #D9EF14 !important; }
.btm-nav > .btm-tab .tab-ic { width: 24px; height: 24px; object-fit: contain; display: block; }
.btm-nav > .btm-tab .tab-ic-mask { width: 24px !important; height: 24px !important; background: #6B7280; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; display: block; }
.btm-nav > .btm-tab.active .tab-ic-mask { background: #D9EF14; }
.btm-nav .btm-tab-trade .trade-circle img { width: 30px; height: 30px; object-fit: contain; display: block; }

/* ── Generic surfaces ────────────────────────────────────────────────── */
.market-panel,
.trust-card,
.search-entry .se-box,
.coin-item,
.entry-item,
.quick-card,
.total-card,
.account-grid .acct-card,
.profile-row,
.ps-user,
.pwd-dialog,
.confirm-box {
  border-color: var(--am-line) !important;
}
.trust-card,
.total-card,
.pwd-dialog,
.confirm-box {
  background: var(--am-surface) !important;
  border-radius: 18px !important;
}
.market-panel { border-radius: 18px !important; }
.coin-item { border-bottom: 1px solid rgba(255, 255, 255, .05) !important; }
.coin-item:active { background: rgba(255, 255, 255, .04) !important; }

/* Primary buttons across the app */
.btn-primary,
.primary-btn,
.submit-btn,
.mobile-hero-btn.primary,
.pwd-confirm,
.tn-r-btn.primary {
  background: var(--am-red) !important;
  border-color: var(--am-red) !important;
  color: #FFFFFF !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  box-shadow: 0 10px 24px rgba(230, 0, 35, .28) !important;
}
.btn-primary:active,
.primary-btn:active,
.submit-btn:active,
.mobile-hero-btn.primary:active,
.pwd-confirm:active { background: var(--am-red-dark) !important; }

/* Section titles: tighter, editorial */
.section-hd .sh-title { font-weight: 800 !important; letter-spacing: -.2px; }

/* ── Home hero (reference-site style) ────────────────────────────────── */
.am-hero {
  position: relative;
  margin: 0;
  padding: 26px 18px 30px;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(180deg, rgba(5, 7, 13, .25) 0%, rgba(5, 7, 13, .72) 48%, #05070D 100%),
    url("/assets/aurum/img/hero-speed.png") center 30% / cover no-repeat;
  overflow: hidden;
}
.am-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(230, 0, 35, .16), transparent 55%);
  pointer-events: none;
}
.am-hero-eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #FFFFFF;
  opacity: .82;
  margin-bottom: 12px;
}
.am-hero-eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--am-red);
  border-radius: 2px;
}
.am-hero h1 {
  position: relative;
  z-index: 1;
  font-size: 30px;
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -1px;
  color: #FFFFFF;
  margin: 0 0 10px;
}
.am-hero p {
  position: relative;
  z-index: 1;
  font-size: 13px;
  line-height: 1.62;
  color: rgba(255, 255, 255, .72);
  margin: 0 0 18px;
  max-width: 300px;
}
.am-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
}
.am-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.am-btn-red { background: var(--am-red); color: #FFFFFF; box-shadow: 0 12px 22px rgba(230, 0, 35, .28); }
.am-btn-red:active { background: var(--am-red-dark); }
.am-btn-ghost { background: rgba(255, 255, 255, .06); color: #FFFFFF; border-color: rgba(255, 255, 255, .18); }
.am-btn-ghost:active { background: rgba(255, 255, 255, .12); }

/* Stat strip under hero */
.am-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--am-line);
  background: var(--am-bg);
}
.am-stat { padding: 16px 8px; text-align: center; border-right: 1px solid var(--am-line); }
.am-stat:last-child { border-right: 0; }
.am-stat strong { display: block; font-size: 20px; font-weight: 900; letter-spacing: -.5px; color: #FFFFFF; }
.am-stat span { display: block; margin-top: 4px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--am-muted); }

/* Section wrapper */
.am-section { padding: 22px 16px 6px; }
.am-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
}
.am-section-head h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.3px;
  color: #FFFFFF;
  margin: 0;
}
.am-section-head p {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--am-muted);
}
.am-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--am-sub);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.am-link:active { color: var(--am-red); }

/* Market rows */
.am-quote-list { border: 1px solid var(--am-line); border-radius: 16px; overflow: hidden; background: var(--am-surface); }
.am-quote {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.am-quote:last-child { border-bottom: 0; }
.am-quote:active { background: rgba(255, 255, 255, .04); }
.am-quote-sym { flex: 1; min-width: 0; }
.am-quote-sym strong { display: block; font-size: 13px; font-weight: 800; color: #FFFFFF; }
.am-quote-sym span { display: block; font-size: 10px; color: var(--am-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-quote-price { text-align: right; font-size: 13px; font-weight: 700; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.am-quote-chg {
  min-width: 68px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.am-up { color: var(--am-up) !important; }
.am-down { color: var(--am-down) !important; }

/* Payout cards */
.am-payouts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.am-payout {
  background: var(--am-surface);
  border: 1px solid var(--am-line);
  border-radius: 14px;
  padding: 14px 6px;
  text-align: center;
}
.am-payout strong { display: block; font-size: 15px; font-weight: 900; color: var(--am-red); }
.am-payout span { display: block; margin-top: 4px; font-size: 10px; color: var(--am-muted); }

/* Feature cards with real imagery */
.am-feature {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 156px;
  border-radius: 16px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--am-line);
  background: var(--am-surface) center / cover no-repeat;
}
.am-feature::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 7, 13, .1) 0%, rgba(5, 7, 13, .88) 100%);
}
.am-feature > div { position: relative; z-index: 1; }
.am-feature strong { display: block; font-size: 15px; font-weight: 800; color: #FFFFFF; }
.am-feature span { display: block; margin-top: 4px; font-size: 11px; line-height: 1.5; color: rgba(255, 255, 255, .7); }

/* Why cards */
.am-why { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.am-why-item {
  background: var(--am-surface);
  border: 1px solid var(--am-line);
  border-radius: 16px;
  padding: 16px;
}
.am-why-item i { color: var(--am-red); font-size: 17px; }
.am-why-item strong { display: block; margin-top: 10px; font-size: 12px; font-weight: 800; color: #FFFFFF; }
.am-why-item span { display: block; margin-top: 5px; font-size: 10px; line-height: 1.55; color: var(--am-muted); }

/* App download */
.am-download {
  margin: 22px 16px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--am-line);
  background:
    linear-gradient(120deg, rgba(230, 0, 35, .18), rgba(5, 7, 13, .2) 60%),
    url("/assets/aurum/img/mobile-app-trade.webp") right center / 58% auto no-repeat,
    var(--am-surface);
  overflow: hidden;
}
.am-download h3 { margin: 0 0 6px; font-size: 16px; font-weight: 900; color: #FFFFFF; letter-spacing: -.3px; }
.am-download p { margin: 0 0 14px; max-width: 190px; font-size: 11px; line-height: 1.55; color: var(--am-sub); }
.am-download-badges { display: flex; align-items: center; gap: 8px; }
.am-download-badges img { height: 32px; width: auto; display: block; }
.am-download-qr {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  background: #FFFFFF url("/assets/aurum/img/download-qr.png") center / 88% no-repeat;
  padding: 4px;
}

/* Quick access tiles */
.am-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.am-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 6px;
  border-radius: 14px;
  background: var(--am-surface);
  border: 1px solid var(--am-line);
  font-size: 11px;
  font-weight: 600;
  color: var(--am-sub);
  text-decoration: none;
}
.am-tile:active { background: rgba(255, 255, 255, .05); }
.am-tile i { font-size: 16px; color: var(--am-red); }

/* Footer note */
.am-foot {
  padding: 18px 16px 24px;
  font-size: 10px;
  line-height: 1.7;
  color: #4B5563;
  text-align: center;
}

/* ── Profile ("My account") page ─────────────────────────────────────── */
.am-profile-head {
  padding: 22px 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background:
    radial-gradient(circle at 88% 0%, rgba(230, 0, 35, .22), transparent 55%),
    var(--am-surface);
  border-bottom: 1px solid var(--am-line);
}
.am-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(140deg, #FF2A44, var(--am-red));
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  flex: 0 0 auto;
}
.am-profile-id { flex: 1; min-width: 0; }
.am-profile-id strong { display: block; font-size: 16px; font-weight: 800; color: #FFFFFF; }
.am-profile-id span { display: block; margin-top: 3px; font-size: 11px; color: var(--am-muted); }
.am-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 9px;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, .07);
  color: var(--am-sub);
}
.am-badge.ok { background: rgba(22, 163, 74, .14); color: #4ADE80; }
.am-badge.pending { background: rgba(230, 0, 35, .16); color: #FF6B81; }

.am-balance-card {
  margin: 16px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #141A26 0%, #0B0F17 100%);
  border: 1px solid var(--am-line);
}
.am-balance-card span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--am-muted); }
.am-balance-card strong { display: block; margin: 8px 0 14px; font-size: 28px; font-weight: 900; letter-spacing: -1px; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.am-balance-actions { display: flex; gap: 8px; }
.am-balance-actions .am-btn { flex: 1; height: 38px; font-size: 12px; }

.am-menu { margin: 0 16px 16px; border: 1px solid var(--am-line); border-radius: 16px; overflow: hidden; background: var(--am-surface); }
.am-menu-label { padding: 12px 14px 6px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #55606F; font-weight: 800; }
.am-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, .05);
  text-decoration: none;
  color: var(--am-text);
  font-size: 13px;
  font-weight: 600;
}
.am-menu-item:active { background: rgba(255, 255, 255, .04); }
.am-menu-item i.lead { width: 20px; text-align: center; font-size: 14px; color: var(--am-red); }
.am-menu-item .am-menu-value { margin-left: auto; font-size: 11px; color: var(--am-muted); font-weight: 500; }
.am-menu-item .fa-chevron-right { margin-left: auto; font-size: 10px; color: #4B5563; }

/* Drawer rebuild (index page) */
.main-menu-panel { background: #0A0E16 !important; }
.main-menu-item:active { background: rgba(255, 255, 255, .06) !important; }
.main-menu-item .mmi-icon { color: var(--am-red) !important; }

/* Language modal */
.lang-panel { background: var(--am-surface) !important; border: 1px solid var(--am-line); }
.lang-panel .lp-item.active { color: var(--am-red) !important; }
.lang-panel .lp-item .lpi-check { color: var(--am-red) !important; }

/* Keep tabular numbers tidy on price-heavy pages */
.ci-price, .cip-val, .tc-price, .tc-change { font-variant-numeric: tabular-nums; }

/* ── Trading page: red/green candles to match the brand ──────────────── */
:root {
  --chart-up: #16A34A;
  --chart-down: #DC2626;
}

@media (max-width: 360px) {
  .am-hero h1 { font-size: 26px; }
  .am-payouts { grid-template-columns: repeat(2, 1fr); }
  .am-download { background-size: 62% auto; }
}
