/* ============================================================
   TRONVAULT USER APP — LIGHT THEME, MOBILE-FIRST
   ============================================================ */

:root {
    --bg: #f5f7fb;
    --bg-2: #ffffff;
    --bg-3: #f8fafc;
    --border: #e5e9f2;
    --border-strong: #d8dde8;
    --txt: #1a2332;
    --txt-2: #334155;
    --mute: #64748b;
    --mute-2: #94a3b8;
    --primary: #2563eb;
    --green: #10b981;
    --green-dark: #059669;
    --red: #ef4444;
    --amber: #f59e0b;
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
    --shadow: 0 2px 8px rgba(15,23,42,0.06);
    --shadow-md: 0 4px 12px rgba(15,23,42,0.08);
    --radius: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--txt);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

.text-muted { color: var(--mute) !important; }
.text-success { color: var(--green-dark) !important; }
.text-info { color: var(--primary) !important; }
.text-warning { color: #b45309 !important; }
.text-danger { color: var(--red) !important; }

/* ============= LAYOUT ============= */
.app-container {
    max-width: 100%;
    margin: 0 auto;
    padding-bottom: 80px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    position: sticky;
    top: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    box-shadow: 0 4px 14px rgba(16,185,129,0.3);
    flex-shrink: 0;
}

/* ============= AUTH SCREENS ============= */
.auth-container {
    max-width: 420px;
    margin: 40px auto;
    padding: 0 16px;
}

@media (max-width: 480px) {
    .auth-container { margin: 20px auto; padding: 0 12px; }
}

/* ============= HERO BALANCE ============= */
.hero-balance {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    border-radius: 20px;
    padding: 22px 20px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(16,185,129,0.25);
    position: relative;
    overflow: hidden;
}
.hero-balance::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 70%);
    border-radius: 50%;
}
.hero-balance .text-muted { color: rgba(255,255,255,0.75) !important; }
.hero-balance .text-uppercase { font-size: 11px; letter-spacing: 1px; font-weight: 600; }

.balance-amount {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-top: 4px;
}
.balance-amount .currency {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.85;
    margin-left: 4px;
}

@media (max-width: 380px) {
    .balance-amount { font-size: 26px; }
    .hero-balance { padding: 18px 16px; }
}

/* ============= GLASS / CARDS ============= */
.card-glass {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}
.card-glass:hover { box-shadow: var(--shadow); }

/* ============= BOTTOM NAV ============= */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(15,23,42,0.04);
}

.nav-item {
    color: var(--mute);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 10px;
    font-weight: 500;
    gap: 2px;
    padding: 6px 8px;
    flex: 1;
    max-width: 72px;
    border-radius: 8px;
    transition: all .15s ease;
}
.nav-item i { font-size: 22px; }
.nav-item:hover { color: var(--primary); }
.nav-item.active {
    color: var(--primary);
    background: rgba(37,99,235,0.08);
}

@media (min-width: 480px) {
    .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }
}

/* ============= FORMS ============= */
.form-control, .form-select {
    background: var(--bg-2) !important;
    color: var(--txt) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12) !important;
}
.form-control.bg-dark { background: var(--bg-3) !important; }

.form-label {
    color: var(--txt-2);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

/* ============= BUTTONS ============= */
.btn {
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all .15s ease;
}
.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: #fff;
    box-shadow: 0 2px 6px rgba(16,185,129,0.25);
}
.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16,185,129,0.3);
}
.btn-outline-light {
    background: transparent;
    color: var(--txt-2);
    border: 1px solid var(--border-strong);
}
.btn-outline-light:hover {
    background: var(--bg-hover);
    color: var(--txt);
}

/* ============= TRANSACTIONS ============= */
.transaction-list { max-height: 500px; overflow-y: auto; }
.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}
.transaction-item:last-child { border-bottom: none; }

/* ============= BADGES ============= */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 11px;
}
.badge.bg-success { background: rgba(16,185,129,0.15) !important; color: var(--green-dark); }
.badge.bg-warning { background: rgba(245,158,11,0.15) !important; color: #b45309; }
.badge.bg-danger  { background: rgba(239,68,68,0.15) !important; color: #b91c1c; }
.badge.bg-info    { background: rgba(37,99,235,0.15) !important; color: var(--primary); }
.badge.bg-secondary { background: rgba(100,116,139,0.15) !important; color: var(--mute); }

/* ============= QR / WALLET ============= */
.qr-code {
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    max-width: 220px;
}
.wallet-address {
    word-break: break-all;
    font-family: "SF Mono", Menlo, monospace;
    font-size: 13px;
    background: var(--bg-3);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px dashed var(--border-strong);
}

/* ============= ALERTS ============= */
.alert {
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    padding: 10px 14px;
    font-size: 13px;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ============= RESPONSIVE GRID ============= */
.row.g-2 > [class*="col-"] { padding: 4px; }
.row.g-3 > [class*="col-"] { padding: 8px; }

/* Mobile tweaks */
@media (max-width: 380px) {
    .hero-balance .balance-amount { font-size: 24px; }
    h4 { font-size: 18px; }
    .btn { padding: 8px 12px; font-size: 13px; }
}

@media (min-width: 768px) {
    .app-container { max-width: 720px; }
    .bottom-nav { max-width: 520px; left: 50%; transform: translateX(-50%); border-radius: 16px 16px 0 0; }
}

@media (min-width: 992px) {
    .app-container { max-width: 800px; }
}

/* ============= PRINT ============= */
@media print {
    .bottom-nav, .top-bar, .btn { display: none !important; }
    body { background: #fff; }
}