/* Exam simulation app styles — builds on the site's base stylesheet. */

#exam-app { margin: 1.5rem 0; }

.exam-error { color: #b3261e; font-weight: 600; }

/* gate */
.exam-gate { border: 1px solid var(--line, #dfe7f0); border-radius: 12px; padding: 1.5rem; background: var(--card, #fff); }
.exam-gate h2 { margin-top: 0; }

/* intro */
.exam-intro h2 { margin-bottom: 0.25rem; }
.exam-meta { color: var(--muted, #5b6b7f); font-weight: 600; }
.exam-access-note { background: #eef6ee; border: 1px solid #bfe0bf; border-radius: 8px; padding: 0.6rem 0.9rem; }
.exam-access-note.preview { background: #fff8e6; border-color: #f0d98c; }
.exam-spec-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
.exam-spec-table th, .exam-spec-table td { border-bottom: 1px solid var(--line, #dfe7f0); padding: 0.45rem 0.6rem; text-align: left; }
.exam-spec-table td.num, .exam-spec-table th:last-child { text-align: right; }
.exam-spec-table tr.total td { font-weight: 700; }
.exam-fineprint { font-size: 0.85rem; color: var(--muted, #5b6b7f); }

/* topbar */
.exam-topbar { display: flex; align-items: center; gap: 1rem; padding: 0.6rem 0.9rem; border: 1px solid var(--line, #dfe7f0); border-radius: 10px; margin-bottom: 1rem; position: sticky; top: 0; background: var(--card, #fff); z-index: 60; }
.exam-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.25rem; }
.exam-timer.warn { color: #b3541e; }
.exam-timer.urgent { color: #b3261e; }
.exam-progress { flex: 1; color: var(--muted, #5b6b7f); }
.btn-small { padding: 0.35rem 0.8rem; font-size: 0.9rem; }

/* main layout */
.exam-main { display: grid; grid-template-columns: 1fr 220px; gap: 1.25rem; align-items: start; }
@media (max-width: 760px) { .exam-main { grid-template-columns: 1fr; } }

.exam-qwrap { border: 1px solid var(--line, #dfe7f0); border-radius: 12px; padding: 1.25rem; background: var(--card, #fff); }
.exam-qnum { font-size: 0.85rem; color: var(--muted, #5b6b7f); margin-top: 0; }
.exam-stem { font-size: 1.05rem; line-height: 1.55; }
.exam-diagram { background: #fff; border: 1px solid #dfe7f0; border-radius: 10px; padding: 0.75rem; margin: 1rem 0; text-align: center; }
.exam-diagram img { max-width: 100%; height: auto; }
.exam-diagram.small img { max-width: 420px; }

.exam-opts { display: grid; gap: 0.6rem; margin: 1rem 0; }
.exam-opt { display: flex; gap: 0.75rem; align-items: flex-start; text-align: left; padding: 0.7rem 0.9rem; border: 1px solid var(--line, #dfe7f0); border-radius: 10px; background: var(--card, #fff); cursor: pointer; font-size: 1rem; }
.exam-opt:hover { border-color: var(--water-dark, #0B5FA5); }
.exam-opt.selected { border-color: var(--water-dark, #0B5FA5); background: #eef5fc; box-shadow: 0 0 0 1px var(--water-dark, #0B5FA5); }
.opt-key { font-weight: 800; min-width: 1.4rem; }
.opt-val { flex: 1; }

.exam-nav { display: flex; gap: 0.6rem; justify-content: space-between; margin-top: 1rem; flex-wrap: wrap; }
.exam-opt.flagged, .btn.flagged { border-color: #b3541e; color: #b3541e; }

/* palette */
.exam-side { border: 1px solid var(--line, #dfe7f0); border-radius: 12px; padding: 1rem; background: var(--card, #fff); }
.exam-side h3 { margin: 0 0 0.6rem; font-size: 1rem; }
.exam-palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.35rem; max-height: 420px; overflow-y: auto; }
.pal { aspect-ratio: 1; border: 1px solid var(--line, #dfe7f0); border-radius: 6px; background: var(--card, #fff); cursor: pointer; font-size: 0.8rem; padding: 0; }
.pal.answered { background: #e3f0fa; border-color: #9cc6e2; }
.pal.flagged { border-color: #b3541e; color: #b3541e; font-weight: 700; }
.pal.current { outline: 2px solid var(--water-dark, #0B5FA5); font-weight: 800; }
.exam-legend { font-size: 0.8rem; color: var(--muted, #5b6b7f); }

/* results */
.exam-results h2 { margin-bottom: 0.25rem; }
.exam-timeout { background: #fff8e6; border: 1px solid #f0d98c; border-radius: 8px; padding: 0.6rem 0.9rem; }
.exam-score { font-size: 2.2rem; font-weight: 800; margin: 0.5rem 0 0; }
.exam-pct { font-size: 1.2rem; color: var(--muted, #5b6b7f); margin-top: 0; }
.exam-catbars { margin: 1rem 0 1.5rem; display: grid; gap: 0.5rem; }
.catbar-row { display: grid; grid-template-columns: minmax(180px, 260px) 1fr 64px; gap: 0.6rem; align-items: center; font-size: 0.9rem; }
.catbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catbar-track { height: 10px; background: #edf1f6; border-radius: 6px; overflow: hidden; }
.catbar-fill { height: 100%; background: var(--water-dark, #0B5FA5); border-radius: 6px; }
.catbar-val { text-align: right; font-variant-numeric: tabular-nums; }

.exam-review { display: grid; gap: 1rem; margin-top: 1rem; }
.rev-item { border: 1px solid var(--line, #dfe7f0); border-radius: 10px; padding: 1rem 1.1rem; background: var(--card, #fff); }
.rev-item.ok { border-left: 4px solid #2e7d32; }
.rev-item.miss { border-left: 4px solid #b3261e; }
.rev-head { font-size: 0.85rem; font-weight: 700; margin: 0 0 0.4rem; }
.rev-item.ok .rev-head { color: #2e7d32; }
.rev-item.miss .rev-head { color: #b3261e; }
.rev-stem { margin: 0.3rem 0; }
.rev-sol, .rev-dd, .rev-tk { font-size: 0.92rem; margin: 0.35rem 0; }
.rev-dd { color: #b3541e; }
.rev-tk { color: var(--muted, #5b6b7f); font-style: italic; }

/* pricing */
.pass-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.pass-card { border: 1px solid var(--line, #dfe7f0); border-radius: 12px; padding: 1.25rem; background: var(--card, #fff); }
.pass-card.featured { border-color: var(--water-dark, #0B5FA5); box-shadow: 0 2px 12px rgba(11, 95, 165, 0.12); }
.pass-card h3 { margin-top: 0; }
.pass-price { font-size: 1.8rem; font-weight: 800; margin: 0.25rem 0; }
.pass-card ul { padding-left: 1.1rem; margin: 0.6rem 0 1rem; }
.pass-card li { margin: 0.3rem 0; }
.paypal-button-wrap { min-height: 50px; margin-top: 0.75rem; }
.paypal-note { font-size: 0.85rem; color: var(--muted, #5b6b7f); }

.exam-ait-note { font-size: 0.9rem; color: var(--muted, #5b6b7f); font-style: italic; margin: 0.4rem 0; }
.exam-fillwrap { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.exam-fill { font-size: 1.05rem; padding: 0.6rem 0.8rem; border: 1px solid var(--line, #dfe7f0); border-radius: 10px; max-width: 220px; }

/* finish-confirmation modal */
.exam-modal-overlay { position: fixed; inset: 0; background: rgba(20, 30, 45, 0.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.exam-modal { background: var(--card, #fff); border-radius: 12px; padding: 1.5rem; max-width: 420px; width: 100%; box-shadow: 0 8px 32px rgba(0,0,0,0.25); }
.exam-modal h3 { margin-top: 0; }
.exam-modal-row { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }

@media print {
  .exam-topbar, .exam-side, .exam-nav { display: none; }
}

/* sample question preview */
#sample { margin: 2.5rem 0; }
#sample-app { margin-top: 1rem; }
.sample-start { text-align: center; padding: 1.5rem; border: 1px dashed var(--line, #dfe7f0); border-radius: 12px; }
.sample-count { font-weight: 700; margin-top: 0; }
.sample-error { color: #b3541e; }
.exam-opt.correct { border-color: #1e7e34; background: #e9f7ef; box-shadow: 0 0 0 1px #1e7e34; }
.exam-opt.wrong { border-color: #c0392b; background: #fdedec; box-shadow: 0 0 0 1px #c0392b; }
.exam-opt:disabled { cursor: default; }
.sample-feedback { border-top: 1px solid var(--line, #dfe7f0); margin-top: 1rem; padding-top: 1rem; }
.sample-verdict { font-weight: 700; }
.sample-verdict.good { color: #1e7e34; }
.sample-verdict.miss { color: #b3541e; }
.sample-feedback h4 { margin: 0.8rem 0 0.3rem; }
.sample-solution { white-space: pre-line; }
.sample-takeaway { font-style: italic; color: var(--muted, #5b6b7f); }
.sample-nav { margin-top: 1rem; }
.sample-gate { text-align: center; padding: 1.5rem; border: 1px solid var(--line, #dfe7f0); border-radius: 12px; background: var(--card, #fff); }
.sample-gate h3 { margin-top: 0; }
@keyframes sampleFlash { 0% { box-shadow: 0 0 0 0 rgba(11,95,165,0.55); } 100% { box-shadow: 0 0 0 18px rgba(11,95,165,0); } }
#pricing.sample-flash { animation: sampleFlash 1.2s ease-out 2; border-radius: 12px; }

/* pass code (cross-device access) */
.pass-confirm { text-align: center; padding: 2rem 1.5rem; border: 1px solid var(--line, #dfe7f0); border-radius: 12px; background: var(--card, #fff); }
.pass-confirm h2 { margin-top: 0; }
.pass-code-row { display: flex; gap: 0.6rem; justify-content: center; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.pass-code { font-family: ui-monospace, monospace; font-size: 0.82rem; background: #f2f5f9; border: 1px dashed #9fb3c8; border-radius: 8px; padding: 0.6rem 0.8rem; word-break: break-all; max-width: 100%; }
.pass-note { color: var(--muted, #5b6b7f); font-size: 0.9rem; }
.exam-have-code { margin-top: 1.1rem; margin-bottom: 0; }
.linklike { background: none; border: none; color: var(--water-dark, #0B5FA5); text-decoration: underline; cursor: pointer; font-size: 0.95rem; padding: 0; }
.exam-code-form { margin-top: 0.6rem; }
.exam-code-input { font-family: ui-monospace, monospace; font-size: 0.88rem; padding: 0.55rem 0.7rem; border: 1px solid var(--line, #dfe7f0); border-radius: 8px; width: min(420px, 100%); margin: 0 0.5rem 0.5rem 0; }
.exam-code-msg { font-size: 0.9rem; color: #b3541e; min-height: 1.2em; }

/* narrow screens: keep the sticky exam toolbar compact so it never covers answers */
@media (max-width: 640px) {
  .exam-topbar { padding: 0.45rem 0.6rem; gap: 0.6rem; }
  .exam-timer { font-size: 1.05rem; }
  .exam-qwrap { scroll-margin-top: 84px; }
}
