/* HappyBoost — design system (mobile-first) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --green: #00c07a;
  --green-dark: #009a63;
  --green-deep: #01311f;
  --green-light: #e3faf0;
  --amber: #f59e0b;
  --red: #e11d48;
  --ink: #0b1220;
  --muted: #64748b;
  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #e8ecf1;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(11,18,32,.04), 0 8px 24px -12px rgba(11,18,32,.10);
  --grad: linear-gradient(135deg, #00c07a, #00a3a3);
  --grad-dark: linear-gradient(150deg, #071b12 0%, #0a3524 55%, #0d5136 100%);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--ink); font-feature-settings: 'cv11'; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); position: relative; }
@media (min-width: 520px) { .app { box-shadow: 0 0 60px rgba(11,18,32,.14); } }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; }
.brand { color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 600; letter-spacing: -.3px; display: inline-flex; align-items: center; gap: 8px; }
.brand b { font-weight: 800; color: var(--green-dark); }
.logo-mark { width: 28px; height: 28px; border-radius: 9px; background: var(--grad); display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; box-shadow: 0 4px 10px -3px rgba(0,192,122,.55); }
.logo-mark svg { width: 15px; height: 15px; }
.logo-mark.lg { width: 72px; height: 72px; border-radius: 22px; }
.logo-mark.lg svg { width: 36px; height: 36px; }
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; color: var(--ink); text-decoration: none; border: 1px solid var(--line); background: #fff; }
.bell svg { width: 19px; height: 19px; }
.bell .badge { position: absolute; top: -5px; right: -5px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; min-width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #fff; }

.content { flex: 1; padding: 18px 16px 96px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card h2 { font-size: 15px; font-weight: 700; letter-spacing: -.2px; margin-bottom: 10px; }
.card .sub { color: var(--muted); font-size: 13px; }

.hero { background: var(--grad-dark); color: #fff; border-radius: var(--radius); padding: 22px 20px; margin-bottom: 14px; position: relative; overflow: hidden; box-shadow: 0 16px 40px -18px rgba(1,49,31,.7); }
.hero::after { content: ''; position: absolute; top: -60px; right: -60px; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, rgba(0,192,122,.4), transparent 70%); pointer-events: none; }
.hero .label { font-size: 12.5px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; opacity: .75; }
.hero .big { font-size: 34px; font-weight: 800; letter-spacing: -1px; margin: 6px 0 4px; }
.hero .sub { font-size: 13px; opacity: .85; }

/* Buttons */
.btn { display: block; width: 100%; text-align: center; padding: 14px 16px; border: 0; border-radius: 14px; font-family: inherit; font-size: 15px; font-weight: 700; letter-spacing: -.1px; cursor: pointer; text-decoration: none; transition: transform .12s, opacity .15s, box-shadow .15s; }
.btn:active { transform: scale(.98); opacity: .9; }
.btn-primary { background: var(--green-dark); color: #fff; box-shadow: 0 8px 18px -8px rgba(0,154,99,.6); }
.btn-outline { background: #fff; color: var(--green-dark); border: 1.5px solid #cfe9dd; }
.btn-danger { background: #fff1f2; color: var(--red); }
.btn-sm { display: inline-block; width: auto; padding: 9px 15px; font-size: 13px; border-radius: 11px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

/* Forms */
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input, select { width: 100%; padding: 13px 14px; border: 1.5px solid #dbe2ea; border-radius: 13px; font-size: 16px; font-family: inherit; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(0,192,122,.14); }

/* Alerts */
.alert { padding: 13px 15px; border-radius: 14px; font-size: 14px; margin-bottom: 14px; line-height: 1.5; border: 1px solid transparent; }
.alert-success { background: var(--green-light); color: #04624a; border-color: #bdeeda; }
.alert-error { background: #fff1f2; color: #9f1239; border-color: #fecdd3; }
.alert-warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* Bottom navigation */
.bottomnav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: rgba(255,255,255,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); display: flex; z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { flex: 1; text-align: center; padding: 10px 0 8px; text-decoration: none; color: #9aa5b1; font-size: 10.5px; font-weight: 600; letter-spacing: .1px; }
.bottomnav a .icon { display: flex; justify-content: center; margin-bottom: 3px; }
.bottomnav a .icon svg { width: 22px; height: 22px; }
.bottomnav a.active { color: var(--green-dark); }

/* Lists */
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid #f1f4f7; gap: 10px; }
.list-item:last-child { border-bottom: 0; }
.list-item .t { font-weight: 600; font-size: 14px; }
.list-item .d { color: var(--muted); font-size: 12px; margin-top: 2px; }
.list-item .amt { font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.copy-token { border: 0; background: var(--green-light); color: var(--green-dark); border-radius: 7px; padding: 3px 7px; font: inherit; font-size: 10px; font-weight: 800; cursor: pointer; }
.amt.pos { color: var(--green-dark); }
.amt.neg { color: var(--red); }

/* Progress */
.progress { background: #e6ebf0; border-radius: 999px; height: 8px; overflow: hidden; margin: 10px 0; }
.progress > div { height: 100%; background: var(--grad); border-radius: 999px; transition: width .3s; }
.progress.amber > div { background: var(--amber); }

.score-pill { display: inline-block; background: var(--green-light); color: var(--green-dark); font-weight: 700; border-radius: 999px; padding: 5px 13px; font-size: 13px; }

/* Token display */
.token-box { background: var(--green-deep); color: #4ef0af; font-family: 'SF Mono', 'Cascadia Code', Consolas, monospace; font-size: 18px; font-weight: 700; letter-spacing: 1.5px; text-align: center; padding: 20px 12px; border-radius: 16px; margin: 14px 0; word-break: break-all; box-shadow: inset 0 0 0 1px rgba(78,240,175,.18); }

/* Purchase receipt and token-wait animation */
.purchase-wait { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px; padding: 18px 8px 14px; }
.purchase-wait[hidden], .token-box[hidden] { display: none; }
.purchase-wait > b { font-size: 14px; }
.purchase-wait > p { color: var(--muted); font-size: 12.5px; }
.receipt-animation { width: 86px; height: 108px; padding: 14px 13px; border-radius: 9px 9px 4px 4px; background: #fff; border: 1px solid #dce6e1; box-shadow: 0 15px 35px -18px rgba(1,49,31,.55); position: relative; animation: receipt-print 1.8s ease-in-out infinite; }
.receipt-animation::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 8px; background: linear-gradient(135deg, #fff 5px, transparent 0) 0 0/10px 10px repeat-x; }
.receipt-bolt { width: 27px; height: 27px; margin: 0 auto 11px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: var(--grad); font-size: 15px; }
.receipt-animation > span { display: block; height: 5px; margin: 7px 0; border-radius: 9px; background: #dfe8e4; transform-origin: left; animation: receipt-line 1.8s ease-in-out infinite; }
.receipt-animation > span:nth-of-type(2) { width: 76%; animation-delay: .12s; }
.receipt-animation > span:nth-of-type(3) { width: 58%; animation-delay: .24s; }
.receipt-total { height: 6px; width: 42%; margin: 10px 0 0 auto; border-radius: 9px; background: var(--green); }
.wait-dots { display: flex; gap: 5px; height: 12px; align-items: center; margin-top: 4px; }
.wait-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--green-dark); animation: wait-dot 1.2s ease-in-out infinite; }
.wait-dots span:nth-child(2) { animation-delay: .18s; }
.wait-dots span:nth-child(3) { animation-delay: .36s; }
.purchase-receipt { padding: 2px 4px 6px; }
.sms-notice { margin-top: 12px; padding: 13px 14px; border-radius: 14px; background: var(--green-light); color: #075c45; font-size: 13px; line-height: 1.5; text-align: center; }
@keyframes receipt-print { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-5px) rotate(1deg); } }
@keyframes receipt-line { 0%,20% { transform: scaleX(.15); opacity: .3; } 55%,100% { transform: scaleX(1); opacity: 1; } }
@keyframes wait-dot { 0%,60%,100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .receipt-animation, .receipt-animation > span, .wait-dots span { animation: none; }
}

/* Status chips */
.chip { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .5px; }
.chip-active { background: #e0edff; color: #1d4ed8; }
.chip-repaid { background: var(--green-light); color: var(--green-dark); }
.chip-overdue { background: #fffbeb; color: #b45309; }
.chip-defaulted { background: #fff1f2; color: #be123c; }

/* Stat grid */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.stat .v { font-size: 19px; font-weight: 800; letter-spacing: -.4px; }
.stat .k { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-weight: 500; }

/* Auth pages */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 28px 22px; background: var(--grad-dark); }
.auth-card { background: #fff; border-radius: 24px; padding: 26px 22px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.5); }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #fff; font-size: 26px; font-weight: 600; letter-spacing: -.5px; margin-bottom: 26px; text-align: center; }
.auth-logo b { font-weight: 800; }
.auth-logo .tag { font-size: 13.5px; opacity: .75; font-weight: 400; letter-spacing: 0; }
.auth-card h1 { font-size: 20px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 16px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; color: rgba(255,255,255,.85); }
.auth-alt a { color: #4ef0af; font-weight: 700; text-decoration: none; }

/* Misc */
.muted { color: var(--muted); font-size: 13px; }
.mt { margin-top: 14px; }
.center { text-align: center; }
h1.page { font-size: 21px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 14px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.range-out { text-align: center; font-size: 32px; font-weight: 800; letter-spacing: -1px; color: var(--green-dark); margin: 8px 0; }
input[type=range] { padding: 0; accent-color: var(--green-dark); height: 34px; border: 0; box-shadow: none; }
.advance-picker { margin: 4px 0 16px; padding: 20px 18px 14px; border-radius: 20px; background: linear-gradient(145deg,#effcf7,#f8fffc); border: 1px solid #cfeee0; text-align: center; }
.advance-picker-label { display: block; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.advance-picker .range-out { margin: 8px 0 4px; font-size: 42px; line-height: 1.1; }
.advance-picker input[type=range] { width: 100%; margin: 7px 0 0; background: transparent; }
.slider-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; }
.milestone { display: flex; flex-direction: column; gap: 4px; padding: 12px 13px; border-radius: 14px; background: var(--green-light); color: #075c45; font-size: 12.5px; line-height: 1.45; }
.milestone span { text-transform: uppercase; letter-spacing: .5px; font-size: 10px; font-weight: 800; opacity: .7; }

/* ---------- Splash & onboarding ---------- */
.splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: var(--grad-dark); color: #fff; transition: opacity .5s, visibility .5s; }
.splash.hide { opacity: 0; visibility: hidden; }
.splash .logo-mark.lg { animation: splash-pop .7s cubic-bezier(.2,.9,.3,1.4) both; }
.splash .wordmark { font-size: 30px; font-weight: 600; letter-spacing: -.8px; animation: splash-rise .6s .25s ease-out both; }
.splash .wordmark b { font-weight: 800; }
.splash .tag { font-size: 13.5px; opacity: .7; animation: splash-rise .6s .4s ease-out both; }
@keyframes splash-pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes splash-rise { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.onboard { background: var(--grad-dark); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; color: #fff; }
.ob-top { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 0; }
.ob-top .brand { color: #fff; }
.ob-top .brand b { color: #4ef0af; }
.ob-skip { color: rgba(255,255,255,.65); font-size: 14px; font-weight: 600; text-decoration: none; padding: 8px; }
.slides { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 34px; gap: 18px; }
.slide .art { width: 108px; height: 108px; border-radius: 34px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; color: #4ef0af; box-shadow: 0 20px 50px -20px rgba(0,0,0,.6); }
.slide .art svg { width: 52px; height: 52px; }
.slide h2 { font-size: 24px; font-weight: 800; letter-spacing: -.6px; line-height: 1.2; }
.slide p { font-size: 15px; line-height: 1.6; color: rgba(255,255,255,.72); max-width: 300px; }
.ob-bottom { padding: 10px 22px calc(26px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 18px; }
.dots { display: flex; justify-content: center; gap: 7px; }
.dots span { width: 7px; height: 7px; border-radius: 999px; background: rgba(255,255,255,.28); transition: all .25s; }
.dots span.on { width: 22px; background: #4ef0af; }
.ob-bottom .btn-primary { background: #00c07a; color: #04321f; font-size: 16px; padding: 16px; border-radius: 16px; box-shadow: 0 12px 30px -10px rgba(0,192,122,.55); }
.ob-login { text-align: center; font-size: 14px; color: rgba(255,255,255,.6); }
.ob-login a { color: #4ef0af; font-weight: 700; text-decoration: none; }
