<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Open an Account | Tooro People's SACCO</title>
    <meta name="keywords" content="account opening, online application, SACCO membership, registration">
    <meta name="description" content="Open a digital account with Tooro People's SACCO using our secure online application form or download the printable PDF.">
    <meta name="author" content="Tooro People's SACCO">
    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
    <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="css/responsive.css">
    <link rel="stylesheet" href="css/custom.css">
    <link rel="stylesheet" href="css/no-effects.css">
    <style>
        .page-banner {
            position: relative;
            padding: 100px 0 84px;
            background: linear-gradient(135deg, #2456fa 0%, #42b0ff 45%, #7e4dff 100%), url('images/5.jpeg') center/cover no-repeat;
            background-size: cover;
            background-color: #112d67;
            background-blend-mode: multiply, normal;
            color: #fff;
            text-align: center;
            overflow: hidden;
        }
        .page-banner::after {
            content: "";
            position: absolute;
            inset: 0;
            background: rgba(12, 39, 92, 0.45);
        }
        .page-banner .container { position: relative; z-index: 1; }
        .page-banner h1 { font-size: clamp(2.8rem, 5vw, 4rem); font-weight: 800; letter-spacing: -0.03em; }
        .page-banner p { color: rgba(255,255,255,0.94); max-width: 760px; margin: 1rem auto 0; line-height: 1.75; }
        .form-card { border-radius: 1.75rem; background: #fff; padding: 2rem; box-shadow: 0 24px 50px rgba(15, 59, 128, 0.12); border: 1px solid rgba(41, 114, 255, 0.12); }
        .form-card h3 { font-weight: 800; color: #112a52; margin-bottom: 1.4rem; }
        .form-section { margin-bottom: 1.75rem; }
        .form-section h5 { color: #1d3d7a; font-weight: 700; margin-bottom: 1rem; }
        .form-control { border-radius: 0.95rem; }
        .form-control:focus { border-color: #3f7dff; box-shadow: 0 0 0 0.15rem rgba(56, 109, 255, 0.18); }
        .btn-primary.btn-cta { border-radius: 999px; padding: 0.95rem 2rem; background: linear-gradient(135deg, #1f67ff 0%, #4bbfff 100%); border: none; }
        .btn-primary.btn-cta:hover { background: linear-gradient(135deg, #2f7dff 0%, #1f5bd6 100%); }
        .input-group-text { background: #f5f8ff; border-radius: 0.95rem; }
        .card-notice { background: linear-gradient(135deg, rgba(34, 98, 255, 0.1), rgba(154, 220, 255, 0.08)); border: 1px solid rgba(34, 98, 255, 0.14); border-radius: 1.25rem; padding: 1.4rem; }
        .review-summary { background: #f8fbff; border: 1px solid rgba(55, 195, 255, 0.18); border-radius: 1.25rem; padding: 1.4rem; }
        .review-summary dt { font-weight: 700; color: #10264c; }
        .review-summary dd { margin: 0 0 0.9rem 0; color: #4a5f7a; }
        .review-summary ul { margin: 0; padding-left: 1.2rem; color: #4a5f7a; }
        .review-summary ul li { margin-bottom: 0.6rem; }
        .form-success { border-radius: 1.25rem; padding: 1.25rem 1.35rem; margin-bottom: 1.5rem; }
        @media (max-width: 767px) { .page-banner { padding: 80px 0 60px; } }
    </style>
    <script src="js/modernizer.js"></script>
</head>
<body class="host_version">
    <header class="top-navbar">
        <nav class="navbar navbar-expand-lg navbar-light bg-white shadow-sm">
            <div class="container">
                <a class="navbar-brand font-weight-bold" href="index.html">Tooro People's SACCO</a>
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse" id="mainNav">
                    <ul class="navbar-nav ml-auto">
                        <li class="nav-item"><a class="nav-link" href="index.html">Home</a></li>
                        <li class="nav-item"><a class="nav-link" href="about.html">About</a></li>
                        <li class="nav-item"><a class="nav-link" href="products.html">Products</a></li>
                        <li class="nav-item"><a class="nav-link" href="membership.html">Membership</a></li>
                        <li class="nav-item active"><a class="nav-link" href="account-opening.php">Open Account</a></li>
                        <li class="nav-item"><a class="nav-link" href="financial-tools.html">Financial Tools</a></li>
                        <li class="nav-item"><a class="nav-link" href="contact.html">Contact</a></li>
                    </ul>
                </div>
            </div>
        </nav>
    </header>
    <section class="page-banner" style="background-image: url('images/5.jpeg');">
        <div class="container text-center">
            <h1>Digital Account Opening</h1>
            <p>Register online with a complete digital application or download the printable account opening PDF to submit at our office.</p>
            <div class="mt-4">
                <a href="account-opening-form.pdf" class="btn btn-primary btn-cta mr-2" download><i class="fa fa-download mr-2"></i>Download PDF Application</a>
                <a href="#online-application" class="btn btn-light btn-cta text-primary"><i class="fa fa-pencil-square-o mr-2"></i>Start Online Application</a>
            </div>
        </div>
    </section>
    <section class="section wb" id="online-application">
        <div class="container">
            <div class="row justify-content-center">
                <div class="col-lg-10">
                    <div class="card-notice mb-5">
                        <h4 class="mb-3">Fast, secure and mobile-friendly account registration</h4>
                        <p class="mb-0">Complete this digital account opening form, then follow the guidance in your confirmation message to submit the required IDs and activate your membership. If you prefer a printable copy, download the PDF above.</p>
                    </div>
                    <div class="form-card">
                        <h3>Account Opening Application</h3>
                        <div id="accountOpeningResponse" role="status" aria-live="polite"></div>
                        <div class="form-section">
                            <h5>Review summary</h5>
                            <div class="review-summary" id="reviewSummary">
                                <p class="mb-0 text-muted">Fill in the form to see a summary of key details before submission.</p>
                            </div>
                            <div class="review-summary mt-4" id="fileSummary">
                                <p class="mb-0 text-muted">Uploaded files will appear here once selected.</p>
                            </div>
                        </div>
                        <form id="onlineAccountForm" method="POST" action="account-opening-submit.php" enctype="multipart/form-data" novalidate>
                            <div class="form-section">
                                <h5>Membership Details</h5>
                                <div class="form-row">
                                    <div class="form-group col-md-6">
                                        <label for="accountNumber">Account Number</label>
                                        <input type="text" class="form-control"  name="accountNumber" id="accountNumber" placeholder="Enter account number" required>
                                    </div>
                                    <div class="form-group col-md-6">
                                        <label for="serialNumber">Serial</label>
                                        <input type="text" class="form-control"  name="serialNumber" id="serialNumber" placeholder="Enter serial number" required>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="memberName">Member's Name</label>
                                    <input type="text" class="form-control"  name="memberName" id="memberName" placeholder="Enter full name" required>
                                </div>
                                <div class="form-row align-items-center">
                                    <div class="form-group col-md-3">
                                        <label>Gender</label>
                                        <select class="form-control"  name="gender" id="gender" required>
                                            <option value="">Select gender</option>
                                            <option>Male</option>
                                            <option>Female</option>
                                        </select>
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label for="fatherName">Father's Name</label>
                                        <input type="text" class="form-control"  name="fatherName" id="fatherName" placeholder="Enter father's name">
                                    </div>
                                    <div class="form-group col-md-5">
                                        <label for="motherName">Mother's Name</label>
                                        <input type="text" class="form-control"  name="motherName" id="motherName" placeholder="Enter mother's name">
                                    </div>
                                </div>
                            </div>
                            <div class="form-section">
                                <h5>Physical Address</h5>
                                <div class="form-row">
                                    <div class="form-group col-md-6">
                                        <label for="physicalAddress">Physical Address</label>
                                        <input type="text" class="form-control"  name="physicalAddress" id="physicalAddress" placeholder="Enter physical address" required>
                                    </div>
                                    <div class="form-group col-md-3">
                                        <label for="subCounty">Sub County</label>
                                        <input type="text" class="form-control"  name="subCounty" id="subCounty" placeholder="Sub county">
                                    </div>
                                    <div class="form-group col-md-3">
                                        <label for="wardVillage">Ward/Village</label>
                                        <input type="text" class="form-control"  name="wardVillage" id="wardVillage" placeholder="Ward or village">
                                    </div>
                                </div>
                            </div>
                            <div class="form-section">
                                <h5>Contact Information</h5>
                                <div class="form-row">
                                    <div class="form-group col-md-6">
                                        <label for="emailAddress">Business E-mail Address</label>
                                        <input type="email" class="form-control"  name="emailAddress" id="emailAddress" placeholder="Email address" required>
                                    </div>
                                    <div class="form-group col-md-3">
                                        <label for="mobilePhone">Mobile Phone</label>
                                        <input type="tel" class="form-control"  name="mobilePhone" id="mobilePhone" placeholder="Mobile phone" required>
                                    </div>
                                    <div class="form-group col-md-3">
                                        <label for="whatsapp">Whatsapp</label>
                                        <input type="tel" class="form-control"  name="whatsapp" id="whatsapp" placeholder="Whatsapp number">
                                    </div>
                                </div>
                                <div class="form-row">
                                    <div class="form-group col-md-6">
                                        <label for="tiktokAccount">Tiktok Account</label>
                                        <input type="text" class="form-control"  name="tiktokAccount" id="tiktokAccount" placeholder="Tiktok handle">
                                    </div>
                                    <div class="form-group col-md-6">
                                        <label for="twitterAccount">Twitter</label>
                                        <input type="text" class="form-control"  name="twitterAccount" id="twitterAccount" placeholder="Twitter handle">
                                    </div>
                                </div>
                            </div>
                            <div class="form-section">
                                <h5>Required Documents</h5>
                                <p class="text-muted mb-3">Upload the documents needed to process your account application.</p>
                                <div class="form-row">
                                    <div class="form-group col-md-6">
                                        <label for="idDocument">National ID / Passport</label>
                                        <input type="file" class="form-control-file" name="idDocument" id="idDocument" accept=".jpg,.jpeg,.png,.pdf">
                                    </div>
                                    <div class="form-group col-md-6">
                                        <label for="photoDocument">Passport Photo</label>
                                        <input type="file" class="form-control-file" name="photoDocument" id="photoDocument" accept=".jpg,.jpeg,.png,.pdf">
                                    </div>
                                </div>
                                <div class="form-row">
                                    <div class="form-group col-md-6">
                                        <label for="addressDocument">Proof of Address</label>
                                        <input type="file" class="form-control-file" name="addressDocument" id="addressDocument" accept=".jpg,.jpeg,.png,.pdf">
                                    </div>
                                    <div class="form-group col-md-6">
                                        <label for="businessDocument">Registration Document</label>
                                        <input type="file" class="form-control-file" name="businessDocument" id="businessDocument" accept=".jpg,.jpeg,.png,.pdf">
                                    </div>
                                </div>
                            </div>
                            <div class="form-section">
                                <h5>Personal Information</h5>
                                <div class="form-row">
                                    <div class="form-group col-md-4">
                                        <label for="maritalStatus">Marital Status</label>
                                        <input type="text" class="form-control"  name="maritalStatus" id="maritalStatus" placeholder="Marital status">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label for="educationLevel">Education Level</label>
                                        <input type="text" class="form-control"  name="educationLevel" id="educationLevel" placeholder="Education level">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label for="childrenCount">Number of Children</label>
                                        <input type="number" min="0" class="form-control"  name="childrenCount" id="childrenCount" placeholder="0">
                                    </div>
                                </div>
                                <div class="form-row">
                                    <div class="form-group col-md-4">
                                        <label for="childOne">Child 1</label>
                                        <input type="text" class="form-control"  name="childOne" id="childOne" placeholder="Name">
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label for="childOneAge">Age</label>
                                        <input type="number" min="0" class="form-control"  name="childOneAge" id="childOneAge" placeholder="Age">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label for="childTwo">Child 2</label>
                                        <input type="text" class="form-control"  name="childTwo" id="childTwo" placeholder="Name">
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label for="childTwoAge">Age</label>
                                        <input type="number" min="0" class="form-control"  name="childTwoAge" id="childTwoAge" placeholder="Age">
                                    </div>
                                </div>
                                <div class="form-row">
                                    <div class="form-group col-md-4">
                                        <label for="childThree">Child 3</label>
                                        <input type="text" class="form-control"  name="childThree" id="childThree" placeholder="Name">
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label for="childThreeAge">Age</label>
                                        <input type="number" min="0" class="form-control"  name="childThreeAge" id="childThreeAge" placeholder="Age">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label for="childFour">Child 4</label>
                                        <input type="text" class="form-control"  name="childFour" id="childFour" placeholder="Name">
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label for="childFourAge">Age</label>
                                        <input type="number" min="0" class="form-control"  name="childFourAge" id="childFourAge" placeholder="Age">
                                    </div>
                                </div>
                                <div class="form-row">
                                    <div class="form-group col-md-4">
                                        <label for="dependants">Number of Dependants</label>
                                        <input type="number" min="0" class="form-control"  name="dependants" id="dependants" placeholder="0">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label for="employer">Working Institution/Employer</label>
                                        <input type="text" class="form-control"  name="employer" id="employer" placeholder="Employer or institution">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label for="position">Position</label>
                                        <input type="text" class="form-control"  name="position" id="position" placeholder="Position">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="officeLocation">Office Location</label>
                                    <input type="text" class="form-control"  name="officeLocation" id="officeLocation" placeholder="Office location">
                                </div>
                            </div>
                            <div class="form-section">
                                <h5>Existing Account Details</h5>
                                <div class="form-row">
                                    <div class="form-group col-md-6">
                                        <label for="existingAccNumber">Account Number</label>
                                        <input type="text" class="form-control"  name="existingAccNumber" id="existingAccNumber" placeholder="Existing account number">
                                    </div>
                                    <div class="form-group col-md-6">
                                        <label for="existingInstitution">Institution's Name</label>
                                        <input type="text" class="form-control"  name="existingInstitution" id="existingInstitution" placeholder="Institution name">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="existingAccountName">Account Name</label>
                                    <input type="text" class="form-control"  name="existingAccountName" id="existingAccountName" placeholder="Existing account name">
                                </div>
                            </div>
                            <div class="form-section">
                                <h5>Referee Information</h5>
                                <div class="form-row">
                                    <div class="form-group col-md-6">
                                        <label for="refereeName">Referee's Name</label>
                                        <input type="text" class="form-control"  name="refereeName" id="refereeName" placeholder="Referee's name">
                                    </div>
                                    <div class="form-group col-md-3">
                                        <label for="refereeRelationship">Relationship</label>
                                        <input type="text" class="form-control"  name="refereeRelationship" id="refereeRelationship" placeholder="Relationship">
                                    </div>
                                    <div class="form-group col-md-3">
                                        <label for="refereePhone">Telephone Contact</label>
                                        <input type="tel" class="form-control"  name="refereePhone" id="refereePhone" placeholder="Phone number">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="refereeSignature">Referee's Signature</label>
                                    <input type="text" class="form-control"  name="refereeSignature" id="refereeSignature" placeholder="Type name as signature">
                                </div>
                            </div>
                            <div class="form-section">
                                <h5>Next of Kin</h5>
                                <div class="form-row">
                                    <div class="form-group col-md-6">
                                        <label for="nextOfKin">Next of Kin</label>
                                        <input type="text" class="form-control"  name="nextOfKin" id="nextOfKin" placeholder="Next of kin name">
                                    </div>
                                    <div class="form-group col-md-3">
                                        <label for="nextOfKinRelationship">Relationship</label>
                                        <input type="text" class="form-control"  name="nextOfKinRelationship" id="nextOfKinRelationship" placeholder="Relationship">
                                    </div>
                                    <div class="form-group col-md-3">
                                        <label for="nextOfKinPhone">Telephone Contact</label>
                                        <input type="tel" class="form-control"  name="nextOfKinPhone" id="nextOfKinPhone" placeholder="Phone number">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="nextOfKinSignature">Signature</label>
                                    <input type="text" class="form-control"  name="nextOfKinSignature" id="nextOfKinSignature" placeholder="Type name as signature">
                                </div>
                                <div class="form-group">
                                    <label for="nextOfKinAddress">Physical Address</label>
                                    <input type="text" class="form-control"  name="nextOfKinAddress" id="nextOfKinAddress" placeholder="Physical address">
                                </div>
                            </div>
                            <div class="form-section">
                                <h5>Declaration</h5>
                                <p>I request you to open an account in my names; authorize you to undertake funds/accounts transfer and make enquiries necessary in connection with this application. I have understood and accepted the terms and conditions in the tariff guide and agree to be bound by them.</p>
                                <div class="form-group">
                                    <label for="applicantSignature">Applicant Signature</label>
                                    <input type="text" class="form-control"  name="applicantSignature" id="applicantSignature" placeholder="Type full name to sign" required>
                                </div>
                            </div>
                            <div class="form-section">
                                <h5>Group Registration (Optional)</h5>
                                <div class="form-row">
                                    <div class="form-group col-md-4">
                                        <label for="groupName">Group Name</label>
                                        <input type="text" class="form-control"  name="groupName" id="groupName" placeholder="Group name">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label for="groupTagline">Group Tagline</label>
                                        <input type="text" class="form-control"  name="groupTagline" id="groupTagline" placeholder="Group tagline">
                                    </div>
                                    <div class="form-group col-md-4">
                                        <label for="groupLocation">Group Location</label>
                                        <input type="text" class="form-control"  name="groupLocation" id="groupLocation" placeholder="Location">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="groupMandate">Mandate</label>
                                    <input type="text" class="form-control"  name="groupMandate" id="groupMandate" placeholder="Mandate">
                                </div>
                                <div class="form-group">
                                    <label for="groupPurpose">Group Purpose</label>
                                    <input type="text" class="form-control"  name="groupPurpose" id="groupPurpose" placeholder="Purpose">
                                </div>
                                <div class="form-group">
                                    <label for="groupRegistration">Group Registration Details</label>
                                    <textarea class="form-control"  name="groupRegistration" id="groupRegistration" rows="3" placeholder="Registration details"></textarea>
                                </div>
                            </div>
                            <button type="submit" class="btn btn-primary btn-cta">Submit Application</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <footer class="site-footer">
        <div class="container">
            <div class="row footer-top">
                <div class="col-md-4 mb-4">
                    <h5>Tooro People's SACCO</h5>
                    <p class="mb-1">Wazalendo Building, Room 11, Balya Road, Fort Portal Tourism City</p>
                    <p class="mb-1">Email: <a href="mailto:tooropeoplesacco@gmail.com">tooropeoplesacco@gmail.com</a></p>
                    <p>Phone: <a href="tel:+256772372695">+256 772 372 695</a>, <a href="tel:+256700874910">+256 700 874 910</a></p>
                </div>
                <div class="col-md-3 mb-4">
                    <h5>Quick Links</h5>
                    <ul class="list-unstyled footer-links">
                        <li><a href="membership.html">Membership</a></li>
                        <li><a href="contact.html">Contact</a></li>
                        <li><a href="account-opening.php">Open Account</a></li>
                    </ul>
                </div>
                <div class="col-md-3 mb-4">
                    <h5>Resources</h5>
                    <ul class="list-unstyled footer-links">
                        <li><a href="account-opening-form.pdf">Download PDF</a></li>
                    </ul>
                </div>
                <div class="col-md-2 mb-4">
                    <h5>Newsletter</h5>
                    <form class="newsletter" action="#" method="post">
                        <div class="input-group">
                            <input type="email" class="form-control form-control-sm" placeholder="Email address" aria-label="Email">
                            <div class="input-group-append">
                                <button class="btn btn-primary btn-sm" type="submit">Subscribe</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="footer-bottom text-center">
                <small>© 2026 Tooro People's SACCO. All Rights Reserved.</small>
            </div>
        </div>
    </footer>
    <a href="#" id="scroll-to-top" class="dmtop global-radius"><i class="fa fa-angle-up"></i></a>
    <script src="js/all.js"></script>
    <script src="js/custom.js"></script>
    <script>
        (function() {
            var form = document.getElementById('onlineAccountForm');
            var responseContainer = document.getElementById('accountOpeningResponse');
            var reviewSummary = document.getElementById('reviewSummary');
            var fileSummary = document.getElementById('fileSummary');

            function formatReviewItem(label, value) {
                return '<dt>' + label + '</dt><dd>' + (value ? value : '<span class="text-muted">Not provided</span>') + '</dd>';
            }

            function updateReview() {
                if (!reviewSummary || !fileSummary) {
                    return;
                }

                var fields = [
                    { label: 'Member name', field: 'memberName' },
                    { label: 'Account number', field: 'accountNumber' },
                    { label: 'Email address', field: 'emailAddress' },
                    { label: 'Mobile phone', field: 'mobilePhone' },
                    { label: 'Physical address', field: 'physicalAddress' },
                    { label: 'Gender', field: 'gender' },
                    { label: 'Employer / institution', field: 'employer' },
                    { label: 'Next of kin', field: 'nextOfKin' },
                    { label: 'Referee', field: 'refereeName' },
                    { label: 'Group name', field: 'groupName' }
                ];

                var summaryHtml = fields.map(function(item) {
                    var input = form[item.field];
                    return formatReviewItem(item.label, input ? input.value : '');
                }).join('');

                reviewSummary.innerHTML = '<dl>' + summaryHtml + '</dl>';

                var files = [
                    { label: 'National ID / Passport', input: form.idDocument },
                    { label: 'Passport Photo', input: form.photoDocument },
                    { label: 'Proof of Address', input: form.addressDocument },
                    { label: 'Registration Document', input: form.businessDocument }
                ];

                var fileItems = files.map(function(file) {
                    var fileName = file.input && file.input.files.length ? file.input.files[0].name : 'No file selected';
                    return '<li><strong>' + file.label + ':</strong> ' + fileName + '</li>';
                });

                fileSummary.innerHTML = '<h6>Attached documents</h6><ul>' + fileItems.join('') + '</ul>';
            }

            if (form) {
                var inputs = Array.from(form.querySelectorAll('input, select, textarea'));
                inputs.forEach(function(input) {
                    input.addEventListener('input', updateReview);
                    input.addEventListener('change', updateReview);
                });
                updateReview();

                form.addEventListener('submit', function(event) {
                    event.preventDefault();
                    if (!form.checkValidity()) {
                        form.classList.add('was-validated');
                        return;
                    }
                    responseContainer.innerHTML = '<div class="alert alert-info">Submitting your application, please wait...</div>';
                    var formData = new FormData(form);
                    fetch('account-opening-submit.php', {
                        method: 'POST',
                        body: formData
                    })
                    .then(function(response) {
                        if (!response.ok) {
                            throw new Error('Server error: ' + response.status + ' ' + response.statusText);
                        }
                        return response.text();
                    })
                    .then(function(html) {
                        responseContainer.innerHTML = html;
                        if (html.indexOf('alert-success') !== -1) {
                            form.reset();
                            updateReview();
                        }
                        responseContainer.scrollIntoView({ behavior: 'smooth' });
                    })
                    .catch(function(error) {
                        responseContainer.innerHTML = '<div class="alert alert-danger">An error occurred while submitting your application. Please try again later.</div>';
                        console.error('Account opening submit error:', error);
                        responseContainer.scrollIntoView({ behavior: 'smooth' });
                    });
                });
            }
        })();
    </script>
</body>
</html>
