/* ============================================================
   Avrors — design system
   Palette: deep space indigo with an aurora violet→cyan accent.
   Deliberately avoids the cream/serif and acid-green AI defaults.
   ============================================================ */

:root {
  /* Surfaces */
  --bg-0: #070812;          /* page base */
  --bg-1: #0d0f1e;          /* raised */
  --glass: rgba(23, 27, 51, 0.55);
  --glass-strong: rgba(30, 35, 66, 0.78);
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-bright: rgba(255, 255, 255, 0.16);

  /* Aurora accent */
  --accent: #7c5cff;        /* violet */
  --accent-2: #21d4fd;      /* cyan */
  --accent-3: #b721ff;      /* magenta */
  --grad-accent: linear-gradient(135deg, #7c5cff 0%, #b721ff 50%, #21d4fd 100%);
  --grad-accent-soft: linear-gradient(135deg, rgba(124,92,255,.22), rgba(33,212,253,.18));

  /* Text */
  --text: #f3f4fb;
  --text-dim: #a3a7c4;
  --text-faint: #6b7091;

  /* State */
  --good: #34e5a3;
  --bad: #ff6b8b;
  --warn: #ffd166;

  /* Metrics */
  --radius: 22px;
  --radius-sm: 14px;
  --radius-lg: 30px;
  --gap: 14px;
  --tap: cubic-bezier(.22,.61,.36,1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-0) !important;
  color: var(--text);
  font-family: -apple-system, "SF Pro Display", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  /* Ambient aurora glows anchored top + bottom */
  background:
    radial-gradient(120% 60% at 15% -10%, rgba(124,92,255,.22), transparent 60%),
    radial-gradient(120% 60% at 90% 0%, rgba(33,212,253,.14), transparent 55%),
    radial-gradient(140% 80% at 50% 120%, rgba(183,33,255,.16), transparent 60%),
    var(--bg-0) !important;
  background-attachment: fixed;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 14px) 18px 12px;
  background: linear-gradient(180deg, rgba(7,8,18,.9), rgba(7,8,18,.4) 70%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.topbar__title {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .3px;
  flex: 1;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar__balance {
  font-weight: 700;
  font-size: 14px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--stroke-bright);
  box-shadow: 0 0 20px rgba(124,92,255,.25);
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  transition: transform .15s var(--tap), background .2s;
}
.icon-btn:active { transform: scale(.92); background: var(--glass-strong); }

/* ---------------- Screen container ---------------- */
.screen {
  flex: 1;
  padding: 8px 16px 120px;
  animation: screen-in .38s var(--tap);
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- Glass card ---------------- */
.card {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05);
}

/* ---------------- Hero banner ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 26px 22px 24px;
  margin-bottom: 20px;
  background:
    var(--grad-accent-soft),
    var(--glass-strong);
  border: 1px solid var(--stroke-bright);
  box-shadow: 0 20px 60px rgba(124,92,255,.28);
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 260px; height: 260px;
  background: var(--grad-accent);
  filter: blur(60px);
  opacity: .55;
  animation: float 9s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-24px, 20px) scale(1.12); }
}
.hero__eyebrow {
  position: relative;
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 700;
  margin-bottom: 8px;
}
.hero__title {
  position: relative;
  font-size: 30px;
  line-height: 1.08;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -.5px;
}
.hero__sub {
  position: relative;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 88%;
}

/* ---------------- Quick action grid ---------------- */
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin-bottom: 22px;
}
.quick {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--stroke);
  cursor: pointer;
  transition: transform .18s var(--tap), border-color .2s, box-shadow .25s;
}
.quick:active { transform: scale(.96); }
.quick:hover { border-color: var(--stroke-bright); box-shadow: 0 10px 30px rgba(124,92,255,.2); }
.quick--wide { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
.quick__icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--grad-accent-soft);
  border: 1px solid var(--stroke-bright);
}
.quick__icon svg { width: 24px; height: 24px; color: var(--accent-2); }
.quick__label { font-weight: 700; font-size: 15px; }
.quick__hint { font-size: 12.5px; color: var(--text-faint); }

.section-title {
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
  margin: 24px 4px 12px;
}

