/*
 * Phase 6 — the assessment engine's four pages (catalogue, detail, taking, result).
 *
 * First transcribed from wireframes/tests.html, test-detail.html, test-taking.html and
 * test-result.html; on the v3 kit since 2026-09-11; on the spacing standard since 2026-09-29
 * (docs/design-system.md): every margin, padding and gap is a role token or a --space-N step, every
 * text style is a ladder rung. What is still a literal is one of the standard's rule-5 exemptions
 * and says so where it stands: 1–2px borders, icon-tile / avatar / ring sizes, control heights,
 * column measures (the 264px filter rail and the 340px start panel are design decisions), radii,
 * and the negative offsets that centre the progress stem's parts on its line.
 *
 * Icons are sized from the ladder's own sizes (`--text-*-size`), as tickets.css does.
 * Every directional property is logical: this site has no LTR variant to fall back on.
 */

/* ---------------------------------------------------------------- the trust lines (all four pages)
 * What a parent wants settled before, during and after answering questions about their child —
 * privacy, how long answers are kept, and that a result is not a diagnosis. Each line restates
 * something the code enforces (the templates say which). No box of its own. The icon is a Font
 * Awesome glyph (owner, 2026-09-29 — it was a small brand illustration) in the secondary green at
 * 600, which keeps 3:1 against every ground it lands on. */
.test-trust { display: grid; gap: var(--space-1); margin: var(--space-head) 0 0; padding: 0; list-style: none; }
.test-trust li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--gap-inline); align-items: start; color: var(--iz-ink-soft); font: var(--text-caption); text-wrap: pretty; }
/* The nudge sets a 16px glyph on the first line's x-height (13px × 1.7 leading). */
.test-trust i { margin-block-start: var(--space-0); color: var(--secondary-600); font-size: var(--text-body-size); }
.test-trust b { color: var(--iz-ink); font-weight: 600; }

/* ---------------------------------------------------------------- the two panels' switch
 * The kit's segmented tabs. tests-catalog.js toggles `aria-pressed`, which the kit's selected rule
 * does not read, so the pill is restated for it here, focus ring included. Page head → first block
 * above it, heading → content below it. */
.test-switchbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-block) var(--space-head); }
.test-switch [aria-pressed="true"] { color: var(--iz-ink); background: #fff; box-shadow: var(--iz-shadow-1); }
.test-switch [aria-pressed="true"]:focus-visible { box-shadow: var(--iz-focus); }
.test-switch [aria-pressed="false"] .iz-count { background: #fff; color: var(--iz-ink-soft); }

/* ---------------------------------------------------------------- catalog: filters + toolbar */

.test-catalog { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: var(--space-block); padding-block-end: var(--space-section); }
/* No rail (archive-iz_test.php renders it only once the list is long enough to narrow): one column. */
.test-catalog--plain { grid-template-columns: minmax(0, 1fr); }
.test-filters { position: sticky; top: var(--space-4); align-self: start; padding: var(--pad-card); border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); }
.test-filters__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-block-end: var(--space-stack); }
.test-filters__head h2 { margin: 0; color: var(--color-heading); font: var(--text-h4); }
.test-filters__head a { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-text); font: var(--text-micro); }
.test-filters__head a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--color-focus-ring); border-radius: 4px; }
/* A <legend> sits inside its fieldset's top border and cuts it; floated, it is ordinary content
 * under the border and the line runs full width. Rows are 44px: in the phone sheet every one of
 * them is a touch target. */
.test-filter__group { margin: 0; padding: var(--space-2) 0 var(--space-0); border: 0; border-block-start: 1px solid var(--color-border); }
.test-filter__group legend { float: inline-start; width: 100%; margin: 0 0 var(--gap-title); padding: 0; color: var(--color-heading); font: 600 var(--text-caption-size)/var(--text-caption-lh) var(--font-body); }
.test-filter__group label { clear: both; display: flex; align-items: center; gap: var(--gap-inline); min-height: 44px; color: var(--color-text); font: var(--text-caption); cursor: pointer; }
.test-filter__group input { width: 18px; height: 18px; margin: 0; accent-color: var(--secondary-600); }
.test-filters .iz-btn { width: 100%; min-height: 44px; margin-block-start: var(--space-head); }

/* ---------------------------------------------------------------- catalog: cards + attempts */

.test-list { display: grid; gap: var(--gap-grid); }
/* The catalogue card: one row — mark, copy, action. The whole card is one link (the title carries
 * `.iz-stretch`), so it presses as one surface — `scale`, not `transform`, because the hover lift
 * already owns `transform` and the two must compose. Wider than 320px, so the large press depth.
 * The mark (owner, 2026-09-29: Font Awesome instead of the brand drawing) is a 64px grey tile
 * holding one glyph; a test with its own image keeps the 148px picture, because that is content. */
