<%- include ("partials/header") %>

    <head>
        <title>Tuerti</title>
    </head>
    <div class="login">
        <div id="login" class="body">
            <form action="/login" method="post">
                <input type="hidden" name="_csrf" value="<%= csrfToken %>">
                <div class="form-group login-wrapper">
                    <div class="form-item">
                        <% if (messages.error=="Missing credentials" ||messages.error=="mail" ) { %>
                            <input tabindex="1" class="form-control textbox error" type="email" id="email" name="email"
                                placeholder="Email">
                            <i class="fas fa-exclamation-triangle login-warning"></i>
                            <% } else { %>
                                <input tabindex="1" class="form-control textbox" type="email" id="email" name="email"
                                    placeholder="Email">
                                <% } %>
                                    <label for="remember" class="remember-me">
                                        <input tabindex="3" type="checkbox" name="remember" id="remember" value="1">
                                        <p>
                                            <%= locals["rememberme"] %>
                                        </p>
                                    </label>
                    </div>
                    <div class="form-item">
                        <% if (messages.error=="pass" ) { %>
                            <input tabindex="2" class="form-control textbox error" type="password" id="password"
                                name="password" placeholder="<%= locals.password %> ">
                            <i class="fas fa-exclamation-triangle login-warning"></i>
                            <% } else { %>
                                <input tabindex="2" class="form-control textbox" type="password" id="password"
                                    name="password" placeholder="<%= locals.password %> ">
                                <% } %>
                                    <a href="" title="Forgot your password?">
                                        <%= locals["forgotpassword"] %>
                                    </a>
                    </div>
                    <input type="submit" id="submit-button" class="submit" value="<%= locals.submit %> ">
                </div>
            </form>
            <div class="getAccount">
                <div class="logborder">
                    <p>
                        <span class="info"></span>
                        <a href="register" title="Get an account">
                            <%= locals["register1"] %> <strong>
                                    <%= locals["register2"] %>
                                </strong>
                        </a>
                    </p>
                </div>
            </div>
        </div>
    </div>
    <a href="/">
        <div class="cover">
            <div class="description">
                <h1>Tuerti - Tu red social</h1>
                <h2>
                    <%= locals["whatistuenti"] %>
                </h2>
                <p>
                    <%= locals["whatistuentidesc"] %>
                </p>
            </div>
            <div class="mainpoints">
                <ul>
                    <li class="social">
                        <h3>
                            <%= locals["social"] %>
                        </h3>
                        <p>
                            <%= locals["socialdesc"] %>
                        </p>
                    </li>
                    <li class="xlocal">
                        <h3>
                            <%= locals["local"] %>
                        </h3>
                        <p>
                            <%= locals["localdesc"] %>
                        </p>
                    </li>
                    <li class="mobile">
                        <h3>
                            <%= locals["mobile"] %>
                        </h3>
                        <p>
                            <%= locals["mobiledesc"] %>
                        </p>
                    </li>
                </ul>
            </div>
        </div>
    </a>
    <div class="footer index-footer">
        <div class="footerContent">
            <ul>
                <li>
                    <a href="legal">
                        <%= locals.legal %>
                    </a>
                </li>
                <li>
                    <a href="privacy">
                        <%= locals.privacy %>
                    </a>
                </li>
                <li>
                    <a href="help">
                        <%= locals.help %>
                    </a>
                </li>
                <li>
                    <a href="about">
                        <%= locals.about %>
                    </a>
                </li>

                <a href="/">
                    <li class="copy">Â© Tuenti 2020</li>
                </a>
                <li class="language">

                    <ul class="languageSelector">
                        <li class="language">
                            <form id="lang-english" action="/changelang" method="post">
                                <input type="hidden" name="_csrf" value="<%= csrfToken %>">
                                <input hidden type="text" value="en" id="lang-en" name="lang">
                                <% if (locals.help=="Ayuda" ) { %>
                                    <input class="lang-sel lang-nonsel" type="submit" value="English">
                                    <% } else{%>
                                        <input class="lang-sel" type="submit" value="English">
                                        <% } %>
                            </form>
                        </li>
                        <li class="language">
                            <form id="lang-spanish" action="/changelang" method="post">
                                <input type="hidden" name="_csrf" value="<%= csrfToken %>">
                                <input hidden type="text" value="es" id="lang-es" name="lang">
                                <% if (locals.help=="Help" ) { %>
                                    <input class="lang-sel lang-nonsel" type="submit" value="Spanish">
                                    <% } else{%>
                                        <input class="lang-sel" type="submit" value="Spanish">
                                        <% } %>
                            </form>
                        </li>
                    </ul>

                </li>
            </ul>
        </div>
        <div class="brand-footer">

        </div>
    </div>

    </div>
    </body>
    <script type="text/javascript">
        $(document).ready(function ($) {
            $(".error").click(function (e) {
                e.preventDefault();
                $(this).removeClass("error");
                $(this).parent().find("i").remove();
            });
        });
    </script>

    </html>