/* ==========================================================
   Bull Investment - dark / red mobile theme
   ========================================================== */
:root {
  --bg: #0d0b0e;
  --bg-elev: #17141a;
  --card: #1c171f;
  --card-2: #221c25;
  --red: #e0263f;
  --red-bright: #ff4d5e;
  --red-dark: #8c1627;
  --gold: #f0b429;
  --gold-soft: #f6c452;
  --text: #f5f2f0;
  --text-dim: #ab9ca2;
  --border: rgba(255,255,255,0.08);
  --success: #2bb673;
  --danger: #ff4d5e;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--gold-soft); text-decoration: none; }
button { font-family: inherit; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

/* ---------------- auth screens (login / register / install / admin login) ---------------- */
.auth-bg {
  background:
    radial-gradient(circle at 50% 0%, rgba(224,38,63,0.25), transparent 60%),
    var(--bg);
}
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px 32px;
  position: relative;
}
.auth-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../img/bull.svg') no-repeat center 10%;
  background-size: 480px;
  opacity: 0.06;
  pointer-events: none;
}
.logo-lg { width: 86px; height: 86px; margin-bottom: 10px; filter: drop-shadow(0 6px 18px rgba(224,38,63,0.45)); }
.brand {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0 0 2px;
  color: var(--text);
}
.brand span { color: var(--red-bright); }
.brand.small { font-size: 18px; }
.brand small { font-size: 11px; color: var(--text-dim); font-weight: 400; letter-spacing: 2px; text-transform: uppercase; }
.tagline { color: var(--text-dim); margin: 0 0 24px; font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  width: 100%;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.card-title { margin: 0 0 16px; font-size: 18px; font-weight: 700; }

.field-label { display: block; font-size: 12.5px; color: var(--text-dim); margin: 14px 0 6px; }
.field-label:first-of-type { margin-top: 0; }
.muted { color: var(--text-dim); font-weight: 400; }

.text-input, .phone-input {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  padding: 12px 14px;
}
.text-input:focus { outline: none; border-color: var(--red); }
.phone-input { display: flex; align-items: center; padding: 0; overflow: hidden; }
.phone-input .prefix { padding: 12px 10px 12px 14px; color: var(--gold-soft); font-weight: 600; border-right: 1px solid var(--border); }
.phone-input input { flex: 1; background: transparent; border: none; color: var(--text); font-size: 15px; padding: 12px 14px; min-width: 0; }
.phone-input input:focus { outline: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-block { width: 100%; margin-top: 20px; }
.btn-primary { background: linear-gradient(135deg, var(--red-bright), var(--red-dark)); color: #fff; box-shadow: 0 6px 18px rgba(224,38,63,0.35); }
.btn-gold { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #241a00; }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-danger { background: rgba(255,77,94,0.15); color: var(--danger); border: 1px solid rgba(255,77,94,0.35); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.alert { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }
.alert p { margin: 2px 0; }
.alert-error { background: rgba(255,77,94,0.12); border: 1px solid rgba(255,77,94,0.3); color: #ffb3ba; }
.alert-ok { background: rgba(43,182,115,0.12); border: 1px solid rgba(43,182,115,0.3); color: #8fe3bb; }
.ok { color: var(--success); font-weight: 600; }
.err { color: var(--danger); }

.switch-link { text-align: center; margin: 18px 0 0; font-size: 13.5px; color: var(--text-dim); }

/* ---------------- admin ---------------- */
.admin-app { max-width: 560px; }
.admin-wrap { padding: 24px 18px 40px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-title { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin: 26px 0 10px; }
.admin-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.admin-card-row { display: flex; justify-content: space-between; align-items: center; }
.admin-card-row .amount { color: var(--gold-soft); font-weight: 700; }
.admin-card-meta { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; line-height: 1.5; }
.admin-actions { display: flex; gap: 8px; margin-top: 10px; }
.badge { padding: 2px 8px; border-radius: 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; }
.badge-approved { background: rgba(43,182,115,0.15); color: #8fe3bb; }
.badge-rejected { background: rgba(255,77,94,0.15); color: #ffb3ba; }
.badge-pending { background: rgba(240,180,41,0.15); color: var(--gold-soft); }

/* ==========================================================
   Dashboard (Vue app)
   ========================================================== */
.dash-bg { background: var(--bg); }

.dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}
.dashboard::before {
  content: '';
  position: fixed;
  top: -40px; right: -60px;
  width: 340px; height: 340px;
  background: url('../img/bull.svg') no-repeat center;
  background-size: contain;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
  background: linear-gradient(180deg, rgba(13,11,14,0.98), rgba(13,11,14,0.9));
  backdrop-filter: blur(6px);
}
.topbar-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; }
.topbar-brand img { width: 26px; height: 26px; }
.topbar-brand span { color: var(--red-bright); }
.topbar-phone { font-size: 12px; color: var(--text-dim); }
.logout-link { font-size: 12.5px; color: var(--text-dim); border: 1px solid var(--border); padding: 6px 10px; border-radius: 8px; }

.content { flex: 1; padding: 6px 18px 100px; position: relative; z-index: 1; }

/* balance card */
.balance-card {
  background: linear-gradient(135deg, var(--red-bright) 0%, var(--red-dark) 70%);
  border-radius: 18px;
  padding: 22px 20px;
  margin: 10px 0 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(224,38,63,0.3);
}
.balance-card::after {
  content: '';
  position: absolute; right: -30px; bottom: -30px;
  width: 160px; height: 160px;
  background: url('../img/bull.svg') no-repeat center;
  background-size: contain;
  opacity: 0.18;
}
.balance-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.85; }
.balance-amount { font-size: 32px; font-weight: 800; margin: 4px 0 14px; }
.balance-row { display: flex; gap: 8px; position: relative; z-index: 1; flex-wrap: wrap; }
.balance-row .btn { flex: 1; min-width: 90px; padding: 10px 6px; font-size: 12.5px; }
.ref-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.25);
  padding: 8px 12px; border-radius: 10px; font-size: 11.5px; margin-top: 12px;
  position: relative; z-index: 1; cursor: pointer; max-width: 100%;
}
.ref-pill .link-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.ref-pill svg { width: 14px; height: 14px; flex-shrink: 0; }

/* stat grid */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.stat-box { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.stat-box .label { font-size: 11.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.stat-box .value { font-size: 18px; font-weight: 700; margin-top: 4px; color: var(--gold-soft); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.section-head h3 { margin: 0; font-size: 15px; }

/* transactions */
.tx-list { display: flex; flex-direction: column; gap: 8px; }
.tx-item { display: flex; justify-content: space-between; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.tx-note { font-size: 13px; }
.tx-date { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.tx-amount.pos { color: var(--success); font-weight: 700; }
.tx-amount.neg { color: var(--danger); font-weight: 700; }
.empty-state { text-align: center; color: var(--text-dim); font-size: 13.5px; padding: 30px 10px; }

/* plans */
.plan-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; }
.plan-name { font-size: 16px; font-weight: 700; }
.plan-tagline { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.plan-pct { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: #241a00; font-weight: 800; font-size: 13px; padding: 5px 10px; border-radius: 8px; white-space: nowrap; }
.plan-meta { display: flex; gap: 16px; margin: 12px 0; font-size: 12.5px; color: var(--text-dim); }
.plan-meta b { color: var(--text); display: block; font-size: 14px; }

/* investments */
.inv-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.inv-top { display: flex; justify-content: space-between; align-items: center; }
.inv-amount { font-size: 16px; font-weight: 700; }
.progress-bar { height: 8px; background: var(--bg-elev); border-radius: 6px; margin: 12px 0 8px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); border-radius: 6px; transition: width .4s ease; }
.inv-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); }

/* referrals */
.ref-box { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; text-align: center; margin-bottom: 18px; }
.ref-code-display { font-size: 26px; font-weight: 800; letter-spacing: 4px; color: var(--gold-soft); margin: 8px 0 14px; }
.ref-link-box { display: flex; gap: 8px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 11.5px; color: var(--text-dim); align-items: center; }
.ref-link-box span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.ref-item { display: flex; justify-content: space-between; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; font-size: 13.5px; }
.ref-item .date { color: var(--text-dim); font-size: 11.5px; }

/* buy credit */
.bank-box { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.bank-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.bank-row:last-child { border-bottom: none; }
.bank-row .k { color: var(--text-dim); }
.bank-row .v { font-weight: 700; }

/* bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 480px; margin: 0 auto;
  display: flex;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: none; color: var(--text-dim);
  font-size: 10.5px; padding: 6px 2px; cursor: pointer; border-radius: 10px;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--red-bright); }
.nav-item.active svg { filter: drop-shadow(0 0 6px rgba(224,38,63,0.6)); }

/* modal (welcome bonus) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 24px;
}
.modal-box {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 28px 22px; text-align: center; max-width: 340px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.modal-box .bonus-icon { width: 64px; height: 64px; margin-bottom: 12px; filter: drop-shadow(0 6px 16px rgba(240,180,41,0.5)); }
.modal-box h3 { margin: 0 0 6px; font-size: 19px; }
.modal-box .bonus-amount { font-size: 30px; font-weight: 800; color: var(--gold-soft); margin: 10px 0; }
.modal-box p.desc { color: var(--text-dim); font-size: 13.5px; margin-bottom: 18px; }

/* toast */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--card-2); border: 1px solid var(--border);
  padding: 12px 18px; border-radius: 12px; font-size: 13.5px;
  z-index: 60; max-width: 86%; text-align: center; box-shadow: 0 10px 24px rgba(0,0,0,0.4);
}
.toast.error { border-color: rgba(255,77,94,0.4); color: #ffb3ba; }
.toast.ok { border-color: rgba(43,182,115,0.4); color: #8fe3bb; }

/* amount pad / invest form */
.invest-form { background: var(--bg-elev); border-radius: 12px; padding: 14px; margin-top: 12px; }
.invest-form input { width: 100%; background: var(--card); border: 1px solid var(--border); color: var(--text); font-size: 16px; padding: 10px 12px; border-radius: 10px; margin-bottom: 10px; }
.invest-form input:focus { outline: none; border-color: var(--red); }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* P2P dispute thread */
.dispute-thread { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.dispute-msg { font-size: 12.5px; background: var(--bg-elev); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.dispute-msg strong { text-transform: capitalize; color: var(--gold-soft); }
.dispute-msg a { margin-left: 6px; }
.dispute-msg-admin { border-left: 3px solid var(--red-bright); }

@media (min-width: 540px) {
  .app { box-shadow: 0 0 60px rgba(0,0,0,0.6); }
}