.test-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) 176px; gap: var(--gap-grid); align-items: center; padding: var(--pad-card); border: 1px solid var(--iz-line-soft); border-radius: var(--iz-r-lg); background: #fff; box-shadow: var(--shadow-card); transition: transform .24s var(--iz-ease-out), scale .16s var(--iz-ease-out), box-shadow .24s var(--iz-ease), border-color .2s var(--iz-ease); }
.test-card:has(.iz-stretch:active) { scale: var(--iz-press-lg); }
.test-card:has(.iz-stretch:focus-visible) { box-shadow: var(--iz-focus); }
.test-card__mark { display: grid; place-items: center; align-self: start; width: 64px; height: 64px; overflow: hidden; border-radius: var(--radius-card); background: var(--iz-sunk); color: var(--secondary-600); font-size: var(--text-number-l-size); }
.test-card__mark:has(img) { align-self: stretch; width: 148px; height: auto; min-height: 132px; }
.test-card__mark img { width: 100%; height: 100%; min-height: 132px; object-fit: cover; }
.test-card__body { display: grid; gap: var(--gap-title); min-width: 0; }
/* The start button and the «more» cue sit above the stretched link's overlay. */
.test-card__footer > * { position: relative; z-index: 2; }
.test-card__footer .iz-btn { width: 100%; min-height: 44px; }
.test-card__more { min-height: 0; }
.test-card--closed .test-card__mark { filter: grayscale(.6); opacity: .8; }
.test-card__category { margin: 0; color: var(--primary-600); font: 600 var(--text-caption-size)/var(--text-caption-lh) var(--font-body); }
.test-card h3 { margin: 0; color: var(--iz-ink); font: var(--text-h4); text-wrap: balance; }
.test-card h3 a { color: inherit; text-decoration: none; transition: color .16s var(--iz-ease); }
/* The ring is drawn on the card (see `:has(.iz-stretch:focus-visible)` above), not on the title. */
.test-card h3 a:focus-visible { outline: none; }
.test-card__body > p:not(.test-card__category) { max-width: 74ch; margin: 0; color: var(--iz-text); font: var(--text-body-s); }
/* The card's facts are the same grey chips as the detail page's head (one list, one look). They
 * are a new line of the card, so they stand a stack step under the sentence, not a title step. */
.test-card__meta { display: flex; flex-wrap: wrap; gap: var(--gap-inline); margin: var(--space-1) 0 0; padding: 0; list-style: none; }
.test-card__meta li { display: inline-flex; align-items: center; gap: var(--space-0); min-height: 28px; padding: var(--pad-chip-y) var(--pad-chip-x); border-radius: var(--radius-pill); background: var(--iz-sunk); color: var(--iz-text); font: 500 var(--text-caption-size)/1 var(--font-body); }
.test-card__meta i { color: var(--primary-500); font-size: var(--text-body-s-size); }
/* The divider stands between the copy and the action — the footer's inline START in this RTL row. */
.test-card__footer { display: flex; flex-direction: column; align-self: stretch; justify-content: center; gap: var(--space-1); padding-inline-start: var(--gap-grid); border-inline-start: 1px solid var(--iz-line-soft); }
.test-card__hint { color: var(--iz-ink-soft); font: 500 var(--text-caption-size)/var(--text-caption-lh) var(--font-body); text-align: center; }
.test-card__closed { display: inline-flex; align-items: center; gap: var(--gap-inline); color: var(--tone-attention-fg); font: 600 var(--text-caption-size)/var(--text-caption-lh) var(--font-body); }
@media (hover: hover) and (pointer: fine) {
	.test-card:hover { transform: translateY(-3px); border-color: var(--primary-100); box-shadow: var(--iz-shadow-2); }
	.test-card:hover h3 a { color: var(--primary-700); }
	.test-card:hover .test-card__more .fa-arrow-left { transform: translateX(-4px); }
}

.test-attempts { border-block-start: 1px solid var(--color-border); }
.test-attempt { display: grid; grid-template-columns: 150px minmax(0, 1fr) 170px; gap: var(--gap-grid); align-items: center; min-height: 104px; padding: var(--pad-row) 0; border-block-end: 1px solid var(--color-border); }
.test-attempt__status { display: grid; gap: var(--space-1); padding-inline-end: var(--gap-grid); border-inline-end: 1px solid var(--color-border); }
.test-attempt__status time { color: var(--iz-ink-soft); font: var(--text-micro); }
/* The status is the kit's pill (template-parts/kit/status.php, module `test`). */
.test-attempt__status .iz-status { justify-self: start; }
.test-attempt__main { display: grid; gap: var(--gap-title); min-width: 0; }
.test-attempt__main h3 { margin: 0; color: var(--color-heading); font: var(--text-h4); }
.test-attempt__main p { margin: 0; color: var(--color-text); font: var(--text-body-s); }
.test-attempt__action { display: grid; justify-items: start; }
.test-attempt__action .iz-btn { min-height: 44px; }

/* ---------------------------------------------------------------- the two dialogs */

.test-filter-dialog { width: min(460px, calc(100% - 32px)); padding: 0; border: 0; border-radius: var(--radius-card); background: var(--color-surface); color: var(--color-heading); box-shadow: 0 20px 48px rgb(from var(--primary-700) r g b / .18); }
.test-filter-dialog::backdrop { background: rgb(from var(--neutral-dark) r g b / .28); }
.test-filter-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--pad-card); border-block-end: 1px solid var(--color-border); }
.test-filter-dialog__head h2 { margin: 0; font: var(--text-h4); }
.test-filter-dialog__body { padding: 0 var(--pad-card); }
.test-filter-dialog__foot { display: flex; gap: var(--gap-inline); padding: var(--space-3) var(--pad-card) var(--pad-card); border-block-start: 1px solid var(--color-border); }
.test-filter-dialog__foot > * { flex: 1; min-height: 44px; }

