/* =========================================================
   Joviaearn — shared design system
   Used by the app pages, auth pages, admin panel and gateway.
   (The marketing landing page keeps its own bespoke theme.)
   ========================================================= */

:root {
    --background: #08070b;
    --surface: #13111c;
    --surface-2: #191824;
    --card: #0e0c15;
    --elevated: #161420;
    --border: rgba(255, 255, 255, .10);
    --border-strong: rgba(255, 255, 255, .18);
    --text: #f4f2f8;
    --text-muted: #9aa0ae;
    --text-dim: #6f7686;
    --accent: #9b36e4;
    --accent-hi: #a844f2;
    --accent-soft: rgba(155, 54, 228, .16);
    --gold: #fbbf24;
    --emerald: #34d399;
    --rose: #fb7185;
    --radius: 16px;
    --radius-lg: 24px;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
    --shadow: 0 18px 45px -18px rgba(0, 0, 0, .85);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--background);
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    margin: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5 { font-family: var(--font-heading); margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Backdrop ---------- */
.backdrop {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
    background:
        radial-gradient(ellipse 60% 45% at 15% 0%, rgba(130, 40, 200, .38), transparent 70%),
        radial-gradient(ellipse 55% 40% at 90% 25%, rgba(60, 40, 180, .30), transparent 70%),
        radial-gradient(ellipse 70% 45% at 50% 100%, rgba(155, 54, 228, .18), transparent 70%);
}

/* ---------- Shells ---------- */
.app-shell { position: relative; z-index: 10; max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: 96px; }
.page-shell { position: relative; z-index: 10; max-width: 760px; margin: 0 auto; padding: 24px 16px 72px; }
.wide-shell { position: relative; z-index: 10; max-width: 1100px; margin: 0 auto; padding: 24px 16px 72px; }

/* ---------- Top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 40;
    height: 56px; padding: 0 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: rgba(10, 8, 18, .95);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner { width: 100%; max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-weight: 900; letter-spacing: -.02em; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 11px; padding: 1.5px;
    background: linear-gradient(135deg, #c026d3, #22d3ee);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-mark > span {
    width: 100%; height: 100%; border-radius: 9px; background: #170e24;
    display: flex; align-items: center; justify-content: center; color: #e879f9; font-size: 15px;
}

/* ---------- Cards & panels ---------- */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow);
}
.panel {
    background: rgba(255, 255, 255, .035); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px; backdrop-filter: blur(10px);
}
.stat {
    background: rgba(19, 17, 28, .9); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.stat-label { font-size: 11px; color: var(--text-muted); display: block; }
.stat-value { font-size: 18px; font-weight: 800; margin-top: 2px; }

.tile {
    background: var(--elevated); border: 1px solid rgba(255, 255, 255, .05);
    border-radius: var(--radius); padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    transition: background .2s ease;
}
.tile:hover { background: #1d1a2a; }

.icon-orb {
    width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); border: 1px solid rgba(192, 132, 252, .3); color: #d8b4fe;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: 999px;
    padding: 11px 18px; font-size: 13px; font-weight: 700;
    transition: all .2s ease; white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 22px; font-size: 14px; border-radius: 14px; }
.btn-sm { padding: 8px 13px; font-size: 12px; }

.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 10px 26px -10px rgba(155, 54, 228, .8); }
.btn-accent:hover { background: var(--accent-hi); transform: translateY(-1px); }

