/* TecMestre Certificações - Estilos do Simulador */

/* ====================================
   CSS CUSTOM PROPERTIES (LIGHT / DARK)
   ==================================== */
.tecmestre-simulado-wrapper {
    --sim-bg: #f5f5f5;
    --sim-card-bg: #ffffff;
    --sim-text: #000000;
    --sim-text-heading: #232F3E;
    --sim-text-secondary: #555;
    --sim-text-muted: #666;
    --sim-border: #ddd;
    --sim-border-light: #e0e0e0;
    --sim-hover-bg: #e8f4f8;
    --sim-selected-bg: #cfe8fc;
    --sim-correct-bg: #d4f4dd;
    --sim-correct-border: #2ecc71;
    --sim-correct-text: #1a5e1a;
    --sim-incorrect-bg: #ffdddd;
    --sim-incorrect-border: #e74c3c;
    --sim-question-bg: #ffffff;
    --sim-question-box-bg: #f8f9fa;
    --sim-header-bg: rgba(255, 255, 255, 0.98);
    --sim-app-gradient: linear-gradient(135deg, #1a2332 0%, #2c3e50 50%, #1a3a4a 100%);
    --sim-primary: #146EB4;
    --sim-accent: #FF9900;
    --sim-shadow: rgba(0, 0, 0, 0.12);
    --sim-shadow-light: rgba(0, 0, 0, 0.08);
    --sim-input-bg: #fafafa;
    --sim-info-bg: #e3f2fd;
    --sim-warning-bg: #fff3cd;
    --sim-warning-text: #856404;
    --sim-mode-card-bg: #ffffff;
    --sim-mode-card-text: #1a2332;
    --sim-mode-card-desc: #555;
    --sim-stat-bg: #f8f9fa;
    --sim-domain-bg: #f8f9fa;
    --sim-history-bg: #f8f9fa;
    --sim-history-row-hover: #f0f7ff;
    --sim-comment-bg: #f8f9fa;
    --sim-comment-form-bg: #f8f9fa;
    --sim-nav-bg: #f8f9fa;
    --sim-nav-btn-bg: #ffffff;
    --sim-training-bg: #f8f9fa;
    --sim-explanation-correct-bg: #e8f5e9;
    --sim-explanation-incorrect-bg: #ffebee;
    --sim-details-bg: #f0f4f8;
    --sim-details-hover: #e4ecf4;
    --sim-wrong-exp-bg: #fff3f3;
    --sim-wrong-exp-other-bg: #f8f9fa;
    --sim-correct-exp-bg: #f0fff0;
    --sim-fill-correct-bg: #e8f8f0;
    --sim-multi-tip-bg: #fff7e6;
    --sim-multi-tip-text: #b35b00;
    --sim-medal-label: #333;
    --sim-floating-bg: rgba(255, 255, 255, 0.95);

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    background: var(--sim-bg) !important;
}

/* DARK MODE */
.tecmestre-simulado-wrapper[data-simulado-theme="dark"] {
    --sim-bg: #0d1117;
    --sim-card-bg: #161b22;
    --sim-text: #e6edf3;
    --sim-text-heading: #e6edf3;
    --sim-text-secondary: #b0bec5;
    --sim-text-muted: #8b949e;
    --sim-border: #30363d;
    --sim-border-light: #21262d;
    --sim-hover-bg: #1a3050;
    --sim-selected-bg: #1a3a5c;
    --sim-correct-bg: #1a3328;
    --sim-correct-border: #2ecc71;
    --sim-correct-text: #7ee2a8;
    --sim-incorrect-bg: #3d1a1a;
    --sim-incorrect-border: #e74c3c;
    --sim-question-bg: #1c2333;
    --sim-question-box-bg: #161b22;
    --sim-header-bg: rgba(13, 17, 23, 0.98);
    --sim-app-gradient: linear-gradient(135deg, #010409 0%, #0d1117 50%, #010409 100%);
    --sim-primary: #58a6ff;
    --sim-accent: #FF9900;
    --sim-shadow: rgba(0, 0, 0, 0.4);
    --sim-shadow-light: rgba(0, 0, 0, 0.3);
    --sim-input-bg: #0d1117;
    --sim-info-bg: #0d2137;
    --sim-warning-bg: #2d2200;
    --sim-warning-text: #f0c040;
    --sim-mode-card-bg: #161b22;
    --sim-mode-card-text: #e6edf3;
    --sim-mode-card-desc: #8b949e;
    --sim-stat-bg: #161b22;
    --sim-domain-bg: #161b22;
    --sim-history-bg: #161b22;
    --sim-history-row-hover: #1a2332;
    --sim-comment-bg: #161b22;
    --sim-comment-form-bg: #0d1117;
    --sim-nav-bg: #161b22;
    --sim-nav-btn-bg: #21262d;
    --sim-training-bg: #161b22;
    --sim-explanation-correct-bg: #0d2818;
    --sim-explanation-incorrect-bg: #2d0f0f;
    --sim-details-bg: #21262d;
    --sim-details-hover: #30363d;
    --sim-wrong-exp-bg: #2d1515;
    --sim-wrong-exp-other-bg: #21262d;
    --sim-correct-exp-bg: #0d2818;
    --sim-fill-correct-bg: #0d2818;
    --sim-multi-tip-bg: #2d2200;
    --sim-multi-tip-text: #f0c040;
    --sim-medal-label: #e6edf3;
    --sim-floating-bg: rgba(13, 17, 23, 0.95);
}

/* Esconde anúncios e slots quando o quiz estiver ativo */
body.quiz-mode-active .adsbygoogle,
body.quiz-mode-active .google-auto-placed,
body.quiz-mode-active [id^="google_ads_"],
body.quiz-mode-active [id*="google_ads"],
body.quiz-mode-active [data-ad-client],
body.quiz-mode-active [data-ad-status],
body.quiz-mode-active .tecmestre-ad-slot,
body.quiz-mode-active .ad-slot,
body.quiz-mode-active .ad-container,
body.quiz-mode-active .widget-area,
body.quiz-mode-active .sidebar,
body.quiz-mode-active #secondary,
body.quiz-mode-active #sidebar,
body.quiz-mode-active iframe[src*="googleads"],
body.quiz-mode-active iframe[src*="doubleclick"],
body.quiz-mode-active iframe[src*="googlesyndication"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    z-index: -9999 !important;
    height: 0 !important;
    width: 0 !important;
    max-height: 0 !important;
}

/* Remove sidebar automaticamente */
.tecmestre-simulado-wrapper ~ .sidebar,
.tecmestre-simulado-wrapper ~ .site-sidebar {
    display: none !important;
}

/* Landing Section */
.simulado-landing {
    background: var(--sim-card-bg);
    padding: 40px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px var(--sim-shadow-light);
    color: var(--sim-text);
    position: relative;
}

.simulado-landing h2 {
    color: var(--sim-text-heading);
    margin-bottom: 20px;
    font-size: 2rem;
}

.cta-iniciar {
    display: inline-block;
    background: linear-gradient(135deg, #146EB4, #FF9900);
    color: white !important;
    padding: 20px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    text-decoration: none !important;
    border-radius: 8px;
    margin: 20px 0;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.cta-iniciar:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    color: white !important;
}

/* ====================================
   CTA FLUTUANTE MOBILE
   ==================================== */
.floating-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 12px 16px;
    background: var(--sim-floating-bg);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
    text-align: center;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.floating-cta-hidden {
    transform: translateY(100%) !important;
    pointer-events: none;
}

.floating-cta .cta-iniciar.floating {
    width: 100%;
    max-width: 400px;
    padding: 14px 24px;
    font-size: 1.1rem;
    margin: 0 auto;
    display: block;
}

@media (min-width: 1025px) {
    .floating-cta {
        display: none !important;
    }
}

.info-box {
    background: var(--sim-info-bg);
    border-left: 4px solid var(--sim-primary);
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
    color: var(--sim-text);
}

.warning-box {
    background: var(--sim-warning-bg);
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
    color: var(--sim-warning-text);
}

/* Simulador App */
.simulador-app {
    display: none;
    background: var(--sim-app-gradient);
    min-height: 100vh;
    padding: 20px;
    margin: 0 -20px;
}

.simulador-app.active {
    display: block;
    background: var(--sim-bg);
    min-height: auto;
}

.sim-card {
    background: var(--sim-card-bg);
    border-radius: 12px;
    padding: clamp(20px, 2vw, 40px);
    box-shadow: 0 8px 24px var(--sim-shadow);
    max-width: 960px;
    margin: 0 auto 20px;
    position: relative;
    color: var(--sim-text);
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.mode-card {
    background: var(--sim-mode-card-bg);
    color: var(--sim-mode-card-text);
    padding: 0;
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    border: 2px solid var(--sim-border-light);
    transition: all 0.3s ease;
    font-size: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: row;
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px var(--sim-shadow);
    border-color: var(--sim-primary);
}

.mode-card-stripe {
    width: 8px;
    min-height: 100%;
    flex-shrink: 0;
    background: linear-gradient(180deg, #146EB4, #FF9900);
    border-radius: 16px 0 0 16px;
}

.mode-card-content {
    padding: 24px 20px;
    flex: 1;
}

.mode-card-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--sim-mode-card-text);
    margin: 0 0 8px 0;
}

.mode-card-content p {
    font-size: 0.9rem;
    color: var(--sim-mode-card-desc);
    line-height: 1.5;
    margin: 0;
}

.mode-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
    line-height: 1;
}

/* ── Seletor de Exame (multi-exam certs) ──────────────────────────── */

.exam-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.exam-card {
    background: var(--sim-card-bg);
    border: 2px solid var(--sim-border-light);
    border-radius: 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    padding: 0;
    position: relative;
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    border-color: transparent;
}

.exam-card:active {
    transform: translateY(-2px);
}

.exam-card-stripe {
    width: 8px;
    min-height: 100%;
    flex-shrink: 0;
    border-radius: 16px 0 0 16px;
}

.exam-card-content {
    padding: 28px 24px;
    flex: 1;
}

.exam-card-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
    line-height: 1;
}

.exam-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--sim-text-heading);
    margin: 0 0 8px 0;
}

