/* Practice-test section (portal/practice.ejs, portal/practice-test.ejs).
   Reuses the site's existing tokens and .btn/.card classes from style.css for
   visual consistency; only adds the handful of component classes this section
   needs, plus two small tokens (amber "incomplete" state, a light blue tint)
   that style.css does not already define. */
:root {
  --lightblue-bg: #eef3ff;
  --incomplete: #8a6d1e;
  --incomplete-bg: #fbf1d9;
}

.practice-app h1, .practice-app h2, .practice-app h3 { text-wrap: balance; }
.practice-app button { font-family: inherit; cursor: pointer; }

/* ---------- dashboard ---------- */
.practice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.test-card { display: flex; flex-direction: column; gap: 14px; justify-content: space-between; }
.test-card .tag-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.3px; padding: 4px 10px; border-radius: 999px; }
.pill-full { background: var(--lightblue-bg); color: var(--blue); }
.pill-bank { background: var(--incomplete-bg); color: var(--incomplete); }
.pill-set { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.test-card h3 { font-size: 19px; line-height: 1.25; margin: 0; }
.test-card .meta { font-size: 13.5px; color: var(--muted); }
.best-score { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.best-score b { color: var(--ink); font-size: 16px; }
.test-card-actions { display: flex; gap: 8px; align-items: center; }
.attempt-count { font-size: 12.5px; color: var(--muted); }

/* ---------- test-taking ---------- */
.test-header { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.progress-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.progress-label { font-size: 14px; color: var(--muted); font-weight: 600; }
.progress-track { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress-fill { height: 100%; background: var(--blue); border-radius: 999px; transition: width 0.25s ease; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; }
.palette-group { display: flex; flex-direction: column; gap: 6px; }
.palette-group-label { font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.palette-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.pdot { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--muted); font-size: 12.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pdot.answered { background: var(--lightblue-bg); border-color: var(--blue); color: var(--blue); }
.pdot.incomplete { background: var(--incomplete-bg); border-color: var(--incomplete); color: var(--incomplete); }
.pdot.current { outline: 2px solid var(--navy); outline-offset: 1px; }

.q-domain { font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: var(--blue); background: var(--lightblue-bg); padding: 4px 10px; border-radius: 999px; display: inline-block; }
.q-stem { font-size: 19px; line-height: 1.55; margin-top: 14px; }
.figure-card { margin-top: 16px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; justify-content: center; overflow-x: auto; }
.figure-card.is-table { display: block; padding: 0; overflow: hidden; }
.figure-card.self-contained { background: transparent; border: none; padding: 0; }
.figure-card svg { max-width: 100%; height: auto; display: block; }
.figure-card img { max-width: 100%; height: auto; display: block; }
.figure-card table { width: 100%; border-collapse: collapse; }
.figure-card p { margin: 0; }
.choice-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.choice { display: flex; align-items: flex-start; gap: 14px; text-align: left; border: 1.5px solid var(--border); background: #fff; border-radius: 12px; padding: 14px 18px; width: 100%; }
.choice .letter { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.choice.selected { border-color: var(--blue); background: var(--lightblue-bg); }
.choice.selected .letter { background: var(--blue); color: #fff; border-color: var(--blue); }
.choice.locked { opacity: 0.65; cursor: not-allowed; }
.choice-text { font-size: 16.5px; line-height: 1.4; padding-top: 2px; }
.grid-input-row { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.grid-input-row label { font-size: 13.5px; color: var(--muted); font-weight: 600; }

.solution-zone { margin-top: 22px; }
.solution-confirm { background: var(--incomplete-bg); border: 1px solid var(--incomplete); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.solution-confirm p { font-size: 14.5px; color: var(--ink); line-height: 1.5; margin: 0; }
.solution-confirm .row { display: flex; gap: 10px; flex-wrap: wrap; }
.solution-box { background: var(--lightblue-bg); border-left: 5px solid var(--blue); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.solution-box .label { font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: var(--blue); }
/* Scoped to .solution-box: a bare ".step"/".step-num" would otherwise collide with and override the
   unrelated "How it works" step cards on the homepage (views/index.ejs's .step class, styled in
   style.css), since this stylesheet loads after style.css there and a same-specificity selector wins
   by source order. */
.solution-box .step { display: flex; gap: 14px; align-items: flex-start; }
.solution-box .step-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--navy); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.solution-box .step-text { font-size: 15.5px; line-height: 1.5; padding-top: 2px; }
.method-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.method-card h4 { font-size: 14.5px; margin: 0 0 6px; }
.method-card p { font-size: 14.5px; color: var(--muted); line-height: 1.5; margin: 0; }
.incomplete-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--incomplete); background: var(--incomplete-bg); padding: 5px 10px; border-radius: 999px; margin-top: 12px; }

.test-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--border); }
.submit-banner { background: var(--err-bg); border: 1px solid var(--err); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.submit-banner p { font-size: 14.5px; margin: 0; }
.submit-banner .row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- results / review ---------- */
.score-hero { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.score-ring { width: 128px; height: 128px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: conic-gradient(var(--blue) calc(var(--pct, 0) * 1%), var(--border) 0); }
.score-ring-inner { width: 98px; height: 98px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring-inner b { font-size: 26px; }
.score-ring-inner span { font-size: 11px; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; }
.score-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; }
.stat span { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat.good b { color: var(--ok); }
.stat.bad b { color: var(--err); }
.stat.incomplete b { color: var(--incomplete); }
.review-note { background: var(--incomplete-bg); border: 1px solid var(--incomplete); border-radius: 10px; padding: 12px 16px; font-size: 14px; line-height: 1.5; margin-top: 18px; }

.review-list { display: flex; flex-direction: column; gap: 10px; }
.review-item { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.review-item-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; width: 100%; text-align: left; background: none; border: none; cursor: pointer; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.status-dot.correct { background: var(--ok); }
.status-dot.incorrect { background: var(--err); }
.status-dot.incomplete { background: var(--incomplete); }
.review-item-head .q-no { font-weight: 700; width: 60px; flex: none; }
.review-item-head .q-domain-sm { font-size: 12px; color: var(--muted); flex: 1; text-align: left; }
.review-item-head .q-status-label { font-size: 13px; font-weight: 700; }
.review-item-body { padding: 0 18px 18px 18px; display: none; flex-direction: column; gap: 14px; }
.review-item.open .review-item-body { display: flex; }
.review-item.open .chev { transform: rotate(180deg); }
.chev { transition: transform 0.15s ease; color: var(--muted); }
.answer-compare { display: flex; gap: 24px; flex-wrap: wrap; }
.answer-compare .box { flex: 1; min-width: 160px; }
.answer-compare .box span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); font-weight: 700; }
.answer-compare .box p { font-size: 15px; margin-top: 4px; font-weight: 600; }

/* ---------- attempt history on a test's own page ---------- */
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.history-row:last-child { border-bottom: none; }
.history-meta { display: flex; flex-direction: column; gap: 3px; }
.history-meta b { font-size: 15.5px; }
.history-meta span { font-size: 13px; color: var(--muted); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 48px 20px; color: var(--muted); }

@media (max-width: 560px) {
  .score-hero { gap: 18px; }
  .score-ring { width: 104px; height: 104px; }
  .score-ring-inner { width: 80px; height: 80px; }
  .score-ring-inner b { font-size: 21px; }
}

/* ---------- public full-length practice test (sat-practice-test.ejs) ---------- */
.timer-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; background: var(--lightblue-bg); color: var(--blue); padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
.timer-pill.low { background: var(--err-bg); color: var(--err); }
.est-score-box { margin-top: 18px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; }
.est-score-box .label { display: block; font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.est-score-box b { font-size: 28px; color: var(--navy); display: block; margin-top: 4px; }
.est-score-box p { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 10px 0 0; }
.domain-bars { display: flex; flex-direction: column; gap: 14px; }
.domain-bar-row { display: flex; flex-direction: column; gap: 6px; }
.domain-bar-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }
.domain-bar-track { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; }
.domain-bar-fill { height: 100%; background: var(--blue); border-radius: 999px; }
.cta-card { margin-top: 18px; background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: #fff; }
.cta-card h3, .cta-card p.muted { color: #fff; }
.cta-card .btn-ghost { background: transparent; border-color: rgba(255,255,255,0.4); color: #fff; }
.rules-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 10px; }
.rules-list li { padding-left: 30px; position: relative; color: var(--ink); line-height: 1.5; font-size: 15px; }
.rules-list li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--ok-bg); border: 1.5px solid var(--ok); }
.rules-list li::after { content: ""; position: absolute; left: 6px; top: 7px; width: 5px; height: 9px; border: solid var(--ok); border-width: 0 2px 2px 0; transform: rotate(40deg); }