.test-auth { width: min(520px, calc(100% - 32px)); padding: 0; border: 0; border-radius: var(--radius-card); background: var(--color-surface); color: var(--color-heading); box-shadow: 0 20px 48px rgb(from var(--primary-700) r g b / .18); }
.test-auth::backdrop { background: rgb(from var(--neutral-dark) r g b / .35); }
.test-auth__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--pad-card); border-block-end: 1px solid var(--color-border); }
.test-auth__head h2 { margin: 0; font: var(--text-h3); }
.test-auth__body { padding: var(--pad-card); }
.test-auth__body > p { margin: 0 0 var(--space-head); color: var(--color-text); font: var(--text-body-s); }
.test-auth__two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
/* H1: the name fields show only once otp/request answers will_register — the rule above sets
   display: grid unconditionally, which would otherwise beat the [hidden] attribute. */
.test-auth__two[hidden] { display: none; }
/* The states are re-shown by script as plain blocks, so the field keeps its own bottom space
 * rather than a parent gap; it is the form's field step. */
.test-field { display: grid; gap: var(--gap-field); margin-block-end: var(--gap-form); }
.test-field label { color: var(--color-heading); font: 600 var(--text-caption-size)/var(--text-caption-lh) var(--font-body); }
.test-field input { min-height: 48px; padding: 0 var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-input); background: var(--color-surface); color: var(--color-heading); font: inherit; }
.test-field input:focus-visible { outline: none; border-color: var(--primary-400); box-shadow: 0 0 0 3px var(--color-focus-ring); }
.test-field small { color: var(--color-text); font: var(--text-micro); }
/* The two modals stay centred and settle in from .96 with a fade (never from nothing); the exit is
 * quicker than the entrance. @starting-style gives the entrance without script, and allow-discrete
 * lets `display`/`overlay` wait for the exit. Reduced motion collapses it through tokens.css. */
.test-filter-dialog, .test-auth { opacity: 0; scale: .97; transition: opacity .18s var(--iz-ease-out), scale .18s var(--iz-ease-out), overlay .18s allow-discrete, display .18s allow-discrete; }
.test-filter-dialog[open], .test-auth[open] { opacity: 1; scale: 1; transition-duration: .26s; }
@starting-style { .test-filter-dialog[open], .test-auth[open] { opacity: 0; scale: .96; } }
.test-filter-dialog::backdrop, .test-auth::backdrop { opacity: 0; transition: opacity .18s var(--iz-ease-out), overlay .18s allow-discrete, display .18s allow-discrete; }
.test-filter-dialog[open]::backdrop, .test-auth[open]::backdrop { opacity: 1; transition-duration: .26s; }
@starting-style { .test-filter-dialog[open]::backdrop, .test-auth[open]::backdrop { opacity: 0; } }

.test-auth__state { display: none; }
.test-auth__state.is-active { display: block; }
.test-auth__sent { margin: 0 0 var(--space-head); padding: var(--space-2) var(--space-3); border-radius: var(--radius-input); background: var(--iz-sunk); color: var(--color-text); font: var(--text-caption); }
/* H1 added a resend link and its countdown to this row; without wrap the four items clip on a phone. */
.test-auth__inline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.test-auth__inline [data-resend-countdown] { margin: 0; color: var(--color-text); font: var(--text-micro); }

/* ---------------------------------------------------------------- catalog: responsive */

@media (max-width: 920px) {
	.test-catalog:not(.test-catalog--plain) { grid-template-columns: 216px minmax(0, 1fr); }
	.test-card { grid-template-columns: auto minmax(0, 1fr); }
	.test-card__mark:has(img) { width: 120px; }
	.test-card__footer { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: var(--space-1) var(--space-3); padding: var(--space-3) 0 0; border-block-start: 1px solid var(--iz-line-soft); border-inline-start: 0; }
	.test-card__footer .iz-btn { width: auto; }
	.test-card__hint { text-align: start; }
}

/* The catalogue's own desktop rail hands over to the «فیلترها» sheet at the same width kit.css
 * folds `.iz-toolbar`'s selects away — 720px. */
@media (max-width: 720px) {
	.test-catalog { display: block; }
	.test-filters { display: none; }
}

