/* LibertyFundz - Modern American Financial Services Theme
   Clean, Professional Light Theme with Patriotic Accents */

/* Import premium fonts */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* CSS Variables - American Professional Theme */
:root {
    /* Primary colors - Navy Blue (American) */
    --primary: #1e3a5f;
    --primary-light: #2c5282;
    --primary-dark: #1a365d;
    --primary-glow: rgba(30, 58, 95, 0.15);
    
    /* Accent - American Red & Gold */
    --accent: #c41e3a;
    --accent-light: #dc3545;
    --accent-dark: #a31830;
    --accent-gold: #d4af37;
    
    /* Background - Clean white/light grays */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.9);
    
    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* Status colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #c41e3a;
    --info: #1e3a5f;
    
    /* Borders & shadows */
    --border: #e2e8f0;
    --border-glow: rgba(13, 148, 136, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 30px var(--primary-glow);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background patterns - subtle for light theme */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(13, 148, 136, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(245, 158, 11, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
    color: var(--text-secondary);
    max-width: 65ch;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-md) 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: all var(--transition-base);
}

.navbar.scrolled {
    padding: var(--space-sm) 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-sm);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

/* Liberty Logo - American themed */
.logo-icon.liberty-logo {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 50%, #1a365d 100%);
    position: relative;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.logo-icon.liberty-logo::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #d4af37 0%, #c41e3a 100%);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: var(--space-sm) 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-base);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 20px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: white;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 20px rgba(245, 158, 11, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: var(--space-sm);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1.1rem;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Form Elements */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-label.required::after {
    content: '*';
    color: var(--danger);
    margin-left: var(--space-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-md);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
    padding-right: var(--space-2xl);
}

.form-hint {
    margin-top: var(--space-xs);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: var(--space-xs);
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group .form-input {
    padding-left: calc(var(--space-md) * 2 + 1.25rem);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
}

.form-check input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(80px + var(--space-2xl)) 0 var(--space-2xl);
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.hero-content {
    max-width: 700px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.hero-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero h1 {
    margin-bottom: var(--space-lg);
}

.hero h1 span {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: var(--space-xl);
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: var(--space-2xl);
    margin-top: var(--space-2xl);
    padding-top: var(--space-2xl);
    border-top: 1px solid var(--border);
}

.stat-item {
    text-align: left;
}

.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value span {
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Section Styles */
.section {
    padding: var(--space-2xl) 0;
}

.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto var(--space-2xl);
}

.section-header h2 {
    margin-bottom: var(--space-md);
}

/* Loan Plans Grid */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: var(--space-xl);
}

.plan-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    overflow: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--plan-color, var(--primary));
}

.plan-card:hover {
    transform: translateY(-8px);
    border-color: var(--plan-color, var(--primary));
    box-shadow: var(--shadow-lg);
}

.plan-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: var(--space-lg);
    background: linear-gradient(135deg, var(--plan-color, var(--primary)) 0%, transparent 100%);
    color: var(--plan-color, var(--primary));
}

.plan-name {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.plan-description {
    font-size: 0.95rem;
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

.plan-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.plan-detail {
    text-align: center;
}

.plan-detail-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.plan-detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.auth-container {
    width: 100%;
    max-width: 480px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-header .logo {
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-xl);
    color: var(--text-secondary);
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
    padding-top: 70px;
    background: var(--bg-secondary);
}

.sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 280px;
    height: calc(100vh - 70px);
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    padding: var(--space-xl);
    overflow-y: auto;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: var(--space-xs);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-nav a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: var(--space-xl);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.page-title {
    font-size: 1.75rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card-content h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.stat-card-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.table-title {
    font-size: 1.1rem;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-secondary);
}

th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: var(--bg-tertiary);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
}

.badge-pending {
    background: rgba(251, 191, 36, 0.15);
    color: #b45309;
}

.badge-under_review {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}

.badge-approved {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.badge-declined {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.badge-disbursed {
    background: rgba(13, 148, 136, 0.15);
    color: var(--primary-dark);
}

.badge-completed {
    background: rgba(107, 114, 128, 0.15);
    color: #4b5563;
}

.badge-processing {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
}

.badge-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.badge-cancelled {
    background: rgba(107, 114, 128, 0.15);
    color: #4b5563;
}

/* Progress Tracker */
.progress-tracker {
    display: flex;
    justify-content: space-between;
    margin: var(--space-xl) 0;
    position: relative;
}

.progress-tracker::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: var(--border);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.progress-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
    transition: all var(--transition-base);
}

.progress-step.active .progress-step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

.progress-step.completed .progress-step-circle {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.progress-step-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

.progress-step.active .progress-step-label,
.progress-step.completed .progress-step-label {
    color: var(--text-primary);
}

/* Alerts */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #047857;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #b91c1c;
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #b45309;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #1d4ed8;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-sm);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-xl);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-xl);
    border-top: 1px solid var(--border);
}

/* Loan Calculator */
.calculator {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-sm);
}

.calculator-result {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-top: var(--space-xl);
    text-align: center;
}

.calculator-result h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
}

.calculator-amount {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.calculator-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

/* Range Slider */
.range-slider {
    position: relative;
    margin: var(--space-lg) 0;
}

.range-slider input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: 4px;
    outline: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary-glow);
}

