/* ============================================================
   PM Toolbox — Mission Mobile Medical
   Design system. All brand values from the 2026 Brand Guidelines.
   Change tokens here to retune the whole site.
   ============================================================ */

:root {
  /* Brand palette — 2026 Brand Guidelines */
  --mission-blue: #00aeef;
  --mission-blue-700: #0089bd;   /* derived: hover/active */
  --mission-blue-050: #e6f7fe;   /* derived: tint surface */
  --ink: #000000;                /* Black */
  --soft-grey: #d3d4d3;          /* Soft Grey */

  /* Derived neutrals for UI surfaces */
  --bg: #ffffff;
  --surface: #f7f8f9;
  --surface-2: #eef0f1;
  --border: #e4e6e7;
  --text: #14171a;
  --text-muted: #5c6469;

  /* Typography — Outfit (headings) + Inter (body) */
  --font-head: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  /* Spacing / shape / motion */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --shadow-hover: 0 2px 4px rgba(0,0,0,.06), 0 16px 40px rgba(0,30,45,.12);
  --ease: cubic-bezier(.2,.7,.3,1);
  --maxw: 1120px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; color: var(--ink); margin: 0; }
p { margin: 0; }
a { color: var(--mission-blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 40px 0; }
.stack > * + * { margin-top: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; gap: 24px;
  height: 64px; max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__logo { height: 34px; width: auto; }
.brand__wordmark { display: flex; flex-direction: column; line-height: 1; }
.brand__wordmark b {
  font-family: var(--font-head); font-weight: 600; font-size: 12px;
  letter-spacing: .14em; color: var(--mission-blue);
}
.brand__name {
  font-family: var(--font-head); font-weight: 600; font-size: 18px;
  color: var(--ink); letter-spacing: -.01em;
}
.brand__sep { width: 1px; height: 26px; background: var(--soft-grey); }

.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a {
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  padding: 8px 12px; border-radius: var(--radius-sm); text-decoration: none;
  transition: color .15s var(--ease), background .15s var(--ease);
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--surface); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--mission-blue-700); background: var(--mission-blue-050); }

.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: 40px; height: 40px; cursor: pointer; color: var(--ink); }

/* ---------- Auth (Entra ID sign-in) ---------- */
/* Hide everything until the sign-in handshake resolves (set in auth.js). */
html.pm-auth-pending body { visibility: hidden; }

.nav__auth { display: inline-flex; align-items: center; gap: 10px; }
.nav__auth:not(:empty) { margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--border); }
.nav__user { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.nav__avatar {
  flex: none; width: 28px; height: 28px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mission-blue); color: #fff;
  font-family: var(--font-head); font-weight: 600; font-size: 11px; letter-spacing: .02em;
}
.nav__username {
  font-size: 14px; font-weight: 500; color: var(--ink);
  max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav__signout {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.nav__signout:hover { color: var(--ink); border-color: var(--soft-grey); }

/* ---------- Page intro ---------- */
.page-intro { padding: 40px 0 8px; }
.page-intro h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.02em; }
.page-intro p { color: var(--text-muted); max-width: 64ch; margin-top: 10px; font-size: 17px; }
.eyebrow {
  font-family: var(--font-head); font-weight: 600; font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--mission-blue); margin-bottom: 10px;
}

/* ---------- Search + filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 24px 0 8px; }
.search {
  flex: 1 1 320px; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 10px 16px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.search:focus-within { border-color: var(--mission-blue); box-shadow: 0 0 0 3px var(--mission-blue-050); }
.search svg { flex: none; color: var(--text-muted); }
.search input { border: none; background: none; outline: none; width: 100%; font-size: 15px; color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border);
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: all .15s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--soft-grey); }
.chip[aria-pressed="true"] { background: var(--mission-blue); border-color: var(--mission-blue); color: #fff; }

/* ---------- Tool grid (launchpad) ---------- */
.tool-grid {
  display: grid; gap: 18px; margin-top: 24px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; text-decoration: none; color: inherit;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.tool-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: transparent; }