@media (max-width: 680px) {
	.test-card { grid-template-columns: minmax(0, 1fr); gap: var(--space-stack); }
	.test-card__footer { grid-column: auto; justify-content: space-between; }
	/* On a phone the glyph tile steps aside (one thing fewer above every title); a test's real
	 * image stays, as a short banner. */
	.test-card__mark:not(:has(img)) { display: none; }
	.test-card__mark:has(img) { width: auto; aspect-ratio: 16 / 7; min-height: 0; }
	.test-card__mark img { min-height: 0; }
	.test-attempt { grid-template-columns: minmax(0, 1fr); gap: var(--space-stack); }
	.test-attempt__status { padding-inline-end: 0; border-inline-end: 0; grid-auto-flow: column; justify-content: start; align-items: center; gap: var(--space-2); }
	.test-auth__two { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* ---------------------------------------------------------------- taking
 * page-test-taking.php draws its own document and never loads the site chrome, so the page's own
 * ground and gutter are set here: the slight grey the owner asked for (2026-09-19), filling the
 * viewport so a short page is not a grey card on a white floor. One column, 760px, whose blocks
 * are spaced by the column's own gap: heading → content between the head rows and the card. */
.test-taking-body { background: var(--iz-sunk); }
.test-take-ground { min-height: 100vh; min-height: 100dvh; background: var(--iz-sunk); }
.test-take { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-head); max-width: 760px; margin-inline: auto; }
.test-taking-body .test-take { padding: var(--space-block) var(--space-3) calc(var(--space-6) + env(safe-area-inset-bottom)); }
.test-take__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-0) var(--space-3); }
.test-take__top h1 { margin: 0; color: var(--iz-ink); font: var(--text-h3); }
.test-take__exit { flex: none; font-size: var(--text-caption-size); }
.test-take__facts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-0) var(--space-3); color: var(--iz-ink-soft); font: 500 var(--text-caption-size)/var(--text-caption-lh) var(--font-body); }
.test-take__facts b { color: var(--iz-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.test-take__facts > span { display: inline-flex; align-items: center; gap: var(--space-0); }
.test-take__facts i { color: var(--primary-500); font-size: var(--text-body-s-size); }

/* The stem. It belongs to the count above it, so it is pulled back up to a title step under that
 * line. The negative margins below are geometry, not rhythm: they centre a 6px line and a 30px
 * sprout on the stem's middle. The sprout rides the fill's tip: test-taking.js owns the fill (it
 * reaches it as `[data-progress] i`) and sets its width directly. */
.test-grow { position: relative; height: 34px; margin-block-start: calc(var(--gap-title) - var(--space-head)); }
.test-grow__track { position: absolute; inset-inline: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: var(--radius-pill); background: var(--iz-line-soft); }
.test-grow__fill { position: absolute; inset-inline-start: 0; top: 50%; height: 6px; margin-top: -3px; width: var(--p, 0%); border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--secondary-300), var(--secondary-600)); transition: width .6s var(--iz-ease-out); }
.test-grow__sprout { position: absolute; top: 50%; inset-inline-start: var(--p, 0%); width: 30px; height: 30px; margin-top: -24px; margin-inline-start: -15px; color: var(--secondary-600); transition: inset-inline-start .6s var(--iz-ease-out); }
.test-grow__sprout svg { width: 100%; height: 100%; }
.test-grow__fill > .test-grow__sprout { inset-inline-start: 100%; }

.test-q { padding: var(--pad-card); border: 1px solid var(--iz-line-soft); border-radius: var(--iz-r-lg); background: #fff; box-shadow: var(--iz-shadow-3); }
.test-q h2 { margin: var(--space-stack) 0 var(--space-head); color: var(--iz-ink); font: var(--text-h3); text-wrap: pretty; }
/* The question block is rebuilt by assets/js/test-taking.js after every navigation, and that script
 * writes the pre-v3 class names; they are aliased onto the v3 rules, and the template carries both. */
.test-q__options, .test-taking__options { display: grid; gap: var(--gap-list); margin: 0; padding: 0; border: 0; }
/* Grey, as the homepage sample card's tag is (2026-09-26): an inner label, not a tint. */
.test-q__n, .test-taking__section { display: inline-flex; margin: 0; padding: var(--pad-chip-y) var(--pad-chip-x); border-radius: var(--radius-pill); background: var(--iz-sunk); color: var(--iz-text); font: 600 var(--text-caption-size)/1 var(--font-body); }
.test-taking__help { margin: 0 0 var(--space-head); color: var(--iz-text); font: var(--text-body-s); }
/* The help line is the sentence directly under the question: a title step, not a heading step. */
.test-q h2 + .test-taking__help { margin-block-start: calc(var(--gap-title) - var(--space-head)); }
/* Back at the row's start, forward at its end. The kit's small button is 40px; this is the one
 * control a respondent presses a dozen times in a row, often on a phone, so it gets the 44px floor. */
.test-q__nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--gap-inline); margin-block-start: var(--space-4); padding-block-start: var(--space-3); border-block-start: 1px solid var(--iz-line-soft); }
.test-q__nav .iz-btn { min-height: 44px; }
.test-q__nav [data-next] { margin-inline-start: auto; }
/* The next question fades up 6px in 200ms. test-taking.js replaces the contents of [data-question]
 * outright, so the new <h2> and options are newly inserted elements and @starting-style is the
 * whole mechanism. It runs on every «next» — a dozen times in a row — so it registers, not performs. */
@media (prefers-reduced-motion: no-preference) {
	@starting-style {
		.test-q h2, .test-q__options, .test-taking__options { opacity: 0; translate: 0 6px; }
	}
	.test-q h2, .test-q__options, .test-taking__options { transition: opacity .2s var(--iz-ease-out), translate .2s var(--iz-ease-out); }
}

/* Option cards are the kit's .iz-option. All this sheet adds is the Persian number key: a counter,
 * because a real element written here would vanish the first time the script repaints. */
.test-option { counter-increment: iz-answer; font: var(--text-body-s); cursor: pointer; }
.test-option .iz-option__key::after { content: counter(iz-answer, persian); }

/* Disabled twice over: «پرسش قبلی» on the first question, and all three while a save is in flight.
 * #58707a on --iz-sunk is 4.68:1. */
