:root {
  --bg: #f8fbff;
  --text: #10243a;
  --accent: #0e7490;
  --surface: #ffffff;
  --border: #d6e4f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(circle at top, #e6f4ff 0%, var(--bg) 45%, #f2f8ff 100%);
  color: var(--text);
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

main.container {
  margin-top: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(16, 36, 58, 0.08);
}

h1 {
  margin-top: 0;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 0.65rem 1rem;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.05);
}

form {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

input,
textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  padding: 0.65rem;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

/* An <output> element: a status region that screen readers announce. */
.form-status {
  display: block;
  min-height: 1.25rem;
  margin: 0.5rem 0 0;
}

/* The privacy notice under the contact form (LEAD-POLICY.md). Opacity
   keeps it quieter than body text in both light and dark mode. */
.form-note {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  opacity: 0.8;
}

.form-status[data-state="error"] {
  color: #b42318;
}

.form-status[data-state="ok"] {
  color: #067647;
}

button[disabled] {
  opacity: 0.6;
  cursor: wait;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1622;
    --text: #e6eef6;
    --accent: #22a3c3;
    --surface: #10202f;
    --border: #22384d;
  }

  body {
    background: var(--bg);
  }

  input,
  textarea {
    background: #0b1622;
    color: var(--text);
  }

  .form-status[data-state="error"] {
    color: #fda29b;
  }

  .form-status[data-state="ok"] {
    color: #75e0a7;
  }
}

.site-header {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.25rem 1rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.site-name {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.site-header ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header a {
  color: var(--accent);
}

.site-header a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.intro {
  font-size: 1.125rem;
}

/* Security checker (check.js) */
.check-row {
  display: flex;
  gap: 0.5rem;
}

.check-row input {
  flex: 1;
  min-width: 0;
}

.check-report {
  margin-top: 2rem;
}

.check-summary {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.check-grade {
  flex: none;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  background: #b42318;
}

.check-grade[data-grade="A+"],
.check-grade[data-grade="A"] {
  background: #067647;
}

.check-grade[data-grade="B"] {
  background: #4f7a0f;
}

.check-grade[data-grade="C"],
.check-grade[data-grade="D"] {
  background: #b54708;
}

.check-summary h2,
.check-summary p {
  margin: 0.15rem 0;
  overflow-wrap: anywhere;
}

.check-findings {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}

.check-findings li {
  border-top: 1px solid var(--border);
  padding: 0.75rem 0;
}

.check-findings h4 {
  margin: 0 0 0.25rem;
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.check-findings p {
  margin: 0.25rem 0;
}

.check-chip {
  flex: none;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.check-chip[data-status="pass"] {
  color: #067647;
}

.check-chip[data-status="fail"] {
  color: #b42318;
}

.check-chip[data-status="warn"] {
  color: #b54708;
}

.check-chip[data-status="info"] {
  color: var(--accent);
}

@media (prefers-color-scheme: dark) {
  .check-chip[data-status="pass"] {
    color: #75e0a7;
  }

  .check-chip[data-status="fail"] {
    color: #fda29b;
  }

  .check-chip[data-status="warn"] {
    color: #fec84b;
  }
}

.check-history {
  font-weight: 600;
}

.check-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}

.check-snippets {
  margin: 0.5rem 0 0;
}

.check-snippets summary {
  cursor: pointer;
  color: var(--accent);
}

.check-findings .check-snippet-platform {
  margin: 0.75rem 0 0.25rem;
  font-weight: 600;
}

.check-snippets pre {
  margin: 0;
  padding: 0.6rem 0.75rem;
  overflow-x: auto;
  white-space: pre;
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* Printing a report: just the report, with every fix section opened by
   check.js before printing. */
@media print {
  .site-header,
  footer,
  .check-form,
  .check-actions {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .check-findings li {
    break-inside: avoid;
  }

  .check-snippets pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}
