/* Practice Test Engine — frontend styles */
.pte-exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 16px 0; }
.pte-exam-card { border: 1px solid #e2e8f0; border-radius: var(--pte-radius, 6px); padding: 18px; background: #fff; }
.pte-exam-card h3 { margin-top: 0; color: var(--pte-secondary, #0f172a); }
.pte-exam-meta { color: #64748b; font-size: 13px; }
.pte-btn, .pte-quiz-wrapper button { display: inline-block; background: var(--pte-button, #2563eb); color: #fff !important; border: none; padding: 10px 18px; border-radius: var(--pte-radius, 6px); cursor: pointer; text-decoration: none; font-size: 14px; }
.pte-btn:hover, .pte-quiz-wrapper button:hover { opacity: .9; }

.pte-set-list h2 { color: var(--pte-secondary, #0f172a); }
.pte-exam-desc { margin-bottom: 12px; color: #475569; }

.pte-quiz-wrapper { max-width: 960px; margin: 20px 0; border: 1px solid #e2e8f0; border-radius: var(--pte-radius, 6px); overflow: hidden; }
.pte-guest-form, .pte-start-panel { padding: 24px; text-align: center; }
.pte-guest-form input { display: block; width: 100%; max-width: 320px; margin: 8px auto; padding: 10px; border: 1px solid #cbd5e1; border-radius: 4px; }
.pte-error { color: #dc2626; }
.pte-notice { padding: 24px; text-align: center; }

.pte-quiz-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: var(--pte-secondary, #0f172a); color: #fff; flex-wrap: wrap; gap: 8px; }
.pte-quiz-header .pte-timer { font-weight: 700; font-size: 18px; }
.pte-quiz-header .pte-timer.pte-low-time { color: #f87171; }

.pte-quiz-body { display: flex; flex-wrap: wrap; }
.pte-quiz-main { flex: 1 1 60%; padding: 20px; min-width: 280px; }
.pte-quiz-sidebar { flex: 1 1 30%; padding: 20px; border-left: 1px solid #e2e8f0; min-width: 220px; }

.pte-q-count { color: #64748b; margin-bottom: 8px; }
.pte-q-text { font-size: 16px; margin-bottom: 16px; }
.pte-q-image { max-width: 100%; border-radius: 4px; margin-bottom: 16px; }
.pte-options label { display: block; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: var(--pte-radius, 6px); margin-bottom: 8px; cursor: pointer; }
.pte-options input { margin-right: 8px; }
.pte-options label.pte-selected { border-color: var(--pte-primary, #2563eb); background: #eff6ff; }

.pte-nav-row { display: flex; justify-content: space-between; margin-top: 20px; }

.pte-palette-title { font-weight: 600; margin-bottom: 8px; }
.pte-palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 16px; }
.pte-palette button { background: #e2e8f0; color: #0f172a !important; border-radius: 4px; padding: 6px 0; font-size: 13px; }
.pte-palette button.pte-p-answered { background: #22c55e; color: #fff !important; }
.pte-palette button.pte-p-not-visited { background: #60a5fa; color: #fff !important; }
.pte-palette button.pte-p-current { background: #facc15; color: #0f172a !important; }
.pte-palette button.pte-p-review { background: #ef4444; color: #fff !important; }

.pte-legend { font-size: 12px; color: #475569; margin-bottom: 16px; }
.pte-legend span { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }

.pte-submit-btn { width: 100%; background: #16a34a; }

.pte-modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.6); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.pte-modal { background: #fff; border-radius: 8px; padding: 24px; max-width: 360px; text-align: center; }
.pte-modal .pte-modal-actions { margin-top: 16px; display: flex; gap: 8px; justify-content: center; }
.pte-modal .pte-cancel-btn { background: #94a3b8; }

.pte-result-page { padding: 10px 0; }
.pte-result-summary { border: 1px solid #e2e8f0; border-radius: var(--pte-radius, 6px); padding: 20px; text-align: center; margin: 16px 0; }
.pte-result-summary.pte-pass { border-color: #22c55e; }
.pte-result-summary.pte-fail { border-color: #ef4444; }
.pte-score-big { font-size: 32px; font-weight: 700; }
.pte-result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.pte-result-grid div { display: flex; flex-direction: column; }
.pte-pass-badge { display: inline-block; padding: 6px 16px; border-radius: 4px; font-weight: 700; background: #22c55e; color: #fff; }
.pte-fail .pte-pass-badge { background: #ef4444; }

.pte-review-item { border-left: 4px solid #94a3b8; padding: 10px 14px; margin-bottom: 12px; background: #f8fafc; }
.pte-review-item.pte-correct { border-color: #22c55e; }
.pte-review-item.pte-wrong { border-color: #ef4444; }
.pte-review-item.pte-unanswered { border-color: #cbd5e1; }
.pte-explanation { color: #475569; font-style: italic; }

.pte-history-table { width: 100%; border-collapse: collapse; }
.pte-history-table th, .pte-history-table td { padding: 8px 10px; border-bottom: 1px solid #e2e8f0; text-align: left; }

@media (max-width: 640px) {
	.pte-quiz-body { flex-direction: column-reverse; }
	.pte-quiz-sidebar { border-left: none; border-top: 1px solid #e2e8f0; }
}


/* v0.2 — professional post-exam result, lead form, attempts and leaderboard */
.pte-examination-result { max-width: 1100px; margin: 24px auto; color: #0f172a; }
.pte-result-head { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:22px; background:#fff; border:1px solid #e2e8f0; border-radius:12px; margin-bottom:14px; }
.pte-result-head h2 { margin:4px 0; font-size:28px; }
.pte-result-head p { margin:0; color:#64748b; }
.pte-result-kicker { display:block; font-size:12px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--pte-primary,#2563eb); }
.pte-result-status { padding:9px 18px; border-radius:999px; font-weight:800; font-size:13px; }
.pte-result-status.is-pass { background:#dcfce7; color:#166534; }
.pte-result-status.is-fail { background:#fee2e2; color:#991b1b; }
.pte-score-block { padding:8px 0 20px; text-align:center; }
.pte-score-block span,.pte-score-block small { display:block; color:#64748b; }
.pte-score-block strong { display:inline-block; font-size:48px; line-height:1.05; margin-top:5px; }
.pte-result-grid-six { grid-template-columns:repeat(6,1fr); }
.pte-result-grid-six div { padding:12px 6px; text-align:center; border:1px solid #e2e8f0; border-radius:8px; background:#fff; }
.pte-result-grid-six strong { font-size:20px; }
.pte-result-grid-six span { color:#64748b; font-size:12px; margin-top:3px; }
.pte-stat-correct strong { color:#15803d; }
.pte-stat-wrong strong { color:#dc2626; }
.pte-result-extra { display:flex; justify-content:center; gap:24px; flex-wrap:wrap; margin-top:16px; color:#475569; }
.pte-course-card { display:flex; gap:20px; align-items:center; margin:20px 0; padding:20px; border:1px solid #dbeafe; border-radius:12px; background:linear-gradient(135deg,#eff6ff,#fff); }
.pte-course-image { flex:0 0 190px; }
.pte-course-image img { display:block; width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:9px; }
.pte-course-content { flex:1; }
.pte-course-label { font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; color:var(--pte-primary,#2563eb); }
.pte-course-content h3 { margin:4px 0 7px; font-size:23px; }
.pte-course-content p { margin:0 0 14px; color:#475569; }
.pte-result-section { margin:26px 0; }
.pte-section-heading { display:flex; justify-content:space-between; gap:12px; align-items:end; border-bottom:1px solid #e2e8f0; padding-bottom:9px; margin-bottom:12px; }
.pte-section-heading h3 { margin:0; font-size:20px; }
.pte-section-heading span { color:#64748b; font-size:12px; }
.pte-attempt-list { display:grid; gap:9px; }
.pte-attempt-card { display:grid; grid-template-columns:1.5fr 1fr auto; align-items:center; gap:12px; padding:14px; border:1px solid #e2e8f0; border-radius:9px; background:#fff; }
.pte-attempt-card.is-current { border-color:var(--pte-primary,#2563eb); box-shadow:0 0 0 2px rgba(37,99,235,.08); }
.pte-attempt-card span { display:block; color:#64748b; font-size:12px; margin-top:3px; }
.pte-attempt-stat strong { font-size:18px; }
.pte-btn-small { padding:7px 12px; font-size:12px; }
.pte-review-item { border:1px solid #e2e8f0; border-left-width:4px; border-radius:9px; padding:16px; margin-bottom:12px; background:#fff; }
.pte-review-topline { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.pte-question-number { font-weight:800; color:#334155; }
.pte-answer-badge { padding:4px 9px; border-radius:999px; font-size:11px; font-weight:800; }
.pte-correct .pte-answer-badge { background:#dcfce7; color:#166534; }
.pte-wrong .pte-answer-badge { background:#fee2e2; color:#991b1b; }
.pte-unanswered .pte-answer-badge { background:#f1f5f9; color:#475569; }
.pte-review-question { font-size:16px; font-weight:600; line-height:1.55; }
.pte-review-image { max-width:100%; max-height:360px; object-fit:contain; display:block; margin:12px 0; border:1px solid #e2e8f0; border-radius:7px; }
.pte-review-answers { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:13px; }
.pte-review-answers > div { padding:11px; border-radius:7px; background:#f8fafc; }
.pte-review-answers span { display:block; color:#64748b; font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.pte-review-answers strong { display:block; margin-top:3px; }
.pte-review-answers .answer-positive { background:#f0fdf4; border:1px solid #bbf7d0; }
.pte-review-answers .answer-negative { background:#fef2f2; border:1px solid #fecaca; }
.pte-review-answers .answer-correct { background:#f0fdf4; border:1px solid #bbf7d0; }
.pte-explanation-box { margin-top:12px; padding:12px 14px; background:#fffbeb; border:1px solid #fde68a; border-radius:7px; color:#713f12; }
.pte-explanation-box strong { display:block; margin-bottom:4px; }
.pte-explanation-box p { margin:0 0 5px; }
.pte-top-performers { display:grid; gap:8px; }
.pte-top-card { display:grid; grid-template-columns:40px 1fr auto; gap:11px; align-items:center; padding:12px; border:1px solid #e2e8f0; border-radius:9px; background:#fff; }
.pte-top-avatar { width:40px; height:40px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--pte-primary,#2563eb); color:#fff; font-weight:800; }
.pte-top-name span,.pte-top-score span { display:block; color:#64748b; font-size:11px; margin-top:2px; }
.pte-top-score { text-align:right; }
.pte-top-score strong { font-size:18px; }
.pte-post-exam-form { max-width:720px; margin:30px auto; padding:30px; background:#fff; border:1px solid #e2e8f0; border-radius:14px; text-align:center; box-shadow:0 8px 30px rgba(15,23,42,.06); }
.pte-post-exam-icon { width:52px; height:52px; margin:0 auto 12px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:#dcfce7; color:#166534; font-size:25px; font-weight:900; }
.pte-post-exam-form h2 { margin:4px 0 8px; font-size:28px; }
.pte-post-exam-form > p { color:#64748b; }
.pte-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:13px; text-align:left; margin:22px 0; }
.pte-detail-grid label { display:block; }
.pte-detail-grid label > span { display:block; font-size:12px; font-weight:700; margin-bottom:5px; color:#334155; }
.pte-detail-grid input,.pte-detail-grid textarea { width:100%; box-sizing:border-box; padding:11px 12px; border:1px solid #cbd5e1; border-radius:7px; background:#fff; }
.pte-detail-full { grid-column:1/-1; }
.pte-post-error { color:#b91c1c !important; background:#fef2f2; padding:9px; border-radius:6px; }
@media (max-width: 760px) {
	.pte-result-head { align-items:flex-start; flex-direction:column; }
	.pte-result-grid-six { grid-template-columns:repeat(3,1fr); }
	.pte-course-card { flex-direction:column; align-items:stretch; }
	.pte-course-image { flex-basis:auto; }
	.pte-attempt-card { grid-template-columns:1fr; }
	.pte-review-answers,.pte-detail-grid { grid-template-columns:1fr; }
	.pte-detail-full { grid-column:auto; }
	.pte-top-card { grid-template-columns:40px 1fr; }
	.pte-top-score { grid-column:2; text-align:left; }
}