.test-take .iz-btn:disabled { border-color: var(--iz-line); background: var(--iz-sunk); color: var(--iz-ink-soft); cursor: not-allowed; }
.test-take .iz-btn:disabled:active { transform: none; }

/* The script's one error surface, on both the card and the dialog. No `display` declared on
 * purpose: it is shown and hidden through the `hidden` attribute. */
.test-taking__error { margin: var(--space-head) 0 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-input); background: var(--tone-attention-bg); color: var(--tone-attention-fg); font: 500 var(--text-body-s-size)/var(--text-body-s-lh) var(--font-body); }
.test-take > noscript .test-taking__error { margin: 0; }

/* Below the card, on the ground: the two counts the script keeps up to date and «پایان آزمون»,
 * then the trust lines. No second white box — the card is the only surface on this page. */
.test-take__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); padding-inline: var(--space-0); }
.test-take__counts { margin: 0; color: var(--iz-ink-soft); font: 500 var(--text-body-s-size)/var(--text-body-s-lh) var(--font-body); }
.test-take__counts b { color: var(--iz-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.test-take__finish { min-height: 44px; }
.test-take__trust { margin: 0; padding: var(--space-head) var(--space-0) 0; border-block-start: 1px solid rgb(from var(--iz-line) r g b / .7); }
@media (max-width: 560px) {
	.test-q__nav .iz-btn { flex: 1 1 0; justify-content: center; padding-inline: var(--space-2); }
	/* Once every question is answered «next» is hidden; the step back stays its own size. */
	.test-q__nav:has([data-next][hidden]) [data-prev] { flex: 0 1 auto; padding-inline: var(--space-3); }
	.test-take__finish { flex: 1 1 100%; }
}

/* ---------------------------------------------------------------- result
 * The page opens with the kit's own light page head (`.test-res__head`). `public-wrap` is 1200px,
 * which puts an interpretation sentence on one very long line, so the reading keeps an 880px
 * measure. The stack's gap is the block step: this page is read, not scanned, and its four blocks
 * (head, scores, the care note, the next step) are separate thoughts. The crumb row runs at the
 * header's width like every other page and sits a heading step above the head. */
.test-res { gap: var(--space-block); padding-block-end: var(--space-section); }
.test-res > :not(.iz-crumbs) { width: min(880px, 100%); justify-self: center; }
.test-res > .iz-crumbs { margin-block-end: calc(var(--space-head) - var(--space-block)); }

/* In the head: when and which version, then the reading it leads with. */
.test-res__meta { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); margin: var(--space-1) 0 0; color: var(--iz-ink-soft); font: 500 var(--text-caption-size)/var(--text-caption-lh) var(--font-body); }
/* The line the head leads with when there is no single number: the scale the test marked primary,
 * named, on a white slip so it reads as the reading and the date beside it as a fact about it. */
.test-res__lead { display: inline-flex; margin: var(--space-stack) 0 0; padding: var(--space-1) var(--space-3); border: 1px solid var(--iz-line-soft); border-radius: var(--radius-input); background: #fff; color: var(--iz-ink); font: 600 var(--text-body-s-size)/var(--text-body-s-lh) var(--font-body); }
.test-res__score { display: flex; align-items: center; gap: var(--space-3); margin-block-start: var(--space-head); }
.test-res__score p { display: grid; margin: 0; }
.test-res__score span { color: var(--iz-ink-soft); font: 500 var(--text-caption-size)/var(--text-caption-lh) var(--font-body); }
.test-res__score b { color: var(--iz-ink); font: var(--text-number-s); }
/* Below 640px the kit gives the head's drawing a row of its own above the title; on this page the
 * reading is the point, so the decoration steps aside and the result starts ~96px higher. */
@media (max-width: 640px) { .test-res__head .iz-pagehead__art { display: none; } }

/* The ring: a line-soft track, a secondary arc, ink numerals. Only ever rendered for a
 * single-scale test — see the template's docblock. */
.test-ring { position: relative; flex: none; width: 96px; height: 96px; }
.test-ring svg { width: 100%; height: 100%; rotate: -90deg; }
.test-ring circle { fill: none; stroke-width: 3; }
.test-ring .bg { stroke: var(--iz-line-soft); }
.test-ring .fg { stroke: var(--secondary-500); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--v, 0)); transition: stroke-dashoffset 1.2s var(--iz-ease-out); }
.test-ring b { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; color: var(--iz-ink); font: var(--text-number-l); font-variant-numeric: tabular-nums; }
.test-ring small { display: block; margin-block-start: var(--gap-title); color: var(--iz-ink-soft); font: 500 var(--text-micro-size)/1 var(--font-body); }

/* A scale: its name (and «شاخص اصلی» on the one the test marked), the score out of its ceiling,
 * what it measures, the meter, then the band word and the author's interpretation. The band is the
 * reading a parent came for, so it is the heaviest line inside the card after the name — stated,
 * never coloured: a band is information, not a grade. */
