/* ===== FOMO Business — Design System ===== */
/* Fonts loaded via <link> in head.php */

:root {
  --fomo-purple: #6D28D9;
  --fomo-purple-dark: #5B21B6;
  --fomo-lavender: #A78BFA;
  --fomo-orange: #FF6B00;
  --bg: #FFFFFF;
  --bg-soft: #F7F5FC;
  --bg-purple: rgba(109, 40, 217, .06);
  --bg-lavender: rgba(167, 139, 250, .10);
  --bg-orange: rgba(255, 107, 0, .08);
  --ink: #16121F;
  --ink2: #2D2640;
  --sub: #6F6878;
  --muted: #9B95A3;
  --line: #E8E5EE;
  --line-soft: #F0EDF5;
  --ok: #059669;
  --ok-bg: #ECFDF5;
  --warn: #D97706;
  --warn-bg: #FFFBEB;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 2px rgba(22,18,31,.04);
  --shadow: 0 2px 8px rgba(22,18,31,.06);
  --font-display: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font: 'Inter', -apple-system, sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
  /* Compat */
  --brand: var(--fomo-purple);
  --card: var(--bg);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: #16121F;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  touch-action: pan-x pan-y; overscroll-behavior: none; -webkit-text-size-adjust: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}

/* ===== PHONE FRAME ===== */
.phone {
  width: 100%; max-width: 420px; background: var(--bg);
  min-height: 100vh; position: relative;
}
@media (min-width: 520px) {
  body { padding: 24px 0; }
  .phone {
    min-height: auto; height: 860px;
    border-radius: 28px;
    box-shadow: 0 0 0 6px #2D2640, 0 0 60px rgba(109,40,217,.12);
    overflow-y: auto; overflow-x: hidden;
    scrollbar-width: none;
  }
  .phone::-webkit-scrollbar { display: none; }
}

.container { max-width: 500px; margin: 0 auto; padding: 0 20px; }
.screen { min-height: 100vh; padding-bottom: 80px; }
@media (min-width: 520px) { .screen { min-height: 840px; } }

/* ===== TOPBAR ===== */
.topbar-biz {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; padding: 4px 0;
}
.topbar-biz h1 { font-family: var(--font-display); font-size: 18px; font-weight: 800; margin: 0; }
.topbar-biz .subtitle { font-size: 11px; color: var(--sub); font-weight: 500; letter-spacing: .5px; }
.topbar-biz a { color: var(--fomo-purple); font-size: 13px; text-decoration: none; font-weight: 600; }

/* ===== BOTTOM NAV ===== */
.nav-biz {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 420px; margin: 0 auto;
  height: 64px;
  background: var(--fomo-purple);
  border-top: 1px solid var(--fomo-purple-dark);
  display: flex; z-index: 10;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-biz a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; font-size: 11px; font-weight: 500;
  color: rgba(255,255,255,.55); text-decoration: none;
}
.nav-biz a i { font-size: 22px; }
.nav-biz a.on { color: #fff; font-weight: 700; }
.nav-biz a.back-btn { color: rgba(255,255,255,.8); }

/* ===== TYPOGRAPHY ===== */
h1 { font-family: var(--font-display); font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -.3px; }
h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin: 0; }
h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin: 0; }

/* ===== STATS GRID ===== */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
.stat {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-align: center;
}
.stat .val { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--fomo-purple); }
.stat .lbl { font-size: 12px; color: var(--sub); margin-top: 4px; }
.stat.highlight { background: var(--fomo-purple); border-color: var(--fomo-purple); }
.stat.highlight .val { color: #fff; }
.stat.highlight .lbl { color: rgba(255,255,255,.7); }

/* ===== CARDS ===== */
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px;
}
.card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card h3 i { font-size: 18px; color: var(--fomo-purple); }

