/* Twist Quiz - Styles intégrés au container Elementor */

.twist-quiz-container {
    --twist-primary-color: #4B3C7D;
    max-width: 100%;
    padding: 20px 0;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

/* Questions container */
.twist-quiz-questions {
    position: relative;
    min-height: 320px;
}

/* Step (each question) */
.twist-quiz-step {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
    transform: translateX(30px);
    pointer-events: none;
}

.twist-quiz-step--active {
    opacity: 1;
    visibility: visible;
    position: relative;
    transform: translateX(0);
    pointer-events: auto;
}

/* Exit state - GARDER position relative pour éviter le glitch de compression */
.twist-quiz-step--exit {
    position: relative;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-30px);
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Question title */
.twist-quiz-question {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--twist-primary-color);
    margin: 0 0 30px 0;
    line-height: 1.4;
}

/* Answers container */
.twist-quiz-answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Answer with radio button visible */
.twist-quiz-answer {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity 0.25s ease;
}

.twist-quiz-answer:hover {
    opacity: 0.7;
}

/* Radio button stylisé et visible */
.twist-quiz-radio {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--twist-primary-color);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    background: transparent;
    margin: 2px 0 0 0;
    transition: background 0.2s ease;
}

.twist-quiz-radio:checked::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--twist-primary-color);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.twist-quiz-radio:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(75, 60, 125, 0.3);
}

/* Answer text */
.twist-quiz-answer-text {
    display: block;
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--twist-primary-color);
    transition: opacity 0.25s ease;
}

/* Selected state */
.twist-quiz-answer.twist-quiz-answer--selected .twist-quiz-answer-text {
    font-weight: 500;
}

/* Footer avec progress bar - rapproché des questions */
.twist-quiz-footer {
    margin-top: 20px;
}

/* Progress Bar */
.twist-quiz-progress {
    height: 6px;
    background: rgba(75, 60, 125, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.twist-quiz-progress-bar {
    height: 100%;
    background: var(--twist-primary-color);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.twist-quiz-progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--twist-primary-color);
    font-weight: 500;
}

/* Écran final (résultat) */
.twist-quiz-result {
    display: none;
    text-align: center;
    padding: 60px 20px;
}

.twist-quiz-result--active {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.twist-quiz-result-text {
    font-size: 1.75rem;
    line-height: 1.5;
    color: #fff;
    margin: 0;
    font-weight: 400;
}

.twist-quiz-result-text strong {
    font-weight: 600;
}

/* Hide elements when showing result */
.twist-quiz-container.twist-quiz-container--result .twist-quiz-questions,
.twist-quiz-container.twist-quiz-container--result .twist-quiz-footer {
    display: none;
}

/* Responsive */
@media (max-width: 600px) {
    .twist-quiz-container {
        padding: 15px 0;
    }

    .twist-quiz-question {
        font-size: 1.25rem;
    }

    .twist-quiz-answer {
        padding: 10px 0;
    }

    .twist-quiz-answer-text {
        font-size: 1.05rem;
    }

    .twist-quiz-questions {
        min-height: 280px;
    }

    .twist-quiz-footer {
        margin-top: 15px;
    }

    .twist-quiz-result {
        padding: 40px 15px;
        min-height: 250px;
    }

    .twist-quiz-result-text {
        font-size: 1.35rem;
    }
}
