@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #5B21B6;
    --primary-light: #7C3AED;
    --bg-body: #F0F2F5;
    --white: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --radius-lg: 16px;
    --radius-md: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #EEF2F6;
    /* Distinct desktop background */
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    /* Critical for preventing scroll */
}

/* Strict Mobile Container */
.app-container {
    width: 100%;
    max-width: 480px;
    /* Mobile App Limit */
    background: #F8F9FE;
    min-height: 100vh;
    padding-bottom: 90px;
    /* Nav Space */
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
    /* Stronger shadow */
    overflow-x: hidden;
    /* internal overflow prevention */
    margin: 0 auto;
    /* Ensure centering */
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    /* Visual boundary */
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    /* Visual boundary */
}

/* --- Common Components --- */

.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 20px 20px 40px;
    border-radius: 0 0 24px 24px;
    position: relative;
    z-index: 10;
    box-shadow: 0 4px 20px -5px rgba(91, 33, 182, 0.4);
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Advanced Card */
.app-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 16px;
    margin-bottom: 15px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Buttons */
.app-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 14px;
    border-radius: 30px;
    /* Pill shape for modern app feel */
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px -5px var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.app-btn:active {
    transform: scale(0.97);
    box-shadow: 0 4px 10px -5px var(--primary);
}

.app-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    background: #9CA3AF;
}

/* Inputs */
.app-input-group {
    margin-bottom: 18px;
}

.app-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-input {
    width: 100%;
    background: #F1F5F9;
    border: 1px solid transparent;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
    transition: all 0.3s;
}

.app-input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.1);
}

/* --- Navigation --- */
.bottom-navigation {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid #F3F4F6;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.03);
    z-index: 100;
}

.b-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #9CA3AF;
    text-decoration: none;
    transition: all 0.2s;
    width: 60px;
}

.b-nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    transition: all 0.2s;
}

.b-nav-item span {
    font-size: 10px;
    font-weight: 600;
}

.b-nav-item.active {
    color: var(--primary);
}

.b-nav-item.active svg {
    transform: translateY(-2px);
    fill: rgba(91, 33, 182, 0.1);
    /* Subtle fill */
}

/* --- Recharge / Withdraw Tabs --- */
.rw-tabs {
    display: flex;
    background: #FFFFFF;
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.rw-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s;
}

.rw-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(91, 33, 182, 0.3);
}

/* --- Plans Grid on Home --- */
.plan-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
    background: #F8FAFC;
    padding: 10px;
    border-radius: 12px;
}

.stat-cell {
    text-align: center;
}

.stat-val {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
}

.stat-lbl {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Bank Card --- */
.bank-card-gradient {
    background: linear-gradient(135deg, #0F172A 0%, #334155 100%);
    border-radius: 20px;
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* --- Utils --- */
.text-primary {
    color: var(--primary);
}

.text-success {
    color: #10B981;
}

.bg-white {
    background: white;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 20px;
    /* Moved to top for better visibility */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 400px;
}

.toast-msg {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(8px);
    color: white;
    padding: 14px 18px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
}

/* Action Icons Home */
.home-action-grid {
    display: flex;
    justify-content: space-between;
    padding: 20px 25px;
    background: white;
    margin-bottom: 10px;
}

.h-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-main);
    width: 25%;
}

.h-icon-circle {
    width: 48px;
    height: 48px;
    background: #F3F4F6;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 20px;
    transition: all 0.2s;
}

.h-action-item:active .h-icon-circle {
    background: #E5E7EB;
    transform: scale(0.95);
}

/* Styling for Missing Modal */
.alert-modal-overlay {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.alert-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.alert-modal-card {
    background: white;
    width: 100%;
    max-width: 320px;
    padding: 25px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.alert-modal-overlay.show .alert-modal-card {
    transform: scale(1);
}

.alert-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
}

.alert-icon-circle.success {
    background: #D1FAE5;
    color: #059669;
}

.alert-icon-circle.error {
    background: #FEE2E2;
    color: #DC2626;
}

.alert-icon-circle.info {
    background: #DBEAFE;
    color: #2563EB;
}

.alert-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.alert-message {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.alert-btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.alert-btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(91, 33, 182, 0.3);
}

.alert-btn:active {
    transform: scale(0.96);
}