/* ===== FORMS ===== */
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--sub); }
input, select, textarea {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); font-size: 15px; font-family: var(--font);
  background: var(--bg); color: var(--ink); outline: none;
  transition: border-color .2s;
}
input:focus, select:focus { border-color: var(--fomo-purple); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700; font-family: var(--font);
  cursor: pointer; transition: opacity .15s, transform .1s; text-decoration: none;
}
.btn-primary { background: var(--fomo-purple); color: #fff; width: 100%; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .45; }
.btn-ghost { background: var(--bg); border: 1.5px solid var(--line); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ===== ALERT ===== */
.alert { padding: 12px 14px; border-radius: var(--radius-xs); font-size: 14px; margin-bottom: 14px; display: none; font-weight: 500; }
.alert.ok { background: var(--ok-bg); color: var(--ok); display: block; }
.alert.err { background: var(--danger-bg); color: var(--danger); display: block; }

/* ===== BALANCE CARD ===== */
.balance-card {
  background: var(--fomo-purple); color: #fff; border-radius: var(--radius);
  padding: 24px; text-align: center; margin: 16px 0;
}
.balance-card .bal-label { font-size: 13px; opacity: .7; }
.balance-card .bal-amount { font-family: var(--font-display); font-size: 32px; font-weight: 800; margin: 8px 0; }
.balance-card .bal-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-xs); padding: 10px 20px; font-weight: 700; font-size: 14px;
  cursor: pointer; font-family: var(--font); margin-top: 8px;
}

/* ===== TABLE ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--line); color: var(--sub); font-size: 12px; text-transform: uppercase; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }

/* ===== BOOKING ROW ===== */
.booking-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.booking-row:last-child { border-bottom: none; }
.booking-row .b-info { flex: 1; }
.booking-row .b-title { font-weight: 600; font-size: 14px; }
.booking-row .b-meta { font-size: 12px; color: var(--sub); margin-top: 2px; }
.booking-row .b-amount { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--fomo-purple); }

/* ===== STATUS PILLS ===== */
.pill { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; display: inline-block; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err { background: var(--danger-bg); color: var(--danger); }
.pill.info { background: var(--bg-lavender); color: var(--fomo-purple); }

/* ===== MODAL ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(22,18,31,.5); display: none; align-items: flex-end; justify-content: center; z-index: 100; }
.modal-bg.show { display: flex; }
.modal { background: var(--bg); border-radius: 20px 20px 0 0; padding: 24px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; animation: slideUp .25s var(--ease); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal h3 { margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.modal .close { float: right; background: var(--bg-soft); border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 18px; cursor: pointer; color: var(--sub); display: flex; align-items: center; justify-content: center; }

/* ===== BRAND HEADER ===== */
.brand-biz { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 0 24px; }
.brand-biz img { height: 48px; width: auto; }
.brand-biz .tag { font-size: 13px; color: var(--sub); font-weight: 600; letter-spacing: .5px; }

/* ===== EMPTY STATE ===== */
.empty { text-align: center; padding: 40px 20px; color: var(--sub); }
.empty i { font-size: 48px; color: var(--muted); }
.empty p { font-size: 15px; margin-top: 8px; }

/* ===== SPINNER ===== */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(109,40,217,.12); border-top-color: var(--fomo-purple); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TX ROWS ===== */
.tx-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.tx-row:last-child { border-bottom: none; }
.tx-icon { width: 36px; height: 36px; border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; }
.tx-icon.credit { background: var(--ok-bg); color: var(--ok); }
.tx-icon.debit { background: var(--danger-bg); color: var(--danger); }
.tx-info { flex: 1; }
.tx-desc { font-size: 13px; font-weight: 600; }
.tx-date { font-size: 11px; color: var(--sub); margin-top: 2px; }
.tx-amount { font-weight: 800; font-size: 14px; }
.tx-amount.credit { color: var(--ok); }
.tx-amount.debit { color: var(--danger); }

/* WD Status */
.wd-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.wd-row:last-child { border-bottom: none; }
.wd-status { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.wd-status.done { background: var(--ok-bg); color: var(--ok); }
.wd-status.processing { background: var(--bg-lavender); color: var(--fomo-purple); }
.wd-status.pending { background: var(--warn-bg); color: var(--warn); }
.wd-status.failed { background: var(--danger-bg); color: var(--danger); }

/* ===== SECTION ===== */
.section-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin: 24px 0 10px; }

/* ===== SWAP/LINK ===== */
.swap { text-align: center; margin-top: 20px; font-size: 14px; color: var(--sub); }
.swap a { color: var(--fomo-purple); font-weight: 700; text-decoration: none; }
.forgot { text-align: right; font-size: 13px; margin-top: 8px; }
.forgot a { color: var(--fomo-purple); text-decoration: none; font-weight: 600; }

/* PW toggle */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); display: flex; align-items: center; }
.pw-toggle i { font-size: 20px; }
