@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #f8fafc; /* Clean Slate Light Tone */
    --bg-surface: #ffffff; /* Crisp White Cards & Panels */
    --bg-navy: #0f172a; /* Deep Oxford Navy */
    --bg-navy-surface: #1e293b; /* Rich Slate Navy */
    --accent-primary: #2563eb; /* Royal Institutional Blue */
    --accent-primary-hover: #1d4ed8;
    --accent-success: #059669; /* Fiscal Green */
    --accent-success-hover: #047857;
    --accent-warning: #d97706; /* Compliance Amber */
    --text-primary: #1e293b; /* Deep Slate Black */
    --text-secondary: #64748b; /* Professional Muted Slate */
    --text-white: #ffffff;
    --border-color: #e2e8f0; 
    --border-navy: #334155;
    --font-main: 'Montserrat', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

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

ul {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.text-navy { color: var(--bg-navy) !important; }
.text-blue { color: var(--accent-primary) !important; }
.text-green { color: var(--accent-success) !important; }

.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Institutional Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-navy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-md);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 76px;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.65rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.5px;
}

.logo span {
    color: #38bdf8; /* Vibrant Royal Accent for 'Funded' */
}

.nav-links {
    display: flex;
    gap: 1.4rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links > li {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-links a, .nav-dropdown-btn {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 400;
    font-size: 0.93rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    padding: 0.5rem 0.2rem;
}

.nav-links a:hover, .nav-links a.active,
.nav-dropdown-btn:hover, .nav-dropdown:hover .nav-dropdown-btn {
    color: #38bdf8;
    font-weight: 400;
}

/* Institutional Fintech Dropdown Navigation */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    box-shadow: 0 20px 30px -5px rgba(0, 0, 0, 0.6), 0 10px 15px -5px rgba(0, 0, 0, 0.3);
    min-width: 240px;
    padding: 0.6rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 3000;
    list-style: none;
    display: flex;
    flex-direction: column;
}

.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu li {
    width: 100%;
    display: block;
}

.nav-dropdown-menu a {
    display: flex !important;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1.3rem !important;
    color: #cbd5e1 !important;
    font-size: 0.89rem !important;
    font-weight: 400 !important;
    border-left: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    width: 100%;
}

.nav-dropdown-menu a:hover {
    background: rgba(56, 189, 248, 0.08);
    color: #38bdf8 !important;
    border-left-color: #38bdf8;
    padding-left: 1.55rem !important;
}

.nav-dropdown-menu .dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.5rem 0;
    width: 100%;
    display: block;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Institutional Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.3rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    font-family: var(--font-main);
    font-size: 0.93rem;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background-color: var(--accent-primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-outline-dark {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline-dark:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--text-primary);
}

.btn-success {
    background-color: var(--accent-success);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}
.btn-success:hover {
    background-color: var(--accent-success-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Hero Section */
.hero {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    padding-top: 110px;
    padding-bottom: 70px;
    background: linear-gradient(180deg, var(--bg-navy) 0%, #0b1120 100%);
    color: #ffffff;
    position: relative;
}

.hero h1 {
    font-size: 3.3rem;
    margin-bottom: 1.25rem;
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.15rem;
    color: #94a3b8;
    margin-bottom: 2.2rem;
}

/* Glass & Clean Cards */
.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 2.2rem;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}
.glass-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

.glass-card-navy {
    background: var(--bg-navy-surface);
    border: 1px solid var(--border-navy);
    border-radius: 10px;
    padding: 2.2rem;
    transition: var(--transition);
    color: #ffffff;
}
.glass-card-navy:hover {
    transform: translateY(-3px);
    border-color: #475569;
}

/* Challenges & Pricing - Standard Grid */
.challenges-section {
    padding: 5.5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3.5rem;
}
.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 0.85rem;
    font-weight: 800;
}
.section-title p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 680px;
    margin: 0 auto;
}

/* Compact Square Pricing Grid for Challenges */
.square-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.square-pricing-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.6rem 1.3rem;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 330px;
}

.square-pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: #3b82f6;
}

.square-pricing-card h3 {
    font-size: 1.15rem;
    color: var(--bg-navy);
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.square-pricing-card .account-size {
    font-size: 1.85rem;
    font-weight: 800;
    color: #2563eb;
    margin-bottom: 1.25rem;
    letter-spacing: -0.5px;
}

.square-pricing-card ul {
    text-align: left;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    flex-grow: 1;
}

.square-pricing-card ul li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
}

.square-pricing-card ul li span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.square-pricing-card .price-tag {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--bg-navy);
    margin-bottom: 1rem;
}

/* Auth Split Layout (Image LEFT, Form RIGHT) */
.auth-split-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2.5rem;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    min-height: 580px;
}

.auth-visual-side {
    position: relative;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3.5rem;
    color: #ffffff;
    overflow: hidden;
}

.auth-visual-side img.bg-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.45;
    transition: transform 10s ease;
}

.auth-visual-side:hover img.bg-image {
    transform: scale(1.05);
}