.test-metrics { display: grid; gap: var(--gap-list); }
.test-metric { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-stack) var(--space-3); align-items: center; padding: var(--pad-card); border: 1px solid var(--iz-line-soft); border-radius: var(--radius-card); background: #fff; }
.test-metric--primary { border-color: var(--primary-100); box-shadow: var(--iz-shadow-1); }
.test-metric h3 { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-0) var(--space-1); margin: 0; color: var(--iz-ink); font: var(--text-h4); }
.test-metric__tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--pad-chip-x); border-radius: var(--radius-pill); background: var(--iz-sunk); color: var(--iz-ink-soft); font: 600 var(--text-micro-size)/var(--text-micro-lh) var(--font-body); }
.test-metric > b { color: var(--iz-ink); font: var(--text-number-m); white-space: nowrap; }
.test-metric > b small { color: var(--iz-ink-soft); font: 500 var(--text-micro-size)/1 var(--font-body); }
.test-metric .iz-meter { grid-column: 1 / -1; }
.test-metric p { grid-column: 1 / -1; margin: 0; color: var(--iz-text); font: var(--text-body-s); }
/* Two classes deep so they outrank `.test-metric p` above without !important. The scope line is
 * the sentence directly under the name, so it is pulled from the card's stack step to a title step. */
.test-metric .test-metric__scope { margin-block-start: calc(var(--gap-title) - var(--space-stack)); color: var(--iz-ink-soft); font: var(--text-caption); }
.test-metric .test-metric__band { color: var(--iz-ink); font: 600 var(--text-subtitle-size)/var(--text-subtitle-lh) var(--font-body); }
.test-metric .test-metric__band + p { margin-block-start: calc(var(--gap-title) - var(--space-stack)); }

/* The care note: the interpretation limit and how long the answers behind it are kept, on the
 * kit's quiet-notice ground (--iz-sunk), holding the shared trust lines. */
.test-res__care { padding: var(--pad-card); border-radius: var(--radius-card); background: var(--iz-sunk); }
.test-res__care .test-trust { margin: 0; }
.test-res__care .test-trust li { color: var(--iz-text); }

/* The next step: a white card whose one colour is its button (owner, 2026-09-19). */
.test-next { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3) var(--space-4); align-items: center; padding: var(--pad-card); border: 1px solid var(--iz-line-soft); border-radius: var(--iz-r-lg); background: #fff; box-shadow: var(--iz-shadow-1); }
.test-next h2 { margin: 0; color: var(--iz-ink); font: var(--text-h3); }
.test-next p { margin: var(--gap-title) 0 0; color: var(--iz-text); font: var(--text-body-s); }
@media (max-width: 600px) {
	.test-next { grid-template-columns: minmax(0, 1fr); }
	.test-next .iz-btn { width: 100%; }
}

/* The quieter routes under «مسیر بعدی». The retake is a POST — it carries a nonce and opens an
 * attempt — so it stays a button in a form and borrows `.iz-link`, which already resets one. */
.test-res__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-4); }
.test-res__acts form { margin: 0; }

/* The kit's text link has no press of its own (chrome.css, not this sheet's to change); on these
 * four pages it gets the same short press every other control has. */
:is(.test-page, .test-take) .iz-link { transition: color .16s var(--iz-ease), transform .16s var(--iz-ease-out); }
:is(.test-page, .test-take) a.iz-link:active, :is(.test-page, .test-take) button.iz-link:not(:disabled):active { transform: scale(var(--iz-press)); }

/* The ring draws once, on arrival: `--v` is written into the markup and a keyframe draws the arc
 * up to it (nothing loads on this route to write it from script). A rare, explanatory entrance,
 * so it may run long. Behind the motion query: with reduced motion the arc is simply there. */
@media (prefers-reduced-motion: no-preference) {
	.test-ring .fg { animation: iz-ring-draw 1.2s var(--iz-ease-out); }
	@keyframes iz-ring-draw { from { stroke-dashoffset: 100; } }
}
/* The scale meters fill once on arrival the same way, from @starting-style into the kit meter's
 * own transition — a rare entrance, so no stagger. */
@starting-style { .test-metric .iz-meter > span { width: 0; } }

/* ---------------------------------------------------------------- detail (single-iz_test.php)
 * The head (owner, 2026-09-29: «proper spacing»). The copy and the drawing share one row whose
 * height is the copy's, not the drawing's: the drawing is capped, so the title starts a heading
 * step under the crumbs instead of floating in the middle of a 220px picture, and the body starts
 * a block step under the head. Inside the copy the order is title → sentence (kit) → the status
 * and facts, a heading step below, as one wrapped row of chips. */
.test-detail__hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-block); align-items: center; }
.test-detail__headmeta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-inline); margin-block-start: var(--space-head); }
.test-detail__chips { margin: 0; }
/* The drawing stands on the canvas, not in a tinted frame of its own. A test's own image keeps a
 * rounded crop. */
.test-detail__mark { position: relative; display: grid; place-items: center; width: 200px; height: 160px; margin: 0; overflow: hidden; border-radius: var(--iz-r-lg); }
.test-detail__mark:not(.test-detail__mark--art) { width: 300px; height: 200px; }
.test-detail__mark img { width: 100%; height: 100%; border-radius: var(--iz-r-lg); object-fit: cover; }
.test-detail__mark .art { width: 100%; height: 100%; }
.test-detail__mark > i.fa-solid { color: var(--primary-400); font-size: var(--text-display-size); }

.test-detail__layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-block); align-items: start; padding-block: var(--space-block) var(--space-section); }
.test-detail__layout:has(+ .test-related) { padding-block-end: 0; }
/* The panel is first in the markup — that is the order a phone reads it in — and placed beside the
 * content here, so the page needs only one of it. */
