/* ==================================================================
   What every student page outside the test screens shares with the
   homepage: the day/night switch (includes/theme.php), a light ground
   behind question figures so they read by night, and the footer
   (includes/site_footer.php). Loaded by the entry pages and the
   dashboard pages, after their own stylesheet. --s- tokens only.
   ================================================================== */

/* ---- day / night switch ------------------------------------------- */
.t-toggle {
    display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none;
    border: 1px solid var(--s-line); border-radius: 10px; padding: 0;
    background: var(--s-card); color: var(--s-ink); cursor: pointer;
}
.t-toggle:hover { background: var(--s-sunken); }
.t-ic { width: 20px; height: 20px; }
/* It shows what it would switch to: a moon by day, a sun by night. */
.t-sun { display: none; }
:root[data-theme="dark"] .t-sun { display: block; }
:root[data-theme="dark"] .t-moon { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .t-sun { display: block; }
    :root:not([data-theme="light"]) .t-moon { display: none; }
}
/* Without JavaScript it can do nothing, so it is not shown. */
html:not(.js) [data-theme-toggle] { display: none; }

/* ---- a field's message (assets/js/inputs.js) ------------------------ */
.js-err { color: var(--s-danger); font-size: 13px; margin-top: 6px; font-weight: 500; }
.js-err[hidden] { display: none; }

/* ---- CAPTCHA (includes/captcha_field.php) --------------------------- */
.captcha-pic { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.captcha-img {
    display: inline-flex; color: var(--s-ink); background: var(--s-sunken);
    border: 1px solid var(--s-line); border-radius: 10px; padding: 4px 6px;
}
.captcha-svg { display: block; width: 200px; max-width: 100%; height: auto; }
/* The reload button beside the picture. */
.captcha-new {
    display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
    border: 1px solid var(--s-line); border-radius: 10px; background: var(--s-card); color: var(--s-primary);
}
.captcha-new:hover { background: var(--s-primary-soft); }
.captcha-new.spin svg { animation: captcha-spin .6s linear infinite; }
@keyframes captcha-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .captcha-new.spin svg { animation: none; } }
.captcha-input { text-transform: uppercase; letter-spacing: 3px; }
/* The honeypot: off screen for people, still in the form for bots. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- the agreement box (includes/consent_field.php) ------------------ */
.consent {
    border: 1px solid var(--s-line); border-radius: 10px; padding: 12px 14px 8px; margin: 0 0 18px;
    font-size: 14px; color: var(--s-ink);
}
.consent legend { font-weight: 700; padding: 0 6px; }
.consent .req { color: var(--s-danger); font-weight: 700; }
.consent-note { margin: 0 0 10px; color: var(--s-ink-dim); font-size: 13px; line-height: 1.5; }
.consent a { color: var(--s-primary); }
.consent-opt, .consent-agree { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; cursor: pointer; line-height: 1.45; }
.consent-opt input, .consent-agree input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.consent-agree { font-weight: 600; margin-top: 12px; }
.consent-guardian { margin: 6px 0 4px 26px; }
.consent-guardian label { display: block; font-size: 13px; color: var(--s-ink-dim); margin-bottom: 4px; }
.consent-guardian .opt { font-weight: 400; }
.consent .form-control { padding: 10px 12px; }
/* With JavaScript, the guardian's box shows only when "under 18" is chosen. */
html.js .consent-guardian.is-hidden { display: none; }

/* ---- question figures ----------------------------------------------- */
body.s-themed .q-body img,
body.s-themed .nb-q img,
body.s-themed .rt-fig img,
body.s-themed .passage img,
body.s-themed .sol img,
body.s-themed .opts img {
    background: var(--s-figure-bg);
    padding: 4px;
}

/* ---- footer ------------------------------------------------------- */
.site-foot {
    border-top: 1px solid var(--s-line);
    background: var(--s-card);
    color: var(--s-ink-dim);
    font-size: 14px;
    margin-top: 24px;
}
.site-foot-in {
    max-width: 1160px; margin: 0 auto; padding: 18px 16px;
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px;
}
.site-foot p { margin: 0; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-foot a { color: var(--s-ink-dim); text-decoration: none; padding: 4px 0; }
.site-foot a:hover { color: var(--s-primary); text-decoration: underline; }
@media (min-width: 768px) { .site-foot-in { padding: 18px 24px; } }
