/* RUFIT online administration: registration, payment, the timed one-item screen, the result. Uses the site tokens. */
.rf-hidden { display: none !important; }
.rf-card { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 26px; box-shadow: var(--shadow); }
.rf-card h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 10px; }
.rf-card h3 { margin: 18px 0 8px; }
.rf-note { color: var(--ink-3); font-size: .92rem; }
.rf-error { color: var(--rust); font-weight: 700; min-height: 1.3em; margin: 10px 0 0; }
.rf-status { color: var(--ink-2); min-height: 1.3em; margin: 8px 0 0; font-size: .95rem; }
.rf-summary { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rf-summary li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rf-summary li span { color: var(--ink-3); }
.rf-paybox { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px; align-items: start; }
@media (max-width: 820px) { .rf-paybox { grid-template-columns: 1fr; } }
.rf-code summary, .rf-recover summary { cursor: pointer; font-weight: 700; color: var(--indigo); margin-top: 16px; }
.rf-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.rf-inline input { flex: 1 1 200px; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--wall); color: var(--ink); font: 400 1rem var(--font-body); }
.rf-rules { margin: 10px 0 18px; padding-left: 1.2em; }
.rf-rules li { margin-bottom: 7px; }
.rf-rules li::marker { color: var(--rust); }

/* the test screen: the site steps back while a test runs */
body.rf-testing .topbar, body.rf-testing .site-footer, body.rf-testing .crumbs, body.rf-testing .rf-outside { display: none !important; }
body.rf-testing #rf-start { padding-block: 10px 18px; background: var(--wall); }
.rf-test { display: grid; grid-template-columns: minmax(0, 1fr) 250px; grid-template-areas: "top top" "stage side"; gap: 12px 22px; align-items: start; }
@media (max-width: 860px) { .rf-test { grid-template-columns: 1fr; grid-template-areas: "top" "stage" "side"; } }
.rf-top { grid-area: top; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 14px; align-items: center; }
.rf-count { font: 600 .82rem/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.rf-limit { font-size: .85rem; color: var(--ink-3); white-space: nowrap; }
.rf-progress { grid-column: 1 / -1; height: 3px; background: var(--wall-2); border-radius: 2px; overflow: hidden; position: relative; }
.rf-progress i { position: absolute; inset: 0; background: var(--ink-3); transform-origin: left; transform: scaleX(0); }
.rf-timerbox { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.rf-timer { flex: 1; position: relative; height: 12px; background: var(--wall-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.rf-timer i { position: absolute; inset: 0; background: var(--indigo); transform-origin: left; }
.rf-timer.low i { background: var(--rust); }
.rf-secs { font: 600 1.15rem/1 var(--font-mono); font-variant-numeric: tabular-nums; min-width: 4.2ch; text-align: right; color: var(--ink); }
.rf-timer.low + .rf-secs { color: var(--rust); }
.rf-stage { grid-area: stage; position: relative; background: #FFFFFF; border: 1px solid var(--line); border-radius: 4px; padding: 6px;
  display: flex; justify-content: center; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; min-height: 200px; }
.rf-stage canvas { display: block; max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); width: auto; height: auto; }
@media (max-width: 860px) { .rf-stage canvas { max-height: none; width: 100%; } }
.rf-stage.loading::after { content: "Loading the next question…"; position: absolute; inset: 0; display: grid; place-items: center;
  background: rgb(255 255 255 / .85); color: #4C5465; font-weight: 700; }
.rf-side { grid-area: side; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 10px; }
.rf-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 860px) { .rf-opts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rf-opt, .rf-sopt { min-height: 52px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  font: 700 1.35rem/1 var(--font-body); cursor: pointer; }
.rf-opt:hover, .rf-sopt:hover { border-color: var(--ink-3); }
.rf-opt[aria-pressed="true"], .rf-sopt[aria-pressed="true"] { background: var(--indigo); color: var(--on-indigo); border-color: var(--indigo); }
.rf-sopt.right { background: #2E7D4F; color: #fff; border-color: #2E7D4F; }
.rf-sopt.wrong { background: var(--rust); color: #fff; border-color: var(--rust); }
.rf-opt:disabled, .rf-sopt:disabled { cursor: default; }
.rf-side .btn { width: 100%; }
.rf-side .rf-skip { background: none; border: 0; color: var(--ink-3); text-decoration: underline; cursor: pointer; font: 400 .92rem var(--font-body); padding: 6px; }
.rf-keys { font-size: .82rem; color: var(--ink-3); margin: 0; }
#rf-warn { position: fixed; left: 50%; top: 12px; transform: translate(-50%, -150%); z-index: 90; background: var(--rust); color: #fff;
  padding: 10px 16px; border-radius: 8px; font-weight: 700; max-width: min(92vw, 640px); box-shadow: var(--shadow); transition: transform .25s ease; }
#rf-warn { visibility: hidden; }
#rf-warn.on { transform: translate(-50%, 0); visibility: visible; }
#rf-net { position: fixed; left: 50%; bottom: 14px; transform: translate(-50%, 160%); z-index: 90; background: var(--ink); color: var(--wall);
  padding: 9px 16px; border-radius: 999px; font-weight: 700; transition: transform .25s ease; max-width: 92vw; text-align: center; }
#rf-net { visibility: hidden; }
#rf-net.on { transform: translate(-50%, 0); visibility: visible; }
@media (prefers-reduced-motion: reduce) { #rf-warn, #rf-net { transition: none; } }
@media print { #rf-start, .rf-stage { display: none !important; } }

/* result */
.rf-score { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; }
@media (max-width: 760px) { .rf-score { grid-template-columns: 1fr; } }
.rf-big { font-family: var(--font-display); font-weight: 600; font-size: clamp(3rem, 8vw, 5rem); line-height: 1; color: var(--indigo); margin: 4px 0 6px; }
/* the sample question uses the test screen's figure and side panel, so it names the same grid areas */
.rf-sample-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 250px; grid-template-areas: "stage side"; gap: 18px 22px; align-items: start; }
@media (max-width: 860px) { .rf-sample-wrap { grid-template-columns: 1fr; grid-template-areas: "stage" "side"; } }
/* phones: slimmer cards, so the figure gets the width */
@media (max-width: 480px) { .rf-card { padding: 18px 14px; } #rf-s-sample .rf-stage { padding: 2px; } }
.rf-sample-wrap img { width: 100%; max-width: 520px; margin: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.norm-table tr.ex td { font-style: italic; color: var(--ink-3); }
.norm-table td, .norm-table th { padding-top: 6px; padding-bottom: 6px; }