.tool-card__icon {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: var(--mission-blue-050); color: var(--mission-blue-700);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.tool-card:hover .tool-card__icon { background: var(--mission-blue); color: #fff; }
.tool-card h3 { font-size: 18px; }
.tool-card p { color: var(--text-muted); font-size: 14px; }
.tool-card__foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 6px; }
.tool-card__cta { font-size: 14px; font-weight: 600; color: var(--mission-blue-700); }
.badge {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted);
}
.badge--soon { background: #fff4e0; color: #9a6400; }
.badge--live { background: var(--mission-blue-050); color: var(--mission-blue-700); }

/* ---------- Content lists (change log / specs / sops / templates) ---------- */
.list { margin-top: 20px; display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--border); }
.row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: start;
  padding: 18px 4px; border-bottom: 1px solid var(--border);
  transition: background .15s var(--ease);
}
.row:hover { background: var(--surface); }
.row__main { min-width: 0; }
.row__title { font-family: var(--font-head); font-weight: 600; font-size: 17px; color: var(--ink); }
.row__title a { color: inherit; }
.row__meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 6px; color: var(--text-muted); font-size: 13px; }
.row__meta b { color: var(--text); font-weight: 600; }
.row__desc { margin-top: 8px; color: var(--text-muted); font-size: 14.5px; max-width: 80ch; }
.row__aside { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.tag {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-muted); white-space: nowrap;
}
.tag--added   { background: #e6f6ec; color: #1f7a44; }
.tag--changed { background: var(--mission-blue-050); color: var(--mission-blue-700); }
.tag--fixed   { background: #fdeede; color: #9a6400; }
.tag--removed { background: #fce8e8; color: #b03030; }

.open-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: var(--mission-blue-700); white-space: nowrap;
}
.open-link svg { width: 14px; height: 14px; }

/* ---------- Sample / empty / callout ---------- */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--mission-blue-050); border: 1px solid #bfeafb;
  border-radius: var(--radius); padding: 14px 18px; color: #0b5e7e; font-size: 14px;
  margin-top: 24px;
}
.notice svg { flex: none; margin-top: 2px; }
.sample-flag {
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: #9a6400; background: #fff4e0; padding: 2px 8px; border-radius: 5px;
}
.empty { padding: 48px 24px; text-align: center; color: var(--text-muted); }

/* ---------- Coming soon (pricing) ---------- */
.coming {
  margin-top: 28px; border: 1px dashed var(--soft-grey); border-radius: var(--radius);
  padding: 48px 32px; text-align: center; background: var(--surface);
}
.coming__icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 16px;
  display: grid; place-items: center; background: var(--mission-blue-050); color: var(--mission-blue-700); }
.coming h2 { font-size: 24px; }
.coming p { color: var(--text-muted); max-width: 56ch; margin: 12px auto 0; }
.coming ul { text-align: left; max-width: 44ch; margin: 22px auto 0; color: var(--text-muted); padding-left: 20px; }
.coming li { margin: 6px 0; }

/* ---------- Prose (guide) ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 24px; margin-top: 40px; }
.prose h3 { font-size: 18px; margin-top: 28px; }
.prose p, .prose li { color: var(--text); }
.prose p { margin-top: 12px; }
.prose ul, .prose ol { margin-top: 12px; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px;
  background: var(--surface-2); padding: 2px 6px; border-radius: 5px;
}
.prose pre {
  background: #0d1b22; color: #e6f0f4; border-radius: var(--radius); padding: 18px 20px;
  overflow-x: auto; margin-top: 16px; font-size: 13.5px; line-height: 1.6;
}
.prose pre code { background: none; padding: 0; color: inherit; }
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps li { position: relative; padding-left: 44px; margin: 18px 0; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px; width: 30px; height: 30px;
  background: var(--mission-blue); color: #fff; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; font-size: 14px;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 64px; background: var(--surface); }
.site-footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 24px;
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center;
  color: var(--text-muted); font-size: 13.5px;
}
.site-footer__inner .brand__name { font-size: 15px; }
.site-footer a { color: var(--text-muted); }
.site-footer .spacer { margin-left: auto; }

/* ---------- Motion: reveal on scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(14px); }
[data-reveal].is-in { opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.tool-grid [data-reveal].is-in { transition-delay: var(--d, 0ms); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 2px;
    background: #fff; border-bottom: 1px solid var(--border); padding: 12px 16px;
    transform: translateY(-120%); transition: transform .25s var(--ease); align-items: stretch;
  }
  .nav.is-open { transform: none; box-shadow: var(--shadow); }
  .nav a { padding: 12px; }
  /* Auth chip: stack full-width with a top divider instead of a left one. */
  .nav__auth { flex-direction: column; align-items: stretch; gap: 8px; }
  .nav__auth:not(:empty) { margin: 6px 0 0; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--border); }
  .nav__user { padding: 4px 12px; }
  .nav__username { max-width: none; }
  .nav-toggle { display: grid; place-items: center; }
  .row { grid-template-columns: 1fr; }
  .row__aside { flex-direction: row; align-items: center; flex-wrap: wrap; }
}
