/*
 * longhorizons | Project health check | Styles
 * Follows 01 Style System v0.1: light default, IBM Plex, Steel Print accent.
 * Red, amber and green appear only in the status pills.
 */

:root {
  --bg: #FFFFFF;
  --wash: #F2F6F8;
  --ink: #0F1C26;
  --ink-2: #4A5C6C;
  --line: #C8D8E4;
  --accent: #2A6882;      /* Steel Print: text and links */
  --accent-rule: #4A8FA8; /* Steel Blue: rules, bands, non-text */
  --accent-pale: #DCEAF0;
  --error: #A12626;

  /* Status pills: pale fill, saturated text of the same hue, no border */
  --s0-bg: #E2F3E2; --s0-fg: #1A5E1A;  /* On track */
  --s1-bg: #FCF0D2; --s1-fg: #6E4A00;  /* On watchlist */
  --s2-bg: #FBE4D6; --s2-fg: #8A3410;  /* Needs attention */
  --s3-bg: #F8DEDE; --s3-fg: #9A2222;  /* Delayed */

  --serif: 'IBM Plex Serif', Georgia, serif;
  --sans: 'IBM Plex Sans', Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent-rule);
  outline-offset: 2px;
}

.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }

/* ---------- Site header ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.wordmark { font-family: var(--serif); font-size: 21px; color: var(--ink); text-decoration: none; }
.site-header nav a { font-size: 15px; text-decoration: none; margin-left: 20px; }

/* ---------- Intro ---------- */
.intro { padding: 40px 0 8px; }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-2); text-transform: uppercase; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 38px; line-height: 1.2; margin: 8px 0 12px; }
h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.3; margin: 0 0 12px; }
h3 { font-family: var(--sans); font-weight: 600; font-size: 17px; margin: 0 0 6px; }
.lede { font-size: 19px; color: var(--ink); max-width: 62ch; margin: 0 0 12px; }
.note { font-size: 15px; color: var(--ink-2); max-width: 66ch; }

