/* =========================================================
   PERSONALITY QUIZ
   New all-questions-on-one-page experiment
   ========================================================= */

.personalityQuiz {
    width: 100%;
    max-width: 760px;
    margin: 24px auto 0;
    box-sizing: border-box;
}

.personalityQuiz *,
.personalityQuiz *::before,
.personalityQuiz *::after {
    box-sizing: border-box;
}


/* =========================================================
   QUESTION
   ========================================================= */

.personalityQuestion {
    width: 100%;
    margin: 0;

    padding: 24px 20px;

    background: linear-gradient(
        180deg,
        var(--surface-solid) 0%,
        var(--surface-soft) 100%
    );

    border: 1px solid var(--accent-border);
    border-radius: 22px;

    box-shadow: var(--shadow-card);

    transition:
        border-color .22s ease,
        box-shadow .22s ease;
}

.personalityQuestion.is-answered {
    border-color: rgba(95, 127, 114, 0.38);
}


/* =========================================================
   QUESTION IMAGE
   ========================================================= */

.personalityQuestionImageFigure {
    width: 100%;
    margin: 0 0 20px;
}

.personalityQuestionImageHolder {
    width: 100%;
}

.personalityQuestionImage {
    display: block;

    width: 100%;
    aspect-ratio: 16 / 9;

    object-fit: cover;

    border-radius: 16px;

    background: var(--surface-muted);
    border: 1px solid var(--border-soft);

    box-shadow: 0 12px 30px rgba(47, 58, 53, 0.08);
}

.personalityQuestionFigcaption {
    display: block;

    margin-top: 7px;

    color: var(--text-soft);

    font-size: .88rem;
    line-height: 1.4;
}


/* =========================================================
   QUESTION TEXT
   ========================================================= */

.personalityQuestionTextWrapper {
    width: 100%;
}

.personalityQuestionText {
    margin: 0 0 20px !important;

    color: var(--text-main) !important;

    text-align: center;

    font-size: 1.35rem !important;
    font-weight: 850;
    line-height: 1.35 !important;

    letter-spacing: -0.02em;
}


/* =========================================================
   ANSWERS
   ========================================================= */

.personalityAnswers {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 12px;

    width: 100%;
}


/* =========================================================
   ANSWER BUTTON
   ========================================================= */

.personalityAnswer {
    appearance: none;
    -webkit-appearance: none;

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

    width: 100%;
    min-width: 0;
    min-height: 58px;

    margin: 0;
    padding: 14px 16px;

    border: 1px solid rgba(95, 127, 114, 0.20);
    border-radius: 16px;

    background: var(--surface-solid);

    color: var(--text-main);

    font: inherit;
    font-size: 1.04rem;
    font-weight: 760;
    line-height: 1.3;

    text-align: center;

    cursor: pointer;
    user-select: none;

    box-shadow: 0 8px 22px rgba(47, 58, 53, 0.06);

    transition:
        transform .16s ease,
        background-color .22s ease,
        border-color .22s ease,
        box-shadow .22s ease,
        color .22s ease,
        opacity .22s ease;
}

.personalityAnswerText {
    display: block;

    width: 100%;

    overflow-wrap: anywhere;
}


/* hover only for answers that are still selectable */

.personalityAnswer:not(:disabled):hover {
    transform: translateY(-1px);

    background: var(--surface-soft);

    border-color: rgba(95, 127, 114, 0.38);

    box-shadow: 0 12px 28px rgba(47, 58, 53, 0.10);
}

.personalityAnswer:not(:disabled):active {
    transform: translateY(0);
}


/* keyboard navigation */

.personalityAnswer:focus-visible {
    outline: 3px solid rgba(95, 127, 114, 0.32);
    outline-offset: 3px;
}


/* =========================================================
   SELECTED ANSWER
   ========================================================= */

.personalityAnswer.is-selected,
.personalityAnswer.is-selected:disabled {
    opacity: 1;

    cursor: default;

    background: var(--accent-soft);

    border-color: rgba(95, 127, 114, 0.58);

    color: var(--text-main);

    -webkit-text-fill-color: var(--text-main);

    box-shadow: 0 10px 26px rgba(95, 127, 114, 0.16);

    transform: none;
}


/* =========================================================
   UNSELECTED ANSWERS AFTER QUESTION IS ANSWERED
   ========================================================= */

.personalityAnswer.is-unselected,
.personalityAnswer.is-unselected:disabled {
    cursor: default;

    opacity: .55;

    background: var(--surface-muted);

    border-color: rgba(95, 127, 114, 0.14);

    color: var(--text-soft);

    -webkit-text-fill-color: var(--text-soft);

    box-shadow: none;

    transform: none;
}


/* =========================================================
   AD SLOT BETWEEN QUESTIONS
   ========================================================= */

.personalityQuizAdSlot {
    width: 100%;

    margin: 28px 0;

    box-sizing: border-box;
}