.auth-visual-content {
    position: relative;
    z-index: 2;
}

.auth-form-side {
    padding: 3.5rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Forms */
.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

th {
    padding: 0.9rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-navy);
    color: #ffffff;
    font-weight: 600;
    background: var(--bg-navy);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.92rem;
}

tr:nth-child(even) td { background: #f8fafc; }
tr:hover td { background: #f1f5f9; }

/* Badges */
.status-badge {
    padding: 0.28rem 0.7rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-pending { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.status-funded { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.status-failed { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Alerts */
.alert {
    padding: 0.9rem 1.2rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.92rem;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error, .alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    opacity: 0;
    transform: translateY(15px);
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Financial Summary Widget (Multi-Account Calculation) */
.summary-widget-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.summary-stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.summary-stat-card.primary { border-top: 4px solid #2563eb; }
.summary-stat-card.success { border-top: 4px solid #10b981; }
.summary-stat-card.warning { border-top: 4px solid #f59e0b; }
.summary-stat-card.info    { border-top: 4px solid #38bdf8; }

.stat-label {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--bg-navy);
    line-height: 1.2;
}

/* KYC Badges & Admin Modal Window */
.kyc-badge {
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.kyc-badge.approved { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.kyc-badge.pending  { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.kyc-badge.rejected { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.kyc-badge.none     { background: #e2e8f0; color: #475569; border: 1px solid #cbd5e1; }

.admin-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.admin-modal-window {
    background: #ffffff;
    border-radius: 12px;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    border: 1px solid #cbd5e1;
    position: relative;
    padding: 2.2rem;
}

/* Universal Hamburger Menu Navigation */
.hamburger-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2001;
}

.hamburger-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #ffffff;
    border-radius: 3px;
    transition: var(--transition);
}

.hamburger-toggle.open span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}
.hamburger-toggle.open span:nth-child(2) {
    opacity: 0;
}
.hamburger-toggle.open span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

.mobile-nav-drawer {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 85%;
    max-width: 380px;
    height: calc(100vh - 70px);
    background: #0f172a;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: -15px 0 35px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    padding: 2.2rem 1.8rem;
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-nav-drawer.open {
    right: 0;
}

.mobile-nav-drawer ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mobile-nav-drawer a {
    color: #cbd5e1;
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav-drawer a.active, .mobile-nav-drawer a:hover {
    color: #38bdf8;
    padding-left: 0.5rem;
}

/* Comprehensive Mobile & Tablet Adaptability (Responsive) */
@media (max-width: 992px) {
    .auth-split-layout {
        grid-template-columns: 1fr;
    }
    .auth-visual-side {
        padding: 2.5rem;
        min-height: 260px;
    }
    .auth-form-side {
        padding: 2.5rem 2rem;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    
    /* Reveal hamburger toggle and hide desktop nav on tablets & phones */
    .navbar {
        justify-content: space-between;
    }
    .nav-links, .nav-buttons {
        display: none !important;
    }
    .hamburger-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.2rem;
    }
    .hero {
        padding-top: 140px;
        text-align: center;
    }
    .hero h1 {
        font-size: 2.15rem;
    }
    .square-pricing-grid {
        grid-template-columns: 1fr;
    }
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    .auth-form-side {
        padding: 2rem 1.2rem;
    }
    .summary-widget-grid {
        grid-template-columns: 1fr;
    }
    
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: #ffffff;
        box-shadow: var(--shadow-sm);
    }
    td {
        border: none;
        border-bottom: 1px solid #f1f5f9;
        position: relative;
        padding: 0.85rem 1rem 0.85rem 45%;
        text-align: right;
    }
    td:before {
        position: absolute;
        top: 0.85rem;
        left: 1rem;
        width: 42%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 700;
        color: var(--bg-navy);
        content: attr(data-label);
    }
}
/* Client Portal Supplemental Sidebar Layout */
.client-layout-wrapper {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.client-sidebar-container {
    width: 280px;
    flex-shrink: 0;
    margin-top: 130px;
}

.client-sidebar {
    position: sticky;
    top: 130px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.client-main-content {
    flex: 1;
    min-width: 0;
}

.sidebar-widget {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    text-align: center;
}
.sidebar-widget h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.85rem;
    color: #0f172a;
    font-weight: 700;
}
.sidebar-widget p {
    margin: 0 0 1rem 0;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}

@media (max-width: 991px) {
    .client-layout-wrapper {
        flex-direction: column;
    }
    .client-sidebar-container {
        width: 100%;
        margin-top: 2rem;
        margin-bottom: 3rem;
    }
    .client-sidebar {
        position: static;
    }
}
/* Refined Sidebar Navigation */
.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.8rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}
.sidebar-nav a:hover {
    background: transparent;
    color: #0f172a;
    border-left: 2px solid #cbd5e1;
}
.sidebar-nav a.active {
    background: transparent;
    color: #0f172a;
    border-left: 2px solid #0f172a;
    font-weight: 600;
}