/* Landing layer in front of the application: login, training code, loading */

@font-face { font-family: "Bebas Neue"; src: url("fonts/BebasNeueBold.ttf"); font-weight: 700; }
@font-face { font-family: "PT Sans"; src: url("fonts/PTSans-Regular.ttf"); font-weight: 400; }
@font-face { font-family: "PT Sans"; src: url("fonts/PTSans-Bold.ttf"); font-weight: 700; }

:root {
    --login-main: #2a3e50;
    --login-text: rgba(19, 41, 61, 0.85);
    --login-accent: #e7c671;
    --secondary: #498ba9;
    --rule: #cbd5e1;
    --error: #dc2626;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #fff;
    font-family: "PT Sans", system-ui, sans-serif;
    color: var(--login-text);
}

#unity-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
}

#landing {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    padding: 60px;
    box-sizing: border-box;
    background: #fff url("landing-bg.png") left bottom / auto 45% no-repeat;
    transition: opacity 0.4s ease;
}

#landing.is-leaving { opacity: 0; pointer-events: none; }
#landing[hidden] { display: none; }

.landing__logo {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
}

.landing__intro {
    flex: 1 1 50%;
    padding-right: 48px;
    border-right: 2px solid var(--rule);
}

.landing__intro h1 {
    margin: 12px 0 44px;
    padding-left: 20px;
    border-left: 6px solid var(--login-accent);
    font: 700 60px/1 "Bebas Neue", sans-serif;
    text-transform: uppercase;
    color: var(--login-main);
}

.landing__intro p {
    margin: 0 0 32px;
    font-size: 24px;
    line-height: 1.35;
}

.landing__panel {
    flex: 1 1 50%;
    display: grid;
    place-items: center;
}

.view {
    display: flex;
    flex-direction: column;
    width: min(420px, 80%);
}

.view[hidden] { display: none; }

label {
    margin-bottom: 6px;
    font-size: 18px;
    color: var(--login-main);
}

input {
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid #94a3b8;
    border-radius: 0;
    font: inherit;
    font-size: 20px;
    color: #000;
}

input:focus {
    outline: 2px solid var(--secondary);
    outline-offset: 0;
}

#code {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 28px;
}

button, .button {
    padding: 14px 16px;
    border: 0;
    background: var(--login-main);
    color: #fff;
    font: 700 26px/1.1 "Bebas Neue", sans-serif;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover, .button:hover { background: var(--login-accent); }
button:disabled { opacity: 0.6; cursor: default; }

.button--secondary { display: block; background: var(--secondary); }

button.link {
    margin-top: 16px;
    padding: 4px;
    background: none;
    color: var(--login-text);
    font: 400 16px "PT Sans", sans-serif;
    text-transform: none;
    text-decoration: underline;
}

button.link:hover { background: none; color: #000; }

.or {
    margin: 14px 0;
    text-align: center;
    font-size: 16px;
}

.message {
    min-height: 22px;
    margin: -8px 0 12px;
    font-size: 16px;
    color: var(--error);
}

/* A refused form shakes once */
.view.is-refused input { border-color: var(--error); }
.view.is-refused { animation: shake 0.35s; }

@keyframes shake {
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

#view-loading p { margin: 0 0 16px; font-size: 22px; text-align: center; }

.progress {
    height: 10px;
    background: #e2e8f0;
}

.progress__bar {
    width: 0;
    height: 100%;
    background: var(--secondary);
    transition: width 0.2s;
}

.spinner {
    align-self: center;
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Shown over the application while files are dragged over the window */
#drop {
    position: fixed;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: rgba(15, 23, 42, 0.72);
    outline: 4px dashed #e2e8f0;
    outline-offset: -24px;
    pointer-events: none;
}

#drop[hidden] { display: none; }

/* "Still there?" question, over the application and over the landing layer */
#idle {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.6);
}

#idle[hidden] { display: none; }

.idle__box {
    width: 100%;
    max-width: 640px;
    padding: 48px;
    box-sizing: border-box;
    background: #fff;
    text-align: center;
}

.idle__box h2 {
    margin: 0 0 28px 0;
    font-size: 36px;
    font-weight: 700;
    color: #000;
}

.idle__box p {
    margin: 0 0 32px 0;
    font-size: 22px;
    line-height: 1.35;
    color: #000;
}

.idle__box button {
    width: 80%;
    padding: 16px 8px;
    border: 0;
    background: var(--login-main);
    color: #fff;
    font-family: "Bebas Neue", sans-serif;
    font-size: 32px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s;
}

.idle__box button:hover,
.idle__box button:focus-visible { background: var(--login-accent); color: var(--login-main); outline: none; }

#drop p {
    max-width: 720px;
    margin: 0;
    color: #fff;
    font-size: 30px;
    line-height: 1.3;
    text-align: center;
}

@media (max-width: 900px) {
    #landing { flex-direction: column; padding: 32px; }
    .landing__intro { border-right: 0; padding-right: 0; flex: 0 0 auto; }
    .landing__intro h1 { font-size: 44px; margin-bottom: 24px; }
    .landing__intro p { font-size: 18px; margin-bottom: 16px; }
}
