/* ==================================================
   PAYPLUS - EARNING — DESIGN TOKENS
   Palette: cream base, ink navy, brass gold accent
   Display type: Sora / Body type: Inter
================================================== */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Colors */
  --cream: #F6F3EC;
  --cream-2: #EFEAE0;
  --ink: #10131C;
  --ink-2: #1C2233;
  --ink-3: #2A3247;
  --brass: #C9A15A;
  --brass-light: #E6C989;
  --brass-dark: #9C7B3E;
  --white: #FFFFFF;
  --text-main: #1A1D26;
  --text-muted: #6B7280;
  --text-inverse: #F6F3EC;
  --success: #1F9D6B;
  --danger: #D14848;
  --border: #E7E2D6;

  /* Layout */
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-soft: 0 8px 24px rgba(16, 19, 28, 0.08);
  --shadow-card: 0 12px 32px rgba(16, 19, 28, 0.14);
  --nav-height: 68px;
  --header-height: auto;

  /* Type */
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

body {
  padding-bottom: calc(var(--nav-height) + 16px);
  min-height: 100vh;
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  color: var(--text-main);
  margin: 0;
}

button { font-family: var(--font-body); }

a { color: inherit; text-decoration: none; }

::selection { background: var(--brass-light); color: var(--ink); }

/* ==================================================
   APP SHELL
================================================== */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--cream);
}

/* ==================================================
   TOP HEADER
================================================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
}

.brand {
  display: flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand .accent { color: var(--brass-dark); }
.brand .cent { font-size: 16px; margin-left: 2px; color: var(--brass); }

.topbar-actions { display: flex; gap: 8px; }

.pill-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.pill-btn:active { transform: scale(0.96); }
.pill-btn i { color: var(--brass-dark); font-size: 13px; }

/* ==================================================
   SIGNATURE ELEMENT: BALANCE CARD
   Woven brass-line mesh over deep ink gradient
================================================== */
.balance-card {
  position: relative;
  margin: 6px 18px 18px;
  border-radius: var(--radius-lg);
  padding: 22px 20px 18px;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, #2A3350 0%, transparent 55%),
    linear-gradient(135deg, #171B29 0%, #0E1119 100%);
  box-shadow: var(--shadow-card);
  color: var(--text-inverse);
}

.balance-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    repeating-linear-gradient(115deg, var(--brass) 0px, var(--brass) 1px, transparent 1px, transparent 34px),
    repeating-linear-gradient(25deg, var(--brass) 0px, var(--brass) 1px, transparent 1px, transparent 34px);
  pointer-events: none;
}

.balance-card .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass-light);
  opacity: 0.9;
  position: relative;
}

.balance-card .amount {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  margin-top: 4px;
  position: relative;
  letter-spacing: -0.01em;
}

.balance-card .sub {
  font-size: 12px;
  color: #B9BECD;
  margin-top: 2px;
  position: relative;
}

.balance-card .user-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.balance-card .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--brass);
  object-fit: cover;
  background: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--brass-light);
}

.balance-card .user-name { font-weight: 600; font-size: 14px; }
.balance-card .user-id { font-size: 11px; color: #9AA0B4; }

.balance-card .quicklinks {
  position: relative;
  display: flex;
  gap: 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(230, 201, 137, 0.18);
  font-size: 12px;
  color: #D8DBE5;
}
.balance-card .quicklinks span { display: flex; align-items: center; gap: 5px; }
.balance-card .quicklinks i { color: var(--brass-light); font-size: 13px; }

/* ==================================================
   GENERIC CARD
================================================== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin: 0 18px 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 4px;
}
.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* ==================================================
   AD WATCH TILE
================================================== */
.ad-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, #FBFAF6, #F3EFE5);
  border: 1.5px solid var(--brass-light);
  border-radius: var(--radius-md);
  padding: 14px;
}