.range-value {
    position: absolute;
    right: 0;
    top: -30px;
    font-weight: 600;
    color: var(--primary);
}

/* Footer */
.footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: var(--space-2xl) 0;
    margin-top: var(--space-2xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-2xl);
}

.footer-brand {
    max-width: 300px;
}

.footer-brand p {
    margin-top: var(--space-md);
    font-size: 0.9rem;
}

.footer-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Wallet Card Styling */
.wallet-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    color: white;
}

.wallet-card h3,
.wallet-card p {
    color: white;
}

.wallet-card .text-muted {
    color: rgba(255, 255, 255, 0.7);
}

/* ========================================
   RESPONSIVE DESIGN - Mobile First
   ======================================== */

/* Extra Small Devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    :root {
        --space-lg: 1rem;
        --space-xl: 1.5rem;
        --space-2xl: 2rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .container {
        padding: 0 var(--space-md);
    }
    
    /* Navigation */
    .navbar {
        padding: var(--space-sm) 0;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .logo span {
        display: none;
    }
    
    .nav-links {
        display: none;
    }
    
    .nav-actions {
        gap: var(--space-sm);
    }
    
    .nav-actions .btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.85rem;
    }
    
    /* Hero */
    .hero {
        padding: calc(70px + var(--space-lg)) 0 var(--space-lg);
        min-height: auto;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: var(--space-xs) var(--space-sm);
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--space-md);
        margin-top: var(--space-lg);
        padding-top: var(--space-lg);
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    /* Cards */
    .card {
        padding: var(--space-md);
        border-radius: var(--radius-md);
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    /* Dashboard */
    .dashboard {
        padding-top: 60px;
    }
    
    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        z-index: 100;
        transition: max-height var(--transition-base), padding var(--transition-base);
    }
    
    .sidebar.open {
        max-height: 100vh;
        padding: var(--space-md);
        overflow-y: auto;
    }
    
    .main-content {
        margin-left: 0;
        padding: var(--space-md);
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .stat-card {
        padding: var(--space-md);
    }
    
    .stat-card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .stat-card-content h3 {
        font-size: 1.5rem;
    }
    
    /* Tables - Responsive */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    th, td {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.85rem;
    }
    
    /* Plans Grid */
    .plans-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .plan-card {
        padding: var(--space-md);
    }
    
    .plan-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .plan-details {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
        padding: var(--space-md);
    }
    
    /* Auth */
    .auth-page {
        padding: var(--space-md);
    }
    
    .auth-card {
        padding: var(--space-lg);
    }
    
    /* Calculator */
    .calculator {
        padding: var(--space-lg);
    }
    
    .calculator-amount {
        font-size: 2rem;
    }
    
    .calculator-breakdown {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    /* Progress Tracker */
    .progress-tracker {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    
    .progress-tracker::before {
        display: none;
    }
    
    .progress-step {
        flex-direction: row;
        gap: var(--space-md);
    }
    
    .progress-step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    /* Footer */
    .footer {
        padding: var(--space-xl) 0;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    /* Modal */
    .modal {
        margin: var(--space-sm);
        max-height: calc(100vh - var(--space-lg));
        border-radius: var(--radius-lg);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-md);
    }
    
    /* Buttons */
    .btn-lg {
        padding: var(--space-md) var(--space-lg);
        font-size: 1rem;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: var(--space-md);
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: var(--space-md);
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .form-check {
        font-size: 0.9rem;
    }
    
    .form-check input {
        width: 18px;
        height: 18px;
    }
    
    /* Wallet Card */
    .wallet-card {
        padding: var(--space-md);
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .nav-links {
        display: none;
    }
    
    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        top: 70px;
        left: 0;
        width: 260px;
        height: calc(100vh - 70px);
        transform: translateX(-100%);
        z-index: 100;
        transition: transform var(--transition-base);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .nav-links {
        display: flex;
        gap: var(--space-lg);
    }
    
    .sidebar {
        position: fixed;
        top: 70px;
        left: 0;
        width: 240px;
        height: calc(100vh - 70px);
        transform: translateX(-100%);
        z-index: 100;
        transition: transform var(--transition-base);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .calculator-breakdown {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .sidebar {
        width: 260px;
    }
    
    .main-content {
        margin-left: 260px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .plans-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 2fr repeat(3, 1fr);
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        margin-left: 280px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .plans-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-sm);
}

@media (max-width: 991.98px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        border-color: var(--border);
        box-shadow: var(--shadow-sm);
    }
    
    .plan-card:hover {
        transform: none;
    }
    
    /* Larger touch targets */
    .btn {
        min-height: 44px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        min-height: 44px;
    }
    
    .sidebar-nav a {
        min-height: 48px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .sidebar,
    .nav-actions,
    .btn,
    .footer {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: calc(60px + var(--space-md)) 0 var(--space-md);
    }
    
    .auth-page {
        padding: var(--space-md);
    }
    
    .auth-card {
        padding: var(--space-md);
    }
}

/* Animation utilities */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: #b45309; }
.text-danger { color: #b91c1c; }
.text-muted { color: var(--text-muted); }

.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.hidden { display: none !important; }
.visible { display: block !important; }
