/* Portugues.ai — teste / exame do Modo académico (index.html e /t). */
.quiz { display: grid; gap: 14px; }
.quiz-bar { position: sticky; z-index: 20; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px 14px; box-shadow: 0 8px 20px rgba(15,23,42,.06); display: grid; gap: 8px; }
.dark .quiz-bar { background: #111827; border-color: #374151; }
.qb-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9rem; }
.dark .qb-top { color: #e5e7eb; }
#qbStats { color: #475569; font-weight: 600; }
.dark #qbStats { color: #cbd5e1; }
.qb-ok { color: #16a34a; } .qb-ko { color: #dc2626; }
.qb-grade { color: #0369a1; font-weight: 800; }
.dark .qb-grade { color: #7dd3fc; }
.qb-track { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.dark .qb-track { background: #374151; }
.qb-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #0ea5e9, #2563eb); transition: width .3s; }
.qb-dots { display: flex; flex-wrap: wrap; gap: 4px; max-height: 64px; overflow-y: auto; }
.qb-dots button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid #e2e8f0; background: #f8fafc; color: #64748b; font-size: .72rem; font-weight: 700; cursor: pointer; }
.dark .qb-dots button { background: #1f2937; border-color: #374151; color: #94a3b8; }
.qb-dots button.qb-done { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.qb-dots button.qb-correto { background: #dcfce7; border-color: #86efac; color: #166534; }
.qb-dots button.qb-parcial { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.qb-dots button.qb-errado { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.qb-submit { justify-self: end; padding: 10px 18px; min-height: 44px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #0ea5e9, #2563eb); color: #fff; font-weight: 700; cursor: pointer; }
.qb-submit:disabled { opacity: .45; cursor: not-allowed; }
.quiz-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.qz { border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 16px; background: #fff; scroll-margin-top: 200px; }
.dark .qz { background: #111827; border-color: #374151; color: #e5e7eb; }
.qz.is-right, .qz.is-correto { border-color: #86efac; } .qz.is-wrong, .qz.is-errado { border-color: #fca5a5; } .qz.is-parcial { border-color: #fcd34d; }
.qz-n { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #0369a1; }
.dark .qz-n { color: #7dd3fc; }
.qz-q { font-weight: 600; margin: 4px 0 10px; line-height: 1.5; }
.qz-opts { display: grid; gap: 8px; }
.qz-opt { display: flex; align-items: flex-start; gap: 10px; text-align: left; width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid #e2e8f0; border-radius: 12px; background: #fff; color: #0f172a; font-size: .95rem; cursor: pointer; }
.dark .qz-opt { background: #1f2937; border-color: #374151; color: #e5e7eb; }
.qz-opt:hover:not(:disabled) { border-color: #7dd3fc; }
.qz-opt:disabled { cursor: default; }
.qz-opt .qz-l { flex: none; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: #f1f5f9; font-weight: 800; font-size: .8rem; color: #475569; }
.dark .qz-opt .qz-l { background: #111827; color: #cbd5e1; }
.qz-opt.right { border-color: #22c55e; background: #f0fdf4; } .qz-opt.right .qz-l { background: #22c55e; color: #fff; }
.qz-opt.wrong { border-color: #ef4444; background: #fef2f2; } .qz-opt.wrong .qz-l { background: #ef4444; color: #fff; }
.dark .qz-opt.right { background: #052e16; } .dark .qz-opt.wrong { background: #450a0a; }
.qz-fb { margin-top: 10px; font-size: .9rem; line-height: 1.55; color: #334155; background: #f8fafc; border-radius: 10px; padding: 10px 12px; }
.dark .qz-fb { background: #0b1220; color: #cbd5e1; }
.qz-fb p { margin: 4px 0 0; }
.qz-src { display: block; margin-top: 6px; font-size: .82rem; color: #64748b; font-style: italic; }
.qz-answer { width: 100%; font-size: 16px; line-height: 1.55; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: #0f172a; resize: vertical; }
.dark .qz-answer { background: #1f2937; border-color: #374151; color: #e5e7eb; }
.qz-answer:focus { outline: none; border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.2); }
.qz-answer[readonly] { background: #f8fafc; }
.dark .qz-answer[readonly] { background: #111827; }
.qz-verdict { font-weight: 800; display: flex; justify-content: space-between; gap: 8px; }
.qz-verdict span { font-weight: 700; color: #64748b; }
.v-correto { color: #16a34a; } .v-parcial { color: #d97706; } .v-errado { color: #dc2626; }
.qz-missing { color: #92400e; } .dark .qz-missing { color: #fcd34d; }
.qz-part { font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #0369a1; padding: 8px 2px 0; display: grid; gap: 2px; }
.dark .qz-part { color: #7dd3fc; }
.qz-part span { font-size: .8rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: #64748b; }
.qz-opt.chosen { border-color: #0ea5e9; background: #f0f9ff; } .qz-opt.chosen .qz-l { background: #0ea5e9; color: #fff; }
.dark .qz-opt.chosen { background: #0c2a3f; }
.qe-parts { color: #475569; margin: 2px 0 0; } .dark .qe-parts { color: #cbd5e1; }
.qz-model { margin-top: 6px; } .qz-model summary { cursor: pointer; color: #0369a1; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.dark .qz-model summary { color: #7dd3fc; }
.quiz-end { text-align: center; border: 1px solid #bae6fd; background: #f0f9ff; border-radius: 14px; padding: 18px; }
.dark .quiz-end { background: #0c2a3f; border-color: #0c4a6e; color: #e5e7eb; }
.qe-score { font-size: 2rem; font-weight: 900; color: #0369a1; }
.dark .qe-score { color: #7dd3fc; }
.qe-score small { font-size: 1rem; font-weight: 700; color: #64748b; }
.qe-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 639px) {
    .quiz-bar { padding: 10px 12px; }
    .qb-dots { flex-wrap: nowrap; overflow-x: auto; max-height: none; padding-bottom: 2px; scrollbar-width: thin; }
    .qb-dots button { flex: none; }
    .qb-submit { justify-self: stretch; }
    .qz { padding: 12px; }
}

/* ===== Partilhar teste (quem cria) ===== */
.share-card { border: 1px solid #c7d2fe; background: linear-gradient(160deg, #eef2ff 0%, #ffffff 60%); border-radius: 14px; padding: 14px 16px; display: grid; gap: 12px; }
.dark .share-card { background: linear-gradient(160deg, #1e1b4b 0%, #111827 60%); border-color: #3730a3; color: #e5e7eb; }
.share-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.share-head b { font-size: 1rem; }
.share-head small { color: #64748b; font-size: .8rem; }
.dark .share-head small { color: #94a3b8; }
.share-pill { font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #4338ca; background: #e0e7ff; padding: 3px 8px; border-radius: 999px; }
.dark .share-pill { color: #c7d2fe; background: #312e81; }
.share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
@media (max-width: 639px) { .share-grid { grid-template-columns: minmax(0, 1fr); } }
.share-field { display: grid; gap: 4px; font-size: .85rem; }
.share-field > span { font-weight: 600; color: #334155; }
.dark .share-field > span { color: #cbd5e1; }
.share-field.full { grid-column: 1 / -1; }
.share-field input[type="text"], .share-field input[type="datetime-local"], .share-field select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: #0f172a; font-size: 16px; }
.dark .share-field input, .dark .share-field select { background: #1f2937; border-color: #374151; color: #e5e7eb; }
.share-check { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: .9rem; cursor: pointer; }
.share-check input { width: 18px; height: 18px; accent-color: #4f46e5; }
.share-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.share-seg label { flex: 1; min-width: 120px; display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; cursor: pointer; font-size: .85rem; }
.dark .share-seg label { background: #1f2937; border-color: #374151; }
.share-seg input { accent-color: #4f46e5; }
.share-btn { min-height: 44px; padding: 10px 16px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #6366f1, #0ea5e9); color: #fff; font-weight: 700; cursor: pointer; }
.share-btn:disabled { opacity: .55; cursor: wait; }
.share-done { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
@media (max-width: 639px) { .share-done { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; } }
.share-qr { width: 132px; height: 132px; border-radius: 10px; background: #fff; padding: 6px; border: 1px solid #e2e8f0; }
.share-code { font-size: 1.9rem; font-weight: 900; letter-spacing: .18em; color: #4338ca; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dark .share-code { color: #a5b4fc; }
.share-link { font-size: .9rem; word-break: break-all; color: #0369a1; }
.dark .share-link { color: #7dd3fc; }
.share-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
@media (max-width: 639px) { .share-actions { justify-content: center; } }
.share-note { font-size: .8rem; color: #64748b; }
.dark .share-note { color: #94a3b8; }
.share-msg { font-size: .85rem; border-radius: 10px; padding: 8px 10px; }
.share-msg.ok { background: #f0fdf4; color: #166534; } .share-msg.ko { background: #fef2f2; color: #991b1b; }
.dark .share-msg.ok { background: #052e16; color: #bbf7d0; } .dark .share-msg.ko { background: #450a0a; color: #fecaca; }
.qb-timer { font-variant-numeric: tabular-nums; font-weight: 800; color: #0369a1; }
.qb-timer.low { color: #dc2626; }
.dark .qb-timer { color: #7dd3fc; } .dark .qb-timer.low { color: #f87171; }