.ad-tile .play-btn {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--brass-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: none;
  cursor: pointer;
  transition: transform .15s ease;
}
.ad-tile .play-btn:active { transform: scale(0.92); }
.ad-tile .play-btn:disabled { background: #C9C9C9; color: #888; cursor: not-allowed; }

.ad-tile .ad-info { flex: 1; min-width: 0; }
.ad-tile .ad-info h4 { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.ad-tile .ad-info p { font-size: 12px; color: var(--text-muted); margin: 0; line-height: 1.4; }

.ad-tile .reward-badge {
  background: var(--ink);
  color: var(--brass-light);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.progress-row { margin-top: 12px; }
.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--cream-2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brass-dark), var(--brass-light));
  border-radius: 999px;
  transition: width .4s ease;
}
.progress-label {
  display: flex;
  justify-content: flex-end;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 600;
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cream-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 12px;
  font-weight: 600;
}
.status-strip i { color: var(--brass-dark); }
.status-strip.success { background: #E7F5EE; color: #1F9D6B; }
.status-strip.error { background: #FBEAEA; color: #C13B3B; }

.stat-grid { display: flex; gap: 12px; margin: 0 18px 18px; }
.stat-box {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}
.stat-box .stat-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brass-dark);
}
.stat-box .stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
}

/* ==================================================
   TASK LIST
================================================== */
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }

.task-icon {
  width: 42px; height: 42px; min-width: 42px;
  border-radius: 12px;
  background: var(--cream-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--brass-dark);
  font-size: 17px;
}

.task-body { flex: 1; min-width: 0; }
.task-body h4 { font-size: 14px; font-weight: 700; margin: 0 0 2px; }
.task-body p { font-size: 12px; color: var(--text-muted); margin: 0 0 6px; }

.task-progress { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.task-progress .progress-track { margin-top: 4px; height: 5px; }

.btn-task {
  background: linear-gradient(180deg, var(--brass-light), var(--brass));
  color: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.btn-task:disabled { background: #DDD; color: #999; cursor: not-allowed; }
.btn-task.done { background: var(--success); color: var(--white); }

/* ==================================================
   REFERRAL
================================================== */
.referral-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.referral-icon {
  width: 44px; height: 44px; min-width: 44px;
  border-radius: 12px;
  background: var(--cream-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--brass-dark);
  font-size: 18px;
}

.link-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 10px 0;
}
.link-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 12.5px;
  color: var(--ink-2);
  outline: none;
  min-width: 0;
}
.btn-copy {
  background: var(--ink);
  color: var(--brass-light);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-primary-full {
  width: 100%;
  background: var(--ink);
  color: var(--brass-light);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform .15s ease;
}
.btn-primary-full:active { transform: scale(0.98); }

/* ==================================================
   WITHDRAW
================================================== */
.method-grid { display: flex; gap: 10px; margin: 12px 0 16px; }
.method-card {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.method-card.active {
  border-color: var(--brass);
  background: #FBF6EA;
}
.method-card i { font-size: 20px; color: var(--ink-2); margin-bottom: 6px; display: block; }
.method-card span { font-size: 12px; font-weight: 700; }

.field-group { margin-bottom: 14px; }
.field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}
.field-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-main);
  outline: none;
  transition: border-color .15s ease;
}
.field-input:focus { border-color: var(--brass); }
.field-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
.field-hint b { color: var(--ink-2); }

/* ==================================================
   BOTTOM NAVIGATION
================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-height);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #9CA0AC;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 12px;
  transition: color .15s ease, background .15s ease;
}
.nav-item i { font-size: 19px; }
.nav-item.active {
  color: var(--brass-dark);
  background: #FBF6EA;
}

/* ==================================================
   SKELETON LOADING
================================================== */
.skeleton {
  background: linear-gradient(90deg, #EDEAE0 25%, #F6F3EC 37%, #EDEAE0 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ==================================================
   MISC / UTILITY
================================================== */
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  margin: 4px 18px 10px;
  color: var(--ink-2);
}

.fade-in { animation: fadeIn .25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 32px; color: var(--brass-light); margin-bottom: 10px; display: block; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

@media (max-width: 360px) {
  .balance-card .amount { font-size: 32px; }
  .card { padding: 15px; }
}
