/* ── Overlay ── */
#quiz-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Sans', sans-serif;
}

/* Blurred page behind - CORREGIDO para usar variable */
#quiz-gate-overlay::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(var(--qg-blur, 16px));
    z-index: -1;
}

/* ── Card container - CORREGIDO para centrar ── */
.qg-card-wrap {
    width: 100%;
    max-width: 500px;
    margin: 20px auto;
    position: relative;
    z-index: 1;
}

/* ── Quiz card ── */
.qg-quiz-card {
    width: 100%;
    background: var(--qg-bg, #ffffff);
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.14);
    overflow: hidden;
}

/* Progress bar */
.qg-progress-bar {
    height: 5px;
    background: #eaedf4;
}
.qg-progress-fill {
    height: 100%;
    background: var(--qg-primary, #3B5BDB);
    transition: width 0.5s cubic-bezier(.4,0,.2,1);
    width: 0%;
}

/* ── Steps ── */
.qg-step {
    display: none;
    padding: 36px 28px 32px;
    min-height: 220px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: qgFadeUp 0.35s cubic-bezier(.4,0,.2,1);
}
.qg-step.active { display: flex; }

@keyframes qgFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Start step ── */
.qg-start-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--qg-text, #222);
    line-height: 1.3;
    margin: 0 0 24px;
}

/* ── Question step ── */
.qg-question-text {
    font-size: 19px;
    font-weight: 600;
    color: var(--qg-text, #222);
    line-height: 1.4;
    margin: 0 0 22px;
}

/* Buttons */
.qg-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 14px;
    background: var(--qg-primary, #3B5BDB);
    color: var(--qg-btn-text, #fff);
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-bottom: 10px;
}
.qg-btn:last-child { margin-bottom: 0; }
.qg-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.16);
    background: var(--qg-btn-hover, var(--qg-primary, #3B5BDB));
    color: var(--qg-btn-hover-text, var(--qg-btn-text, #fff));
}

/* ── Loading step ── */
.qg-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}
.qg-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--qg-primary, #3B5BDB);
    animation: qgDotPulse 1.2s ease-in-out infinite;
}
.qg-dot:nth-child(1) { animation-delay: 0s; }
.qg-dot:nth-child(2) { animation-delay: 0.2s; }
.qg-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes qgDotPulse {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
    40%           { opacity: 1;    transform: scale(1.1); }
}

.qg-loading-text {
    font-size: 17px;
    font-weight: 500;
    color: var(--qg-text, #222);
    opacity: 0.7;
}

/* ── Complete step ── */
.qg-complete-title {
    font-size: 21px;
    font-weight: 700;
    color: var(--qg-text, #222);
    margin: 0 0 6px;
}
.qg-complete-sub {
    font-size: 13px;
    color: #aaa;
    margin: 0 0 22px;
}
.qg-complete-subtext {
    font-size: 13px;
    color: #666;
    margin: 12px 0 0;
    text-align: center;
}

/* ── Revealed state ── */
#quiz-gate-overlay.qg-revealed {
    animation: qgFadeOut 0.5s ease forwards;
    pointer-events: none;
}
@keyframes qgFadeOut {
    to { opacity: 0; visibility: hidden; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .qg-card-wrap {
        max-width: 90%;
        margin: 15px auto;
    }
    .qg-step {
        padding: 28px 20px 24px;
    }
    .qg-start-title {
        font-size: 20px;
    }
    .qg-question-text {
        font-size: 17px;
    }
}

@media (max-width: 480px) {
    .qg-card-wrap {
        max-width: 95%;
        margin: 10px auto;
    }
    .qg-step {
        padding: 24px 16px 20px;
    }
    .qg-btn {
        padding: 11px 16px;
        font-size: 14px;
        border-radius: 11px;
        margin-bottom: 8px;
    }
}

/* Reveal loading step */
.qg-reveal-loading-step {
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.qg-reveal-loading-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--qg-text);
    opacity: 0.85;
    text-align: center;
    margin: 0;
    line-height: 1.4;
    max-width: 300px;
    animation: qg-fade-in 0.4s ease;
}

@keyframes qg-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 0.75; transform: translateY(0); }
}