.exam-card-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--sim-text-secondary);
    margin: 0 0 10px 0;
}

.exam-card-desc {
    font-size: 0.88rem;
    color: var(--sim-text-muted);
    line-height: 1.5;
    margin: 0 0 14px 0;
}

.exam-card-badge {
    display: inline-block;
    background: var(--sim-nav-bg);
    color: var(--sim-text-heading);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.exam-card:hover .exam-card-badge {
    background: var(--sim-info-bg);
    color: var(--sim-primary);
}

.exam-card-all {
    border-style: dashed;
}

.exam-card-all .exam-card-stripe {
    background: linear-gradient(180deg, #2980b9, #27ae60) !important;
}

/* Responsivo para exam cards */
@media (max-width: 600px) {
    .exam-selector-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .exam-card-content {
        padding: 20px 18px;
    }
    
    .exam-card-icon {
        font-size: 2.2rem;
        margin-bottom: 8px;
    }
    
    .exam-card h3 {
        font-size: 1.15rem;
    }
}

/* ── Fim Seletor de Exame ─────────────────────────────────────────── */

.question-box {
    background: var(--sim-question-box-bg) !important;
    padding: clamp(12px, 1.2vw, 20px);
    border-radius: 10px;
    margin: 0;
    scroll-margin-top: 60px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    position: -webkit-sticky;
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 10;
    background: var(--sim-header-bg);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    padding: 12px 16px;
    margin: -20px -20px 20px -20px;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 8px var(--sim-shadow-light);
}

.btn-ghost {
    background: transparent;
    color: var(--sim-text-heading);
    border: 2px dashed var(--sim-primary);
    flex: 0 0 auto;
    min-width: auto;
    padding: 10px 20px;
}

.btn-ghost:hover {
    background: rgba(20, 110, 180, 0.08);
    color: var(--sim-text);
}

.multi-tip {
    background: var(--sim-multi-tip-bg);
    border-left: 4px solid var(--sim-accent);
    padding: 12px 15px;
    border-radius: 8px;
    margin: -10px 0 15px;
    font-weight: 600;
    color: var(--sim-multi-tip-text);
    font-size: 0.95rem;
}

.question-text {
    font-size: clamp(1rem, 1vw + 0.2rem, 1.2rem);
    color: var(--sim-text) !important;
    margin-bottom: clamp(15px, 1.5vw, 25px);
    line-height: 1.8;
    font-weight: 600;
    background: var(--sim-question-bg);
    padding: clamp(12px, 1vw, 20px);
    border-radius: 8px;
    border-left: 4px solid var(--sim-primary);
}

/* Sobrescreve tema WordPress */
body .question-text,
.entry-content .question-text,
article .question-text {
    color: var(--sim-text) !important;
    background: var(--sim-question-bg) !important;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 0.8vw, 12px);
}

.option-btn {
    background: var(--sim-card-bg) !important;
    color: var(--sim-text) !important;
    border: 2px solid var(--sim-border) !important;
    padding: 18px 20px;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: 600;
    text-transform: none !important;
    box-shadow: 0 1px 3px var(--sim-shadow-light) !important;
}

.option-btn:hover {
    border-color: var(--sim-primary) !important;
    background: var(--sim-hover-bg) !important;
    color: var(--sim-text) !important;
}

.option-btn.selected {
    border-color: var(--sim-primary) !important;
    background: var(--sim-selected-bg) !important;
    font-weight: 700;
    color: var(--sim-text) !important;
}

.option-btn.correct {
    border-color: var(--sim-correct-border) !important;
    background: var(--sim-correct-bg) !important;
    font-weight: 700;
    color: var(--sim-text) !important;
}

.option-btn.incorrect {
    border-color: var(--sim-incorrect-border) !important;
    background: var(--sim-incorrect-bg) !important;
    color: var(--sim-text) !important;
}

/* Sobrescreve QUALQUER tema do WordPress/Elementor */
body .option-btn,
.entry-content .option-btn,
article .option-btn,
.post-content .option-btn,
main .option-btn {
    background: var(--sim-card-bg) !important;
    color: var(--sim-text) !important;
}

body .option-btn:hover,
.entry-content .option-btn:hover,
article .option-btn:hover {
    background: var(--sim-hover-bg) !important;
    color: var(--sim-text) !important;
}

body .option-btn.selected,
.entry-content .option-btn.selected,
article .option-btn.selected {
    background: var(--sim-selected-bg) !important;
    color: var(--sim-text) !important;
}

body .option-btn.correct,
.entry-content .option-btn.correct,
article .option-btn.correct {
    background: var(--sim-correct-bg) !important;
    color: var(--sim-text) !important;
}

body .option-btn.incorrect,
.entry-content .option-btn.incorrect,
article .option-btn.incorrect {
    background: var(--sim-incorrect-bg) !important;
    color: var(--sim-text) !important;
}

.explanation-box {
    background: var(--sim-explanation-correct-bg);
    border-left: 4px solid var(--sim-correct-border);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
    color: var(--sim-text) !important;
    max-height: none;
    overflow: visible;
    scroll-behavior: smooth;
}

.explanation-box.show {
    display: block;
}

.explanation-box.incorrect {
    background: var(--sim-explanation-incorrect-bg);
    border-left-color: var(--sim-incorrect-border);
}

.nav-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding-top: 10px;
    border-top: 1px solid var(--sim-border-light);
    background: var(--sim-card-bg);
}

