body {
    display: flex;
    gap: 1em;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 900;
    height: fit-content;
    padding: 1em;
    margin: 0;

    --colour-1-rgb: 89, 182, 213;
    --colour-2-rgb: 240, 89, 124;
    --colour-1: rgb(var(--colour-1-rgb));
    --colour-2: rgb(var(--colour-2-rgb));
    --fade-delay: 0s;
}

form {
    display: flex;
    gap: 2em;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.animated-background {
    background: #eee;
    overflow: hidden;
    -webkit-mask-size: cover;
    mask-size: cover;
    position: relative;
    container-type: size;
}

.animated-background > .backdrop {
    position: absolute;
    z-index: -1;
    inset: 0;
    --unit: 1cqmax;
    --radius: calc(4 * var(--unit));
    filter: blur(var(--radius));
}

.animated-background > .backdrop > span {
    width: calc(var(--radius) * 8);
    border-radius: 50%;
    aspect-ratio: 1;
    position: absolute;
    animation: 10s linear 0s infinite rotate;
}

@keyframes rotate {
    from {
        transform: rotate(0);
    }
    
    to {
        transform: rotate(360deg);
    }
}

button {
    background: var(--colour-1);
    color: white;
    border: none;
    min-height: 32px;
    padding: 0 12px;
    font-size: 13px;
    border-radius: 3px;
    width: auto;
    margin-top: 0;
}

.avatar {
    width: 50vw;
    aspect-ratio: 1;
}

.avatar .logo {
    width: 100%;
    height: 100%;
    max-width: unset;
}

.avatar .avatar-image-container {
    width: 100%;
    height: 100%;
    background: none;
    --animated-background-colours: #ffffff80;
    --animated-background-density: 20;
    -webkit-mask-image: radial-gradient(black 56%, rgba(0, 0, 0, 10%) 65%, transparent 70%);
    mask-image: radial-gradient(black 56%, rgba(0, 0, 0, 10%) 65%, transparent 70%);
}

.avatar .avatar-image-container .backdrop {
    background: var(--avatar-image);
    background-size: cover;
}

.avatar img {
    position: absolute;
    display: block;
    width: 80%;
    height: 80%;
    inset: 10%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 50%;
}

.fade {
    opacity: 0;
    transform: translateY(20px);
}

.visible .fade {
    transform: none;
    animation: 0.5s var(--fade-delay) fade-in linear both;
}

.toolbar {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2em;
}

.logo {
    width: 80%;
    aspect-ratio: 1;
    -webkit-mask-image: url("/logo-mask.svg");
    mask-image: url("/logo-mask.svg");        
    background: var(--colour-1);
    --animated-background-colours: var(--colour-2);
    --animated-background-density: 20;
}

input[type="text"], input[type="password"], input[type="email"] {
    height: 3em;
    border-radius: 1.5em;
    padding: 0.5em 1.5em;
    border: none;
    box-shadow: 0 0 6px 6px rgba(var(--colour-1-rgb), 0.2);
    width: 100%;
    margin-top: 1em;
}

input[name="otp"] {
    --spacing: 0.5ch;
    --left-pad: calc((100% - (6 * (1ch + var(--spacing)) - var(--spacing))) / 2);
    letter-spacing: 0.5ch;
    padding: 0.5em calc(var(--left-pad) - var(--spacing)) 0.5em var(--left-pad);
}

input[type="submit"], button, .button {
    height: 3em;
    border-radius: 1.5em;
    padding: 0.5em 3em;
    border: none;
    background: none;
    box-shadow: 0 0 6px 6px rgba(var(--colour-1-rgb), 0.2);
    text-transform: uppercase;
    color: var(--colour-1);
    font-weight: 600;
    margin-top: 1em;
    transition: color 0.5s, box-shadow 0.5s;
}

input[type="submit"]:focus, button:focus, .button:focus {
    color: var(--colour-2);
    animation: 0.5s linear 0s gain-focus forwards;
    outline: none;
}

input[type="submit"]:hover, button:focus, .button:focus {
    color: var(--colour-2);
    box-shadow: 0 0 6px 6px rgba(var(--colour-2-rgb), 0.2);
}

input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus {
    outline: none;
    animation: 0.5s linear 0s gain-focus forwards;
    transition: box-shadow 0.5s;
}

#ForgotPassword a {
    color: inherit;
    text-decoration: none;
    font-size: smaller;
    transition: all 0.5s;
}

#ForgotPassword a:hover, #ForgotPassword a:focus {
    color: var(--colour-2);
}

.welcome {
    font-weight: 400;
}

.welcome .user-name {
    font-weight: 900;
}

@keyframes gain-focus {
    50% {
        box-shadow: 0 0 10px 10px rgba(var(--colour-2-rgb), 0.3);
    }

    to {
        box-shadow: 0 0 6px 6px rgba(var(--colour-2-rgb), 0.2);
        opacity: 1;
        transform: none;
    }
}

@keyframes fade-in {
    to {
        opacity: 1;
        transform: none;
    }
}