/* 1. Import professional fonts for English and Arabic */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Roboto:wght@400;500;700&display=swap');

:root {
    /* Brand Colors extracted from UI reference */
    --brand-blue: #0A58CA; 
    --brand-dark-blue: #002D56;
    --text-main: #1a1c1e;
    --text-muted: #73777f;
    --bg-color: #f8fafd;
    
    /* Override standard Material purple to use Brand Blue */
    --md-sys-color-primary: var(--brand-blue); 

    /* Force Material Components to use our imported fonts */
    --md-sys-typescale-label-large-font-family: 'Roboto', 'Cairo', sans-serif;
    --md-sys-typescale-label-large-weight: 500;
}

/* 2. Global Base Styles */
body {
    margin: 0;
    font-family: 'Roboto', 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    text-align: center;
}

/* 3. Screen Layout Containers */
.screen-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.header-top {
    display: flex;
    justify-content: flex-end;
}

/* Centers the logo, title, and buttons vertically and horizontally */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

/* 4. Typography & Elements */
.logo {
    width: 200px;
    height: auto;
    margin-bottom: 12px;
}

.title {
    font-size: 26px;
    font-weight: bold;
    margin: 0;
    color: var(--brand-dark-blue);
}

.subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0 0 32px 0;
}

.footer-text {
    font-size: 12px;
    color: var(--text-muted);
    padding: 16px 0;
}

/* 5. Button Container & Overrides */
.btn-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Forces Material buttons to take up the full width of the container */
.btn-container md-filled-button,
.btn-container md-text-button {
    width: 100%;
    --md-filled-button-container-shape: 12px; /* Rounds the button corners */
}

/* Secondary Gray Button override */
.btn-secondary {
    --md-sys-color-primary: #e0e2e7; /* Light gray background */
    --md-sys-color-on-primary: var(--text-main); /* Dark text */
}

/* 6. Bi-directional (RTL) Layout Support for Arabic */
html[dir="rtl"] {
    text-align: right;
}

html[dir="rtl"] .header-top {
    /* In RTL mode, this logically pushes the language toggle to the top left */
    justify-content: flex-end; 
}

/* Wizard Specific Styles */
.btn-gold {
    --md-sys-color-primary: #cda047; /* The wireframe gold */
    --md-sys-color-on-primary: #ffffff;
}

.wizard-container {
    padding: 16px 24px;
    text-align: left; /* Align text to the left for forms */
}

/* --- Vanilla Material UI Overrides --- */

/* 1. Custom Progress Bar */
.wizard-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #eef0f8;
    z-index: 100;
}

.wizard-progress-bar {
    height: 100%;
    background-color: #cda047; /* Wireframe Gold */
    width: 10%; /* Starts at step 1 */
    transition: width 0.4s ease;
}

/* 2. Custom Phone Input Group (Matches Wireframe) */
.custom-input-group {
    display: flex;
    align-items: center;
    width: 100%;
    border: 1px solid var(--text-muted);
    border-radius: 12px;
    padding: 4px 16px;
    box-sizing: border-box;
    background: transparent;
    transition: border-color 0.2s;
    margin-bottom: 24px;
    min-height: 56px;
}

.custom-input-group:focus-within {
    border-color: #cda047; /* Gold focus */
    border-width: 2px;
    padding: 3px 15px; /* Adjusts for border shift */
}

.input-prefix {
    font-weight: 500;
    font-size: 16px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-divider {
    width: 1px;
    height: 24px;
    background-color: #e0e2e7;
    margin: 0 12px;
}

.custom-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    background: transparent;
    color: var(--text-main);
}

.custom-input::placeholder {
    color: #a0a4ab;
}

/* 3. OTP Input Style */
.otp-input {
    width: 100%;
    text-align: center;
    letter-spacing: 16px;
    font-size: 24px;
    font-weight: bold;
    border: 1px solid var(--text-muted);
    border-radius: 12px;
    padding: 16px;
    box-sizing: border-box;
    margin-bottom: 24px;
    outline: none;
    transition: border-color 0.2s;
}

.otp-input:focus {
    border-color: #0A58CA;
    border-width: 2px;
    padding: 15px;
}

