@import url('../general-and-utility-classes.css');

.signup-modal,
.login-modal,
.forgot-password-modal {

    .signup-modal__right,
    .login-modal__right,
    .forgot-password-modal__right {

        form {
            label {
                display: block;
                font-size: 16px;
                line-height: 1.2em;
                font-weight: 600;
                color: var(--color-black);
                margin-bottom: 8px;
            }

            input[type="text"],
            input[type="password"] {
                width: 100%;
                font-size: 16px;
                line-height: 1em;
                color: var(--color-black);
                padding: 16px !important;
                border: 1px solid #A9A9A9;
                background-color: #F1F2F4;

                &::placeholder {
                    color: var(--color-gray);
                }

                &:focus {
                    outline: none;
                }
            }

            button {
                position: relative;
                z-index: 1;
                font-size: 16px;
                font-weight: 700;
                text-transform: uppercase;
                background-color: var(--color-slick-yellow);
                background-image: none;
                border: none;
                padding: 24px;
                margin-top: 42px;
                overflow: hidden;
                cursor: pointer;
                transition: .2s linear;

                &::after {
                    content: '';
                    position: absolute;
                    top: 50%;
                    left: 50%;
                    width: 20px;
                    height: 20px;
                    background-color: var(--color-success);
                    border-radius: 50%;
                    transform: translate(-50%, -50%) scale(0);
                    transition: transform 0.6s ease-out;
                    z-index: -1;
                }

                &:hover {
                    background-color: var(--color-slick-yellow-darkened);
                    transition: .2s linear;
                }

                &.disabled {
                    background-color: #E4E4E4;
                    cursor: not-allowed;

                    .label {
                        color: #BFBFBF;
                    }
                }

                &.success {
                    padding: 12px;

                    &::after {
                        transform: translate(-50%, -50%) scale(25);
                    }
                }

                .label {
                    color: var(--color-text-black);
                }

                .spinner {
                    display: none;
                    border: 3px solid #f3f3f3;
                    border-top: 3px solid var(--color-slick-blue);
                    border-radius: 50%;
                    width: 20px;
                    height: 20px;
                    animation: spin 1s linear infinite;
                    margin: 0 auto;
                }

                .checkmark {
                    display: none;
                    flex-wrap: wrap;
                    justify-content: center;
                    align-items: center;
                    height: max-content;
                }

                /* -- SVG Tick Animation -- */
                .tick {
                    stroke-opacity: 0;
                    stroke-dasharray: 29px;
                    stroke-dashoffset: 29px;
                    animation: draw .8s cubic-bezier(.25, .25, .25, 1) forwards;
                    animation-delay: .6s;
                }

                .circle {
                    fill-opacity: 0;
                    stroke: var(--color-white);
                    stroke-width: 16px;
                    transform-origin: center;
                    transform: scale(0);
                    animation: grow 1s cubic-bezier(.25, .25, .25, 1.25) forwards;   
                }  
            }
        }
    }
}

.forgot-password-modal {

    .forgot-password-confirmation {

        h2 {
            font-size: 32px;
            line-height: 38px;
            color: var(--color-black);
            text-align: center;
            width: 100%;
            margin: 12px 0 6px;
        }

        p {
            font-size: 16px;
            line-height: 20px;
        }
    }
}

