@{
    ViewData["Title"] = "Open an Account";
    Layout = "~/Views/Shared/_LoginLayout.cshtml";
}

@model EForT.Models.Legacy.LoginModel

@using (Html.BeginForm("OpenAccount", "Login", FormMethod.Post, Model))
{
    <div class="container center-layout">
        <div class="content-wrapper">
            <div class="content-header row">
            </div>
            <div class="content-body">
                <section class="flexbox-container">
                    <div class="col-12 d-flex align-items-center justify-content-center">
                        <div class="col-sm-12 col-md-6 col-lg-5 col-xl-5 col-12 box-shadow-2 p-0 py-2">
                            <div class="card border-grey border-lighten-3 px-1 py-1 m-0">
                                <div class="card-header border-0 pb-0">
                                    <div class="card-title text-center row">
                                        <div class="col-12">
                                            <img src="~/images/apple-icon76.png" alt="branding logo">
                                        </div>
                                        <div class="col-12">
                                            <h6 class="card-subtitle line-on-side text-center font-small-3 pt-1"><span>Open an EForT Account</span></h6>
                                        </div>
                                    </div>
                                </div>
                                <div class="card-content">
                                    <div class="card-body pb-1">
                                        <div class="row">
                                            <div class="col-12">
                                                <div class="mb-2 pb-0 font-medium-2 bottom-border">
                                                    <p>Personal Information</p>
                                                </div>
                                                <div class="form-horizontal">
                                                    <fieldset class="form-group">
                                                        <label for="TitleID">Title<i class="warning">*</i></label>
                                                        <select class="form-control" asp-for="NewAccount.TitleID" id="TitleID" required>
                                                            <option value="" selected disabled>Select</option>
                                                            @if (Model.ListTitles != null)
                                                            {
                                                                if (Model.ListTitles.Count > 0)
                                                                {
                                                                    for (int i = 0; i < Model.ListTitles.Count; i++)
                                                                    {
                                                                        <option value="@Model.ListTitles[i].TitleID">@Model.ListTitles[i].TitleDescription</option>
                                                                    }
                                                                }
                                                            }
                                                        </select>
                                                    </fieldset>
                                                    <fieldset class="form-group">
                                                        <label for="UserFirstName">First Name<i class="warning">*</i></label>
                                                        <input type="text" class="form-control" asp-for="NewAccount.UserFirstName" id="UserFirstName" maxlength="50" required>
                                                    </fieldset>
                                                    <fieldset class="form-group">
                                                        <label for="UserMiddleInitial">Middle Initial</label>
                                                        <input type="text" class="form-control" asp-for="NewAccount.UserMiddleInitial" id="UserMiddleInitial" maxlength="1">
                                                    </fieldset>
                                                    <fieldset class="form-group">
                                                        <label for="UserLastName">Last Name<i class="warning">*</i></label>
                                                        <input type="text" class="form-control" asp-for="NewAccount.UserLastName" id="UserLastName" maxlength="50" required>
                                                    </fieldset>
                                                    <fieldset class="form-group">
                                                        <label for="pickerUserDOB">Date of Birth<i class="warning">*</i></label>
                                                        <input type="text" class="form-control" asp-for="NewAccount.UserDOB" id="pickerUserDOB" required />
                                                    </fieldset>
                                                    <fieldset class="form-group">
                                                        <label for="UserPhone">Primary Phone<i class="warning">*</i></label>
                                                        <input type="text" class="form-control" asp-for="NewAccount.UserPhone" id="UserPhone" maxlength="50" required>
                                                    </fieldset>
                                                </div>
                                            </div>
                                            <div class="col-12">
                                                <div class="my-2 pb-0 font-medium-2 bottom-border">
                                                    <p>Residential Information</p>
                                                </div>
                                                <fieldset class="form-group">
                                                    <label for="CountryID">Country of Residence<i class="warning">*</i></label>
                                                    <select class="form-control" asp-for="NewAccount.CountryID" id="CountryID" required>
                                                        <option value="" selected disabled>Select</option>
                                                        @if (Model.ListCountries != null)
                                                        {
                                                            if (Model.ListCountries.Count > 0)
                                                            {
                                                                for (int i = 0; i < Model.ListCountries.Count; i++)
                                                                {
                                                                    <option value="@Model.ListCountries[i].CountryID">@Model.ListCountries[i].CountryDescription</option>
                                                                }
                                                            }
                                                        }
                                                    </select>
                                                </fieldset>
                                                <fieldset class="form-group">
                                                    <label for="UserAddress1">Address<i class="warning">*</i></label>
                                                    <input type="text" class="form-control" asp-for="NewAccount.UserAddress1" id="UserAddress1" maxlength="50" required>
                                                </fieldset>
                                                <fieldset class="form-group">
                                                    <label for="UserAddress2">Address Cont.</label>
                                                    <input type="text" class="form-control" asp-for="NewAccount.UserAddress2" id="UserAddress2" maxlength="50">
                                                </fieldset>
                                                <fieldset class="form-group">
                                                    <label for="UserCity">City<i class="warning">*</i></label>
                                                    <input type="text" class="form-control" asp-for="NewAccount.UserCity" id="UserCity" maxlength="50" required>
                                                </fieldset>
                                                <fieldset class="form-group">
                                                    <label for="StateID">State<i class="warning">*</i></label>
                                                    <select class="form-control" asp-for="NewAccount.StateID" id="StateID" required>
                                                        <option value="" selected disabled>Select</option>
                                                        @if (Model.ListStates != null)
                                                        {
                                                            if (Model.ListStates.Count > 0)
                                                            {
                                                                for (int i = 0; i < Model.ListStates.Count; i++)
                                                                {
                                                                    <option value="@Model.ListStates[i].StateID">@Model.ListStates[i].StateDescription</option>
                                                                }
                                                            }
                                                        }
                                                    </select>
                                                </fieldset>
                                                <fieldset class="form-group">
                                                    <label for="UserZipCode">Zip Code<i class="warning">*</i></label>
                                                    <input type="text" class="form-control" asp-for="NewAccount.UserZipCode" id="UserZipCode" maxlength="10" required>
                                                </fieldset>
                                            </div>
                                            <div class="col-12">
                                                <div class="my-2 pb-0 font-medium-2 bottom-border">
                                                    <p>EForT Account Information</p>
                                                </div>
                                                <fieldset class="form-group">
                                                    <label for="RoleID">Role<i class="warning">*</i></label>
                                                    <select class="form-control" asp-for="NewAccount.RoleID" id="RoleID" required>
                                                        @if (Model.ListRoles != null)
                                                        {
                                                            if (Model.ListRoles.Count > 0)
                                                            {
                                                                <option value="@Model.ListRoles[0].RoleID">@Model.ListRoles[0].RoleDescription</option>
                                                            }
                                                        }
                                                    </select>
                                                </fieldset>
                                                <fieldset class="form-group">
                                                    <label for="UserEmail">Email Address <i class="warning">*</i></label>
                                                    <input type="email" class="form-control" asp-for="UserEmail" id="UserEmail" maxlength="100" required>
                                                    <p class="mb-0 text-muted">You will be contacted primarily through email. Please provide a valid email address.</p>
                                                    <span asp-validation-for="UserEmail" class="error-text"></span>
                                                </fieldset>
                                                <fieldset class="form-group">
                                                    <label for="UserName">Username <i class="warning">*</i></label>
                                                    <input type="text" class="form-control" asp-for="UserName" id="UserName" placeholder="Username must be 8-15 characters" maxlength="15" required>
                                                    <span asp-validation-for="UserName" class="error-text"></span>
                                                </fieldset>
                                                <fieldset class="form-group">
                                                    <label for="UserPassword">Password <i class="warning">*</i></label>
                                                    <input type="password" class="form-control UserPassword" asp-for="UserPassword" id="UserPassword" name="UserPassword" placeholder="Password must be 8-15 characters" maxlength="15" required>
                                                    <span asp-validation-for="UserPassword" class="error-text"></span>
                                                </fieldset>
                                                <fieldset class="form-group mb-0">
                                                    <label for="ComparePassword">Confirm Password <i class="warning">*</i></label>
                                                    <input type="password" class="form-control compare" asp-for="ComparePassword" name="ComparePassword" id="ComparePassword" placeholder="Password must be 8-15 characters" maxlength="15" required>
                                                    <span asp-validation-for="ComparePassword" class="error-text"></span>
                                                </fieldset>
                                                <div class="col-12 pt-1 pb-0 px-0">
                                                    <div class="requirements">
                                                        <ul class="helper-text">
                                                            <li class="no-list">Requirements:</li>
                                                            <li class="length">Must be at least 8 characters long.</li>
                                                            <li class="lowercase">Must contain a letter.</li>
                                                            <li class="number">Must contain a number.</li>
                                                        </ul>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-12">
                                                <div class="my-2 pb-0 font-medium-2 bottom-border">
                                                    <p>Security Questions</p>
                                                </div>
                                                <fieldset class="form-group">
                                                    <label for="QuestionID1">Question 1 <i class="warning">*</i></label>
                                                    <select class="form-control" asp-for="NewAccount.QuestionID1  " id="QuestionID1" required>
                                                        <option value="" selected disabled>Select</option>
                                                        @if (Model.ListSecurityQuestions != null)
                                                        {
                                                            if (Model.ListSecurityQuestions.Count > 0)
                                                            {
                                                                for (int i = 0; i < Model.ListSecurityQuestions.Count; i++)
                                                                {
                                                                    <option value="@Model.ListSecurityQuestions[i].QuestionID">@Model.ListSecurityQuestions[i].QuestionDescription</option>
                                                                }
                                                            }
                                                        }
                                                    </select>
                                                </fieldset>
                                                <fieldset class="form-group">
                                                    <label for="Answer1">Answer <i class="warning">*</i></label>
                                                    <input type="text" class="form-control" asp-for="NewAccount.Answer1" id="Answer1" maxlength="50" required>
                                                </fieldset>
                                                <fieldset class="form-group">
                                                    <label for="QuestionID2">Question 2 <i class="warning">*</i></label>
                                                    <select class="form-control" asp-for="NewAccount.QuestionID2" id="QuestionID2" required>
                                                        <option value="" selected disabled>Select</option>
                                                        @if (Model.ListSecurityQuestions != null)
                                                        {
                                                            if (Model.ListSecurityQuestions.Count > 0)
                                                            {
                                                                for (int i = 0; i < Model.ListSecurityQuestions.Count; i++)
                                                                {
                                                                    <option value="@Model.ListSecurityQuestions[i].QuestionID">@Model.ListSecurityQuestions[i].QuestionDescription</option>
                                                                }
                                                            }
                                                        }
                                                    </select>
                                                </fieldset>
                                                <fieldset class="form-group">
                                                    <label for="Answer2">Answer <i class="warning">*</i></label>
                                                    <input type="text" class="form-control" asp-for="NewAccount.Answer2" id="Answer2" maxlength="50" required>
                                                </fieldset>
                                                <fieldset class="form-group">
                                                    <label for="QuestionID3">Question 3 <i class="warning">*</i></label>
                                                    <select class="form-control" asp-for="NewAccount.QuestionID3" id="QuestionID3" required>
                                                        <option value="" selected disabled>Select</option>
                                                        @if (Model.ListSecurityQuestions != null)
                                                        {
                                                            if (Model.ListSecurityQuestions.Count > 0)
                                                            {
                                                                for (int i = 0; i < Model.ListSecurityQuestions.Count; i++)
                                                                {
                                                                    <option value="@Model.ListSecurityQuestions[i].QuestionID">@Model.ListSecurityQuestions[i].QuestionDescription</option>
                                                                }
                                                            }
                                                        }
                                                    </select>
                                                </fieldset>
                                                <fieldset class="form-group">
                                                    <label for="Answer3">Answer <i class="warning">*</i></label>
                                                    <input type="text" class="form-control" asp-for="NewAccount.Answer3" id="Answer3" maxlength="50" required>
                                                </fieldset>
                                                @if (ViewBag.OpenAccount != "")
                                                {
                                                    <div class="text-danger text-center error-message my-2">
                                                        <span>@ViewBag.OpenAccount</span>
                                                    </div>
                                                }
                                                <button type="submit" class="btn btn-primary btn-block mt-1">Submit</button>
                                                <div class="col-12 mt-2 px-0 font-medium-1">
                                                    By submitting information I confirm that I agree to the EForT.com <a class="link-alt" href="#">Terms and Conditions</a>, <a class="link-alt" href="#">Privacy Policy</a>, and <a class="link-alt" href="#">Notice Regarding Anti-Money Laundering</a> and may be contacted about my application.
                                                </div>
                                                <p class="card-subtitle line-on-side text-muted text-center font-small-3 my-2"><span>Already a Member?</span></p>
                                                <a href="@Url.Action("Index", "Login")" class="btn btn-secondary btn-block">Back to Login</a>
                                            </div>
                                        </div>                                        
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
            </div>
        </div>
    </div>
}