/* ---------------- Category list ---------------- */
.cat-list { display: flex; flex-direction: column; gap: 12px; }
.cat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--stroke);
  cursor: pointer;
  transition: transform .16s var(--tap), border-color .2s, background .2s;
}
.cat:active { transform: scale(.98); background: var(--glass-strong); }
.cat__emoji {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 24px;
  border-radius: 14px;
  background: var(--grad-accent-soft);
  border: 1px solid var(--stroke);
}
.cat__body { flex: 1; min-width: 0; }
.cat__title { font-weight: 700; font-size: 16px; }
.cat__meta { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.cat__chev { color: var(--text-faint); }

/* ---------------- Product cards ---------------- */
.product-grid { display: flex; flex-direction: column; gap: 14px; }
.product {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--glass);
  border: 1px solid var(--stroke);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .2s, box-shadow .25s;
}
.product:hover { border-color: var(--stroke-bright); box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.product__top { display: flex; gap: 14px; align-items: flex-start; }
.product__thumb {
  width: 58px; height: 58px;
  border-radius: 15px;
  flex-shrink: 0;
  background: var(--grad-accent-soft);
  border: 1px solid var(--stroke);
  object-fit: cover;
  display: grid; place-items: center;
  font-size: 26px;
}
.product__info { flex: 1; min-width: 0; }
.product__title { font-weight: 700; font-size: 16px; line-height: 1.3; }
.product__desc { font-size: 13px; color: var(--text-dim); line-height: 1.45; margin-top: 5px; }
.product__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product__price { font-weight: 800; font-size: 20px; letter-spacing: -.3px; }
.product__price span { font-size: 13px; color: var(--text-faint); font-weight: 600; }
.badge {
  font-size: 11px; font-weight: 700;
  padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--stroke-bright);
}
.badge--out { color: var(--bad); border-color: rgba(255,107,139,.4); }
.badge--in { color: var(--good); border-color: rgba(52,229,163,.4); }

/* ---------------- Buttons ---------------- */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: var(--grad-accent);
  background-size: 180% 180%;
  transition: transform .15s var(--tap), box-shadow .25s, filter .2s;
  box-shadow: 0 10px 26px rgba(124,92,255,.4);
}
.btn:active { transform: scale(.96); }
.btn:disabled { filter: grayscale(.6) brightness(.7); box-shadow: none; cursor: not-allowed; }
.btn--sm { padding: 10px 16px; font-size: 14px; border-radius: 12px; }
.btn--block { width: 100%; }
.btn--ghost {
  background: var(--glass-strong);
  border: 1px solid var(--stroke-bright);
  box-shadow: none;
  color: var(--text);
}
.btn--danger { background: linear-gradient(135deg,#ff6b8b,#b721ff); box-shadow: 0 10px 26px rgba(255,107,139,.35); }

/* ---------------- Profile ---------------- */
.profile-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--grad-accent-soft), var(--glass-strong);
  border: 1px solid var(--stroke-bright);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.profile-card::after {
  content: ""; position: absolute; inset: auto -30% -60% auto;
  width: 220px; height: 220px; border-radius: 50%;
  background: var(--grad-accent); filter: blur(70px); opacity: .4;
}
.profile-head { display: flex; align-items: center; gap: 14px; position: relative; }
.avatar {
  width: 60px; height: 60px; border-radius: 20px;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 800;
  background: var(--grad-accent);
  box-shadow: 0 8px 24px rgba(124,92,255,.5);
}
.profile-name { font-size: 19px; font-weight: 800; }
.profile-username { color: var(--accent-2); font-size: 13.5px; font-weight: 600; }
.balance-big {
  position: relative;
  margin-top: 20px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
}
.balance-big span { font-size: 18px; color: var(--text-dim); }
.balance-label { position: relative; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.stat {
  padding: 16px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--stroke);
}
.stat__value { font-size: 24px; font-weight: 800; }
.stat__label { font-size: 12px; color: var(--text-faint); margin-top: 3px; }

/* Info rows */
.info-list { display: flex; flex-direction: column; }
.info-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--stroke);
  font-size: 14.5px;
}
.info-row:last-child { border-bottom: none; }
.info-row__key { color: var(--text-faint); }
.info-row__val { font-weight: 600; text-align: right; word-break: break-word; }

