/* ==========================================================
   StackTest Poll
   Joomla 6
   Step 1 - Layout + Stack
   ========================================================== */

.container {
    width: 90%;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    padding-bottom: 2rem;
}

.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ==========================================================
   Stack
   ========================================================== */

.stack {
    position: relative;
    width: 320px;
    height: 430px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
    z-index: 100;
}

.stack__item {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;

    width: 100%;
    height: 100%;

    opacity: 0;
    pointer-events: none;

    overflow: hidden;

    transition:
        transform .5s ease,
        opacity .5s ease;
}

/* Верхняя карточка */

.stack__item--current {
    opacity: 1;
    pointer-events: auto;
    z-index: 100;
}

/* Вторая карточка */

.stack__item:nth-child(2) {
    opacity: .95;
    transform: translateY(4px) scale(.99);
    z-index: 99;
}

/* Третья карточка */

.stack__item:nth-child(3) {
    opacity: .90;
    transform: translateY(8px) scale(.98);
    z-index: 98;
}

/* Остальные */

.stack__item:nth-child(n+4) {
    opacity: 0;
    z-index: 1;
}

/* ==========================================================
   Step 2 - Flip
   ========================================================== */

.stack-flip-container {
    width: 100%;
    height: 100%;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

.stack-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform .6s;
}

.stack-flip-container.stack-click .stack-flipper {
    transform: rotateY(180deg);
}

.question,
.answer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    backface-visibility: hidden;
    cursor: pointer;
}

.question {
    z-index: 2;
    transform: rotateY(0deg);

    background: #b5f4df;
    border: 1px solid #95ccb9;
}

.answer {
    transform: rotateY(180deg);

    background: #e1ffa4;
    border: 1px solid #cbff60;
}

.question-wrapper,
.answer-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

.question-image,
.answer-image {
    margin: 0 auto;
}

.question-image img,
.answer-image img {
    display: block;
    width: 100%;
    height: auto;
}

.question-wrapper fieldset,
.answer-wrapper fieldset {
    border: 0;
    padding: 0;
    margin: .75rem 0;
    flex-grow: 1;
}

.question-wrapper fieldset div,
.answer-wrapper fieldset div {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
}

.text-answer {
    margin-top: .75rem;
    color: #0d62c0;
    line-height: 1.3;
    flex-grow: 1;
}

.comment {
    text-align: right;
    color: green;
    margin-top: .5rem;
}

.comment-text {
    margin-top: .5rem;
    padding: .5rem;
    border: 1px solid #96c9a8;
}

/* ==========================================================
   Step 3 - Controls
   ========================================================== */

.controls {
    width: 320px;
    margin: 16px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.button--accept,
.button--reject,
.button--help {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 56px;
    height: 56px;

    border: 0;
    border-radius: 50%;

    background: #246ab2;
    color: #fff;

    cursor: pointer;

    transition: all .2s ease;
}

.button--accept:hover,
.button--reject:hover,
.button--help:hover {
    background: #1d5a96;
    transform: translateY(-2px);
}

.button--accept:active,
.button--reject:active,
.button--help:active {
    transform: scale(.96);
}

.button--accept svg,
.button--reject svg,
.button--help svg {
    width: 24px;
    height: 24px;
    display: block;
}

.button--reject.disabled {
    opacity: .35;
    pointer-events: none;
}


.close_time {
    width: 320px;
    margin: 18px auto 0;
    text-align: center;
}

.button--back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    color: #246ab2;
    text-decoration: none;
    font-weight: 500;
}

.button--back:hover {
    color: #1d5a96;
}

.button--back svg {
    width: 20px;
    height: 20px;
}

.title_time {
    color: #246ab2;
    font-size: .9rem;
    font-weight: 600;
}

.stack__item--accept,
.stack__item--reject {
    will-change: transform;
    animation-fill-mode: forwards;
}

/***********************************************/
/******************** krisna *******************/
/***********************************************/


.stack--krisna .stack__item--reject {
    -webkit-animation: krisnaReject 0.5s forwards;
    animation: krisnaReject 0.5s forwards;
}

@-webkit-keyframes krisnaReject {
    from {
        -webkit-transform: translate3d(-25vw, 0, 0) translate3d(-60%, 0, 0) rotate3d(0, 0, 1, -5deg);
        transform: translate3d(-25vw, 0, 0) translate3d(-60%, 0, 0) rotate3d(0, 0, 1, -5deg);
    }

    to {
        -webkit-transform: translate3d(0, 0, 0) translate3d(0, 0, 0) rotate3d(0, 0, 1, 0deg);
        transform: translate3d(0, 0, 0) translate3d(0, 0, 0) rotate3d(0, 0, 1, 0deg);
    }
}

@keyframes krisnaReject {
    from {
        -webkit-transform: translate3d(-25vw, 0, 0) translate3d(-60%, 0, 0) rotate3d(0, 0, 1, -5deg);
        transform: translate3d(-25vw, 0, 0) translate3d(-60%, 0, 0) rotate3d(0, 0, 1, -5deg);
    }

    to {
        -webkit-transform: translate3d(0, 0, 0) translate3d(0, 0, 0) rotate3d(0, 0, 1, 0deg);
        transform: translate3d(0, 0, 0) translate3d(0, 0, 0) rotate3d(0, 0, 1, 0deg);
    }
}

.stack--krisna .stack__item--accept {

    animation: krisnaAccept 0.5s forwards;
}

@-webkit-keyframes krisnaAccept {
    to {

        transform: translate3d(25vw, 0, 0) translate3d(60%, 0, 0) rotate3d(0, 0, 1, 5deg);
    }
}

@keyframes krisnaAccept {
    to {

        transform: translate3d(25vw, 0, 0) translate3d(60%, 0, 0) rotate3d(0, 0, 1, 5deg);
    }
}

/* ...when content has 100% viewport width */
@media screen and (max-width: 60em) {
    @-webkit-keyframes krisnaReject {
        to {
            -webkit-transform: translate3d(-50vw, 0, 0) translate3d(-60%, 0, 0) rotate3d(0, 0, 1, -5deg);
            transform: translate3d(-50vw, 0, 0) translate3d(-60%, 0, 0) rotate3d(0, 0, 1, -5deg);
        }
    }

    @keyframes krisnaReject {
        to {
            -webkit-transform: translate3d(-50vw, 0, 0) translate3d(-60%, 0, 0) rotate3d(0, 0, 1, -5deg);
            transform: translate3d(-50vw, 0, 0) translate3d(-60%, 0, 0) rotate3d(0, 0, 1, -5deg);
        }
    }

    @-webkit-keyframes krisnaAccept {
        to {
            -webkit-transform: translate3d(50vw, 0, 0) translate3d(60%, 0, 0) rotate3d(0, 0, 1, 5deg);
            transform: translate3d(50vw, 0, 0) translate3d(60%, 0, 0) rotate3d(0, 0, 1, 5deg);
        }
    }

    @keyframes krisnaAccept {
        to {
            -webkit-transform: translate3d(50vw, 0, 0) translate3d(60%, 0, 0) rotate3d(0, 0, 1, 5deg);
            transform: translate3d(50vw, 0, 0) translate3d(60%, 0, 0) rotate3d(0, 0, 1, 5deg);
        }
    }
}