.test-detail__content { grid-area: 1 / 1; display: grid; gap: var(--space-block); min-width: 0; }
.test-detail__section { min-width: 0; }
.test-detail__section + .test-detail__section { padding-block-start: var(--space-block); border-block-start: 1px solid var(--iz-line-soft); }
.test-detail__section .iz-notice { margin-block-start: var(--space-head); }
.test-detail__prose { color: var(--iz-text); font: 400 15px / 2 var(--font-body); }
.test-detail__prose > :first-child { margin-block-start: 0; }
.test-detail__prose > :last-child { margin-block-end: 0; }

/* The start panel (owner, 2026-09-29: Font Awesome icons, «proper spacing»). One card, one
 * padding, one gap: heading and price (a title step apart), the action, the note under it, then
 * the trust lines and the history, each behind a hairline a stack step away on both sides. */
.test-start { display: grid; gap: var(--space-head); padding: var(--pad-card); border: 1px solid var(--iz-line-soft); border-radius: var(--iz-r-lg); background: #fff; }
.test-start__top { display: grid; gap: var(--gap-title); }
.test-start__top h2 { display: flex; align-items: center; gap: var(--gap-inline); margin: 0; color: var(--iz-ink); font: var(--text-h3); }
.test-start__top h2 i { color: var(--secondary-600); font-size: var(--text-body-size); }
.test-start__body { display: grid; gap: var(--space-stack); }
.test-start__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-0) var(--space-1); margin: 0; }
.test-start__price b { color: var(--secondary-700); font: var(--text-number-m); }
.test-start__price small { color: var(--iz-ink-soft); font: 500 var(--text-caption-size)/var(--text-caption-lh) var(--font-body); }
.test-start__progress { display: grid; gap: var(--space-1); padding: var(--space-2) var(--space-3); border-radius: var(--radius-input); background: var(--iz-sunk); }
.test-start__progress p { margin: 0; color: var(--iz-ink); font: 600 var(--text-caption-size)/var(--text-caption-lh) var(--font-body); font-variant-numeric: tabular-nums; }
.test-start__trust { margin: 0; padding-block-start: var(--space-stack); border-block-start: 1px solid var(--iz-line-soft); }
.test-start__form { margin: 0; }
.test-start__action { min-height: 48px; }
.test-start__note { margin: 0; color: var(--iz-ink-soft); font: var(--text-caption); }
.test-start__history { display: grid; justify-items: start; gap: var(--gap-title); padding-block-start: var(--space-stack); border-block-start: 1px solid var(--iz-line-soft); }
.test-start__history p { margin: 0; color: var(--iz-text); font: 500 var(--text-caption-size)/var(--text-caption-lh) var(--font-body); }

.test-fit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: var(--gap-grid); }
/* Both white, as on the course page's «for / not for» pair (2026-09-19): the icon carries the
 * difference, the ground does not. */
.test-fit { display: grid; align-content: start; gap: var(--space-stack); padding: var(--pad-card); border: 1px solid var(--iz-line-soft); border-radius: var(--iz-r-lg); background: #fff; }
.test-fit h3 { margin: 0; color: var(--iz-ink); font: var(--text-h4); }
.test-fit ul { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.test-fit li { display: flex; align-items: flex-start; gap: var(--gap-inline); color: var(--iz-text); font: var(--text-body-s); }
.test-fit i { margin-block-start: var(--space-0); color: var(--secondary-600); font-size: var(--text-body-size); }
.test-fit--avoid i { color: var(--accent-500); }

.test-structure { margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--iz-line-soft); border-radius: var(--iz-r-lg); background: #fff; list-style: none; }
.test-structure__row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; min-height: 76px; padding: var(--pad-row); }
.test-structure__row + .test-structure__row { border-block-start: 1px solid var(--iz-line-soft); }
.test-structure__step { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--iz-sunk); color: var(--iz-ink); font: var(--text-number-s); }
.test-structure__main { display: grid; gap: var(--gap-title); }
.test-structure__main b { color: var(--iz-ink); font: var(--text-h4); }
.test-structure__main span { color: var(--iz-ink-soft); font: var(--text-caption); }
.test-structure__count { display: flex; align-items: center; gap: var(--gap-inline); color: var(--iz-text); font: 600 var(--text-caption-size)/var(--text-caption-lh) var(--font-body); font-variant-numeric: tabular-nums; }
.test-structure__count i { color: var(--primary-500); font-size: var(--text-body-size); }

/* The result path rides the kit's rail — the same vine the course agenda and the account timeline
 * use. The paragraph's top padding centres its first line on the 44px node. */
.test-path li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.test-path p { margin: 0; padding-block-start: var(--space-1); color: var(--iz-text); font: var(--text-body-s); }

@media (max-width: 900px) {
	.test-detail__layout { grid-template-columns: minmax(0, 1fr); }
	.test-detail__content, .test-start { grid-area: auto; }
	.test-start { position: static; }
}
/* The head stacks above the mark at the width the course detail page stacks at. The mark stays
 * under the copy — on a phone the first thing to read is what this test is — and the decorative
 * drawing steps aside so the start button is reached sooner. */