/* ---------------- Top-up ---------------- */
.amount-display {
  text-align: center;
  padding: 30px 20px 24px;
  margin-bottom: 18px;
}
.amount-value { font-size: 52px; font-weight: 800; letter-spacing: -2px; }
.amount-value span { font-size: 24px; color: var(--text-dim); }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.chip {
  flex: 1 1 30%;
  padding: 13px 10px;
  border-radius: 14px;
  text-align: center;
  font-weight: 700;
  background: var(--glass);
  border: 1px solid var(--stroke);
  cursor: pointer;
  transition: transform .14s var(--tap), border-color .2s;
}
.chip:active { transform: scale(.94); }
.chip.is-active { border-color: var(--accent); box-shadow: 0 0 16px rgba(124,92,255,.4); background: var(--grad-accent-soft); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.key {
  padding: 18px; border-radius: 16px;
  font-size: 22px; font-weight: 700; text-align: center;
  background: var(--glass); border: 1px solid var(--stroke);
  cursor: pointer; user-select: none;
  transition: transform .1s var(--tap), background .15s;
}
.key:active { transform: scale(.93); background: var(--glass-strong); }

.pay-method {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--stroke-bright);
  margin-bottom: 18px;
}
.pay-method__logo {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(135deg,#5b2be0,#00d0ff); color: #fff;
}

/* ---------------- Inputs ---------------- */
.field { margin-bottom: 14px; }
.field__label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 7px; font-weight: 600; }
.input, .textarea, .select {
  width: 100%;
  padding: 13px 15px;
  border-radius: 13px;
  background: var(--glass-strong);
  border: 1px solid var(--stroke);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,92,255,.2);
}
.textarea { min-height: 92px; resize: vertical; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px; }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { display: none; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--glass-strong); border: 1px solid var(--stroke-bright);
  transition: background .25s;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform .25s var(--tap);
}
.switch input:checked + span { background: var(--grad-accent); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------------- Tab bar ---------------- */
.tabbar {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 0;
  width: 100%; max-width: 560px;
  display: flex;
  padding: 8px 10px calc(8px + var(--safe-bottom));
  gap: 4px;
  background: linear-gradient(180deg, transparent, rgba(7,8,18,.85) 30%);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-top: 1px solid var(--stroke);
  z-index: 40;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px;
  background: none; border: none; cursor: pointer;
  color: var(--text-faint);
  font-size: 10.5px; font-weight: 600;
  border-radius: 14px;
  transition: color .2s, background .2s;
}
.tab svg { width: 24px; height: 24px; }
.tab.is-active { color: var(--text); }
.tab.is-active svg { color: var(--accent-2); filter: drop-shadow(0 0 8px rgba(33,212,253,.6)); }
.tab--admin.is-active svg { color: var(--warn); filter: drop-shadow(0 0 8px rgba(255,209,102,.6)); }

/* ---------------- Modal / sheet ---------------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4,5,12,.6);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid var(--stroke-bright);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 10px 20px calc(28px + var(--safe-bottom));
  animation: sheet-up .4s var(--tap);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet__grab { width: 42px; height: 5px; border-radius: 3px; background: var(--stroke-bright); margin: 8px auto 16px; }
.sheet__title { font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.sheet__sub { color: var(--text-dim); font-size: 14px; margin-bottom: 18px; }

/* ---------------- FAQ accordion ---------------- */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq__item { border-radius: var(--radius); background: var(--glass); border: 1px solid var(--stroke); overflow: hidden; }
.faq__q { padding: 15px 16px; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14.5px; }
.faq__q svg { transition: transform .25s; color: var(--text-faint); flex-shrink: 0; }
.faq__item.is-open .faq__q svg { transform: rotate(180deg); }
.faq__a { max-height: 0; overflow: hidden; transition: max-height .3s var(--tap); }
.faq__a-inner { padding: 0 16px 15px; color: var(--text-dim); font-size: 14px; line-height: 1.55; }

/* ---------------- States ---------------- */
.empty { text-align: center; padding: 60px 24px; color: var(--text-faint); }
.empty__icon { font-size: 46px; margin-bottom: 14px; opacity: .8; }
.empty__title { font-weight: 700; font-size: 16px; color: var(--text-dim); margin-bottom: 6px; }

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(255,255,255,.04) 30%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.04) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  height: 84px; margin-bottom: 14px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

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

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-top) + 14px);
  transform: translate(-50%, -140%);
  z-index: 90;
  max-width: 92%;
  padding: 13px 18px;
  border-radius: 16px;
  font-size: 14px; font-weight: 600;
  background: var(--glass-strong);
  border: 1px solid var(--stroke-bright);
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
  transition: transform .4s var(--tap), opacity .3s;
  opacity: 0;
}
.toast.is-show { transform: translate(-50%, 0); opacity: 1; }
.toast--good { border-color: rgba(52,229,163,.5); }
.toast--bad { border-color: rgba(255,107,139,.5); }

/* ---------------- Admin ---------------- */
.admin-tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 4px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  flex-shrink: 0;
  padding: 9px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  background: var(--glass); border: 1px solid var(--stroke);
  color: var(--text-dim); cursor: pointer; white-space: nowrap;
  transition: all .2s;
}
.admin-tab.is-active { background: var(--grad-accent-soft); border-color: var(--accent); color: var(--text); }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid var(--stroke);
  margin-bottom: 10px;
}
.list-row__body { flex: 1; min-width: 0; }
.list-row__title { font-weight: 700; font-size: 14.5px; }
.list-row__sub { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.row-actions { display: flex; gap: 6px; }
.mini-btn {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; cursor: pointer;
  background: var(--glass-strong); border: 1px solid var(--stroke);
  color: var(--text-dim); transition: transform .12s var(--tap), color .2s, border-color .2s;
}
.mini-btn:active { transform: scale(.9); }
.mini-btn--danger { color: var(--bad); }
.mini-btn svg { width: 17px; height: 17px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
