{% assign ready = false %}
{% if current_person.signed_in? %}
  {% for group in current_person.groups %}
    {% if group %}
        {% assign ready = true %}
        {% break %}
    {% endif %}
  {% endfor %}
{% endif %}

{% if ready %}
    <script>
      if (window.location.pathname != '/app/dashboard'){
        window.location.replace('/app/dashboard');
      }
    </script>
{% else %}
    <script>
        window.setTimeout(function() {
            window.location.reload(true);
        }, 3000);
    </script>
{% endif %}

<main>
    <div class="waiting-room-container">
        <img class="image" src="https://s3.amazonaws.com/static.northpass.com/Mizuno+Golf/logo.png">
        <div class="text">
            Thank you for entering your PGA ID! 
            Please wait while we configure the school for you. 
            You’ll be automatically redirected when it's ready!
        </div>
    </div>
</main>

<style>
    main {
        align-items: center;
        background: #001588;
        display: flex;
        flex-direction: row;
        height: 100%;
        margin: auto;
    }
    .waiting-room-container{
        align-items: center;
        display: flex;
        flex-direction: column;
    }
    .image {
        display: flex;
        margin: 30px auto;
        width: 90%;
    }
    .text {
        color: #FFFFFF;
        font-size: 30px;
        margin: 50px auto;
        text-align: center;
    }

    @media screen and (min-width: 1000px){
        .image{
            width: 70%;
        }

        .text{
            margin: 50px;
            margin-top: 0;
        }
    }

    @media screen and (min-width: 1200px){
        .image{
            width: 60%;
        }

        .text{
            margin: 40px 100px;
        }
    }

    @media screen and (min-width: 1700px){
        .image{
            width: 50%;
        }

        .text{
            font-size: 36px;
            margin: 50px 150px;
        }
    }

    @media screen and (min-width: 2200px){
        .image{
            width: 40%;
        }

        .text{
            font-size: 48px;
            margin: 50px 200px;
            margin-top: 0;
        }
    }
</style>