/* ===== CSS VARIABLES & ROOT ===== */
:root {
    --bg-primary: #0a0f1c;
    --bg-secondary: #111827;
    --bg-card: #1a2234;
    --bg-card-hover: #222d42;
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-primary: #10b981;
    --accent-secondary: #059669;
    --accent-tertiary: #34d399;
    --border-color: #374151;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    --info-color: #3b82f6;
    --wall-color: #0f2e53;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s ease;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-tertiary);
}

input, button, select, textarea {
    font-family: inherit;
    font-size: 16px;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader {
    text-align: center;
}

.axes-logo-loader {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    letter-spacing: 0.2em;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-card);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none !important;
}

.page {
    min-height: 100vh;
}

/* ===== AUTH PAGES ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.logo span {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-form {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.image-preview {
    margin-top: 0.75rem;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-secondary);
    display: none;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview.has-image {
    display: block;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    min-height: 48px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline:hover {
    background: var(--accent-primary);
    color: var(--text-primary);
}

.btn-full {
    width: 100%;
}

.btn-danger {
    background: var(--error-color);
    color: var(--text-primary);
}

.btn-danger:hover {
    background: #dc2626;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

/* ===== DASHBOARD ===== */
.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 15, 28, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-small {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon-small {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-primary);
}

.logo-small span {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.user-profile:hover {
    background: var(--bg-card);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-primary);
}

.user-name {
    font-weight: 500;
    font-size: 0.875rem;
    display: none;
}

@media (min-width: 640px) {
    .user-name {
        display: block;
    }
}

/* ===== PROFILE DROPDOWN ===== */
.profile-dropdown {
    position: fixed;
    top: 70px;
    right: 1rem;
    width: 280px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    z-index: 200;
    padding: 1.5rem;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-details h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.profile-details p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-primary);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

/* ===== DASHBOARD MAIN ===== */
.dashboard-main {
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== BALANCE CARD ===== */
.balance-card {
    background: linear-gradient(135deg, var(--wall-color) 0%, var(--bg-secondary) 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.balance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.balance-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.active {
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary);
}

.status-indicator.pending {
    background: var(--warning-color);
    box-shadow: 0 0 10px var(--warning-color);
}

.balance-amount {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.balance-amount .currency {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.balance-amount .amount {
    font-size: 2.0rem;
    font-weight: 800;
    color: var(--text-primary);
}

.balance-usd {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.balance-usd .currency-small {
    font-size: 1rem;
    color: var(--accent-primary);
}

.balance-usd .amount-small {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent-primary);
}

/* ===== ACTION GRID ===== */
.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    min-height: 100px;
}

.action-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.action-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon svg {
    width: 24px;
    height: 24px;
}

.withdrawal-icon {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-primary);
}

.id-icon {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info-color);
}

.passport-icon {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.action-btn span {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

/* ===== SECTIONS ===== */
.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* ===== TRANSACTION LIST ===== */
.transaction-list {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.transaction-icon.withdrawal {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

.transaction-icon.deposit {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-primary);
}

.transaction-icon svg {
    width: 20px;
    height: 20px;
}

.transaction-details h4 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.transaction-details p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.transaction-amount {
    text-align: right;
}

.transaction-amount .amount {
    font-size: 0.875rem;
    font-weight: 600;
}

.transaction-amount .amount.negative {
    color: var(--error-color);
}

.transaction-amount .amount.positive {
    color: var(--accent-primary);
}

.transaction-amount .status {
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    display: inline-block;
    margin-top: 0.25rem;
}

.transaction-amount .status.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.transaction-amount .status.completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-primary);
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--error-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

/* ===== PAYMENT METHOD SECTION ===== */
.payment-method-section h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.method-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.method-tab {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.method-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.payment-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.payment-option {
    cursor: pointer;
}

.payment-option input {
    display: none;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.payment-option input:checked + .option-content {
    border-color: var(--accent-primary);
    background: rgba(16, 185, 129, 0.1);
}

.option-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
}

.option-logo.mpesa { background: #4CAF50; }
.option-logo.airtel { background: #E53935; }
.option-logo.tigo { background: #1565C0; }
.option-logo.halo { background: #FF9800; }
.option-logo.crdb { background: #0D47A1; }
.option-logo.nmb { background: #43A047; }
.option-logo.nbc { background: #1976D2; }
.option-logo.stanbic { background: #0277BD; }
.option-logo.equity { background: #D32F2F; }
.option-logo.kcb { background: #2E7D32; }
.option-logo.exim { background: #6A1B9A; }
.option-logo.dtb { background: #00695C; }

.option-content span {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== WITHDRAWAL FORM ===== */
.withdrawal-form {
    margin-top: 1rem;
}

/* ===== DOCUMENT MODALS (ID & PASSPORT) ===== */
.modal-document {
    max-width: 380px;
}

.id-card,
.passport-card {
    background: linear-gradient(135deg, #1a2234 0%, #0a0f1c 100%);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.id-header,
.passport-header {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    padding: 1rem;
    text-align: center;
}

.id-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.id-type {
    font-size: 0.75rem;
    opacity: 0.9;
    letter-spacing: 0.2em;
}

.passport-country {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.passport-title {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.id-body,
.passport-body {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
}

.id-photo,
.passport-photo {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
}

.id-details p,
.passport-field {
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.id-details strong {
    color: var(--text-secondary);
}

.passport-field {
    display: flex;
    flex-direction: column;
}

.field-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.field-value {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
}

.id-footer,
.passport-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.id-barcode,
.mrz-code {
    font-family: monospace;
    font-size: 0.5rem;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.1em;
    word-break: break-all;
}

/* ===== ALERT MODAL ===== */
.modal-alert {
    max-width: 350px;
    text-align: center;
    padding: 2rem;
}

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

.alert-icon.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

.alert-icon.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-primary);
}

.alert-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.alert-icon.info {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info-color);
}

.modal-alert h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.modal-alert p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.alert-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (min-width: 640px) {
    .balance-amount .amount {
        font-size: 3rem;
    }
    
    .action-grid {
        gap: 1.5rem;
    }
    
    .action-btn {
        padding: 1.5rem 1rem;
    }
}

@media (min-width: 768px) {
    .dashboard-main {
        padding: 2rem;
    }
    
    .modal-content {
        max-width: 500px;
    }
    
    .payment-options {
        grid-template-columns: repeat(4, 1fr);
    }
}
