/* SafeAssure Review Portal — Phase 1
   Palette taken from the SafeAssure letterhead: charcoal, orange, warm red. */
:root {
  --ink: #1c1f23;
  --ink-2: #4a5158;
  --muted: #7b848c;
  --line: #e3e6e9;
  --bg: #f6f7f8;
  --card: #ffffff;
  --orange: #f0662b;
  --orange-dk: #d8511a;
  --red: #e03131;
  --green: #2f9e44;
  --amber: #f08c00;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* header */
.top { background: var(--ink); color: #fff; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 16px; }
.brand strong { font-weight: 600; }
.mark {
  width: 20px; height: 20px; border-radius: 50%;
  background: conic-gradient(from 200deg, var(--orange), var(--red), #c9ccd0, var(--orange));
}
.top nav { display: flex; align-items: center; gap: 18px; }
.top nav a { color: #cfd4d9; text-decoration: none; font-size: 14px; }
.top nav a:hover { color: #fff; }

main { padding: 28px 0 40px; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; }
h2.sect { margin: 26px 0 10px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.crumb { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.crumb a { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.req { color: var(--red); }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }

/* cards */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
}
.cols { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

/* forms */
label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--ink-2); }
input[type=text], input:not([type]), input[type=file], textarea, select {
  width: 100%; margin-top: 5px; padding: 9px 11px; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 7px; background: #fff;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: var(--orange); }
.hint { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row input { margin-top: 0; }
.actions { display: flex; gap: 10px; margin-top: 6px; }

.btn {
  display: inline-block; padding: 9px 15px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: inherit; font-size: 14px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--orange-dk); border-color: var(--orange-dk); }

/* choices */
fieldset.choice { border: 0; padding: 0; margin: 0 0 16px; }
fieldset.choice legend { font-size: 13px; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.opt {
  display: flex; gap: 11px; align-items: flex-start; padding: 12px;
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer;
}
.opt:hover { border-color: var(--muted); }
.opt input { margin-top: 3px; }
.opt em { display: block; font-style: normal; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.opt:has(input:checked) { border-color: var(--orange); background: #fff8f5; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin-right: 18px; }
.tight .opt { display: inline-flex; }

/* table */
.grid { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600;
}
.grid td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover { background: #fafbfb; cursor: pointer; }
.grid a { color: var(--ink); text-decoration: none; }
.grid a:hover { color: var(--orange-dk); }

/* pills & tags */
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: #eef0f2; color: var(--ink-2); }
.pill-yes { background: #e7f5ea; color: var(--green); }
.pill-rec { background: #fff4e0; color: var(--amber); }
.pill-no  { background: #ffe9e9; color: var(--red); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 11.5px; border: 1px solid var(--line); }
.tag-project { background: #eef4ff; border-color: #d6e4ff; color: #2b6cb0; }
.tag-prequal { background: #f4eeff; border-color: #e2d6ff; color: #6b46c1; }
.status { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; text-transform: capitalize; background: #eef0f2; color: var(--ink-2); }
.status-approved, .status-delivered { background: #e7f5ea; color: var(--green); }
.status-in_review { background: #fff4e0; color: var(--amber); }

/* items */
.items { padding: 0; }
.item { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item-n { background: #fffafa; box-shadow: inset 3px 0 0 var(--red); }
.item-h { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.num { color: var(--muted); font-size: 12px; min-width: 20px; font-variant-numeric: tabular-nums; }
.label { flex: 1; font-size: 14px; }
.answers { display: flex; gap: 4px; }
.ans { margin: 0; cursor: pointer; }
.ans input { position: absolute; opacity: 0; pointer-events: none; }
.ans span {
  display: inline-block; min-width: 36px; text-align: center; padding: 4px 8px;
  border: 1px solid var(--line); border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); background: #fff;
}
.ans-Y input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
.ans-N input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.ans-NA input:checked + span { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.item textarea { font-size: 13px; }
.outcomes { margin-bottom: 12px; }

/* misc */
.alert { background: #ffe9e9; border: 1px solid #ffc9c9; color: #a02020; padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.note { background: #f4eeff; border: 1px solid #e2d6ff; color: #4c3070; padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.ok { color: var(--green); }
.empty { text-align: center; padding: 56px 20px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.files { list-style: none; padding: 0; margin: 0; }
.files li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.files li:last-child { border-bottom: 0; }
.files a { color: var(--ink); }
.audit { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.audit li { padding: 9px 0 9px 12px; border-left: 2px solid var(--line); margin-bottom: 2px; }
.audit .at { display: block; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.foot { padding: 18px 24px 40px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); margin-top: 20px; }
code { background: #eef0f2; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

/* WHSMP: product tag, and Desktop Audit's met/partial/not-met answers */
.tag-product { background: #eef7f0; border-color: #cfe8d6; color: #2f7a45; font-weight: 600; }
.ans-met input:checked + span      { background: var(--green);  border-color: var(--green);  color: #fff; }
.ans-partial input:checked + span  { background: var(--amber);  border-color: var(--amber);  color: #fff; }
.ans-not_met input:checked + span  { background: var(--red);    border-color: var(--red);    color: #fff; }
.ans-partial span, .ans-not_met span, .ans-met span { min-width: 84px; }

/* Management System Review: C / NC / TBA / N-A / OFI / WIP status pills */
.ans-C input:checked + span    { background: var(--green);  border-color: var(--green);  color: #fff; }
.ans-NC input:checked + span   { background: var(--red);    border-color: var(--red);    color: #fff; }
.ans-TBA input:checked + span  { background: var(--amber);  border-color: var(--amber);  color: #fff; }
.ans-N-A input:checked + span  { background: var(--ink-2);  border-color: var(--ink-2);  color: #fff; }
.ans-OFI input:checked + span  { background: #d6336c;       border-color: #d6336c;       color: #fff; }
.ans-WIP input:checked + span  { background: #1c7ed6;       border-color: #1c7ed6;       color: #fff; }
.ans-C span, .ans-NC span, .ans-TBA span, .ans-N-A span, .ans-OFI span, .ans-WIP span { min-width: 40px; }
.item-lead { padding: 10px 16px; font-size: 13px; color: var(--ink-2); font-style: italic; }
.item-note { padding: 10px 16px; font-size: 12.5px; color: var(--muted); background: #f7f7f8; font-style: italic; }

/* Engagement panel */
.engagement { border-color: #cfe8d6; }
.eng-list { list-style: none; padding: 0; margin: 0 0 12px; }
.eng-list li { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.eng-list li:last-child { border-bottom: 0; }
.eng-list li.eng-here { font-weight: 600; }
.eng-list a { color: var(--ink); flex: 1; }

/* Hub: sign-in panel and the tool tiles */
.signin-split {
  display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 0; margin: 28px auto; max-width: 940px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
}
.signin-form { padding: 34px 34px 30px; }
.signin-form h1 { margin-bottom: 2px; }
.signin-form .btn-primary { width: 100%; }
.signin-art {
  background-image: image-set(url("/static/hero.jpg") 1x);
  background-size: cover; background-position: center;
  min-height: 420px;
}
/* The photo is decoration: below this width it costs layout and bandwidth for nothing,
   so it goes and the form takes the full card. */
@media (max-width: 820px) {
  .signin-split { grid-template-columns: 1fr; max-width: 440px; }
  .signin-art { display: none; }
}

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 7px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px 22px 20px; text-decoration: none; color: var(--ink);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.tile:hover {
  border-color: var(--orange); transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(28,31,35,.07);
}
.tile-icon {
  width: 38px; height: 38px; border-radius: 10px; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: center;
  background: #fff1ea; color: var(--orange-dk);
}
.tile-icon svg { width: 20px; height: 20px; }
.tile strong { font-size: 16.5px; letter-spacing: -.01em; }
.tile .go { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--orange-dk); opacity: 0; transition: opacity .15s ease; }
.tile:hover .go { opacity: 1; }

/* Landing hero */
.hero { padding: 6px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.hero h1 { font-size: 27px; letter-spacing: -.02em; margin-bottom: 4px; }
.hero p { margin: 0; font-size: 14.5px; }

/* Header logo (drops in automatically when static/logo.svg or logo.png exists) */
.brand img { height: 30px; width: auto; display: block; }

/* User guide — rendered from engine/docs/user-guide.md */
.guide { max-width: 760px; line-height: 1.65; }
.guide h1 { font-size: 24px; margin: 0 0 6px; }
.guide h2 { font-size: 17px; margin: 30px 0 8px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.guide h3 { font-size: 14px; margin: 22px 0 6px; color: var(--ink-2); }
.guide p, .guide li { font-size: 14.5px; }
.guide ul, .guide ol { padding-left: 22px; }
.guide li { margin-bottom: 5px; }
.guide table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13.5px; }
.guide th { text-align: left; border-bottom: 2px solid var(--line); padding: 7px 10px 7px 0; }
.guide td { border-bottom: 1px solid var(--line); padding: 7px 10px 7px 0; vertical-align: top; }
.guide blockquote { margin: 14px 0; padding: 10px 14px; background: #fff8f5; border-left: 3px solid var(--orange); border-radius: 0 6px 6px 0; }
.guide blockquote p:last-child { margin-bottom: 0; }
.guide hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.guide code { font-size: 12.5px; }
.guide pre { background: #f7f7f8; padding: 12px 14px; border-radius: 7px; overflow-x: auto; }
.guide-plain { white-space: pre-wrap; font-size: 13px; }
