:root {
  --primary-blue: #052B9A;
  --secondary-blue: #149BFF;
  --dark-blue: #031F73;
  --primary-red: #F20519;
  --soft-blue: #EAF5FF;
  --soft-red: #FFE9EC;

  --background: #FFFFFF;
  --surface: #FFFFFF;
  --surface-soft: #F6F8FC;

  --text-primary: #171A1F;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;

  --border: #E5E7EB;
  --shadow-blue: rgba(5, 43, 154, 0.12);
  --shadow-red: rgba(242, 5, 25, 0.18);
  
  --safe-padding: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
    margin: 0;
    padding: 0;
}

body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    overscroll-behavior: none;
    background-color: var(--surface-soft);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
    position: relative;
}

@keyframes slideInRightPage {
    0% {
        opacity: 0;
        transform: translateX(45px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--background);
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    padding-bottom: 80px; /* space for bottom nav */
    overflow-x: hidden;
}

.mobile-container.page-transition-slide {
    animation: slideInRightPage 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.container-padding {
    padding: var(--safe-padding);
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--text-primary);
    font-weight: 700;
}

p {
    color: var(--text-secondary);
}

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-white { color: #FFFFFF; }
.text-blue { color: var(--primary-blue); }
.text-red { color: var(--primary-red); }

/* Forms */
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}
.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}
.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--soft-blue);
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary-blue);
    color: #FFFFFF;
    box-shadow: 0 4px 12px var(--shadow-blue);
}
.btn-primary:active {
    background: var(--dark-blue);
}

/* Auth Screens */
.auth-header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 60px;
}
.auth-logo {
    width: 80px;
    height: 80px;
    background: var(--soft-blue);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--primary-blue);
}
.auth-logo i { font-size: 40px; }

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px var(--safe-padding) 32px var(--safe-padding);
}

.dashboard-bg {
    background: linear-gradient(180deg, var(--soft-blue) 0%, var(--background) 40%, var(--background) 100%);
}
.header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}
.header-greeting {
    font-size: 12px;
    color: var(--text-secondary);
}
.header-name {
    font-size: 14px;
    font-weight: 700;
}
.header-actions {
    display: flex;
    gap: 16px;
}
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--soft-blue);
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: none;
    cursor: pointer;
}
.badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    background: var(--primary-red);
    border-radius: 50%;
    border: 2px solid white;
}

/* Balance Card */
.balance-card-wrapper {
    padding: 0 var(--safe-padding);
    margin-bottom: 24px;
    margin-top: -4px;
}
.balance-card {
    background: linear-gradient(145deg, #001969 0%, #052b9a 45%, #0d47d9 100%);
    border-radius: 22px;
    padding: 24px;
    color: white;
    box-shadow: 0 12px 32px rgba(5, 43, 154, 0.35);
    position: relative;
    overflow: hidden;
}
.balance-card::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -25%;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(20,155,255,0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.balance-card::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -15%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.balance-label {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 8px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}
.balance-amount {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}
.balance-actions {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 1;
}
.balance-action-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px 10px;
    border-radius: 14px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.balance-action-btn:active {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(0.97);
}

/* Menu Grid */
.menu-section {
    padding: 0 var(--safe-padding);
    margin-bottom: 30px;
}
.menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px 12px;
}
.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
}
.menu-icon-wrapper {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    color: var(--primary-blue);
    font-size: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.menu-item:active .menu-icon-wrapper {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.menu-label {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

/* Promo Banner */
.promo-section {
    padding: 0 var(--safe-padding);
    margin-bottom: 30px;
}
.promo-banner {
    background: linear-gradient(135deg, var(--soft-blue), #FFFFFF);
    border: 1px solid #D7ECFF;
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 10px 24px rgba(5, 43, 154, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.promo-content h3 {
    font-size: 16px;
    color: var(--dark-blue);
    margin-bottom: 8px;
}
.promo-content p {
    font-size: 13px;
    margin-bottom: 12px;
}
.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 8px;
    background: var(--primary-red);
    color: white;
    border: none;
    font-weight: 600;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #FFFFFF;
    display: flex;
    justify-content: space-between;
    padding: 12px 24px 20px;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    z-index: 100;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
}
.nav-item.active {
    color: var(--primary-red);
}
.nav-icon {
    font-size: 24px;
}
.nav-item-scan {
    position: relative;
    top: -24px;
}
.fab-scan {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-red), #ff4d5a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    box-shadow: 0 8px 20px var(--shadow-red);
    margin-bottom: 4px;
    border: 4px solid #FFFFFF;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}
.alert-error {
    background: var(--soft-red);
    color: var(--primary-red);
    border: 1px solid rgba(242, 5, 25, 0.2);
}
.alert-success {
    background: #e6fcf5;
    color: #0ca678;
    border: 1px solid #b2f2bb;
}

@keyframes bounceBadge {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-1.5px); }
}
.nav-badge {
    position: absolute;
    top: -4px;
    right: 50%;
    margin-right: -16px;
    background: var(--primary-red);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid white;
    animation: bounceBadge 2s infinite;
    z-index: 2;
    min-width: 8px;
    text-align: center;
}
