@keyframes popup-fadein {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.modal {
    height: 25vh;
    width: 40%;
    background-color: #fafafa;
    border: 0;
    border-radius: 2rem;
    padding: 10px;
    overflow: auto;
    animation: popup-fadein;
    animation-duration: 150ms;
    position: absolute;
    top: -40%;
}

.modal.large {
    height: max(50vh, 250px);
    width: max(250px, min(60%, 430px));
    top: -20%;
}

.modal.extra-large {
    height: 40%;
    width: 80%;
    top: -30%;
}

.modal.medium-tall {
    height: 60%;
    top: -10%;
}

.modal.tall {
    height: 80%;
    top: 0;
}

.modal[open] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10%;
}

.modal::backdrop {
    background-color: rgba(0, 0, 0, 0.4);
    animation: popup-fadein;
    animation-duration: 150ms;
}

.modal-text-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    flex-wrap: wrap;
}

.modal-text-container > h3 {
    font-size: 2rem;
    text-align: center;
}

.modal-text-container > span {
    font-size: 1.1rem;
    text-align: center;
}

.modal-form {
    min-width: 90%;
    padding: 0 10px;
    overflow: auto;
}

.modal-form.large {
    height: 70%;
}

.modal-form-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5vh 0;
    gap: 0.5vw;
}

.modal-form-buttons.half-width {
    width: 50%;
}

.modal-form-buttons > button {
    flex: 1;
}