.personalityQuizAdSlot .feedAdContainer {
    width: 100%;
    min-height: 250px;

    margin: 0;

    box-sizing: border-box;
}


/* =========================================================
   FINISH AREA
   ========================================================= */

.personalityQuizFinish {
    display: flex;
    justify-content: center;

    width: 100%;

    margin: 32px 0 0;
}

.personalityQuizFinishButton {
    appearance: none;
    -webkit-appearance: none;

    width: 100%;
    min-height: 56px;

    margin: 0;
    padding: 14px 20px;

    border: 1px solid rgba(72, 105, 95, 0.30);
    border-radius: 16px;

    background: linear-gradient(
        135deg,
        var(--accent) 0%,
        var(--accent-strong) 100%
    );

    color: var(--color-white);

    font: inherit;
    font-size: 1.08rem;
    font-weight: 850;
    line-height: 1.2;

    text-align: center;

    cursor: pointer;

    box-shadow: 0 12px 28px rgba(72, 105, 95, 0.20);

    transition:
        transform .16s ease,
        box-shadow .22s ease,
        filter .22s ease,
        opacity .22s ease,
        background-color .22s ease,
        border-color .22s ease,
        color .22s ease;
}

.personalityQuizFinishButton:not(:disabled):hover {
    transform: translateY(-1px);

    filter: saturate(1.03) brightness(.98);

    box-shadow: 0 16px 34px rgba(72, 105, 95, 0.25);
}

.personalityQuizFinishButton:not(:disabled):active {
    transform: translateY(0);
}

.personalityQuizFinishButton:focus-visible {
    outline: 3px solid rgba(95, 127, 114, 0.34);
    outline-offset: 3px;
}


/* disabled until every question has an answer */

.personalityQuizFinishButton:disabled {
    cursor: default;

    opacity: 1;

    background: #edf0ea;

    border-color: rgba(95, 127, 114, 0.18);

    color: var(--text-soft);

    -webkit-text-fill-color: var(--text-soft);

    box-shadow: none;

    transform: none;
}


/* =========================================================
   ERROR
   ========================================================= */

.personalityQuizError {
    width: 100%;

    margin-top: 20px;
    padding: 14px 16px;

    border: 1px solid rgba(170, 82, 82, 0.30);
    border-radius: 14px;

    background: rgba(170, 82, 82, 0.08);

    color: #5c2b2b;

    font-size: .98rem;
    font-weight: 650;
    line-height: 1.45;
}

.personalityQuizError[hidden] {
    display: none;
}


/* =========================================================
   RESULT CONTAINER
   ========================================================= */

.personalityQuizResult {
    width: 100%;

    margin-top: 32px;

    scroll-margin-top: 110px;
}

.personalityQuizResult[hidden] {
    display: none;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.personalityQuizEmpty {
    width: 100%;

    padding: 22px 18px;

    border: 1px solid var(--border-soft);
    border-radius: 16px;

    background: var(--surface-soft);

    color: var(--text-muted);

    text-align: center;

    font-size: 1rem;
    line-height: 1.45;
}


/* =========================================================
   TABLET / MOBILE
   ========================================================= */

@media (max-width: 760px) {
    .personalityQuiz {
        margin-top: 20px;
    }

    .personalityQuestion {
        padding: 20px 16px;

        border-radius: 20px;
    }

    .personalityQuizAdSlot {
        margin: 24px 0;
    }
}


/* =========================================================
   MOBILE ANSWERS
   ========================================================= */

@media (max-width: 560px) {
    .personalityQuestion {
        padding: 18px 14px;

        border-radius: 18px;
    }

    .personalityQuestionImageFigure {
        margin-bottom: 16px;
    }

    .personalityQuestionImage {
        border-radius: 14px;
    }

    .personalityQuestionText {
        margin-bottom: 16px !important;

        font-size: 1.18rem !important;
    }

    .personalityAnswers {
        grid-template-columns: 1fr;

        gap: 10px;
    }

    .personalityAnswer {
        min-height: 54px;

        padding: 13px 14px;

        border-radius: 14px;

        font-size: 1rem;

        text-align: left;
        justify-content: flex-start;
    }

    .personalityQuizAdSlot {
        margin: 22px 0;
    }

    .personalityQuizAdSlot .feedAdContainer {
        min-height: 250px;
    }

    .personalityQuizFinish {
        margin-top: 26px;
    }

    .personalityQuizFinishButton {
        min-height: 54px;

        border-radius: 14px;

        font-size: 1.04rem;
    }

    .personalityQuizResult {
        margin-top: 26px;

        scroll-margin-top: 90px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .personalityQuestion,
    .personalityAnswer,
    .personalityQuizFinishButton {
        transition: none;
    }

    .personalityAnswer:not(:disabled):hover,
    .personalityQuizFinishButton:not(:disabled):hover {
        transform: none;
    }
}