@media (max-width: 860px) {
	.test-detail__hero { grid-template-columns: minmax(0, 1fr); gap: var(--space-head); }
	.test-detail__mark:not(.test-detail__mark--art) { width: min(420px, 100%); height: auto; aspect-ratio: 3 / 2; }
	.test-detail__mark--art { display: none; }
}
/* The stage list narrows instead of scrolling: its three parts still fit on a 390px phone once the
 * step disc gives up a few pixels. */
@media (max-width: 620px) {
	.test-structure__row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: var(--space-2); }
	.test-structure__step { width: 32px; height: 32px; }
}

/* ---------------------------------------------------------------- related tests (detail page)
 * Owner, 2026-09-29: a related card «like the course and workshops card». The offer card
 * (template-parts/learning/offer-card.php) reads a course's or workshop's facts and price and
 * cannot take a test, and its stylesheet is not loaded on this route, so this is the same anatomy
 * under this sheet's own names: inset 16:9 media, a one-line title, a label-free stat row (icon
 * above value, hairline dividers), then a foot with the state at the start and the button-shaped
 * restatement of the card's one link at the end. Same motion as the offer card: a 1.5% press on
 * the card, title colour and shadow on a fine pointer's hover, no lift.
 * The section renders only when another published test shares a category or stage (C2). */
.test-related { display: grid; gap: var(--space-head); padding-block: var(--space-section); }
.test-related > .iz-h2 { margin: 0; }
.test-related__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--gap-grid); }
.test-offer { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--iz-line-soft); border-radius: var(--radius-card); background: var(--color-surface); transition: border-color .2s var(--iz-ease), box-shadow .2s var(--iz-ease), scale .16s var(--iz-ease-out); }
.test-offer:has(.test-offer__link:active) { scale: var(--iz-press-lg); }
.test-offer:has(.test-offer__link:focus-visible) { box-shadow: 0 0 0 3px var(--color-focus-ring); }
.test-offer__media { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; margin: var(--space-1) var(--space-1) 0; border-radius: var(--radius-input); background: var(--iz-sunk); color: var(--secondary-600); font-size: var(--text-display-size); }
.test-offer__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--iz-ease-out); }
.test-offer.is-off .test-offer__media { filter: grayscale(.6); opacity: .8; }
.test-offer__body { display: flex; flex: 1; flex-direction: column; gap: var(--space-stack); min-height: 0; padding: var(--space-2) var(--pad-row) var(--pad-row); }
.test-offer h3 { display: -webkit-box; margin: 0; overflow: hidden; color: var(--color-heading); font: var(--text-h4); -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.test-offer h3 a { color: inherit; text-decoration: none; transition: color .16s var(--iz-ease); }
.test-offer__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-card); }
.test-offer__link:focus-visible { outline: none; }
.test-offer__stats { display: grid; grid-auto-flow: column; grid-auto-columns: max-content; justify-content: end; margin: 0; padding: 0; list-style: none; }
.test-offer__stats li { display: grid; justify-items: center; gap: 1px; min-width: 0; padding: 0 var(--space-1); border-inline-start: 1px solid var(--iz-line-soft); color: var(--iz-ink-soft); font: var(--text-micro); text-align: center; font-variant-numeric: tabular-nums; }
.test-offer__stats li:first-child { border-inline-start: 0; }
.test-offer__stats li:last-child { padding-inline-end: 0; }
.test-offer__stats i { font-size: var(--text-body-s-size); opacity: .7; }
.test-offer__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-3); min-height: 40px; margin-block-start: auto; }
.test-offer__status { display: inline-flex; align-items: center; gap: var(--gap-inline); color: var(--iz-ink-soft); font: 600 var(--text-caption-size)/var(--text-caption-lh) var(--font-body); white-space: nowrap; }
.test-offer__status.is-ok { color: var(--secondary-700); }
.test-offer__go { display: inline-flex; flex: none; align-items: center; gap: var(--gap-inline); margin-inline-start: auto; color: var(--secondary-700); font: var(--text-button-s); white-space: nowrap; }
.test-offer__go i { transition: transform .2s var(--iz-ease-out); }
.test-offer__go.is-primary { min-height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-input); background: var(--secondary-600); color: #fff; transition: background-color .16s var(--iz-ease); }
@media (hover: hover) and (pointer: fine) {
	.test-offer:hover { border-color: var(--primary-200); box-shadow: var(--iz-shadow-lift); }
	.test-offer:hover h3 a { color: var(--secondary-700); }
	.test-offer:hover .test-offer__media img { transform: scale(1.02); }
	.test-offer:hover .test-offer__go i { transform: translateX(-3px); }
	.test-offer:hover .test-offer__go.is-primary { background: var(--secondary-700); }
}
@media (prefers-reduced-motion: reduce) {
	.test-offer, .test-offer * { transition-property: color, background-color, border-color, box-shadow, opacity !important; }
}

/* The detail page takes the course and workshop layout (owner, 2026-10-01): the start panel sits in
   .learning-side__stick, which does the sticking, so the panel itself is a plain card. On a phone it stays
   first, as before, so the start button is reached before the long reading. */
.test-detail .learning-layout > .learning-side { min-width: 0; }
@media (max-width: 900px) { .test-detail .learning-layout > .learning-side { order: -1; } }
/* The price stands at the left edge of its row. */
.test-start__price { justify-content: flex-end; }
