/* 
 * Loader (spinner)
 * https://css-loaders.com/spinner/
 */
#kpopup #kpopuploader {
    /* Spinner */
    width: 20px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: 
        radial-gradient(farthest-side,#ffffff 94%,#0000) top/4px 4px no-repeat,
        conic-gradient(#0000 30%,#ffffff);
    mask: radial-gradient(farthest-side,#0000 calc(100% - 4px),#000 0);
    -webkit-mask: radial-gradient(farthest-side,#0000 calc(100% - 4px),#000 0);
    animation: kpopuploaderl13 1s infinite linear;

    /* Custom */
    margin: auto;
}

@keyframes kpopuploaderl13 { 
    100% { transform: rotate(1turn) }
}

/*
 * Default browser styles to prevent
 */
#kpopup button:focus {
    outline: 0;
}

/*
 * Mobile (first)
 */
#kpopupcontainer {
    position: fixed;
    bottom: 0;
    height: 100vh;
    width: 100%;

    background: #00000082;

    display: flex;
    align-items: center;
    justify-content: center;

    /* Max z-index */
    z-index: 2147483647;

    /* Animation */
    transition: all 0.3s;
    opacity: 0;
}

#kpopup {
    /* Fixed */
    display: flex;
    border-radius: 10px;
    box-shadow: 0px 0px 5px 0px #00000026;
    overflow: hidden;

    /* Dynamic */
    flex-direction: column-reverse;
    height: 560px;
    width: 82%;
}
#kpopup.kpopupsuccess {
    flex-direction: column-reverse;
}

#kpopup > div,
#kpopup > form {
    height: 50%;
}

#kpopup #kpopuplabel {
    font-size: 26px;
    text-align: center;
    font-weight: bold;
    line-height: 1;
    margin: 0;
}
#kpopup #kpopuplabel.kpopuplabellong {
    font-size: 22px;
}
#kpopup.kpopupsuccess #kpopuplabel {
    font-size: 28px;
}

#kpopup #kpopupform {
    /* Fixed */
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    text-align: center;
    justify-content: space-evenly;

    /* Dynamic */
    gap: 16px;
}
#kpopup.kpopupsuccess #kpopupform {
    gap: 42px;
    padding: 50px 20px;
}

#kpopup #kpopupform #kpopupemail {
    /* Fixed */
    margin: 0;
    border-radius: 5px;
    border: 1px solid #00000069;
    font-size: 14px;

    /* Dynamic */
    padding: 10px;
}

#kpopup #kpopupform #kpopupcaptchalegal {
    font-size: 10px;
    line-height: 1.2;
}

#kpopup #kpopupform #kpopupsubscriptionlabel {
    display: flex;
    justify-content: center;
    margin: 0;
    text-align: left;
    font-size: 12px;
    line-height: 1.4;
}
#kpopup #kpopupform #kpopupsubscriptionlabel #kpopupsubscriptioncheckbox {
    margin: 0 8px 0 4px;
}

#kpopup #kpopupform #kpopupsubmit {
    /* Fixed */
    margin: 0;
    border: 0;
    border-radius: 3px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;

    /* Dynamic */
    padding: 10px;
}

#kpopup #kpopupimage {
    background-size: cover;
    background-position: center;
}

#kpopup #kpopuperror {
    position: absolute;
    width: 100%;
    height: 36px;
    bottom: -36px;
    background: #d21a1a;
    text-align: center;
    font-size: 12px;
    padding: 1px;
    font-weight: bold;
    color: white;
    line-height: 1.2;

    /* Animation */
    transition: bottom 0.5s ease-in-out;

    /* Vertical align text */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/**
 * Tablet / Desktop (> 576px)
 */
@media (min-width: 576px) {
    #kpopupcontainer {
        background: transparent;

        pointer-events: none;

        align-items: flex-end;
        justify-content: flex-start;
    }

    #kpopup {
        position: sticky;
        bottom: 20px;
        margin-left: 20px;

        pointer-events: auto;
        
        flex-direction: row;
        width: 520px;
        height: unset;
    }
    #kpopup.kpopupsuccess {
        flex-direction: row-reverse;
    }

    #kpopup > div,
    #kpopup > form {
        width: 50%;
        height: unset;
    }

    #kpopup #kpopuplabel {
        font-size: 24px;
        margin-bottom: 12px;
    }
    #kpopup #kpopuplabel.kpopuplabellong {
        font-size: 22px;
    }
    #kpopup.kpopupsuccess #kpopuplabel {
        font-size: 16px;
        margin-bottom: 0;
    }

    #kpopup #kpopupform {
        gap: 6px;
    }
    #kpopup.kpopupsuccess #kpopupform {
        gap: 20px;
    }

    #kpopup #kpopupform #kpopupemail {
        padding: 5px;
    }

    #kpopup #kpopupform #kpopupsubmit {
        padding: 5px;
    }

    #kpopup #kpopuperror {
        height: 20px;
        bottom: -20px;
        font-size: 12px;
    }
}

/*
 * Not affected by responsive
 */
#kpopup #kpopupclose {
    background: #00000033;
    padding: 4px;
    border: 0;
    position: absolute;
    top: 3px;
    right: 3px;
    width: 28px;
    height: 28px;
    color: #ffffff;
    font-family: sans-serif;
    font-size: 15px;
    border-radius: 5px;
    cursor: pointer;
}
#kpopup #kpopupclose:hover {
    background: #00000054; 
}