/* MailCHK -- shared stylesheet. Sober, not flashy: a lot of whitespace, one
   accent colour (Secure Networks red, sampled from the real logo file --
   #FF1700), system fonts only (no external font/CDN dependency, consistent
   with this project's self-hosted, no-third-party-services posture and the
   strict `default-src 'self'` CSP in security_headers.go). */

:root {
  --bg: #faf9f8;
  --surface: #ffffff;
  --border: #e8e5e3;
  --text: #1c1b1a;
  --text-muted: #6b6764;
  --accent: #ff1700;
  --accent-dark: #cc1200;
  --accent-tint: #fff0ee;
  --pass: #1a7f4b;
  --pass-tint: #eaf6ef;
  --fail-tint: #fdeceb;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(28, 27, 26, 0.04), 0 8px 24px rgba(28, 27, 26, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* ---- Layout shell ---- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
}

.brand-logo-link {
  display: block;
  line-height: 0;
}

.brand-logo-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.brand img {
  height: 38px;
  width: auto;
  display: block;
}

.brand-tagline {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.005em;
}

.brand-desc {
  font-size: 14px;
  color: var(--text-muted);
}

main {
  flex: 1;
  padding: 56px 24px 64px;
}

.container {
  max-width: 640px;
  margin: 0 auto;
}

.site-footer {
  padding: 22px 24px 32px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---- Typography ---- */

h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin: 0 0 8px;
}

.lede {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0 0 36px;
}

/* ---- Cards ---- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.card + .card {
  margin-top: 20px;
}

/* ---- Form controls ---- */

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 16px;
}
input[type="email"]:focus,
input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.captcha-image {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  max-width: 100%;
  height: auto;
}

.checkbox-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 0 0 16px;
}
.checkbox-group legend {
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
}
.checkbox-group .note {
  margin: 0 0 12px;
}
.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 400;
  margin-bottom: 10px;
  cursor: pointer;
}
.checkbox-option:last-child {
  margin-bottom: 0;
}
.checkbox-option input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.checkbox-option strong {
  color: var(--text);
}
.checkbox-option span {
  color: var(--text-muted);
}

/* SPF/DKIM/DMARC in the checkbox-group - always on, not a real choice
   (see the fieldset's own comment in home.html). Muted further than a
   regular option, and the browser's own disabled-checkbox styling already
   signals "you can't change this". */
.checkbox-option-locked {
  cursor: default;
  opacity: 0.7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.btn:hover {
  background: var(--accent-dark);
  color: #fff;
  text-decoration: none;
}

/* A .btn used as a standalone link straight in .container (not inside a
   form/card, which already has its own spacing) - address.html's "Check
   report status" and report.html's "Validate another domain". */
.container > .btn {
  margin-top: 20px;
}

/* ---- Explainer row (home page) ---- */

.mechanisms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.mechanism {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.mechanism .abbr {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 4px;
}

.mechanism p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

@media (max-width: 520px) {
  .mechanisms {
    grid-template-columns: 1fr;
  }
}

/* ---- Address / report display ---- */

.address-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: var(--accent-tint);
  border: 1px solid #ffd9d3;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-dark);
  word-break: break-all;
}

.note {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 16px;
}

/* ---- Report status ---- */

.status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}
.status-banner.pending {
  background: #f1efec;
  color: var(--text-muted);
}
.status-banner.error {
  background: var(--fail-tint);
  color: var(--accent-dark);
}

.meta-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 14px;
  margin-bottom: 24px;
}
.meta-list dt {
  color: var(--text-muted);
}
.meta-list dd {
  margin: 0;
  font-weight: 600;
}

table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.results {
  table-layout: fixed;
}
table.results th:nth-child(1),
table.results td:nth-child(1) {
  width: 22%;
}
table.results th:nth-child(2),
table.results td:nth-child(2) {
  width: 26%;
}
table.results th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--border);
}
table.results td {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.results tr:last-child td {
  border-bottom: none;
}
table.results td.mechanism-name {
  font-weight: 700;
  overflow-wrap: break-word;
  padding-right: 16px;
}
table.results td.detail {
  overflow-wrap: break-word;
  color: var(--text-muted);
  font-size: 13px;
}

/* Below this, the fixed 22%/26% column widths leave too little room for
   real mechanism names/details to read comfortably even with wrapping
   enabled (see td.mechanism-name/td.detail's overflow-wrap above, which
   stops them overlapping the next column but still looks cramped).
   Reported from a phone by Pedro, 2026-08-30 - same fix applied to DnsCHK's
   own copy of this stylesheet. Stack each row into two lines instead: the
   mechanism name on its own full-width line, then the result badge and
   detail together underneath - a standard responsive-table pattern, not
   custom-invented here. */
@media (max-width: 600px) {
  table.results thead {
    display: none;
  }
  table.results tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 10px;
    row-gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
  }
  table.results tr:last-child {
    border-bottom: none;
  }
  table.results td {
    display: block;
    width: auto;
    padding: 0;
    border-bottom: none;
  }
  table.results td.mechanism-name {
    flex-basis: 100%;
    padding-right: 0;
  }
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: lowercase;
}
.badge.pass {
  background: var(--pass-tint);
  color: var(--pass);
}
.badge.fail {
  background: var(--fail-tint);
  color: var(--accent-dark);
}
.badge.neutral {
  background: #f1efec;
  color: var(--text-muted);
}