/* ---------- Form ---------- */
form { padding: 16px 0 48px; }
fieldset { border: 0; padding: 24px 0 8px; margin: 0; border-top: 1px solid var(--line); }
legend { font-family: var(--serif); font-size: 22px; padding: 0; margin-bottom: 4px; }
.fieldset-note { font-size: 15px; color: var(--ink-2); margin: 0 0 16px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.field { display: flex; flex-direction: column; }
.field label { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.field .hint { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select {
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid #8FA6B6;
  border-radius: 6px;
  padding: 10px 12px;
  min-height: 46px;
  width: 100%;
}
.field input[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.field .error { color: var(--error); font-size: 14px; margin-top: 4px; min-height: 0; }
.suffix-wrap { position: relative; }
.suffix-wrap input { padding-right: 40px; }
.suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }

.error-summary {
  border-left: 4px solid var(--error);
  background: #FBEDED;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 15px;
}
.error-summary h2 { font-family: var(--sans); font-size: 17px; font-weight: 600; margin: 0 0 6px; color: var(--error); }
.error-summary ol { margin: 0; padding-left: 20px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding-top: 24px; border-top: 1px solid var(--line); margin-top: 16px; }
.btn {
  font: inherit; font-size: 16px; font-weight: 600;
  border-radius: 6px; padding: 12px 20px; min-height: 46px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--bg); color: var(--accent);
}
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn:hover { background: var(--wash); }
.btn-primary:hover { background: #22576D; }
.btn-link { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 12px 4px; font-weight: 400; }

/* ---------- Report ---------- */
.report { padding: 24px 0 48px; }
.report[hidden] { display: none; }
.report-sheet { border: 1px solid var(--line); border-radius: 8px; padding: 28px; background: var(--bg); }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid var(--accent-rule); padding-bottom: 12px; margin-bottom: 16px; }
.report-brand { font-family: var(--serif); font-size: 18px; }
.report-meta { font-size: 13px; color: var(--ink-2); text-align: right; }

.verdict { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.verdict p { font-family: var(--serif); font-size: 22px; line-height: 1.35; margin: 0; flex: 1; }

.pill {
  display: inline-block; border-radius: 999px; padding: 3px 12px;
  font-size: 13px; font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.pill.s0 { background: var(--s0-bg); color: var(--s0-fg); }
.pill.s1 { background: var(--s1-bg); color: var(--s1-fg); }
.pill.s2 { background: var(--s2-bg); color: var(--s2-fg); }
.pill.s3 { background: var(--s3-bg); color: var(--s3-fg); }
.pill.sx { background: var(--wash); color: var(--ink-2); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.tile { background: var(--wash); border-radius: 6px; padding: 12px 14px; }
.tile .t-label { font-size: 13px; color: var(--ink-2); margin-bottom: 2px; }
.tile .t-value { font-size: 24px; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; }
.tile .t-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; }
.tile .pill { margin-top: 6px; }

.timeline { margin: 4px 0 18px; }
.timeline svg { width: 100%; height: auto; display: block; }
.timeline .legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink); margin-top: 6px; }
.timeline .legend span { display: inline-flex; align-items: center; gap: 6px; }
.timeline .legend svg { width: 16px; height: 12px; display: inline-block; }

.section-title { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); margin: 16px 0 8px; }
.findings { margin: 0; padding-left: 20px; }
.findings li { margin-bottom: 10px; font-size: 15px; }
.findings li strong { font-weight: 600; }
.questions { margin: 0; padding-left: 20px; font-size: 15px; }
.questions li { margin-bottom: 4px; }
.checks { margin: 0; padding-left: 20px; font-size: 14px; color: var(--ink); }

.inputs-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.inputs-table td { padding: 3px 8px 3px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.inputs-table td:nth-child(2n) { font-variant-numeric: tabular-nums; padding-right: 18px; }
.inputs-table td:nth-child(2n+1) { color: var(--ink-2); }

.report-foot { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.report-foot p { margin: 0 0 4px; }

.report-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

/* ---------- Site footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 20px 0 40px; font-size: 14px; color: var(--ink-2); }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  h1 { font-size: 30px; }
  .grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .report-sheet { padding: 18px 14px; }
  .report-head { flex-direction: column; }
  .report-meta { text-align: left; }
  .verdict { flex-direction: column; gap: 8px; }
  .verdict p { font-size: 19px; }
  .inputs-table td { display: block; border: 0; padding: 0; }
  .inputs-table td:nth-child(2n) { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .site-header nav a { margin-left: 12px; }
}

/* ---------- Print: one A4 page ---------- */
@page { size: A4; margin: 11mm 12mm; }
@media print {
  body { font-size: 9.5pt; line-height: 1.4; }
  .no-print, .site-header, .site-footer, .intro, form { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .report { padding: 0; }
  .report-sheet { border: 0; padding: 0; border-radius: 0; }
  .report-head { padding-bottom: 6px; margin-bottom: 10px; }
  .verdict { margin-bottom: 10px; }
  .verdict p { font-size: 14pt; }
  .tiles { gap: 6px; margin-bottom: 10px; }
  .tile { padding: 7px 9px; }
  .tile .t-value { font-size: 14pt; }
  .tile .t-label, .tile .t-sub { font-size: 8pt; }
  .findings li, .questions li { font-size: 9pt; margin-bottom: 4px; }
  .checks { font-size: 8.5pt; }
  .timeline .legend { font-size: 8pt; margin-top: 2px; }
  .section-title { margin: 8px 0 4px; font-size: 7.5pt; }
  .inputs-table { font-size: 8pt; }
  .report-foot { font-size: 7.5pt; margin-top: 8px; padding-top: 6px; }
  .pill { font-size: 8pt; padding: 1px 8px; }
  .tile, .pill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: var(--ink); text-decoration: none; }
}
