/* Connectivity Doctor — styling.
 *
 * Brand colours are lifted from the palette in the main application's
 * api/static/css/brand.css, but the webfont is deliberately NOT loaded. The
 * whole promise of this tool is that it contacts nothing except the addresses
 * printed on its own consent screen, and a Google Fonts request would break
 * that promise for the sake of a typeface. System fonts it is.
 *
 * The page also has to be legible on a phone held at arm's length by somebody
 * who is already annoyed, so: large type, high contrast, no reliance on colour
 * alone to convey a result.
 */

:root {
  --primary-purple: #3C107B;
  --primary-blue: #5510F4;
  --dark-purple: #1E083E;
  --cyan: #38F5FF;
  --lime: #A1FD00;
  --orange: #FF6900;
  --teal: #36E7B0;

  --ink: #16121f;
  --muted: #5b5470;
  --line: #e2dff0;
  --paper: #ffffff;
  --shell: #f6f5fb;

  --pass: #1f7a4d;
  --fail: #b3261e;
  --warn: #a8600a;
  --info: #3C107B;
  --none: #6b6480;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--shell);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 18px 80px;
}

header.masthead {
  background: var(--dark-purple);
  color: #fff;
  padding: 28px 18px;
}
header.masthead .wrap { padding: 0; max-width: 780px; }
header.masthead h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.01em; }
header.masthead p { margin: 0; color: #cfc7e8; font-size: 16px; }

h2 { font-size: 21px; margin: 32px 0 10px; }
h3 { font-size: 17px; margin: 22px 0 6px; }
p { margin: 0 0 12px; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin: 18px 0;
}

.card.quiet { background: #fbfaff; }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 13px 22px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary-blue);
  color: #fff;
  font-family: inherit;
}
.btn:hover { background: var(--primary-purple); }
.btn.secondary { background: #fff; color: var(--primary-purple); border: 1.5px solid var(--primary-purple); }
.btn.secondary:hover { background: #f1ecff; }
.btn:disabled { background: #b8b2c9; cursor: not-allowed; }
.btn + .btn { margin-left: 8px; }

@media (max-width: 560px) {
  .btn { display: block; width: 100%; margin: 8px 0 0; }
  .btn + .btn { margin-left: 0; }
}

label { display: block; font-weight: 600; margin: 14px 0 4px; font-size: 15px; }
select, input[type="text"], textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
textarea.report {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  min-height: 420px;
  white-space: pre;
  overflow-x: auto;
}

/* URL list on the consent screen. This is the promise, rendered. */
ul.urls { list-style: none; margin: 8px 0 0; padding: 0; }
ul.urls li {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  word-break: break-all;
}
ul.urls li span.why {
  display: block;
  font-family: inherit;
  font-size: 14px;
  color: var(--muted);
}

ul.plain { margin: 8px 0 12px; padding-left: 22px; }
ul.plain li { margin-bottom: 6px; }

/* Result rows. The status word is spelled out, never colour alone: this page
 * will be read by people with colour vision deficiency and printed in mono. */
.check {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.check:last-child { border-bottom: 0; }
.check .row { display: flex; gap: 12px; align-items: baseline; }
.check .badge {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 5px;
  min-width: 72px;
  text-align: center;
  border: 1.5px solid currentColor;
}
.badge.ok { color: var(--pass); }
.badge.fail { color: var(--fail); }
.badge.warn { color: var(--warn); }
.badge.info { color: var(--info); }
.badge.unavailable, .badge.skipped, .badge.running { color: var(--none); }
.check .title { font-weight: 600; }
.check .headline { color: var(--muted); font-size: 15px; margin-top: 2px; }

details.explain { margin-top: 8px; }
details.explain summary {
  cursor: pointer;
  font-size: 15px;
  color: var(--primary-purple);
  font-weight: 600;
}
details.explain .body { padding: 10px 0 4px; font-size: 15px; color: var(--muted); }
details.explain pre {
  background: #f4f2fb;
  border-radius: 8px;
  padding: 10px;
  font-size: 12.5px;
  overflow-x: auto;
  margin: 8px 0 0;
}

/* The verdict banner. Deliberately loud: it is the answer. */
.verdict { border-radius: 12px; padding: 20px; margin: 18px 0; border: 2px solid; }
.verdict h2 { margin: 0 0 8px; font-size: 20px; }
.verdict.ok { border-color: var(--pass); background: #f0f9f4; }
.verdict.degraded { border-color: var(--warn); background: #fdf6ec; }
.verdict.blocked { border-color: var(--fail); background: #fdf1f0; }

.progress {
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
  margin: 14px 0;
}
.progress > div { height: 100%; background: var(--primary-blue); width: 0; transition: width 0.25s; }

.hidden { display: none !important; }

.note {
  font-size: 15px;
  color: var(--muted);
  border-left: 3px solid var(--cyan);
  padding-left: 12px;
  margin: 12px 0;
}

.toolbar { margin: 14px 0; }
.toggle { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; margin: 12px 0; }
.toggle input { width: auto; }

footer.foot {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
footer.foot a { color: var(--primary-purple); }
