body {
    background: #2D4059;
    font-family: sans-serif;
    padding-top: 2rem;
    color: white;
}

h1 {
    text-align: center;
}

main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

section {
    display: flex;
    justify-content: center;
    gap: 1rem;
    place-items: center;
}

button {
    padding: 0.7rem 1.2rem;
    font-size: large;
    background: #EA5455;
    color: white;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

button:hover {
    filter: brightness(1.2);
}

img {
    width: 100%;
    border: 2px solid white;
}

.preview {
    position: relative;
    max-width: 400px;
    margin: 0 2rem;
}

.loader.active+img {
    opacity: 0.5;
}

.loader.active {
    display: block;
}

.loader {
    display: none;
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
    width: 80px;
    height: 80px;
}

.loader div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 64px;
    height: 64px;
    margin: 8px;
    border: 8px solid #fff;
    border-radius: 50%;
    animation: loader 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #fff transparent transparent transparent;
}

.loader div:nth-child(1) {
    animation-delay: -0.45s;
}

.loader div:nth-child(2) {
    animation-delay: -0.3s;
}

.loader div:nth-child(3) {
    animation-delay: -0.15s;
}

@keyframes loader {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}