.btn {
    padding: 14px 30px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    min-width: 120px;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #146EB4, #FF9900);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: var(--sim-card-bg);
    color: var(--sim-text-heading);
    border: 2px solid var(--sim-primary);
}

.btn-secondary:hover {
    background: var(--sim-question-box-bg);
}

.result-score {
    text-align: center;
    font-size: 5rem;
    font-weight: bold;
    color: var(--sim-primary);
    margin: 10px 0;
}

/* ====================================
   MEDALHA DE RESULTADO
   ==================================== */
.result-medal-section {
    text-align: center;
    padding: 30px 20px 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    transition: background 0.5s;
}

.result-medal {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 5px;
    animation: medalBounce 0.6s ease-out;
}

@keyframes medalBounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.25); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}

.result-label {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--sim-medal-label);
    margin-top: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    text-align: center;
    background: var(--sim-stat-bg);
    padding: 20px;
    border-radius: 10px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--sim-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--sim-text-muted);
    margin-top: 5px;
}

.hidden {
    display: none !important;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--sim-text-muted);
}

/* ====================================
   SEÇÃO DE COMENTÁRIOS CERTIFICAÇÕES
   ==================================== */
.cert-comments-section {
    background: var(--sim-card-bg);
    border-radius: 12px;
    padding: 40px;
    margin-top: 60px;
    box-shadow: 0 2px 12px var(--sim-shadow-light);
}

