@import './parts/fonts';
@import './parts/variables';
@import './parts/general';

.accessible-docs-popup {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    position: fixed;
    z-index: 9999;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: $font-primary;

    &__overlay {
        cursor: pointer;
        display: block;
        position: absolute;
        z-index: 1;
        height: 100%;
        width: 100%;
    }

    &__close {
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: transparent;
        cursor: pointer;
        border: none;
        padding: 0;
        width: 24px;
        height: 24px;
        margin-left: auto;

        svg{
            width: 14px;
            height: 14px;
        }

        * {
            pointer-events: none;
        }
    }

    &__wrapper {
        position: relative;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        background-color: rgba(33, 33, 33, .8);
        min-height: 100%;
        z-index: 2;
        display: flex;
        align-items: center;
    }

    &__inner {
        overflow: hidden;
        max-width: 456px;
        width: calc(100% - 30px);
        position: relative;
        background-color: $color-white;
        padding: 16px 24px 24px;
        margin: 20px auto;
        display: flex;
        flex-direction: column;
        gap: 32px;
    }

    &__loader {
        background-image: url('../images/loader.svg');
        background-position: center;
        background-size: 60px;
        background-repeat: no-repeat;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        z-index: 1000;
        background-color: rgba($color: $color-dark, $alpha: 0.5);
        visibility: hidden;
        opacity: 0;
        transition: 300ms linear;
        transition-property: opacity, visibility;

        &.active {
            visibility: visible;
            opacity: 1;
        }
    }

    &__body {
        &.in-process, &.error, &.completed {
            .accessible-docs-popup__request {
                display: none;
            }
        }
        
        &.in-process .accessible-docs-popup__processed,
        &.error .accessible-docs-popup__error,
        &.completed .accessible-docs-popup__ready {
            display: block;
        }
    }

    &__request {
        margin-bottom: 16px;
        display: flex;
        flex-direction: column;
        gap: 32px;
    }

    &__processed,
    &__ready,
    &__error {
        display: none;
        margin-bottom: 32px;
    }

    &__content {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    &__title,
    &__text,
    &__download-file {
        font-family: $font-primary;
        text-align: center;
        margin: 0;
        padding: 0;
        color: $color-dark;
        width: 100%;
    }

    &__title {
        font-size: 32px;
        font-weight: 600;
        line-height: 1.2;
    }

    &__text,
    &__error {
        font-weight: 400;
        font-size: 16px;
        line-height: 1.375;
    }

    &__form {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }
    
    input,
    input[type="email"],
    &__input {
        font-family: $font-primary;
        width: 100%;
        padding: 16px;
        height: 56px;
        border-radius: 4px;
        background-color: $color-white-smoke;
        color: $color-dark;
        font-size: 16px;
        font-weight: 400;
        border: none;

        &::placeholder {
            color: $color-light-gray;
        }
    }

    &__error {
        color: $color-red;
        display: none;
        font-family: $font-primary;
    }

    &__button {
        font-family: $font-primary;
        margin-top: 16px;
        background-color: $color-dark;
        color: $color-white;
        text-align: center;
        font-weight: 500;
        padding: 15px 30px;
        font-size: 18px;
        line-height: 1.2;
        border-radius: 4px;
        width: 100%;
        border: none;
        cursor: pointer;
        transition: background-color 300ms linear;

        &:hover {
            background-color:  $color-black;
        }
    }

    &__bottom {
        display: flex;
        justify-content: center;
    }

    &__download-file {
        font-size: 18px;
        font-weight: 500;
        line-height: 1.16;
        text-decoration: underline;

        &:hover {
            text-decoration: none;
        }
    }
}
