/* ============================================================
   PTE Exam Player — interface styles
   Re-themed exam chrome (violet/coral) layered on the shared
   design tokens. Clean and distraction-free, exam-appropriate.
   ============================================================ */

:root {
  --ex-brand: #6d28d9;
  --ex-coral: #ff4d76;
  --ex-ink: #17123a;
  --ex-muted: #6b6786;
  --ex-border: #e7e2f5;
  --ex-surface: #ffffff;
  --ex-bg: #f5f3fb;
  --ex-ok: #16a34a;
  --ex-bad: #ef4444;
}

.exam-body {
  margin: 0; font-family: 'Sora', system-ui, sans-serif; color: var(--ex-ink);
  background: var(--ex-bg); min-height: 100vh; -webkit-font-smoothing: antialiased;
}

/* top progress ribbon */
.exam-ribbon { height: 6px; background: linear-gradient(90deg, var(--ex-brand), var(--ex-coral)); }

/* ---------- Header ---------- */
.exam-header {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 22px; background: var(--ex-surface);
  border-bottom: 1px solid var(--ex-border); position: sticky; top: 0; z-index: 30;
}
.exam-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.exam-title .dot { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--ex-brand), var(--ex-coral)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.exam-meta { display: flex; align-items: center; gap: 22px; font-size: 13px; color: var(--ex-muted); }
.exam-meta .m { display: inline-flex; align-items: center; gap: 7px; }
.exam-time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ex-ink); }
.exam-time.warning { color: var(--ex-coral); animation: timer-pulse 1s ease-in-out infinite; }
.exam-counter { font-weight: 600; color: var(--ex-ink); }

/* ---------- Stage / content ---------- */
.exam-stage { max-width: 1080px; margin: 0 auto; padding: 34px 24px 130px; }
.exam-card { background: var(--ex-surface); border: 1px solid var(--ex-border); border-radius: 18px;
  box-shadow: 0 10px 30px -18px rgba(23,18,58,.18); padding: 30px 32px; }
.exam-instruction { font-size: 15px; line-height: 1.6; color: #2c2647; margin-bottom: 22px; }
.exam-instruction b { color: var(--ex-ink); }
.exam-type-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700;
  letter-spacing: .4px; text-transform: uppercase; color: var(--ex-brand); background: rgba(109,40,217,.08);
  padding: 5px 11px; border-radius: 999px; margin-bottom: 16px; }

.exam-passage { font-size: 16px; line-height: 1.75; color: #221d3d; }
.exam-passage.serious { background: var(--ex-bg); border: 1px solid var(--ex-border); border-radius: 12px; padding: 20px 22px; }

/* two-column passage + question */
.exam-split { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.exam-split .divider { border-left: 1px solid var(--ex-border); }
@media (max-width: 820px) { .exam-split { grid-template-columns: 1fr; } }

/* ---------- Footer nav ---------- */
.exam-footer {
  position: fixed; left: 0; right: 0; bottom: 0; height: 74px; z-index: 30;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--ex-border); display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
}
.exam-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 24px;
  border-radius: 11px; font-size: 14px; font-weight: 600; cursor: pointer; border: none;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s; }
.exam-btn:disabled { opacity: .45; cursor: not-allowed; }
.exam-btn-primary { background: var(--ex-brand); color: #fff; }
.exam-btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 24px -10px rgba(109,40,217,.6); }
.exam-btn-accent { background: var(--ex-coral); color: #fff; }
.exam-btn-accent:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 24px -10px rgba(255,77,118,.55); }
.exam-btn-ghost { background: transparent; color: var(--ex-ink); border: 1.5px solid var(--ex-border); }
.exam-btn-ghost:hover:not(:disabled) { border-color: var(--ex-brand); color: var(--ex-brand); }

/* ---------- Alert modal ---------- */
.exam-overlay { position: fixed; inset: 0; background: rgba(23,18,58,.45); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.exam-overlay.show { opacity: 1; pointer-events: auto; }
.exam-modal { width: min(420px, 92vw); background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(23,18,58,.5); transform: translateY(8px) scale(.98); transition: transform .2s; }
.exam-overlay.show .exam-modal { transform: none; }
.exam-modal-head { padding: 18px 22px 0; font-weight: 700; font-size: 17px; }
.exam-modal-body { padding: 10px 22px 20px; color: var(--ex-muted); font-size: 14px; line-height: 1.6; }
.exam-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; background: var(--ex-bg); }

