/* ============================================================
   Quiz Educativo — quiz.css
   Compatível com Elementor Pro (herda tipografia do tema)
   ============================================================ */

/* ── Wrapper ── */
.quiz-educativo-wrapper {
    margin: 0 auto;
    color: inherit;
}

/* ── Loading ── */
.quiz-loading {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 2rem;
    color: #888;
    font-size: .95rem;
}

.quiz-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ddd;
    border-top-color: #4caf50;
    border-radius: 50%;
    animation: quiz-spin .8s linear infinite;
    flex-shrink: 0;
}

@keyframes quiz-spin {
    to { transform: rotate(360deg); }
}

/* ── Progresso ── */
.quiz-progress {
    margin-bottom: 1.75rem;
}

.quiz-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5rem;
}

.quiz-progress-label {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #000;
}

.quiz-progress-pct {
    font-size: .8rem;
    font-weight: 700;
    color: #000;
}

.quiz-progress-bar {
    height: 6px;
    background: #EEE;
    border-radius: 99px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #66bb6a, #43a047);
    border-radius: 99px;
    transition: width .5s ease;
}

/* ── Layout lado a lado (imagem + conteúdo) ── */
.quiz-layout {
    display: flex;
    gap: 4rem;
    align-items: center;
    min-height: 650px;
}

.quiz-layout-img {
    flex: 0 0 42%;
    max-width: 42%;
}

.quiz-layout-body {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    font-family: 'Space Grotesk', sans-serif;
}

/* ── Imagem da pergunta ── */
.quiz-question-img {
    display: block;
    width: 100%;
    height: 500px !important;
    object-fit: cover;
    border-radius: 1.25rem !important;
}

@media (max-width: 640px) {
    .quiz-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .quiz-layout-img {
        flex: none;
        max-width: 100%;
    }

    .quiz-question-img {
        max-height: 220px;
    }
}

/* ── Pergunta ── */
.quiz-question-text {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 1.5rem;
    color: inherit;
}

/* ── Opções ── */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: #FFF;
    border: 2px solid #000;
    border-radius: 50px;
    cursor: pointer;
    text-align: left;
    transition: border-color .18s, background .18s, transform .18s;
    font-size: 1rem;
    width: 100%;
    line-height: 1.45;
    color: #000;
    padding: 1rem;
    white-space: normal;
}
@media(max-width:767px) {
    .quiz-option { height: 90px; }
}

.quiz-option:hover:not(:disabled) {
    background: #FFF;
    color: #000;
    transform: translateX(5px);
}

.quiz-option:disabled {
    cursor: not-allowed;
    background-color: #c36;
}

/* Estado correto */
.quiz-option.correct {
    border-color: #4caf50;
    background: #E3F8DD;
    color: #000;
    opacity: 1;
}

.quiz-option.correct .quiz-option-label {
    background: #4caf50;
    color: #FFF;
}

/* Estado errado */
.quiz-option.wrong {
    background: #ffebee;
    border-color: #ef5350;
    color: #000;
    animation: quiz-shake .35s ease;
}

.quiz-option.wrong .quiz-option-label {
    background: #ef5350;
    color: #fff;
}

@keyframes quiz-shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-7px); }
    75%       { transform: translateX(7px); }
}

/* Label A / B / C */
.quiz-option-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    background: #E3F8DD;
    color: #3F8F7A;
    border-radius: 50%;
    font-weight: 800;
    font-size: .8rem;
    text-transform: uppercase;
    flex-shrink: 0;
    transition: background .18s, color .18s;
}

.quiz-option-text {
    flex: 1;
}

/* ── Feedback ── */
.quiz-feedback {
    min-height: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height .25s ease, padding .25s ease;
    padding: 0 1rem;
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: 0;
}

.quiz-feedback.show {
    max-height: 80px;
    padding: 1rem;
    text-align: center;
}

.quiz-feedback.correct {
    color: #2e7d32;
}

.quiz-feedback.wrong {
    color: #c62828;
}

/* ── Botão recuar ── */
.quiz-back-btn {
    display: inline-block;
    background: transparent;
    border: none;
    color: #000;
    padding: 0;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: background .18s;
}

.quiz-back-btn:hover {
    background: transparent;
    color: #000;
}

/* ── Botão avançar ── */
.quiz-next-btn {
    display: block;
    margin: 1rem 0;
    padding: 1.25rem;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, transform .18s;
    width: 100%;
}

.quiz-next-btn:hover {
    background: #3ebc43;
    transform: translateX(4px);
}

/* ── Referência ── */
.quiz-referencia {
    font-size: .78rem;
    color: #000;
    padding: 0 .5rem;
    border-left: 2px solid #000;
    margin-top: 1rem;
    font-style: italic;
    line-height: 1.5;
}

.quiz-referencia-label {
    font-weight: 700;
}

/* ── Formulário de diploma ── */
.quiz-diploma-form {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.quiz-diploma-label {
    font-size: .95rem;
    font-weight: 600;
    color: inherit;
}

.quiz-diploma-input {
    width: 100%;
    padding: .75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    color: inherit;
    background: #fff;
    transition: border-color .18s;
    box-sizing: border-box;
}

.quiz-diploma-input:focus {
    outline: none;
    border-color: #43a047;
}

.quiz-diploma-error {
    display: none;
    font-size: .85rem;
    color: #c62828;
    margin: 0;
}

.quiz-diploma-error.visible {
    display: block;
}

.quiz-diploma-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 1.25rem;
    background: #4caf50;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .18s, transform .15s;
    width: 100%;
}

.quiz-diploma-btn:hover {
    background: #3ebc43;
    transform: translateY(-2px);
}

.quiz-diploma-btn:active {
    transform: translateY(0);
}

.quiz-restart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: transparent;
    color: #000;
    border: 2px solid #000;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .18s, transform .15s;
    width: 100%;
}

.quiz-restart-btn:hover {
    background: rgba(0, 0, 0, .06);
    color: #000;
    transform: translateY(-2px);
}

.quiz-restart-btn:active {
    transform: translateY(0);
}

/* ── Mensagem final ── */
.quiz-final {
    text-align: center;
    padding: 3rem 1.5rem;
    animation: quiz-fade-in .5s ease;
}

.quiz-final-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    animation: quiz-pop .4s ease;
}

.quiz-final-message {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.5;
    color: inherit;
}

@keyframes quiz-fade-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes quiz-pop {
    0%   { transform: scale(.5); }
    70%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ── Erro de shortcode ── */
.quiz-error,
.quiz-error-msg {
    color: #c62828;
    background: #ffebee;
    padding: .75rem 1rem;
    border-radius: 8px;
    font-size: .9rem;
}

/* ── Responsivo ── */
@media (max-width: 540px) {
    .quiz-question-text {
        font-size: 1rem;
    }

    .quiz-option {
        font-size: .9rem;
        padding: .75rem .9rem;
    }

    .quiz-final-message {
        font-size: 1.1rem;
    }
}
