/*
 * Test page styles — the look of the platform's own check page (app.metacoach.ai/check):
 * light theme, Inter, content on the left, illustration and "powered by" on the right.
 * Images and the font are in static/brand/ (copied from app.metacoach.ai).
 */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url(brand/fonts/inter-latin-400.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url(brand/fonts/inter-latin-500.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url(brand/fonts/inter-latin-600.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url(brand/fonts/inter-latin-700.woff2) format("woff2"); }

:root {
  /* Platform colours */
  --text: #1d1b20; --muted: #625b71; --outline: #79747e; --border: #e6e0e9;
  --surface: #ffffff; --panel: #f9f9f9; --soft: #f5f5f7;
  --brand: #5246a5; --brand-soft: #e6e6ff; --brand-soft-hover: #d8daff;
  /* Results: text colour and badge background */
  --ok: #4f8800; --ok-bg: #d6eaba;
  --bad: #ce2e2a; --bad-bg: #fad9d6;
  --warn: #9a6200; --warn-bg: #fde7b5;
  --accent: #5246a5; --info-bg: #e6e6ff;
  --neutral: #4f4c5f; --neutral-bg: #e4e3e8;
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--surface);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); }
[hidden] { display: none !important; }

/* --- Layout: content | illustration ------------------------------------------------------------ */
.layout { display: flex; min-height: 100vh; }
.layout-main { flex: 1 1 60.65%; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 56px 24px; }
.page { width: min(600px, 100%); }
.art-panel {
  flex: 0 0 39.35%; position: sticky; top: 0; height: 100vh;
  display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--panel);
}
.art { width: 75%; max-width: 540px; height: auto; }
.powered { display: flex; flex-direction: column; align-items: center; gap: 9px; font-size: 17px; letter-spacing: -.02em; color: #000; }
.powered img { width: 173px; height: auto; }
.art-panel .powered { position: absolute; left: 0; right: 0; bottom: 46px; }
.powered-inline { display: none; margin-top: 40px; font-size: 14px; }
.powered-inline img { width: 130px; }
@media (max-width: 900px) {
  .art-panel { display: none; }
  .powered-inline { display: flex; }
  .layout-main { padding: 32px 16px; align-items: flex-start; }
}

/* --- Text ------------------------------------------------------------------------------------- */
.topbar { margin-bottom: 26px; }
h1 { font-size: 24px; font-weight: 500; margin: 0; letter-spacing: 0; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 16px 0 6px; }
p { margin: 8px 0; }
#intro { font-size: 17px; margin-top: 0; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .05em; font-size: 15px; }
.sev-text-ok { color: var(--ok); }
.sev-text-info { color: var(--accent); }
.sev-text-warn { color: var(--warn); }
.sev-text-error { color: var(--bad); }

/* --- Sections (no boxes, as on the platform page) ---------------------------------------------- */
.card { margin: 0 0 28px; min-width: 0; }
details { margin-top: 8px; }
details > summary { cursor: pointer; }
.alert { border: 1px solid var(--bad); color: var(--bad); background: var(--bad-bg); padding: 10px 14px; border-radius: 6px; margin: 0 0 16px; }

/* --- Buttons: pill-shaped, primary = soft brand, others outlined ------------------------------ */
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 10px; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 26px;
  font: inherit; font-size: 16px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--muted); background: transparent; color: var(--muted);
  transition: background .2s, opacity .2s;
}
button:hover:not(:disabled), .button:hover { background: #625b710f; }
button:disabled { opacity: .45; cursor: default; }
button.primary { border-color: transparent; background: var(--brand-soft); color: var(--brand); }
button.primary:hover:not(:disabled) { background: var(--brand-soft-hover); }
button.big { padding: 0 32px; }

/* --- Badges: PASS / WARN / FAIL / INFO --------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  min-width: 64px; height: 24px; padding: 0 8px; border-radius: 20px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; vertical-align: 2px;
}
.badge.sev-ok { background: var(--ok-bg); color: var(--ok); }
.badge.sev-info { background: var(--info-bg); color: var(--accent); }
.badge.sev-warn { background: var(--warn-bg); color: var(--warn); }
.badge.sev-error { background: var(--bad-bg); color: var(--bad); }
.badge.pending, .badge.running { background: var(--neutral-bg); color: var(--neutral); }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid #ffffffaa; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- "Tests to run": badge | name, result, what it checks ------------------------------------- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
/* Fixed badge column, so names line up also when a badge holds a value ("145 ms", "1062 Mb/s"). */
.steps li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 0 12px; align-items: start; }
.steps .badge { width: 100%; min-width: 0; padding: 0 4px; }
.check { display: flex; flex-direction: column; min-width: 0; }
.check-name { font-weight: 600; font-size: 17px; line-height: 24px; }
.check-result { font-size: 15px; overflow-wrap: anywhere; }
.check-result.muted { opacity: .9; }
/* As on the platform page, a passing result is plain grey text; only problems are coloured. */
.check-result.sev-text-ok, .check-result.sev-text-info { color: var(--muted); }
.check-what { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }

/* --- Result -------------------------------------------------------------------------------------- */
/* Speed meters: zones by rating threshold, marker at the measured value. */
.meter { margin: 12px 0 20px; }
.meter-head { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; margin-bottom: 6px; }
.meter-track { position: relative; height: 12px; border-radius: 6px; background: var(--soft); overflow: visible; }
.meter-zone { position: absolute; top: 0; bottom: 0; }
.meter-zone:first-child { border-radius: 6px 0 0 6px; }
.meter-zone:nth-last-child(2) { border-radius: 0 6px 6px 0; }
.meter-zone.sev-ok { background: var(--ok-bg); }
.meter-zone.sev-info { background: var(--info-bg); }
/* Between good and warning (latency 100–250 ms): pale yellow, so the bar reads green → yellow. */
.meter-zone.sev-mild { background: #fdf1d2; }
.meter-zone.sev-warn { background: var(--warn-bg); }
.meter-zone.sev-error { background: var(--bad-bg); }
.meter-marker { position: absolute; top: -4px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: var(--text); }
.meter-marker.sev-ok { background: var(--ok); }
.meter-marker.sev-info { background: var(--accent); }
.meter-marker.sev-warn { background: var(--warn); }
.meter-marker.sev-error { background: var(--bad); }
.meter-scale { position: relative; height: 16px; margin-top: 3px; font-size: 11px; color: var(--muted); }
.meter-tick { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.meter-tick:first-child { transform: none; }
.meter-tick:last-child { transform: translateX(-100%); }

/* Small preview of the three.js test scene under the 3D graphics row. */
.three-canvas { display: block; width: 96px; height: 64px; margin-top: 6px; border-radius: 6px; background: #101820; }
.three-canvas.hidden { display: none; }

/* Privacy note at the bottom of the page. */
.privacy { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.privacy h2 { font-size: 15px; color: var(--text); margin-bottom: 6px; }
.privacy p { margin: 6px 0; }
