/* Bookiverse — placement tests (EPT and EMT). Builds on bookiverse-account.css (site header, footer, buttons, cards). */

.t-main { padding: 40px 0 72px; flex: 1; }
.t-main .wrap { max-width: 960px; }

/* ------------------------------------------------------------ introduction */
.t-intro { padding: 40px 40px 36px; text-align: center; }
.t-intro h1 { font-family: var(--font-head); font-weight: 400; font-size: clamp(2rem, 4.4vw, 2.8rem); line-height: 1.15; margin: 12px 0 14px; }
.t-intro .lead { color: var(--ink-2); font-size: 1.06rem; max-width: 680px; margin: 0 auto; }
.t-facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 26px 0 8px; }
.t-fact { min-width: 140px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.t-fact b { display: block; font-family: var(--font-head); font-weight: 400; font-size: 1.7rem; color: var(--gold); line-height: 1.1; }
.t-fact span { color: var(--ink-2); font-size: .86rem; font-weight: 700; }
.t-howto { list-style: none; text-align: start; max-width: 640px; margin: 24px auto 28px; display: grid; gap: 10px; }
.t-howto li { display: flex; gap: 12px; color: var(--ink-2); font-size: .95rem; line-height: 1.55; }
.t-howto li::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px rgba(255, 215, 0, .5); }
.t-age { margin: 0 auto 26px; max-width: 640px; }
.t-intro .btn { min-width: 220px; }

