/* ============================================
   HARMONIIE BANKING - MODERN DESIGN SYSTEM
   Ultra-Professional Contemporary Banking UI
   ============================================ */

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

:root {
    /* Primary Brand Colors - Emerald & Teal */
    --brand-primary: #0ea5e9;
    --brand-primary-dark: #0284c7;
    --brand-primary-light: #38bdf8;
    --brand-secondary: #10b981;
    --brand-secondary-dark: #059669;
    
    /* UI Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #0f172a;
    --bg-card: #ffffff;
    
    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Border Colors */
    --border-primary: #e2e8f0;
    --border-secondary: #cbd5e1;
    --border-accent: #0ea5e9;
    
    /* Status Colors */
    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --error: #ef4444;
    --error-bg: #fee2e2;
    --info: #3b82f6;
    --info-bg: #dbeafe;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    --gradient-secondary: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    --gradient-card: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-brand: 0 8px 24px -4px rgba(14, 165, 233, 0.25);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 16px;
}

/* ============================================
   LOGIN PAGE - MODERN SPLIT DESIGN
   ============================================ */

#loginPage {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-secondary);
}

@media (max-width: 968px) {
    #loginPage {
        grid-template-columns: 1fr;
    }
}

.login-left {
    background: var(--gradient-hero);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.5; }
    50% { transform: scale(1.1) translate(-20px, -20px); opacity: 0.8; }
}

.login-brand {
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-brand h1 {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--text-inverse);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.login-brand p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.login-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 4rem;
    position: relative;
    z-index: 1;
}

.login-feature {
    text-align: center;
    color: var(--text-inverse);
}

.login-feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.login-feature-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.login-feature-desc {
    font-size: 0.875rem;
    opacity: 0.7;
}

.login-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--bg-primary);
}

.login-form-container {
    width: 100%;
    max-width: 450px;
}

.login-form-header {
    margin-bottom: 2.5rem;
}

.login-form-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-form-header p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */

#dashboardPage {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
}

/* Header */
.dashboard-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-size: 1.25rem;
    font-weight: 800;
}

.header-logo-text h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header-logo-text p {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-weight: 700;
    font-size: 1rem;
}

.header-user-info {
    text-align: right;
}

.header-user-greeting {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.header-user-name {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Navigation */
.dashboard-nav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-base);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn i {
    font-size: 1.125rem;
}

.nav-btn:hover {
    color: var(--brand-primary);
    background: rgba(14, 165, 233, 0.05);
}

.nav-btn.border-green-600,
.nav-btn.text-green-700 {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
    background: rgba(14, 165, 233, 0.05);
}

/* Main Content */
.dashboard-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
}

/* ============================================
   CARDS & CONTAINERS
   ============================================ */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-primary);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-title i {
    color: var(--brand-primary);
}

/* Account Cards */
.account-card {
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    color: var(--text-inverse);
    box-shadow: var(--shadow-brand);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.account-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    animation: float 10s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-20px, -20px) rotate(180deg); }
}

.account-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px -4px rgba(14, 165, 233, 0.4);
}

.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.account-card-type {
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.account-card-icon {
    font-size: 1.5rem;
    opacity: 0.8;
}

.account-card-balance {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.account-card-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.account-card-detail {
    opacity: 0.9;
}

.account-card-detail-label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.account-card-detail-value {
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* ============================================
   FORMS
   ============================================ */

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

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all var(--transition-base);
    outline: none;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

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

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 1.125rem;
    pointer-events: none; /* CRITICAL FIX: Allow clicks to pass through icon to input field on mobile */
    z-index: 1; /* Keep icon above input but not clickable */
}

.input-group .form-input,
.input-group .form-select {
    padding-left: 3rem;
    position: relative; /* Ensure input is positioned correctly */
    z-index: 2; /* Above icon to receive clicks */
    background: transparent; /* Ensure background doesn't block */
    pointer-events: auto; /* Explicitly enable pointer events on mobile */
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -4px rgba(14, 165, 233, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-secondary);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.btn-success {
    background: var(--gradient-secondary);
    color: var(--text-inverse);
}

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

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

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-harmoniie {
    background: var(--gradient-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-brand);
}

.btn-harmoniie:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -4px rgba(14, 165, 233, 0.35);
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border-left: 4px solid;
}

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.alert-success {
    background: var(--success-bg);
    color: #065f46;
    border-left-color: var(--success);
}

.alert-warning {
    background: var(--warning-bg);
    color: #92400e;
    border-left-color: var(--warning);
}

.alert-error {
    background: var(--error-bg);
    color: #991b1b;
    border-left-color: var(--error);
}

.alert-info {
    background: var(--info-bg);
    color: #1e40af;
    border-left-color: var(--info);
}

/* Tax Notice */
.tax-notice {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid var(--warning);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
    display: none !important;
}

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

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

.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.gap-4 {
    gap: var(--space-md);
}

.gap-6 {
    gap: var(--space-lg);
}

.gap-8 {
    gap: var(--space-xl);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .dashboard-content {
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--brand-primary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-primary-dark);
}

/* ============================================
   MOBILE FIX - Password Input Fields
   ============================================ */

/* Ensure password fields are clickable on mobile devices */
@media (max-width: 768px) {
    .input-icon {
        /* Icon should not block clicks on mobile */
        pointer-events: none !important;
        z-index: 1 !important;
    }
    
    .input-group .form-input,
    .input-group .form-select {
        /* Input fields should receive all touch events */
        pointer-events: auto !important;
        z-index: 2 !important;
        touch-action: manipulation; /* Enable proper touch handling */
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1); /* Visual feedback on tap */
    }
    
    .password-toggle-btn {
        /* Eye icon button should remain clickable */
        pointer-events: auto !important;
        z-index: 10 !important;
        /* Larger touch target for mobile */
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Ensure input fields have minimum touch target size */
    .form-input,
    .form-select {
        min-height: 44px; /* iOS recommended minimum touch target */
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}