.cert-comments-section h2 {
    color: var(--sim-text) !important;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.cert-comments-section .comment-list {
    list-style: none;
    padding: 0;
    margin: 30px 0;
}

.cert-comments-section .comment {
    background: var(--sim-comment-bg);
    border-left: 4px solid #0083e8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.cert-comments-section .comment:hover {
    box-shadow: 0 4px 12px rgba(0,131,232,0.15);
    transform: translateX(3px);
}

/* Badge para respostas da equipe TecMestre */
.cert-comments-section .bypostauthor > .comment-body {
    background: linear-gradient(135deg, #e8f4fd, #f0f8ff);
    border-left-color: #32b6e5;
    position: relative;
}

.cert-comments-section .bypostauthor > .comment-body::before {
    content: "✓ EQUIPE TECMESTRE";
    position: absolute;
    top: 10px;
    right: 15px;
    background: #32b6e5;
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.cert-comments-section .comment-author {
    font-weight: bold;
    color: var(--sim-primary);
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: block;
}

.cert-comments-section .comment-meta {
    color: var(--sim-text-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.cert-comments-section .comment-content {
    color: var(--sim-text) !important;
    line-height: 1.7;
    font-size: 1rem;
}

.cert-comments-section .comment-content p {
    color: var(--sim-text) !important;
    margin-bottom: 10px;
}

.cert-comments-section .reply {
    margin-left: 40px;
    border-left-color: #81d742;
}

/* Formulário de comentário */
.cert-comments-section .comment-respond {
    background: var(--sim-comment-form-bg);
    padding: 30px;
    border-radius: 10px;
    margin-top: 40px;
}

.cert-comments-section .comment-reply-title {
    color: var(--sim-text) !important;
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.cert-comments-section .comment-form label {
    display: block;
    font-weight: 600;
    color: var(--sim-text-secondary);
    margin-bottom: 8px;
}

.cert-comments-section .comment-form input[type="text"],
.cert-comments-section .comment-form input[type="email"],
.cert-comments-section .comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--sim-border-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: var(--sim-card-bg);
    color: var(--sim-text);
}

.cert-comments-section .comment-form input[type="text"]:focus,
.cert-comments-section .comment-form input[type="email"]:focus,
.cert-comments-section .comment-form textarea:focus {
    outline: none;
    border-color: #0083e8;
    box-shadow: 0 0 0 3px rgba(0,131,232,0.1);
}

.cert-comments-section .comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.cert-comments-section .form-submit {
    margin-top: 20px;
}

.cert-comments-section .form-submit input[type="submit"] {
    background: linear-gradient(135deg, #0083e8, #32b6e5);
    color: #fff;
    border: none;
    padding: 14px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cert-comments-section .form-submit input[type="submit"]:hover {
    background: linear-gradient(135deg, #006bb3, #2a9fd6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,131,232,0.3);
}

/* Aviso de moderação */
.cert-comments-section .comment-notes,
.cert-comments-section .comment-awaiting-moderation {
    background: var(--sim-warning-bg);
    border-left: 4px solid #ffc107;
    padding: 12px 18px;
    margin: 15px 0;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--sim-warning-text);
}

/* Contador de comentários */
.cert-comments-section .comments-title {
    color: var(--sim-text) !important;
    font-size: 1.5rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cert-comments-section .comments-title::before {
    content: "💬";
    font-size: 1.8rem;
}

/* Responsive adjustments for Laptops/Notebooks (1366x768 and similar) */
@media (max-width: 1440px) {
    /* Force full width and remove theme constraints */
    .site-content, .content-area, .entry-content {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .tecmestre-simulado-wrapper {
        max-width: 1200px !important;
        margin: 0 auto !important;
    }

    .sim-card {
        padding: 15px !important;
        max-width: 100% !important;
        margin-bottom: 10px !important;
    }
    
    .simulado-landing {
        padding: 20px !important;
    }
    .simulado-landing h2 {
        font-size: 1.4rem !important;
        margin-bottom: 10px !important;
    }
    .mode-card {
        border-radius: 12px !important;
    }
    .mode-card-content {
        padding: 15px !important;
    }
    .mode-icon {
        font-size: 2rem !important;
    }
    .question-box {
        padding: 15px !important;
        margin: 10px 0 !important;
    }
    .question-text {
        font-size: 1rem !important;
        margin-bottom: 10px !important;
        padding: 10px !important;
    }
    .option-btn {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
        margin-bottom: 5px !important;
    }
    .result-score {
        font-size: 3rem !important;
    }
    
    /* Compact Header in Quiz Mode */
    .quiz-header {
        padding: 5px 10px !important;
        margin-bottom: 10px !important;
        min-height: auto !important;
    }
    
    #progressText, #timerText {
        font-size: 0.9rem !important;
    }
    
    .btn-ghost {
        padding: 5px 10px !important;
        font-size: 0.8rem !important;
    }
}

/* Adjustments for height-constrained screens (like 1366x768) — LAPTOPS ONLY */
@media (max-height: 800px) and (min-width: 1024px) {
    .tecmestre-simulado-wrapper {
        padding-bottom: 60px !important; /* Space for footer if needed */
    }

    .simulador-app {
        padding: 0 !important;
        min-height: auto !important;
    }
    
    /* Hide site header elements if possible or reduce margin */
    .site-header, #masthead, .admin-bar {
        /* We can't hide admin bar easily without JS, but we can try to slide content up */
    }
    
    /* Compact Card Style */
    .sim-card {
        padding: 10px 15px !important;
        margin-bottom: 8px !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    }
    
    /* Super Compact Header */
    .quiz-header {
        padding: 5px 10px !important;
        margin: 0 0 8px 0 !important;
        background: var(--sim-card-bg) !important;
        border-bottom: 1px solid var(--sim-border-light) !important;
    }
    
    .quiz-header #progressText { font-size: 0.85rem !important; }
    .quiz-header #timerText { font-size: 0.9rem !important; }
    .quiz-header .btn-ghost { padding: 2px 8px !important; font-size: 0.75rem !important; }
    
    /* Compact Question Box */
    .question-box {
        padding: 10px !important;
        margin: 5px 0 !important;
        background: var(--sim-question-box-bg) !important;
    }
    
    .question-text {
        font-size: 0.95rem !important;
        margin-bottom: 8px !important;
        line-height: 1.3 !important;
        padding: 8px !important;
        border-left-width: 3px !important;
    }
    
    /* Compact Options */
    .options-list {
        gap: 6px !important;
    }
    
    .option-btn {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
        border-width: 1px !important;
        min-height: auto !important;
    }
    
    /* Compact Nav Buttons */
    .nav-btns {
        margin-top: 10px !important;
        padding-top: 5px !important;
        gap: 8px !important;
    }
    
    .btn {
        padding: 8px 15px !important;
        font-size: 0.9rem !important;
        height: 36px !important;
        line-height: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Explanation Box Compact */
    .explanation-box {
        margin-top: 10px !important;
        padding: 10px !important;
        font-size: 0.9rem !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-btns {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        min-width: unset;
    }
    
    .quiz-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .btn-ghost {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .simulador-app {
        padding: 12px;
        margin: 0 -12px;
    }
    
    .sim-card {
        border-radius: 8px;
    }
    
    .result-score {
        font-size: 3.5rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .mode-grid {
        grid-template-columns: 1fr;
    }
    
    .cert-comments-section {
        padding: 25px 20px;
    }
    
    .cert-comments-section .reply {
        margin-left: 20px;
    }
    
    .cert-comments-section .bypostauthor > .comment-body::before {
        position: static;
        display: block;
        margin-bottom: 10px;
    }
    
    .cert-comments-section .comment-respond {
        padding: 20px;
    }
}

@media (max-width: 600px) {
    .option-btn {
        padding: 14px 16px;
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .simulador-app {
        padding: 8px;
        margin: 0 -8px;
    }
    
    /* Header compacto: progress + timer na mesma linha */
    .quiz-header {
        padding: 8px 12px;
        margin: -15px -15px 12px -15px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .quiz-header #progressText,
    .quiz-header #timerText {
        flex: 1;
        font-size: 0.85rem;
        text-align: center;
    }
    
    .btn-ghost {
        width: 100%;
        order: 3;
        padding: 6px 10px;
        font-size: 0.8rem;
        text-align: center;
    }

    /* Landing page mobile */
    .simulado-landing {
        padding: 16px 12px !important;
    }
    .simulado-landing h2 {
        font-size: 1.2rem !important;
    }
    .cta-iniciar {
        padding: 16px 24px;
        font-size: 1.1rem;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
    .info-box, .warning-box {
        padding: 14px;
        margin: 12px 0;
    }

    /* Nav grid colapsável — movido para breakpoint 768px */
    /* (mantido aqui vazio) */

    /* Touch targets adequados para botões de navegação */
    .qnav-btn {
        width: 36px;
        height: 36px;
        font-size: 0.72rem;
        line-height: 36px;
        border-radius: 6px;
    }

    /* Botão Revisar: inline (não full-width) */
    .btn-review {
        flex: 0 0 auto;
        width: auto;
        padding: 10px 14px;
    }

    /* Botões de ação: touch target mínimo 44px */
    .btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Option buttons: touch target adequado */
    .option-btn {
        padding: 14px 16px !important;
        font-size: 0.95rem !important;
        min-height: 44px !important;
    }

    /* Explanation box no mobile */
    .explanation-box {
        max-height: 280px;
        overflow-y: auto;
    }

    /* Domain cards: 1 coluna em telas muito pequenas */
    .domain-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .domain-name {
        font-size: 0.8rem;
    }
}

/* ====================================
   FASE 1: EXPLICAÇÕES POR ALTERNATIVA
   ==================================== */
.correct-explanation-item {
    background: var(--sim-correct-exp-bg);
    border-left: 3px solid var(--sim-correct-border);
    padding: 10px 14px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--sim-correct-text) !important;
}

.wrong-explanations-header {
    font-weight: 700;
    margin-top: 14px;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--sim-text-secondary) !important;
    border-bottom: 1px solid var(--sim-border);
    padding-bottom: 4px;
}

.wrong-explanation-item {
    background: var(--sim-wrong-exp-bg);
    border-left: 3px solid var(--sim-incorrect-border);
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 6px;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--sim-text) !important;
}

.wrong-explanation-item.other {
    background: var(--sim-wrong-exp-other-bg);
    border-left-color: #999;
    color: var(--sim-text-secondary) !important;
    font-size: 0.88rem;
}

.wrong-explanation-item strong {
    color: var(--sim-text) !important;
}

/* ====================================
   DETAILS COLAPSÁVEL (explicações)
   ==================================== */
.wrong-details {
    margin-top: 12px;
    border: 1px solid var(--sim-border-light);
    border-radius: 8px;
    overflow: hidden;
}

.wrong-details summary {
    padding: 14px;
    min-height: 44px;
    background: var(--sim-details-bg);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--sim-text-heading) !important;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    transition: background 0.2s;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.wrong-details summary::-webkit-details-marker {
    display: none;
}

.wrong-details summary::after {
    content: '▸';
    margin-left: auto;
    transition: transform 0.2s;
    font-size: 0.85rem;
}

.wrong-details[open] summary::after {
    transform: rotate(90deg);
}

.wrong-details summary:hover {
    background: var(--sim-details-hover);
}

.wrong-details[open] summary {
    border-bottom: 1px solid var(--sim-border-light);
}

.wrong-details > .wrong-explanations-header,
.wrong-details > .wrong-explanation-item {
    margin-left: 8px;
    margin-right: 8px;
}

.wrong-details > .wrong-explanations-header:first-child {
    margin-top: 10px;
}

.wrong-details > .wrong-explanation-item:last-child {
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .explanation-box {
        max-height: 320px !important;
    }
    .correct-explanation-item,
    .wrong-explanation-item {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
}

/* ====================================
   FASE 3: BREAKDOWN POR DOMÍNIO
   ==================================== */
.domain-breakdown {
    background: var(--sim-domain-bg);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.domain-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.domain-card {
    background: var(--sim-card-bg);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 6px var(--sim-shadow-light);
    transition: transform 0.2s;
}

.domain-card:hover {
    transform: translateY(-2px);
}

.domain-card.domain-weak {
    border: 2px solid #e74c3c;
    background: var(--sim-incorrect-bg);
}

.domain-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--sim-text) !important;
    margin-bottom: 6px;
}

.domain-score {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.domain-bar-bg {
    background: var(--sim-border-light);
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}

.domain-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
}

.domain-detail {
    font-size: 0.8rem;
    color: var(--sim-text-muted) !important;
}

@media (max-width: 480px) {
    .domain-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .domain-card {
        padding: 12px 8px;
    }
    .domain-score {
        font-size: 1.4rem;
    }
    .domain-name {
        font-size: 0.75rem;
    }
}

/* ====================================
   FASE 5: HISTÓRICO DE TENTATIVAS
   ==================================== */
.history-section {
    background: var(--sim-history-bg);
    border-radius: 12px;
    padding: 20px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--sim-card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.history-table thead {
    background: #146EB4;
    color: #fff;
}

.history-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff !important;
}

.history-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--sim-border-light);
    color: var(--sim-text) !important;
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

.history-table tbody tr:hover {
    background: var(--sim-history-row-hover);
}

@media (max-width: 480px) {
    .history-table {
        font-size: 0.8rem;
    }
    .history-table th,
    .history-table td {
        padding: 6px 8px;
    }
}

/* ====================================
   FASE 4: TOGGLE MODO TREINO
   ==================================== */
.training-toggle {
    background: var(--sim-training-bg);
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid var(--sim-border-light);
}

/* ====================================
   FILL-IN-THE-BLANK (preenchimento)
   ==================================== */
.fill-blank-wrapper {
    margin: 20px 0;
}

.fill-blank-input {
    width: 100%;
    padding: 14px 18px;
    font-size: max(1rem, 16px); /* Previne auto-zoom iOS */
    font-family: 'Courier New', Consolas, monospace;
    border: 2px solid var(--sim-border);
    border-radius: 8px;
    background: var(--sim-input-bg);
    color: var(--sim-text) !important;
    outline: none;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.fill-blank-input:focus {
    border-color: var(--sim-primary);
    background: var(--sim-card-bg);
    box-shadow: 0 0 0 3px rgba(20, 110, 180, 0.15);
}

.fill-blank-input::placeholder {
    color: var(--sim-text-muted);
    font-style: italic;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fill-blank-input.correct {
    border-color: var(--sim-correct-border) !important;
    background: var(--sim-fill-correct-bg) !important;
    color: #27ae60 !important;
    font-weight: 600;
}

.fill-blank-input.incorrect {
    border-color: var(--sim-incorrect-border) !important;
    background: var(--sim-incorrect-bg) !important;
    color: #c0392b !important;
    text-decoration: line-through;
}

.fill-blank-input:disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

.fill-hint {
    margin-top: 10px;
    color: var(--sim-text-muted) !important;
    font-style: italic;
    font-size: 0.92rem;
    padding-left: 4px;
}

.fill-correct-answer {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--sim-fill-correct-bg);
    border: 1px solid var(--sim-correct-border);
    border-radius: 8px;
    color: #27ae60 !important;
    font-size: 1.05rem;
}

@media (max-width: 480px) {
    .fill-blank-input {
        font-size: 1rem;
        padding: 12px 14px;
    }
}

/* ====================================
   BARRA DE PROGRESSO
   ==================================== */
.progress-bar-wrapper {
    background: #e9ecef;
    border-radius: 6px;
    height: 6px;
    overflow: hidden;
    margin: 0 0 16px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #146EB4, #2ecc71);
    border-radius: 6px;
    transition: width 0.4s ease;
    min-width: 2%;
}

/* ====================================
   BOTÃO MARCAR PARA REVISÃO
   ==================================== */
.btn-review {
    background: var(--sim-card-bg);
    color: var(--sim-warning-text);
    border: 2px solid #ffc107;
    flex: 0 0 auto;
    min-width: auto;
    padding: 10px 16px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-review:hover {
    background: var(--sim-warning-bg);
    border-color: #e6ac00;
}

.btn-review.active {
    background: #fff3cd;
    border-color: #ff9800;
    color: #e65100;
    font-weight: 700;
}

/* ====================================
   NAVEGADOR DE QUESTÕES (question grid)
   ==================================== */
.question-nav-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
    padding: 8px;
    background: var(--sim-nav-bg);
    border-radius: 8px;
    justify-content: center;
}

.qnav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--sim-border);
    border-radius: 6px;
    background: var(--sim-nav-btn-bg);
    color: var(--sim-text);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    line-height: 32px;
    text-align: center;
    position: relative;
}

.qnav-btn:hover {
    border-color: var(--sim-primary);
    background: var(--sim-hover-bg);
}

.qnav-btn.current {
    border-color: var(--sim-primary);
    background: var(--sim-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(20, 110, 180, 0.3);
}

.qnav-btn.answered-correct {
    background: var(--sim-correct-bg);
    border-color: var(--sim-correct-border);
    color: var(--sim-correct-text);
}

.qnav-btn.answered-wrong {
    background: var(--sim-incorrect-bg);
    border-color: var(--sim-incorrect-border);
    color: #8b1a1a;
}

.qnav-btn.flagged::after {
    content: '🚩';
    position: absolute;
    top: -6px;
    right: -4px;
    font-size: 0.55rem;
    line-height: 1;
}

/* Current sobrescreve answered */
.qnav-btn.current.answered-correct,
.qnav-btn.current.answered-wrong {
    background: #146EB4;
    color: #fff;
    border-color: #146EB4;
}

/* Nav grid compacta apenas para laptops com tela curta */
@media (max-height: 800px) and (min-width: 1024px) {
    .question-nav-grid {
        padding: 4px;
        gap: 3px;
        margin-bottom: 8px;
    }
    .qnav-btn {
        width: 28px;
        height: 28px;
        font-size: 0.65rem;
        line-height: 28px;
        border-radius: 4px;
    }
}

/* ====================================
   DARK MODE TOGGLE BUTTON
   ==================================== */
.dark-mode-toggle-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--sim-question-box-bg);
    border: 2px solid var(--sim-border);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 5;
    padding: 0;
    line-height: 1;
}

.dark-mode-toggle-btn:hover {
    background: var(--sim-hover-bg);
    border-color: var(--sim-primary);
    transform: scale(1.1);
}

.quiz-header .dark-mode-toggle-quiz {
    background: var(--sim-question-box-bg);
    border: 2px solid var(--sim-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-width: 36px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    padding: 0;
    flex: 0 0 auto;
}

.quiz-header .dark-mode-toggle-quiz:hover {
    background: var(--sim-hover-bg);
    border-color: var(--sim-primary);
}

/* ====================================
   ACESSIBILIDADE — FOCUS-VISIBLE
   ==================================== */
.option-btn:focus-visible,
.btn:focus-visible,
.mode-card:focus-visible {
    outline: 3px solid var(--sim-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(20, 110, 180, 0.2) !important;
}

.fill-blank-input:focus-visible {
    outline: 3px solid #146EB4;
    outline-offset: 1px;
}

.btn-ghost:focus-visible {
    outline: 3px solid #146EB4;
    outline-offset: 2px;
    background: rgba(20, 110, 180, 0.08);
}

/* ====================================
   MOBILE: TOGGLE PARA NAV GRID
   ==================================== */
.qnav-toggle {
    display: none; /* Oculto por padrão em desktop */
}

@media (max-width: 768px) {
    /* Nav grid colapsável — mostra 2 linhas no mobile/tablet */
    .question-nav-grid {
        max-height: 80px;
        overflow: hidden;
        position: relative;
        transition: max-height 0.3s ease;
    }
    .question-nav-grid.expanded {
        max-height: 2000px;
    }

    .qnav-toggle {
        display: block;
        width: 100%;
        padding: 6px;
        background: var(--sim-border-light);
        border: none;
        border-radius: 0 0 8px 8px;
        color: var(--sim-text-muted);
        font-size: 0.75rem;
        cursor: pointer;
        font-weight: 600;
        margin-top: -12px;
        margin-bottom: 8px;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
    }
    .qnav-toggle:hover {
        background: #dee2e6;
    }
}

/* ====================================
   TELAS ULTRA-PEQUENAS (320-360px)
   ==================================== */
@media (max-width: 360px) {
    .domain-cards-grid {
        grid-template-columns: 1fr !important;
    }
    .domain-name {
        font-size: 0.85rem;
    }
    .simulado-landing h2 {
        font-size: 1.1rem !important;
    }
    .cta-iniciar {
        padding: 14px 16px;
        font-size: 1rem;
    }
    .stat-value {
        font-size: 1.6rem;
    }
    .history-table {
        font-size: 0.75rem;
    }
    .history-table th,
    .history-table td {
        padding: 5px 6px;
    }
}

/* ====================================
    REDESIGN — LAYOUT ADAPTATIVO 3 ZONAS
    ==================================== */

/* Modo foco: libera área útil no topo durante o quiz */
body.quiz-mode-active .single-page-header,
body.quiz-mode-active #site-breadcrumb {
    display: none !important;
}

body.quiz-mode-active .site-content,
body.quiz-mode-active .single-content-wrap,
body.quiz-mode-active .entry-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.quiz-mode-active .tecmestre-simulado-wrapper {
    margin-top: 0 !important;
}

body.quiz-mode-active .simulador-app.active {
    padding-top: 8px;
    margin-top: 0;
}

/* Expande quiz screen para comportar sidebar */
#quizScreen {
    max-width: 1400px;
    padding: clamp(12px, 1.5vw, 20px);
}

/* Header redesenhado: progress bar integrada */
#quizScreen .quiz-header {
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 12px;
}

.quiz-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.quiz-progress-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--sim-text-heading);
    white-space: nowrap;
}

.quiz-timer {
    font-weight: 700;
    font-size: 1rem;
    color: var(--sim-primary);
    white-space: nowrap;
    min-width: 70px;
}

.quiz-header-bar {
    flex: 1;
    margin: 0 !important;
    align-self: center;
}

.quiz-header-right {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
}

.btn-finish {
    background: transparent;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    padding: 8px 14px;
    font-size: 0.88rem;
    font-weight: 700;
    min-width: auto;
    flex: 0 0 auto;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-finish:hover {
    background: #e74c3c;
    color: #fff;
}

#quizScreen .btn-ghost {
    padding: 8px 14px;
    font-size: 0.88rem;
}

/* Grid principal: navegação + conteúdo + ações — altura travada no viewport */
.quiz-layout {
    display: grid;
    grid-template-columns: minmax(200px, 230px) minmax(0, 1fr) minmax(220px, 240px);
    gap: 14px;
    align-items: stretch;
    height: var(--tm-quiz-layout-height, calc(100dvh - 150px));
    min-height: 430px;
    overflow: hidden;
}

/* Sidebar de navegação — scroll interno */
.quiz-sidebar {
    height: 100%;
    overflow-y: auto;
    background: var(--sim-nav-bg);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid var(--sim-border-light);
    scrollbar-width: thin;
    scrollbar-color: var(--sim-border) transparent;
}

.sidebar-header {
    margin-bottom: 8px;
}

.sidebar-total {
    font-size: 0.78rem;
    color: var(--sim-text-muted);
    text-align: center;
    margin-bottom: 6px;
}

.sidebar-tabs {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 6px;
}

.stab {
    background: var(--sim-nav-btn-bg);
    border: 1px solid var(--sim-border);
    border-radius: 20px;
    padding: 3px 7px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--sim-text-muted);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.stab:hover {
    border-color: var(--sim-primary);
    color: var(--sim-primary);
}

.stab.active {
    background: var(--sim-primary);
    border-color: var(--sim-primary);
    color: #fff;
}

/* Nav grid dentro da sidebar: sem fundo, sem padding duplicado */
.quiz-sidebar .question-nav-grid {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
    justify-content: center;
}

/* Conteúdo principal — leitura e explicação */
.quiz-main {
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--sim-card-bg) !important;
}

.question-box {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--sim-border) transparent;
}

/* Coluna de ações (desktop) */
.quiz-actions {
    min-width: 0;
    height: 100%;
}

.quiz-actions-card {
    height: 100%;
    background: var(--sim-nav-bg);
    border: 1px solid var(--sim-border-light);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-actions-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sim-text-muted);
}

.quiz-actions .nav-btns {
    border-top: 0;
    padding-top: 0;
    margin: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quiz-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    flex: 0 0 auto;
    justify-content: center;
}

/* Diferencia ações críticas para evitar clique por engano */
.quiz-actions #confirmBtn {
    background: linear-gradient(135deg, #146EB4, #2f80c3);
    color: #fff;
    border: 1px solid #0f5f97;
}

.quiz-actions #confirmBtn:hover {
    background: linear-gradient(135deg, #0f5f97, #256da6);
}

.quiz-actions #nextBtn {
    background: linear-gradient(135deg, #1f9d55, #2ecc71);
    color: #fff;
    border: 1px solid #198347;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}

.quiz-actions #nextBtn:hover {
    background: linear-gradient(135deg, #198347, #27ae60);
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.28);
}

.quiz-actions-hint {
    margin-top: auto;
    margin-bottom: 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--sim-text-muted);
}