.btn-gold { background: linear-gradient(135deg, #fbbf24, #facc15 45%, #f59e0b); color: #3b0764; }
.btn-gold:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-ghost { background: rgba(255, 255, 255, .07); border-color: var(--border); color: #ece9f3; }
.btn-ghost:hover { background: rgba(255, 255, 255, .14); }

.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); background: var(--accent-soft); }

.btn-danger { background: rgba(251, 113, 133, .15); border-color: rgba(251, 113, 133, .35); color: #fda4af; }
.btn-danger:hover { background: rgba(251, 113, 133, .25); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
    border: 1px solid transparent;
}
.badge-accent { background: var(--accent-soft); border-color: rgba(192, 132, 252, .35); color: #d8b4fe; }
.badge-gold   { background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .35); color: #fcd34d; }
.badge-emerald{ background: rgba(52, 211, 153, .14); border-color: rgba(52, 211, 153, .35); color: #6ee7b7; }
.badge-rose   { background: rgba(251, 113, 133, .14); border-color: rgba(251, 113, 133, .35); color: #fda4af; }
.badge-mono   { font-family: var(--font-mono); font-weight: 700; letter-spacing: 0; text-transform: none; }

.chip {
    background: rgba(59, 7, 100, .75); border: 1px solid rgba(192, 132, 252, .3);
    color: var(--gold); border-radius: 999px; padding: 2px 7px;
    font-family: var(--font-mono); font-size: 10px; font-weight: 700;
}

/* ---------- Alerts ---------- */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    border-radius: 14px; padding: 13px 15px; font-size: 13px; line-height: 1.5;
    border: 1px solid transparent;
}
.alert-error   { background: rgba(251, 113, 133, .13); border-color: rgba(251, 113, 133, .32); color: #fda4af; }
.alert-success { background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .3); color: #6ee7b7; }
.alert-warn    { background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .3); color: #fcd34d; }
.alert-info    { background: var(--accent-soft); border-color: rgba(192, 132, 252, .3); color: #e9d5ff; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field-label {
    display: block; font-size: 11px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-muted); margin-bottom: 7px;
}
.input, .select, .textarea {
    width: 100%; padding: 13px 15px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 13px; color: var(--text); font-size: 14px; font-family: inherit;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.input::placeholder, .textarea::placeholder { color: #5c6373; }
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(155, 54, 228, .18);
}
.select { appearance: none; cursor: pointer; }
.textarea { resize: vertical; min-height: 110px; }

/* ---------- Tables (admin) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
    text-align: left; padding: 12px 14px; font-size: 10px; font-weight: 800;
    letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim);
    background: rgba(255, 255, 255, .03); border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, .05); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: rgba(255, 255, 255, .02); }

/* ---------- Layout helpers ---------- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.section-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); margin: 26px 0 12px; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.center { text-align: center; }
.mono { font-family: var(--font-mono); }
.text-gold { color: var(--gold); }
.text-emerald { color: var(--emerald); }
.text-accent { color: #d8b4fe; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
    position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
    width: calc(100% - 24px); max-width: 420px; height: 58px; z-index: 50;
    background: rgba(18, 15, 27, .95); backdrop-filter: blur(20px);
    border: 1px solid var(--border); border-radius: 28px;
    display: flex; align-items: center; justify-content: space-around; padding: 0 8px;
    box-shadow: 0 22px 45px -20px rgba(0, 0, 0, .95);
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: 0; color: var(--text-muted); font-size: 10px; font-weight: 600;
    transition: color .2s ease;
}
.nav-item:hover, .nav-item.is-active { color: #e9e6f2; }
.nav-item i { font-size: 17px; }
.nav-item.is-active i { color: #c252ef; }
.nav-item-center { margin-top: -20px; }
.nav-fab {
    width: 44px; height: 44px; border-radius: 999px; border: 3px solid #08070b;
    background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 18px; box-shadow: 0 10px 25px -8px rgba(155, 54, 228, .9); transition: transform .2s ease;
}
.nav-fab:active { transform: scale(.94); }

/* ---------- Admin sidebar ---------- */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; position: relative; z-index: 10; }
.sidebar { background: rgba(14, 12, 21, .92); border-right: 1px solid var(--border); padding: 20px 14px; }
.sidebar-link {
    display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px;
    font-size: 13px; font-weight: 600; color: var(--text-muted); transition: all .18s ease;
}
.sidebar-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sidebar-link.is-active { background: var(--accent-soft); color: #e9d5ff; border: 1px solid rgba(192, 132, 252, .3); }
.admin-main { padding: 24px; min-width: 0; }

@media (max-width: 880px) {
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--border); display: flex; gap: 8px; overflow-x: auto; }
    .sidebar-links { display: flex; gap: 8px; }
}

/* ---------- Misc ---------- */
.pulse { animation: ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2.1); opacity: 0; } }

.rise { animation: riseIn .45s ease both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