/* ------------------------------------------------------------ timer bar */
.t-bar { position: sticky; top: 68px; z-index: 40; margin: 0 0 22px; padding: 10px 14px 10px 18px; display: flex; align-items: center; gap: 16px;
  border-radius: 999px; background: rgba(13, 4, 31, .92); border: 1px solid var(--gold-line); backdrop-filter: blur(10px); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.t-time { font-family: var(--font-head); font-size: 1.45rem; color: var(--gold); font-variant-numeric: tabular-nums; min-width: 78px; }
.t-time.low { color: #ff9f6b; animation: t-pulse 1s ease-in-out infinite; }
@keyframes t-pulse { 50% { opacity: .55; } }
.t-bar .lbl { color: var(--ink-3); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.t-progress { flex: 1; display: grid; gap: 5px; }
.t-progress .track { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.t-progress .fill { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width .3s var(--ease); }
.t-progress small { color: var(--ink-2); font-size: .8rem; font-weight: 700; }
.t-bar .btn { min-height: 40px; padding: 0 18px; font-size: .88rem; }

/* ------------------------------------------------------------ questions */
.t-form h2 { font-family: var(--font-head); font-weight: 400; font-size: 1.7rem; color: var(--gold); margin: 0 0 6px; }
.t-form h3 { font-size: 1.04rem; font-weight: 800; color: var(--ink); margin: 18px 0 8px; }
.t-form p, .t-form li { color: var(--ink-2); }
.t-form ul { margin: 6px 0 12px 22px; }
.task-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px 30px; margin-bottom: 22px; }
.task-section > p:first-of-type { margin-bottom: 14px; }
.passage { background: rgba(255, 255, 255, .055); border: 1px solid var(--line-strong); border-inline-start: 3px solid var(--gold-line);
  border-radius: var(--radius); padding: 20px 24px; margin: 6px 0 22px; color: var(--ink); font-size: 1.02rem; line-height: 1.85; }
.passage p { color: var(--ink); margin-bottom: 12px; }
.passage p:last-child { margin-bottom: 0; }
.passage strong { color: var(--gold-soft); }
.question { padding: 16px 0; border-top: 1px dashed var(--line); }
.question:first-of-type { border-top: 0; }
.question-text { font-weight: 800; color: var(--ink) !important; margin-bottom: 10px; }
.options { display: grid; gap: 8px; }
.options label { display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; border-radius: 13px; cursor: pointer; color: var(--ink);
  background: rgba(8, 3, 22, .35); border: 1px solid var(--line); transition: border-color .15s, background .15s; line-height: 1.5; }
.options label:hover { border-color: var(--gold-line); background: rgba(255, 215, 0, .05); }
.options label:has(input:checked) { border-color: var(--gold); background: var(--gold-wash); box-shadow: 0 0 0 3px rgba(255, 215, 0, .08); }
.options input[type="radio"], .options input[type="checkbox"] { accent-color: var(--gold); width: 18px; height: 18px; margin-top: 2px; flex: none; }
.options label:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.options img { order: -1; display: block; max-width: 300px; width: 100%; height: auto; margin: 0 0 6px; padding: 10px; border-radius: 14px; background: #fff; }
.gap-fill-input { width: 100%; max-width: 360px; height: 46px; padding: 0 14px; border-radius: 12px; background: rgba(8, 3, 22, .55);
  border: 1px solid var(--line-strong); color: var(--ink); font-size: 1rem; }
.gap-fill-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255, 215, 0, .12); }
.navigation-buttons { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.t-end { text-align: center; color: var(--ink-2); font-weight: 700; margin: 8px 0 18px; }
.t-submit { display: flex; justify-content: center; margin: 10px 0 0; }

/* EMT pages */
.page { display: none; }
.page.active { display: block; }

/* ------------------------------------------------------------ results */
.r-card { padding: 34px 36px; }
.r-head { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.r-level { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 30% 25%, rgba(255, 230, 128, .25), rgba(255, 215, 0, .06) 60%), rgba(13, 4, 31, .6);
  border: 2px solid var(--gold-line); box-shadow: 0 0 40px rgba(255, 215, 0, .12) inset, 0 16px 40px rgba(0, 0, 0, .35); }
.r-level b { display: block; font-family: var(--font-head); font-weight: 400; font-size: 2.7rem; color: var(--gold); line-height: 1; }
.r-level span { display: block; margin-top: 6px; color: var(--ink-2); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.r-head h2 { font-family: var(--font-head); font-weight: 400; font-size: clamp(1.7rem, 3.4vw, 2.2rem); line-height: 1.2; margin: 8px 0 8px; }
.r-head p { color: var(--ink-2); }
.r-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 28px 0 8px; }
.r-stat { padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.r-stat small { display: block; color: var(--ink-3); font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.r-stat b { font-size: 1.22rem; color: var(--ink); font-weight: 800; }
.r-section { margin-top: 30px; }
.r-section h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 14px; }
.r-bars { display: grid; gap: 12px; }
.r-bar { display: grid; grid-template-columns: 190px 1fr 64px; gap: 14px; align-items: center; font-size: .92rem; }
.r-bar .name { color: var(--ink-2); font-weight: 700; }
.r-bar .track { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.r-bar .fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.r-bar .val { text-align: end; font-weight: 800; font-variant-numeric: tabular-nums; }
.r-review { display: grid; gap: 14px; }
.r-group b { display: block; color: var(--ink-2); font-size: .84rem; margin-bottom: 8px; }
.r-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.r-chip { min-width: 38px; height: 34px; padding: 0 10px; border-radius: 10px; display: inline-grid; place-items: center; font-size: .84rem; font-weight: 800; border: 1px solid; }
.r-chip.ok { color: #cdf7de; background: rgba(94, 227, 154, .12); border-color: rgba(94, 227, 154, .4); }
.r-chip.bad { color: #ffd3d8; background: rgba(255, 138, 149, .1); border-color: rgba(255, 138, 149, .38); }
.r-chip.blank { color: var(--ink-3); background: transparent; border-color: var(--line-strong); border-style: dashed; }
.r-chip.part { color: var(--gold-soft); background: var(--gold-wash); border-color: var(--gold-line); }
.r-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; color: var(--ink-3); font-size: .82rem; }
.r-legend span { display: inline-flex; align-items: center; gap: 6px; }
.r-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1px solid; }
.r-next { margin-top: 30px; padding: 22px 24px; border-radius: var(--radius); background: var(--gold-wash); border: 1px solid var(--gold-line); }
.r-next h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 6px; }
.r-next p { color: var(--ink-2); margin-bottom: 14px; }
.r-next .row { display: flex; flex-wrap: wrap; gap: 10px; }
.r-note { margin-top: 22px; color: var(--ink-3); font-size: .84rem; line-height: 1.6; }
.r-cert { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.r-cert h3 { font-size: 1.05rem; font-weight: 800; }
.r-cert .row { display: flex; gap: 10px; flex-wrap: wrap; }
.r-cert .input { max-width: 360px; }
.r-cert .err { color: var(--bad); font-size: .86rem; }
.r-actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.r-raw { display: none; }

/* ------------------------------------------------------------ certificate (print only) */
#certificate-container { display: none; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html, body { background: #fff !important; }
  body > *:not(#certificate-container) { display: none !important; }
  #certificate-container { display: block !important; color: #1a1630; font-family: 'Nunito', sans-serif; }
  .cert { border: 3px solid #c9a300; outline: 10px solid #0d041f; outline-offset: -16px; padding: 18mm 20mm; min-height: 170mm; text-align: center; display: flex; flex-direction: column; justify-content: center; }
  .cert-logo { font-family: 'Fredoka One', sans-serif; font-size: 34pt; color: #b38f00; }
  .cert-title { font-size: 24pt; font-weight: 800; color: #0d041f; margin: 6mm 0 8mm; letter-spacing: .02em; }
  .cert-awarded { font-size: 13pt; }
  .cert-name { font-family: 'Fredoka One', sans-serif; font-size: 26pt; color: #0d041f; margin: 4mm 0; border-bottom: 1px solid #c9a300; display: inline-block; padding: 0 8mm 2mm; }
  .cert-grid { display: flex; justify-content: center; gap: 12mm; margin: 8mm 0; }
  .cert-grid div { font-size: 12pt; }
  .cert-grid b { display: block; font-size: 18pt; color: #0d041f; }
  .cert-foot { margin-top: 8mm; font-size: 9.5pt; color: #4a4560; line-height: 1.6; }
}

/* ------------------------------------------------------------ small screens */
@media (max-width: 760px) {
  .t-main { padding-top: 24px; }
  .t-intro, .r-card { padding: 26px 20px; }
  .t-facts { gap: 8px; }
  .t-fact { min-width: 0; flex: 1; padding: 12px 8px; }
  .t-fact b { font-size: 1.45rem; }
  .task-section { padding: 22px 18px; }
  .passage { padding: 16px 16px; font-size: 1rem; }
  .t-bar { top: 62px; gap: 10px; padding: 8px 10px 8px 14px; }
  .t-bar .lbl { display: none; }
  .t-time { font-size: 1.2rem; min-width: 64px; }
  .r-head { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .r-level { width: 124px; height: 124px; }
  .r-bar { grid-template-columns: 1fr 56px; }
  .r-bar .name { grid-column: 1 / -1; }
}