/* Badge de domínio acima da questão */
.question-domain-badge {
    display: none;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 11px;
    border-radius: 20px;
    border: 1.5px solid var(--sim-primary);
    margin-bottom: 10px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Badges de letra circular nas opções */
.option-btn {
    display: flex !important;
    align-items: center;
    gap: 12px;
    width: 100%;
    overflow: hidden;
}

.option-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    background: var(--sim-border-light);
    color: var(--sim-text-heading);
    font-size: 0.85rem;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    min-width: 0;
    text-align: left;
    line-height: 1.5;
    font-weight: 500;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.option-btn.selected .option-letter {
    background: var(--sim-primary);
    color: #fff;
}

.option-btn.correct .option-letter {
    background: var(--sim-correct-border);
    color: #fff;
}

.option-btn.incorrect .option-letter {
    background: var(--sim-incorrect-border);
    color: #fff;
}

/* Animação de entrada da questão */
@keyframes questionFadeIn {
    from { opacity: 0.4; transform: translateY(5px); }
    to   { opacity: 1;   transform: translateY(0);   }
}

.question-box.fading {
    animation: questionFadeIn 0.2s ease-out;
}

/* ── Responsivo intermediário: notebook e tablet horizontal ── */
@media (max-width: 1200px) {
    .quiz-layout {
        grid-template-columns: 220px minmax(0, 1fr);
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .quiz-sidebar {
        height: auto;
        max-height: 180px;
    }

    .quiz-main {
        height: auto;
        overflow: visible;
    }

    .question-box {
        overflow: visible;
    }

    .quiz-actions {
        grid-column: 1 / -1;
        height: auto;
        position: sticky;
        bottom: 8px;
        z-index: 15;
    }

    .quiz-actions-card {
        height: auto;
        padding: 10px;
        background: var(--sim-floating-bg);
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
        box-shadow: 0 6px 16px var(--sim-shadow);
    }

    .quiz-actions-title,
    .quiz-actions-hint {
        display: none;
    }

    .quiz-actions .nav-btns {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .quiz-actions .btn {
        flex: 1 1 calc(50% - 6px);
        min-width: 150px;
    }

    .quiz-actions #confirmBtn,
    .quiz-actions #nextBtn {
        flex-basis: 100%;
    }

}

/* ── Mobile: uma coluna + barra de ações fixa no rodapé ── */
@media (max-width: 900px) {
    .quiz-layout {
        grid-template-columns: 1fr;
    }

    .quiz-sidebar {
        max-height: 160px;
        overflow-y: hidden;
    }

    .quiz-sidebar .question-nav-grid {
        max-height: 80px;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .quiz-sidebar .question-nav-grid.expanded {
        max-height: 2000px;
    }

    .qnav-toggle {
        display: block !important;
    }

    .quiz-actions {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom, 0px));
        z-index: 40;
    }

    body.quiz-mode-active #quizScreen {
        padding-bottom: 100px;
    }

    .quiz-actions .nav-btns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .quiz-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .quiz-actions #confirmBtn,
    .quiz-actions #nextBtn {
        grid-column: 1 / -1;
    }

    .quiz-header-bar {
        display: none;
    }

    #quizScreen .quiz-header {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 600px) {
    .quiz-actions {
        left: 6px;
        right: 6px;
    }

    body.quiz-mode-active #quizScreen {
        padding-bottom: 110px;
    }

    .btn-finish,
    #quizScreen .btn-ghost {
        padding: 7px 10px;
        font-size: 0.8rem;
    }

    .quiz-progress-label,
    .quiz-timer {
        font-size: 0.88rem;
    }
}

/* Dark mode: badge de domínio */
.tecmestre-simulado-wrapper[data-simulado-theme="dark"] .option-letter {
    background: var(--sim-border);
    color: var(--sim-text);
}
