/*
 * dchecker screen styles.
 *
 * Two rules that are load-bearing rather than cosmetic:
 *
 * 1. The status tone classes (.tc-green … .tc-red) are the legacy's vocabulary
 *    and the mapping must not be "tidied up". tc-blue is the INDETERMINATE and it
 *    must never look like tc-orange, the failure tone — that visual distinction is
 *    what makes "we could not check this" readable as different from "this is
 *    broken". docs/M0-FINDINGS.md 2.3.
 *
 * 2. .custom-hidden is the legacy's hide class and the tab switcher toggles it by
 *    name (js/custom_script.js used the same). Renaming it silently breaks tabs.
 *
 * The report body carries some inline colours because the same markup is fed to
 * xhtml2pdf, which cannot read this file. See dchecker_core/report/render.py.
 */

:root {
  --ink: #212529;
  --muted: #6c757d;
  --line: #dee2e6;
  --bg: #f6f7f9;
  --card: #ffffff;
  --accent: #0b5ed7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 20px 16px 48px; }

/* ---- chrome ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 20px; background: var(--card);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; text-decoration: none; color: var(--ink); }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar a { color: var(--accent); text-decoration: none; }
.topbar a:hover { text-decoration: underline; }
form.inline { display: inline; margin: 0; }
.linkish {
  background: none; border: 0; padding: 0; color: var(--accent);
  cursor: pointer; font: inherit;
}
.linkish:hover { text-decoration: underline; }
.foot {
  text-align: center; color: var(--muted); font-size: 12px; padding: 0 0 24px;
}

/* ---- cards ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  padding: 20px; margin-bottom: 20px;
}
.card.narrow { max-width: 420px; margin: 48px auto; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 17px; margin: 20px 0 10px; }
.lead { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---- forms ---- */
label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 4px; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%; padding: 8px 10px; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px; background: #fff;
}
textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; }
.hidden { display: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

button.primary, a.button {
  display: inline-block; margin-top: 16px; padding: 9px 18px;
  background: var(--accent); color: #fff; border: 0; border-radius: 4px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
button.primary:hover, a.button:hover { background: #0a58ca; }

.alert {
  padding: 10px 12px; border-radius: 4px; background: #fff3cd;
  border: 1px solid #ffe69c; margin: 12px 0;
}
.alert.error { background: #f8d7da; border-color: #f5c2c7; }

/* ---- listings ---- */
table.listing { width: 100%; border-collapse: collapse; margin-top: 10px; }
table.listing th {
  text-align: left; font-size: 12px; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 8px;
}
table.listing td { padding: 7px 8px; border-bottom: 1px solid #eef0f2; }

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 12px; font-weight: 600;
}
.pill-queued  { background: #e9ecef; color: #495057; }
.pill-running { background: #cfe2ff; color: #084298; }
.pill-done    { background: #d1e7dd; color: #0f5132; }
.pill-failed  { background: #f8d7da; color: #842029; }

.statebox {
  margin: 16px 0; padding: 14px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 4px;
}
.reporthead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }

/* ---- report ---- */
.report h1 { font-size: 20px; }
.report h2.record_type_title {
  font-size: 15px; margin: 22px 0 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.report table.record_data {
  width: 100%; border-collapse: collapse; margin-bottom: 8px;
  border: 1px solid var(--line);
}
.report table.record_data th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  background: #f1f3f5; padding: 6px 8px; border-bottom: 1px solid var(--line);
}
.report table.record_data td {
  padding: 7px 8px; border-bottom: 1px solid #eef0f2; vertical-align: top;
  font-size: 14px;
}
.report table.txt-subtable { width: 100%; border: 0; margin: 4px 0 0; }
.report table.txt-subtable td {
  border: 0; padding: 1px 0; font-size: 13px; color: #495057;
  font-family: ui-monospace, Consolas, monospace;
}
.report pre.dnsck-block {
  background: #f1f3f5; border: 1px solid var(--line); padding: 10px;
  overflow-x: auto; font-size: 13px;
}

/* tabs */
.dnsck-tabs {
  display: flex; flex-wrap: wrap; gap: 2px; margin: 18px 0 0;
  border-bottom: 1px solid var(--line);
}
.dnsck-tabs .nav-tab {
  padding: 8px 14px; text-decoration: none; color: var(--muted);
  border: 1px solid transparent; border-bottom: 0; font-size: 14px;
  font-weight: 600; border-radius: 4px 4px 0 0;
}
.dnsck-tabs .nav-tab-active {
  color: var(--ink); background: #fff; border-color: var(--line);
  margin-bottom: -1px;
}
.dnsck-panel { padding-top: 6px; }
/* The legacy's hide class. The tab switcher toggles it BY NAME. */
.custom-hidden { display: none !important; }

/* cover */
.dnsck-cover-band { border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.dnsck-cover-h1 { font-size: 20px; margin: 0; }
.dnsck-cover-domain { font-size: 16px; color: #495057; margin: 2px 0 0; }
.dnsck-cover-meta { font-size: 12px; color: var(--muted); margin: 8px 0 12px; }
.dnsck-cover-verdict {
  padding: 10px 14px; font-size: 16px; font-weight: 700; border-radius: 4px;
  margin-bottom: 14px;
}
.dnsck-cover-tiles { width: 100%; }
.dnsck-tile {
  border: 1px solid var(--line); border-radius: 4px; padding: 10px;
}
.dnsck-tile-label {
  font-size: 11px; text-transform: uppercase; color: var(--muted);
}
.dnsck-tile-value { font-size: 24px; font-weight: 700; }
.dnsck-tile-sub { font-size: 11px; color: var(--muted); }
.dnsck-attention { width: 100%; border: 1px solid var(--line); }
.dnsck-finding-title { font-size: 14px; }
.dnsck-finding-where {
  font-size: 11px; color: var(--muted); margin-left: 8px;
}
.dnsck-finding-detail { font-size: 13px; color: #343a40; }
.dnsck-section-heading {
  font-size: 17px; margin: 6px 0 12px; padding-bottom: 4px;
  border-bottom: 2px solid var(--line);
}
.dnsck-limitations table.record_data { border-color: #b6d4fe; }

/* recommended actions: the fifth tab. The PDF renders the same block last. */
.dnsck-actions-intro, .dnsck-actions-none { font-size: 13px; color: var(--muted); }
.dnsck-action-group { font-size: 14px; margin: 14px 0 6px; }
.dnsck-actions { width: 100%; border: 1px solid var(--line); margin-bottom: 4px; }
.dnsck-action-n { font-weight: 700; color: var(--muted); font-size: 13px; }
.dnsck-action-text { font-size: 14px; }
.dnsck-action-fixes { font-size: 11px; color: var(--muted); }
.dnsck-action-where { font-size: 11px; color: var(--muted); margin-left: 8px; }

/*
 * STATUS TONES. Do not "tidy" this mapping — see the file header.
 *   tc-green  pass          tc-yellow attention
 *   tc-orange fail          tc-blue   INDETERMINATE
 *   tc-red    expiry only
 */
.tc-green  { color: #146c43; }
.tc-yellow { color: #997404; }
.tc-orange { color: #d63384; }
.tc-blue   { color: #0a58ca; }
.tc-red    { color: #b02a37; }
.bold-800  { font-weight: 700; }

/* --------------------------------------------------------------------------
   Administration (users list, edit form, show-once panel).

   Reuses the existing vocabulary — .card, .grid2, .pill, table.listing — and
   adds only what did not exist: a role pill, a destructive button, and the
   monospace treatment for a credential that is shown exactly once.
   -------------------------------------------------------------------------- */

.pill-admin { background: #e2d9f3; color: #432874; }

/* Destructive, and it has to LOOK destructive: the button next to it on the
   same page is "Save changes". */
button.danger {
  background: #b02a37; color: #fff; border: 0; border-radius: 6px;
  padding: 9px 14px; font-size: 14px; cursor: pointer;
}
button.danger:hover { background: #842029; }

hr { border: 0; border-top: 1px solid #eef0f2; margin: 22px 0; }

/* A checkbox reads as part of its label, not as a full-width form control. */
.inline-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.inline-check input { width: auto; margin: 0; }

/* Shown-once credentials. Monospace because they get transcribed by hand, and
   selectable-looking because that is what the operator has to do with them. */
.secret {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 15px; letter-spacing: 0.02em; word-break: break-all;
}
.reveal {
  background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px;
  padding: 12px 14px; margin: 6px 0 14px;
}
input.secret[readonly] { background: #f8f9fa; }

/* A QR needs a light quiet zone around dark modules or it will not scan, and
   segno draws the modules black with a transparent background. */
.qr {
  background: #fff; display: inline-block; padding: 10px;
  border: 1px solid #dee2e6; border-radius: 6px; line-height: 0;
}

form.inline { display: inline-block; margin-right: 8px; }

/* A disabled input has to LOOK disabled, or an administrator types into the
   username field and wonders why nothing happens. The field is immutable by
   server-side design, not just by this attribute — see admin_user_form.html. */
input:disabled {
  background: #f1f3f5; color: #6c757d; cursor: not-allowed;
  border-color: #dee2e6;
}