/* ---------- Countdown chip (prep / record start) ---------- */
.exam-countdown { display: inline-flex; align-items: center; gap: 12px; margin: 6px 0 18px; }
.exam-countdown .ring { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ex-border);
  display: grid; place-items: center; font-weight: 700; font-size: 16px; color: var(--ex-ink); position: relative; }
.exam-countdown.prep .ring { border-color: var(--ex-brand); color: var(--ex-brand); animation: countdown-pulse 1.4s infinite; }
.exam-countdown.record .ring { border-color: var(--ex-coral); color: var(--ex-coral); background: rgba(255,77,118,.06); }
.exam-countdown .label { font-size: 13px; color: var(--ex-muted); }

/* ---------- Recording widget ---------- */
.exam-record { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0; }
.exam-mic { width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,77,118,.10); color: var(--ex-coral); position: relative; }
.exam-mic.live::after { content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--ex-coral); animation: countdown-pulse 1.3s infinite; }
.exam-wave { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.exam-wave .bar { width: 3px; border-radius: 2px; background: var(--ex-coral); animation: waveform .8s ease-in-out infinite; }
.exam-status { font-size: 13px; color: var(--ex-muted); }
.exam-status b { color: var(--ex-coral); }

/* ---------- Audio prompt player ---------- */
.exam-audio { display: flex; align-items: center; gap: 14px; background: var(--ex-bg);
  border: 1px solid var(--ex-border); border-radius: 14px; padding: 14px 16px; max-width: 460px; }
.exam-audio .play { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ex-brand);
  color: var(--ex-brand); display: grid; place-items: center; cursor: pointer; background: #fff; flex-shrink: 0;
  transition: background .2s, color .2s; }
.exam-audio .play:hover:not(:disabled) { background: var(--ex-brand); color: #fff; }
.exam-audio .play:disabled, .exam-audio .play.locked {
  cursor: not-allowed; opacity: .45; border-color: var(--ex-muted); color: var(--ex-muted); background: #fff; }
.exam-audio .track { flex: 1; }
.exam-audio .bar-bg { height: 6px; border-radius: 3px; background: var(--ex-border); overflow: hidden; }
.exam-audio .bar-fill { height: 100%; background: var(--ex-brand); border-radius: 3px; width: 0; transition: width .2s linear; }
.exam-audio .times { display: flex; justify-content: space-between; font-size: 11px; color: var(--ex-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.exam-audio-state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ex-muted); margin-top: 10px; }
.exam-audio-state .live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ex-ok); animation: pulse-dot 1.2s infinite; }