/* Linear Progress Bar at the top */
md-linear-progress {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    --md-linear-progress-active-indicator-color: #cda047;
}

/* Step Icon Container */
.step-icon {
    width: 56px;
    height: 56px;
    background-color: #eef0f8; /* Soft background from wireframe */
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--brand-dark-blue);
}

/* Force Material Input & Progress to render dimensions */
md-outlined-text-field {
    width: 100%;
    min-height: 56px; /* Prevents collapsing */
    margin-bottom: 24px;
}

md-linear-progress {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    height: 4px; /* Forces visibility */
    --md-linear-progress-active-indicator-color: #cda047;
}

/* --- Wizard UI Components (Steps 3-10) --- */

/* Radio Cards (For Income, Goals, Duration) */
.radio-card {
    border: 1px solid var(--text-muted);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.radio-card i.fa-circle-dot { display: none; color: #cda047; }
.radio-card i.fa-circle { color: var(--text-muted); }

.radio-card.selected {
    border-color: #cda047;
    background-color: #fbf8f1;
    border-width: 2px;
    padding: 15px 19px; /* Adjust for border width change */
}
.radio-card.selected i.fa-circle-dot { display: inline-block; }
.radio-card.selected i.fa-circle { display: none; }

/* Chip Selectors (For Sector & Nationality) */
.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.chip {
    padding: 10px 20px;
    border: 1px solid var(--text-muted);
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.chip.selected {
    background-color: var(--brand-dark-blue);
    color: #ffffff;
    border-color: var(--brand-dark-blue);
}

/* File Upload Simulation Box */
.upload-box {
    border: 2px dashed #cda047;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
    cursor: pointer;
    color: #cda047;
    font-weight: 600;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.upload-box.success {
    border-color: #1e8e3e;
    border-style: solid;
    color: #1e8e3e;
    background-color: #e6f4ea;
}

/* Risk Profile Display Card */
.risk-card {
    background-color: #eef4ff;
    border: 2px solid var(--brand-blue);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.risk-card h3 {
    color: var(--brand-blue);
    font-size: 28px;
    margin: 0 0 8px 0;
}

.risk-card p {
    color: var(--brand-dark-blue);
    margin: 0;
    font-size: 14px;
}

/* Fix for the wrapping Risk Profile Text */
.risk-card h3 {
    color: var(--brand-blue);
    font-size: 24px; /* Reduced from 28px */
    line-height: 1.2;
    margin: 0 0 8px 0;
}

/* Vanilla HTML Checkbox Styling */
.custom-checkbox-container {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 24px;
    cursor: pointer;
}

.custom-checkbox {
    width: 24px;
    height: 24px;
    min-width: 24px; /* Prevents it from shrinking */
    accent-color: #cda047; /* Makes the native checkmark gold */
    cursor: pointer;
    margin-top: 2px; /* Aligns perfectly with the first line of text */
}

.custom-checkbox-text {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* --- Success Screen Overlay --- */
.success-bg {
    background-color: var(--brand-blue); /* The lighter brand blue you requested */
    position: fixed; /* Covers the entire screen */
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    z-index: 200; 
}

.success-bg h2 {
    color: #ffffff;
    font-size: 32px;
    margin: 16px 0 8px 0;
}

.success-bg .subtitle {
    color: #eef0f8; /* Light gray for contrast */
    margin-bottom: 32px;
}

.success-bg .risk-card {
    width: 100%;
    box-sizing: border-box;
    background-color: #eef4ff; /* Keeps the card light */
    border: none;
    margin-bottom: 32px;
    padding: 32px 24px;
}

/* Center the arrow icon inside the button */
.btn-gold i {
    margin-left: 8px;
}

/* --- Portfolio Dashboard Styles --- */
.dashboard-container {
    padding: 24px 20px 90px 20px; /* 90px bottom padding protects content from the fixed nav */
    position: relative;
    z-index: 2;
}

/* Background Image Anchored to Top */
.dashboard-bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    background-image: url('../images/dashboard-bg.jpg');
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.dashboard-bg-overlay {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    /* Refined Gradient: Dark at the top for text, clear in the middle for the buildings, solid at the bottom to blend */
    background: linear-gradient(to bottom, 
        rgba(10,37,64, 0.85) 0%,    /* Dark top so "Good morning" is readable */
        rgba(10,37,64, 0.1) 50%,    /* Almost completely transparent so the buildings stay sharp! */
        rgba(248,249,252, 1) 100%   /* Solid bottom to blend perfectly into the page */
    );
}

/* Header & Typography */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    color: #ffffff;
    margin-bottom: 24px;
}
.dash-avatar {
    width: 40px; height: 40px;
    background-color: var(--brand-blue);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; margin-right: 12px;
}

/* Dark "New to Investing" Banner */
.invest-banner {
    background-color: rgba(10, 37, 64, 0.95);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex; justify-content: space-between; align-items: center;
    color: white; margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Blue Portfolio Card */
.portfolio-card {
    background: linear-gradient(135deg, #1d68f2 0%, #0b49c4 100%);
    border-radius: 20px;
    padding: 24px;
    color: white;
    box-shadow: 0 8px 24px rgba(29, 104, 242, 0.3);
    margin-bottom: 32px;
    text-align: left; /* Forces all text inside the card to align left */
}

.portfolio-card .total-label { font-size: 14px; opacity: 0.9; margin-bottom: 4px; }
.portfolio-card .total-value { font-size: 32px; font-weight: bold; margin-bottom: 8px; }
.portfolio-card .total-change { font-size: 14px; display: flex; align-items: center; gap: 4px; }
.fund-mini-stats { display: flex; justify-content: space-between; margin-top: 24px; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 16px; }

/* Tabs & Orders */
.section-title { display: flex; justify-content: space-between; align-items: center; font-weight: bold; font-size: 18px; margin-bottom: 16px; color: var(--brand-dark-blue); }
.section-title a { font-size: 14px; color: var(--text-muted); text-decoration: none; font-weight: normal; }

.tabs { display: flex; border-bottom: 1px solid #e0e2e7; margin-bottom: 16px; }
.tab { flex: 1; text-align: center; padding: 12px 0; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; }
.tab.active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); }

.order-card { background: white; border-radius: 12px; padding: 16px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid #f0f2f5; }
.order-card .fund-name { font-weight: 600; color: var(--brand-dark-blue); font-size: 15px; }
.order-card .order-date { font-size: 12px; color: var(--text-muted); }
.order-card .amount { font-weight: bold; font-size: 16px; }
.zero-state { text-align: center; padding: 32px 16px; color: var(--text-muted); background: white; border-radius: 12px; border: 1px dashed #cfd4dc; }

/* Help Section */
.help-card { background: white; border-radius: 16px; padding: 16px; margin-bottom: 12px; display: flex; align-items: center; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.help-icon { width: 40px; height: 40px; border-radius: 12px; background: #f8f9fc; display: flex; align-items: center; justify-content: center; margin-right: 16px; color: var(--brand-blue); font-size: 18px; }

/* Bottom Navigation Menu */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: white; border-top: 1px solid #e0e2e7;
    display: flex; justify-content: space-around; padding: 12px 0 24px 0; /* Extra bottom padding for iPhone home indicator */
    z-index: 100; box-shadow: 0 -4px 12px rgba(0,0,0,0.03);
}
.nav-item { display: flex; flex-direction: column; align-items: center; color: var(--text-muted); font-size: 11px; text-decoration: none; gap: 4px; }
.nav-item.active { color: var(--brand-blue); font-weight: 600; }
.nav-item i { font-size: 20px; }

/* --- Notifications Panel --- */
.notif-panel {
    position: fixed;
    top: 0; right: -100%; /* Hidden off-screen by default */
    width: 100%; height: 100%;
    background-color: #f8f9fc;
    z-index: 300;
    transition: right 0.3s ease;
    display: flex; flex-direction: column;
}

.notif-panel.open {
    right: 0;
}

.notif-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 24px 20px 16px 20px;
    background: #f8f9fc;
    position: sticky; top: 0; z-index: 301;
}

.notif-header h2 { margin: 0; font-size: 24px; color: var(--brand-dark-blue); }
.mark-all-btn { color: #cda047; font-weight: 600; font-size: 14px; cursor: pointer; border: none; background: none; }
.close-notif-btn { font-size: 20px; color: var(--brand-dark-blue); cursor: pointer; margin-right: 12px; }

.notif-list {
    padding: 0 20px 24px 20px;
    overflow-y: auto;
    flex: 1;
}

/* Notification Cards */
.notif-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    cursor: pointer;
    transition: opacity 0.2s, background-color 0.2s;
}

.notif-card.read {
    opacity: 0.6; /* Faded out if read */
    box-shadow: none;
    border: 1px solid #e0e2e7;
}

.notif-content { flex: 1; }
.notif-title-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.notif-title { font-size: 15px; font-weight: 700; color: var(--brand-dark-blue); }
.notif-card.read .notif-title { font-weight: 600; } /* Less bold when read */
.notif-time { font-size: 12px; color: #a0a4ab; }
.notif-message { font-size: 13px; color: var(--text-muted); line-height: 1.4; }

/* Notification Badge on Bell Icon */
.bell-container { position: relative; cursor: pointer; }
.notif-badge {
    position: absolute; top: -2px; right: -2px;
    background-color: #d93025; color: white;
    font-size: 10px; font-weight: bold;
    width: 16px; height: 16px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    display: none; /* Hidden if 0 */
}

/* --- Notification Read Checkmark --- */
/* Update the existing placeholder to center the icon */
.notif-icon-placeholder {
    width: 40px; height: 40px; min-width: 40px;
    background-color: #f0f2f5;
    border-radius: 12px;
    display: flex;             /* Added to center the icon */
    align-items: center;       /* Added to center the icon */
    justify-content: center;   /* Added to center the icon */
}

/* Updated Icon Styling */
.notif-read-icon {
    color: #1e8e3e; 
    font-size: 20px; /* Increased size to fit the box nicely */
    display: none !important; /* Force hide on unread */
}

/* Force show ONLY when the card is read */
.notif-card.read .notif-read-icon {
    display: block !important; 
}

/* Reveal the checkmark when the card is read */
.notif-card.read .notif-read-icon {
    display: inline-block;
}

/* --- Funds Catalogue Styles --- */

/* Search & Filters */
.search-container {
    display: flex; gap: 12px; margin-bottom: 20px;
}
.search-bar {
    flex: 1; position: relative;
    background: white; border-radius: 12px;
    display: flex; align-items: center; padding: 0 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); border: 1px solid #f0f2f5;
}
.search-bar input {
    border: none; outline: none; background: transparent;
    padding: 14px 0 14px 12px; width: 100%; font-size: 15px; color: var(--brand-dark-blue);
}
.search-bar i { color: #a0a4ab; }
.filter-btn {
    width: 48px; height: 48px; background: white; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); border: 1px solid #f0f2f5;
    color: var(--brand-blue); font-size: 18px; cursor: pointer;
}

.pill-scroller {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 24px;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.pill-scroller::-webkit-scrollbar { display: none; } /* Hide scrollbar Chrome/Safari */

.filter-pill {
    padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
    white-space: nowrap; cursor: pointer;
    background: white; border: 1px solid #e0e2e7; color: var(--text-muted);
}
.filter-pill.active { background: var(--brand-blue); color: white; border-color: var(--brand-blue); }

/* Recommended Fund Cards (Horizontal Scroll) */
.recommended-scroller {
    display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; margin-bottom: 24px;
    scrollbar-width: none;
}
.recommended-scroller::-webkit-scrollbar { display: none; }

.rec-fund-card {
    min-width: 240px; background: linear-gradient(135deg, #2b7afc 0%, #1a5ac6 100%);
    border-radius: 16px; padding: 20px; color: white;
    box-shadow: 0 6px 16px rgba(29, 104, 242, 0.2);
}
.rec-fund-card .fund-type { font-size: 11px; opacity: 0.8; margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; }
.rec-fund-card .fund-name { font-size: 16px; font-weight: bold; margin-bottom: 24px; }
.rec-fund-card .fund-nav { font-size: 24px; font-weight: bold; margin-bottom: 8px; }
.rec-fund-card .fund-change { display: inline-block; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,0.2); }

/* Standard List Cards */
.list-fund-card {
    background: white; border-radius: 16px; padding: 16px; margin-bottom: 12px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); border: 1px solid #f0f2f5;
    text-decoration: none; color: inherit;
}
.list-fund-card .fund-icon {
    width: 48px; height: 48px; border-radius: 12px; background: #eef4ff; color: var(--brand-blue);
    display: flex; align-items: center; justify-content: center; font-size: 20px; margin-right: 16px;
}
.list-fund-card .type-label { font-size: 11px; color: var(--brand-blue); font-weight: 600; margin-bottom: 2px; }
.list-fund-card .fund-name { font-weight: bold; color: var(--brand-dark-blue); font-size: 15px; margin-bottom: 4px; }
.list-fund-card .fund-nav { font-weight: bold; font-size: 14px; }
.list-fund-card .perf-col { text-align: right; }
.list-fund-card .perf-change { font-size: 12px; font-weight: 600; margin-top: 4px; }

/* --- Fund Details Styles --- */
.fund-detail-header {
    background: linear-gradient(180deg, rgba(10,37,64,1) 0%, rgba(15,48,87,1) 100%);
    color: white; padding: 24px 20px 40px 20px;
    border-bottom-left-radius: 24px; border-bottom-right-radius: 24px;
    margin-bottom: 24px;
    text-align: left; /* Added */
}
.back-btn {
    width: 40px; height: 40px; background: rgba(255,255,255,0.1);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; text-decoration: none; font-size: 18px; margin-right: 16px;
}
.chart-container {
    height: 200px; width: 100%; margin-top: 24px; position: relative;
}
.timeframe-filters {
    display: flex; gap: 12px; margin-top: 16px;
}
.timeframe-btn {
    padding: 6px 12px; border-radius: 16px; font-size: 12px; font-weight: 600;
    color: rgba(255,255,255,0.6); cursor: pointer; border: 1px solid transparent;
}
.timeframe-btn.active {
    background: rgba(205, 160, 71, 0.2); color: #cda047; border-color: rgba(205, 160, 71, 0.5);
}

.stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 20px; margin-bottom: 24px;
}
.stat-box {
    background: white; border-radius: 16px; padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); border: 1px solid #f0f2f5;
    text-align: left; /* Added */
}
.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat-value { font-size: 15px; font-weight: bold; color: var(--brand-dark-blue); }

.allocation-section, .doc-section {
    background: white; border-radius: 16px; padding: 20px; margin: 0 20px 24px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); border: 1px solid #f0f2f5;
    text-align: left; /* Added */
}
.doc-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid #f0f2f5; cursor: pointer;
}
.doc-row:last-child { border-bottom: none; padding-bottom: 0; }
.doc-row i.fa-download { color: var(--brand-blue); background: #eef4ff; padding: 8px; border-radius: 8px; }

/* Fixed Bottom Action Bar */
.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 16px 20px 24px 20px; /* Safe padding for mobile bottoms */
    display: flex;
    gap: 16px; /* Space between the two buttons */
    box-sizing: border-box; /* CRITICAL: Prevents padding from pushing width > 100% */
    border-top: 1px solid #f0f2f5;
    z-index: 100;
}
.action-btn {
    flex: 1; padding: 16px; border-radius: 12px; font-weight: bold; font-size: 16px;
    text-align: center; cursor: pointer; border: none;
}
.btn-buy { background: #cda047; color: white; }
.btn-sell { background: var(--brand-dark-blue); color: white; }

/* --- Order Review Styles --- */
.order-header-card {
    background: linear-gradient(135deg, rgba(10,37,64,1) 0%, rgba(15,48,87,1) 100%);
    border-radius: 16px; padding: 20px; color: white; margin-bottom: 16px;
}
.order-header-card .sub-text { font-size: 13px; color: rgba(255,255,255,0.7); margin-bottom: 4px; }
.order-header-card .fund-title { font-size: 16px; font-weight: bold; margin-bottom: 12px; }
.order-header-card .fund-pill {
    display: inline-block; background: rgba(255,255,255,0.1); color: #8ab4f8;
    padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
}

.input-card {
    background: white; border-radius: 16px; padding: 20px; margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); border: 1px solid #f0f2f5;
}
.input-label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.amount-input-wrapper { display: flex; align-items: baseline; gap: 8px; border-bottom: 2px solid #e0e2e7; padding-bottom: 8px; }
.amount-input-wrapper span { font-size: 24px; font-weight: bold; color: var(--brand-dark-blue); }
.amount-input-wrapper input {
    border: none; outline: none; font-size: 32px; font-weight: bold; color: var(--brand-dark-blue);
    width: 100%; background: transparent; padding: 0;
}
.amount-input-wrapper input::placeholder { color: #cfd4dc; }
.wallet-balance-text { font-size: 12px; color: var(--text-muted); margin-top: 8px; display: flex; justify-content: space-between; }

.fee-breakdown {
    background: white; border-radius: 16px; padding: 20px; margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); border: 1px solid #f0f2f5;
}
.fee-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 12px; color: var(--text-muted); }
.fee-row.total { font-weight: bold; color: var(--brand-dark-blue); border-top: 1px solid #f0f2f5; padding-top: 12px; margin-bottom: 0; }
.fee-row.total .net-val { color: #1e8e3e; }

.warning-box {
    background: #fef7e0; color: #b08a28; padding: 12px 16px; border-radius: 12px;
    font-size: 13px; font-weight: 500; display: flex; gap: 8px; align-items: center; margin-bottom: 24px;
}

.terms-checkbox {
    display: flex; gap: 12px; align-items: flex-start; margin-bottom: 32px;
}
.terms-checkbox input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand-blue); cursor: pointer; }
.terms-checkbox label { font-size: 13px; color: var(--text-muted); line-height: 1.5; cursor: pointer; }

.btn-confirm {
    width: 100%; background: #e0e2e7; color: #a0a4ab; border: none; padding: 16px;
    border-radius: 12px; font-size: 16px; font-weight: bold; cursor: not-allowed; transition: all 0.3s ease;
}
.btn-confirm.active {
    background: var(--brand-blue); color: white; cursor: pointer;
    box-shadow: 0 4px 12px rgba(29, 104, 242, 0.3);
}

/* --- Insights Page Styles --- */

/* Market Pulse Grid */
.market-pulse-card {
    background: linear-gradient(135deg, #1d68f2 0%, #0b49c4 100%);
    border-radius: 16px; padding: 20px; color: white; margin-bottom: 32px;
}
.market-pulse-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px;
}
.pulse-box {
    background: rgba(255, 255, 255, 0.15); border-radius: 12px; padding: 16px;
}
.pulse-title { font-size: 12px; opacity: 0.9; margin-bottom: 8px; }
.pulse-val { font-size: 20px; font-weight: bold; margin-bottom: 4px; }
.pulse-change { font-size: 12px; font-weight: 600; }
.pulse-change.up { color: #81c995; }
.pulse-change.down { color: #f28b82; }
.pulse-change.neutral { opacity: 0.8; }

/* YTD Category Grid */
.ytd-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 32px;
}
.ytd-card {
    background: white; border-radius: 16px; padding: 20px; text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); border: 1px solid #f0f2f5;
}
.donut-chart {
    width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 12px auto;
    background: conic-gradient(var(--brand-blue) var(--percent), #eef0f8 0);
    display: flex; align-items: center; justify-content: center;
}
.donut-inner {
    width: 36px; height: 36px; background: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--brand-blue); font-size: 14px;
}
.ytd-title { font-size: 14px; font-weight: 500; color: var(--brand-dark-blue); margin-bottom: 4px; }
.ytd-val { font-size: 16px; font-weight: bold; color: #1e8e3e; }

/* Accordion Component */
.accordion-wrapper {
    background: white; border-radius: 16px; margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); border: 1px solid #f0f2f5; overflow: hidden;
}
.accordion-header {
    padding: 16px 20px; display: flex; align-items: flex-start; gap: 16px;
    cursor: pointer; background: white; transition: background 0.2s;
}
.accordion-header:active { background: #f8f9fc; }
.accordion-icon {
    width: 24px; font-size: 18px; color: var(--brand-blue); margin-top: 2px;
}
.accordion-title-area { flex: 1; text-align: left;}
.accordion-tag {
    display: inline-block; background: #eef4ff; color: var(--brand-blue);
    padding: 4px 8px; border-radius: 4px; font-size: 10px; font-weight: bold; margin-bottom: 6px; text-transform: uppercase;
}
.accordion-title { font-size: 15px; font-weight: 500; color: var(--brand-dark-blue); margin-bottom: 2px;}
.accordion-subtitle { font-size: 12px; color: var(--text-muted); }
.accordion-toggle {
    width: 28px; height: 28px; background: #f8f9fc; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 12px;
    transition: transform 0.3s;
}
.accordion-wrapper.active .accordion-toggle { transform: rotate(180deg); }
.accordion-content {
    display: none; padding: 0 20px 20px 20px; text-align: left;
}
.accordion-wrapper.active .accordion-content { display: block; }
.accordion-content p { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 16px; }

/* Accordion Inner Grid */
.factsheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.factsheet-card {
    background: #f8f9fc; border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 12px;
}
.factsheet-card .icon {
    width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.factsheet-card .name { font-size: 13px; color: var(--text-muted); margin-bottom: 2px; }
.factsheet-card .val { font-size: 13px; font-weight: bold; color: var(--brand-dark-blue); }
.btn-view-all {
    width: 100%; padding: 12px; border-radius: 8px; background: #eef4ff; color: var(--brand-blue);
    border: none; font-weight: bold; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* Info Banner */
.info-banner {
    background: #eef4ff; border-radius: 16px; padding: 16px 20px; display: flex; align-items: flex-start; gap: 16px; margin-top: 24px; margin-bottom: 32px;
}
.info-banner i { color: var(--brand-blue); font-size: 20px; margin-top: 2px; }
.info-banner p { margin: 0; font-size: 14px; color: var(--text-main); line-height: 1.5; text-align: left; }

/* --- Profile Page Styles --- */

.profile-user-card {
    background: var(--brand-dark-blue);
    border-radius: 20px;
    padding: 24px;
    color: white;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 45, 86, 0.15);
}

.profile-avatar-large {
    width: 64px; height: 64px;
    background-color: #cda047;
    color: var(--brand-dark-blue);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: bold;
}

.profile-stats-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 24px;
}

.profile-stat-box {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px; padding: 12px; text-align: center;
}

.profile-section-title {
    font-size: 13px; font-weight: bold; color: #a0a4ab;
    letter-spacing: 1px; text-transform: uppercase;
    margin: 32px 0 12px 16px; text-align: left;
}

.profile-list-group {
    background: white; border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03); border: 1px solid #f0f2f5;
    overflow: hidden; margin-bottom: 24px;
}

.profile-list-item {
    display: flex; align-items: center; padding: 16px 20px;
    border-bottom: 1px solid #f0f2f5; text-decoration: none; color: inherit;
    transition: background 0.2s; cursor: pointer;
}
.profile-list-item:active { background: #f8f9fc; }
.profile-list-item:last-child { border-bottom: none; }

.profile-list-icon {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; margin-right: 16px; flex-shrink: 0;
}
.profile-list-icon.gray { background: #f8f9fc; color: var(--brand-dark-blue); }
.profile-list-icon.blue { background: #eef4ff; color: var(--brand-blue); }
.profile-list-icon.red { background: #fce8e6; color: #d93025; }

.profile-list-text { flex: 1; text-align: left; }
.profile-list-title { font-size: 15px; font-weight: 600; color: var(--brand-dark-blue); margin-bottom: 2px; }
.profile-list-subtitle { font-size: 13px; color: var(--text-muted); }

.profile-chevron { color: #cfd4dc; font-size: 14px; margin-left: 12px; }

/* Badges */
.badge-pill {
    padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; margin-left: 8px;
}
.badge-green { background: #e6f4ea; color: #1e8e3e; }
.badge-gold { background: #fef7e0; color: #b08a28; }
.badge-red { background: #d93025; color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; padding: 0; }

.btn-sign-out {
    width: 100%; padding: 16px; border-radius: 16px;
    background: transparent; color: #d93025; border: 2px solid #d93025;
    font-size: 16px; font-weight: bold; display: flex; align-items: center; justify-content: center; gap: 8px;
    cursor: pointer; margin-bottom: 24px; transition: 0.2s;
}
.btn-sign-out:active { background: #fce8e6; }