/* --- Shared Styles for Signup and Login Modals --- */
.signup-modal,
.login-modal,
.forgot-password-modal {
    display: none;

    &::backdrop {
        background-color: #000000B3;
    } 

    &[open] {
        display: block;
    }

    .signup-modal__container,
    .login-modal__container,
    .forgot-password-modal__container {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        background: var(--color-white);
        max-width: 800px;
        width: 90%;
        display: flex;
        border-radius: 4px;
        overflow: hidden;

        /* Mobile */
        @media only screen and (max-width: 767px) {
            flex-direction: column;
            max-height: 90%;
            overflow: auto;
        }
    }

    .signup-modal__right,
    .login-modal__right,
    .forgot-password-modal__right  {
        width: 100%;
        padding: 64px 24px 24px;

        /* Mobile */
        @media only screen and (max-width: 767px) {
            padding: 24px 32px 42px;
        }

        form {

            button {
                width: 100%;  
            }
        }
    }

    .signup-modal__left,
    .login-modal__left,
    .forgot-password-modal__left  {
        width: 100%;
        max-width: 332px;
        overflow: hidden;

        /* Mobile */
        @media only screen and (max-width: 767px) {
            height: 125px;
            max-width: 100%;
        }

        .banner {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .banner--desktop {
            /* Mobile */
            @media only screen and (max-width: 767px) {
                display: none;
            }
        }

        .banner--mobile {
            display: none;

            /* Mobile */
            @media only screen and (max-width: 767px) {
                display: block;
            }
        }
    }
}

/* --- Login Modal Styles --- */
.login-modal {

    .login-modal__right {

        h2 {
            font-size: 42px;
            line-height: 1.2em;
            font-weight: bold;
            color: var(--color-black);
            margin: 0 0 40px;
        }
    }

    form {

        .password-label {
            margin-top: 24px;
        }
        
        .password-wrapper {
            position: relative;
        }

        .forgot-password {
            position: absolute;
            right: 0;
            top: -8px;
            transform: translateY(-100%);
            font-size: 14px;
            line-height: 1.2em;
            font-weight: 700;
            color: var(--color-slick-yellow);
            transition: .2s linear;

            &:hover {
                color: var(--color-slick-yellow-darkened);
                transition: .2s linear;
            }
        }

        .remember-me-container {
            margin-top: 14px;
        }

        .remember-me {
            display: block;
            position: relative;
            padding-left: 35px;
            color: #323031;
            font-weight: 600;
            margin-bottom: 12px;
            cursor: pointer;
            user-select: none;

            /* Mouse-over */
            &:hover input ~ .checkmark {
                background-color: #ccc;
            }

            input {
                position: absolute;
                opacity: 0;
                cursor: pointer;
                height: 0;
                width: 0;

                /* Checkbox is checked */
                &:checked ~ .checkmark {
                    background-color: var(--color-slick-blue);

                    &::after {
                        display: block;
                    }
                }
            }

            .checkmark {
                position: absolute;
                top: 0;
                left: 0;
                height: 20px;
                width: 20px;
                background-color: var(--color-white);
                border: 1px solid #A9A9A9;
                border-radius: 2px;

                &:after {
                    content: "";
                    display: none;
                    position: absolute;
                    left: 6px;
                    top: 2px;
                    width: 6px;
                    height: 12px;
                    border: solid white;
                    border-width: 0 3px 3px 0;
                    transform: rotate(45deg);
                }
            }
        }

        .sign-up-link {
            font-size: 15px;
            line-height: 1.2em;
            font-weight: 500;
            text-align: center;
            margin-top: 42px;

            a {
                position: relative;
                font-size: 15px;
                line-height: 1.2em;
                font-weight: 700;
                color: var(--color-slick-blue);
            
                &::after {
                    content: '';
                    position: absolute;
                    bottom: 0;
                    left: 0;
                    width: 100%;
                    height: 1px;
                    background-color: var(--color-slick-blue);
                }

                &:hover {
                    opacity: .8;
                    transition: .2s linear;

                    &::after {
                        opacity: .8s;
                        transition: .2s linear;
                    }
                }
            }
        }

        .login-error,
        .login-success-message {
            display: none; 
            font-size: 14px;
            margin-top: 10px;
        }

        .login-error {
            color: var(--color-error); 
        }

        .login-success-message {
            color: var(--color-success); 
        }
    }
}

/* --- Signup Modal Styles --- */
.signup-modal {

    .signup-modal__right {

        h2 {
            font-size: 32px;
            line-height: 1.2em;
            font-weight: bold;
            color: var(--color-black);
            margin-bottom: 8px;
        }

        p {
            font-size: 14px;
            line-height: 1.2em;
            color: var(--color-gray);
            margin-bottom: 24px;
        }
    }

    form.wpcf7-form  {

        .wpcf7-form-control-wrap {

            .wpcf7-form-control.wpcf7-select,
            .wpcf7-form-control.wpcf7-email,
            .wpcf7-form-control.wpcf7-text {
                width: 100%;
                font-size: 16px;
                line-height: 1.2em;
                color: var(--color-black);
                padding: 16px !important;
                border: 1px solid #A9A9A9;
                background-color: #F1F2F4 !important;
                margin-top: 8px;

                &::placeholder {
                    color: var(--color-gray);
                }
            }

            .wpcf7-form-control.wpcf7-select {
                cursor: pointer;

                option {
                    cursor: pointer;
                }
            }

            .wpcf7-not-valid-tip {
                font-size: 14px;
                color: var(--color-error);
                margin-top: 4px;
            }
        }

        p:has(.wpcf7-submit) {
            position: relative;
            margin: 24px 0 0;
        }

        .wpcf7-submit {
            color: var(--color-text-black);
            font-size: 16px;
            font-weight: 700;
            text-transform: uppercase;
            background-color: var(--color-slick-yellow);
            background-image: none;
            border: none;
            width: 100%;
            padding: 24px;
            cursor: pointer;
            transition: .2s linear;

            &:hover {
                background-color: var(--color-slick-yellow-darkened);
                transition: .2s linear;
            }

            &.disabled {
                color: #BFBFBF;
                background-color: #E4E4E4;
                cursor: not-allowed;
            }
        }

        .wpcf7-spinner {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(200%, -50%);
            margin: 0;
        }

        .wpcf7-response-output {
            font-size: 14px;
            border: none;
            padding: 0;
            margin: 10px 0 0;
        }

        &[data-status="invalid"] {

            .wpcf7-response-output {
                color: var(--color-error);
            }
        }

        &[data-status="submitting"],
        &[data-status="resetting"] {
            opacity: .6;
        }

        &[data-status="sent"] {
            position: relative;

            .wpcf7-response-output {
                display: flex;
                justify-content: center;
                align-items: center;
                flex-direction: column;
                gap: 12px;
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background-color: var(--color-white);
                font-size: 18px;
                line-height: 22px;
                text-align: center;
                margin: 0;

                &::before {
                    content: url('../../images/icons/icon-check-fill.svg');
                }
            }
        }

        .already-has-account {
            font-size: 15px;
            font-weight: 500;
            color: var(--color-black);
            text-align: center;
            margin: 24px 0 0;

            a {
                position: relative;
                font-size: 15px;
                font-weight: 700;
                color: var(--color-slick-blue);
                margin-left: 6px;
                opacity: 1;
                transition: .2s linear;

                &::after {
                    content: '';
                    position: absolute;
                    bottom: -2px;
                    left: 0;
                    width: 100%;
                    height: 1px;
                    background-color: var(--color-slick-blue);
                    opacity: 1;
                    transition: .2s linear;
                }

                &:hover {
                    opacity: .8;
                    transition: .2s linear;

                    &::after {
                        opacity: .8s;
                        transition: .2s linear;
                    }
                }
            }
        }
    }
}

/* --- Forgot Pas Modal Styles --- */
.forgot-password-modal {

    form {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 100%;

        .form-reset-header {

            h2 {
                font-size: 32px;
                line-height: 1.2em;
                font-weight: bold;
                color: var(--color-black);
                margin-bottom: 16px;
            }

            p {
                font-size: 14px;
                line-height: 1.2em;
                color: var(--color-gray);
            }
        }

        .form-reset-footer {
            position: relative;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-bottom: 24px;

            a {
                font-size: 14px;
                font-weight: 700;
                color: var(--color-slick-yellow);
                transition: .2s linear;

                &:hover {
                    color: var(--color-slick-yellow-darkened);
                    transition: .2s linear;
                }
            }

            button.reset-button {
                width: max-content;
                min-width: 202px;
                padding: 24px 32px;
                margin: 0;
                cursor: pointer;
            }

            .form-reset-message {
                position: absolute;
                bottom: 0;
                left: 50%;
                transform: translateX(-50%);
                width: max-content;
                max-width: 100%;
                font-size: 14px;
                line-height: 8px;
                color: var(--color-error);
            }
        }
    }

    .forgot-password-confirmation {
        display: none;
        justify-content: center;
        height: 100%;

        .confirmation-content {
            display: flex;
            flex-direction: column;
            justify-content: center;
            flex-wrap: wrap;

            p {
                color: #737A80;
                margin: 0;
            }
        }
    }
}

/* --- Reset Password Form --- */
.woocommerce-lost-password {

    .woocommerce {
        display: flex;
        justify-content: center;
    }

    /* Form */
    .woocommerce-ResetPassword {

        .woocommerce-form-row {
            width: 100%;

            .password-input {

                input.woocommerce-Input {
                    padding: 14px !important;
                }

                .show-password-input {
                    background-image: none;
                }
            }
        }
    }
}


@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes grow {
    60% {
        transform: scale(.8);
        stroke-width: 4px;
        fill-opacity: 0;
    }
    100% {
        transform: scale(.9);
        stroke-width: 8px;
        fill-opacity: 1;
        fill: var(--color-white);
    }
}

@keyframes draw {
    0%, 100% { stroke-opacity: 1; }
    100% { stroke-dashoffset: 0; }
}