/* ---------- Text editor ---------- */
.exam-editor textarea { width: 100%; min-height: 200px; resize: vertical; border: 1px solid var(--ex-border);
  border-radius: 12px; padding: 14px 16px; font-family: inherit; font-size: 15px; line-height: 1.65; color: var(--ex-ink);
  background: #fff; transition: border-color .2s, box-shadow .2s; }
.exam-editor textarea:focus { outline: none; border-color: var(--ex-brand); box-shadow: 0 0 0 3px rgba(109,40,217,.12); }
.exam-editor-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.exam-editor-tools { display: flex; gap: 8px; }
.exam-tool { height: 32px; padding: 0 14px; border: 1px solid var(--ex-border); border-radius: 8px; background: #fff;
  font-size: 13px; font-weight: 500; color: var(--ex-ink); cursor: pointer; transition: all .15s; }
.exam-tool:hover { border-color: var(--ex-brand); color: var(--ex-brand); }
.exam-wordcount { font-size: 13px; color: var(--ex-muted); }
.exam-wordcount b { color: var(--ex-ink); }

/* ---------- Choice options (radio / checkbox) ---------- */
.exam-options { display: flex; flex-direction: column; gap: 10px; }
.exam-option { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border: 1.5px solid var(--ex-border);
  border-radius: 12px; cursor: pointer; transition: all .15s; font-size: 15px; line-height: 1.5; background: #fff; }
.exam-option:hover { border-color: rgba(109,40,217,.4); background: #faf8ff; }
.exam-option.selected { border-color: var(--ex-brand); background: rgba(109,40,217,.06); }
.exam-mark { width: 22px; height: 22px; min-width: 22px; border: 2px solid #b9b2d6; display: grid; place-items: center;
  margin-top: 1px; transition: all .15s; color: #fff; }
.exam-mark.radio { border-radius: 50%; }
.exam-mark.check { border-radius: 6px; }
.exam-option.selected .exam-mark { border-color: var(--ex-brand); background: var(--ex-brand); }
.exam-option.selected .exam-mark.radio { background: #fff; }
.exam-option.selected .exam-mark.radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--ex-brand); }

/* ---------- Fill in blanks ---------- */
.fib-text { font-size: 16px; line-height: 2.1; color: #221d3d; }
.fib-select { display: inline-block; min-width: 130px; height: 32px; border: 1.5px solid var(--ex-brand);
  border-radius: 8px; padding: 0 8px; font-family: inherit; font-size: 14px; color: var(--ex-ink); background: #faf8ff;
  vertical-align: middle; margin: 0 3px; }
.fib-input { display: inline-block; width: 130px; height: 32px; border: 1.5px solid var(--ex-border); border-radius: 8px;
  padding: 0 10px; font-family: inherit; font-size: 14px; vertical-align: middle; margin: 0 3px; background: #fff; }
.fib-input:focus { outline: none; border-color: var(--ex-brand); box-shadow: 0 0 0 3px rgba(109,40,217,.12); }
.fib-slot { display: inline-block; min-width: 120px; height: 34px; border: 1.5px dashed #b9b2d6; border-radius: 8px;
  vertical-align: middle; margin: 0 3px; background: #faf8ff; text-align: center; line-height: 31px; font-size: 14px;
  color: var(--ex-muted); transition: all .15s; }
.fib-slot.over { border-color: var(--ex-brand); background: rgba(109,40,217,.08); }
.fib-slot.filled { border-style: solid; border-color: var(--ex-brand); color: var(--ex-ink); background: #fff; cursor: grab; }
.fib-bank { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding: 18px; background: var(--ex-bg);
  border: 1px solid var(--ex-border); border-radius: 12px; min-height: 60px; }
.fib-chip { padding: 7px 16px; background: #fff; border: 1.5px solid var(--ex-border); border-radius: 8px; font-size: 14px;
  cursor: grab; user-select: none; transition: all .15s; }
.fib-chip:hover { border-color: var(--ex-brand); color: var(--ex-brand); }
.fib-chip.dragging { opacity: .4; }

/* ---------- Reorder ---------- */
.ro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.ro-col-label { font-size: 13px; font-weight: 600; color: var(--ex-muted); margin-bottom: 10px; }
.ro-col { min-height: 220px; background: var(--ex-bg); border: 1px solid var(--ex-border); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px; }
.ro-col.over { border-color: var(--ex-brand); background: rgba(109,40,217,.05); }
.ro-item { background: #fff; border: 1.5px solid var(--ex-border); border-radius: 10px; padding: 12px 14px; font-size: 14px;
  line-height: 1.55; cursor: grab; transition: all .15s; display: flex; gap: 10px; align-items: flex-start; }
.ro-item:hover { border-color: var(--ex-brand); }
.ro-item.dragging { opacity: .4; }
.ro-item .grip { color: #b9b2d6; margin-top: 2px; flex-shrink: 0; }
@media (max-width: 820px) { .ro-grid { grid-template-columns: 1fr; } }

/* ---------- Highlight words ---------- */
.hiw-text { font-size: 16px; line-height: 2.2; color: #221d3d; }
.hiw-word { cursor: pointer; padding: 1px 2px; border-radius: 4px; transition: background .12s; }
.hiw-word:hover { background: rgba(109,40,217,.10); }
.hiw-word.picked { background: var(--ex-brand); color: #fff; }

/* ---------- Section / completion screens ---------- */
.exam-center { max-width: 760px; margin: 0 auto; padding-top: 18px; }
.section-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--ex-border);
  border-radius: 14px; overflow: hidden; }
.section-table caption { text-align: left; font-weight: 700; font-size: 18px; padding: 16px 18px; background: var(--ex-ink); color: #fff; }
.section-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--ex-muted);
  padding: 12px 18px; border-bottom: 1px solid var(--ex-border); background: var(--ex-bg); }
.section-table td { padding: 13px 18px; font-size: 14px; border-bottom: 1px solid var(--ex-border); }
.section-table tr:last-child td { border-bottom: none; }

/* image / chart placeholder */
.exam-figure { background: #fff; border: 1px solid var(--ex-border); border-radius: 12px; padding: 16px; max-width: 460px; }
.exam-figure .cap { text-align: center; font-weight: 700; font-size: 14px; margin-bottom: 8px; }

/* ============================================================
   System / onboarding (system-check.html)
   ============================================================ */
.sc-wrap { max-width: 1180px; margin: 0 auto; padding: 30px 24px 70px; }
.sc-head { text-align: center; max-width: 620px; margin: 0 auto 34px; }
.sc-head h1 { font-size: clamp(26px, 3.5vw, 36px); font-weight: 700; letter-spacing: -.6px; margin-bottom: 8px; }
.sc-head p { color: var(--ex-muted); font-size: 15px; line-height: 1.6; }

.sc-grid { display: grid; grid-template-columns: 196px 1.05fr 1fr; gap: 24px; align-items: stretch; }
@media (max-width: 900px) { .sc-grid { grid-template-columns: 1fr; } .sc-stepper { flex-direction: row; justify-content: center; } .sc-line { width: 40px !important; height: 2px !important; align-self: center; } }

.sc-stepper { background: #fff; border: 1px solid var(--ex-border); border-radius: 20px; padding: 26px 14px;
  display: flex; flex-direction: column; align-items: center; }
.sc-step { text-align: center; width: 100%; }
.sc-step .num { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  font-weight: 700; font-size: 18px; background: #f0ecfb; color: #a99fd0; transition: all .25s; }
.sc-step.active .num { background: linear-gradient(135deg, var(--ex-brand), var(--ex-coral)); color: #fff; box-shadow: 0 10px 22px -8px rgba(109,40,217,.6); }
.sc-step.done .num { background: #16a34a; color: #fff; }
.sc-step .name { font-weight: 600; font-size: 12.5px; margin-top: 10px; line-height: 1.3; color: var(--ex-ink); }
.sc-step.upnext .name { color: var(--ex-muted); }
.sc-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; padding: 3px 9px; border-radius: 999px; margin-top: 7px; }
.sc-pill.active { background: rgba(109,40,217,.10); color: var(--ex-brand); }
.sc-pill.done { background: rgba(22,163,74,.12); color: #16a34a; }
.sc-pill.upnext { background: #f1eefb; color: var(--ex-muted); }
.sc-pill .d { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.sc-line { width: 2px; height: 36px; background: var(--ex-border); margin: 12px auto; border-radius: 2px; }
.sc-line.done { background: #16a34a; }

.sc-illus { position: relative; border-radius: 20px; overflow: hidden; min-height: 380px; display: grid; place-items: center;
  padding: 36px; border: 1px solid var(--ex-border); background:
    radial-gradient(120% 90% at 50% 28%, #f3eefe 0%, #ece4fb 60%, #e6dcfa 100%); }
.sc-illus::before { content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(109,40,217,.10) 1px, transparent 1px); background-size: 20px 20px; }
.sc-illus::after { content: ''; position: absolute; width: 72%; height: 62%; top: 16%; left: 14%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,77,118,.18), transparent 70%); filter: blur(26px); }
.sc-illus img { position: relative; z-index: 1; width: 80%; max-width: 320px; height: auto; object-fit: contain;
  filter: drop-shadow(0 22px 32px rgba(109,40,217,.28)); animation: sc-float 6s ease-in-out infinite; }
@keyframes sc-float { 0%,100% { transform: translateY(-8px); } 50% { transform: translateY(8px); } }

.sc-content { background: #fff; border: 1px solid var(--ex-border); border-radius: 20px; padding: 30px; display: flex; flex-direction: column; }
.sc-content h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.sc-content h2 .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--ex-brand), var(--ex-coral)); color: #fff; }
.sc-mic-list { display: flex; flex-direction: column; gap: 10px; }
.sc-mic { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--ex-border);
  border-radius: 12px; cursor: pointer; font-size: 14px; transition: all .15s; }
.sc-mic:hover { border-color: rgba(109,40,217,.4); }
.sc-mic.sel { border-color: var(--ex-brand); background: rgba(109,40,217,.05); }
.sc-mic .r { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #b9b2d6; display: grid; place-items: center; flex-shrink: 0; }
.sc-mic.sel .r { border-color: var(--ex-brand); }
.sc-mic.sel .r::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--ex-brand); }
.sc-actions { margin-top: auto; padding-top: 24px; display: flex; justify-content: space-between; align-items: center; }

@keyframes timer-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes countdown-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(109,40,217,.35); } 50% { box-shadow: 0 0 0 12px rgba(109,40,217,0); } }
@keyframes waveform { 0%,100% { height: 5px; } 50% { height: 24px; } }
@keyframes pulse-dot { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(1.5); } }
