/* The signed-in area.
 *
 * Deliberately a different room from the public site: same typography and
 * colour, tighter rhythm, a persistent identity strip. Someone who is signed in
 * should be able to tell at a glance, without reading anything, that they are
 * looking at their own record rather than at marketing.
 *
 * Loaded after nbop.css and interactive.css, and reuses their tokens rather
 * than redefining any.
 */

/* ---------- portal chrome ---------- */

.portal-bar {
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--navy);
}
.portal-bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  flex-wrap: wrap;
}
.portal-bar a { color: #fff; }
.portal-bar .mark {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.portal-bar .mark span {
  display: block;
  font-weight: 500;
  letter-spacing: 0.1em;
  font-size: 0.62rem;
  opacity: 0.62;
  margin-top: 0.15rem;
}
.portal-bar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.portal-bar nav a {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.72;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}
.portal-bar nav a:hover { opacity: 1; }
.portal-bar nav a[aria-current="page"] { opacity: 1; border-bottom-color: #fff; }
.portal-bar .who {
  font-size: 0.78rem;
  opacity: 0.72;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.portal-bar .who button {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}
.portal-bar .who button:hover { border-color: #fff; }

/* ---------- state ---------- */

.stage {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--navy);
  padding: 1.5rem 1.7rem;
  margin: 0 0 2rem;
  background: var(--paper-warm);
}
.stage h2 { margin-top: 0; }
.stage p:last-child { margin-bottom: 0; }

.stage.good { border-left-color: #1d6b45; }
.stage.warn { border-left-color: #8a6412; }
.stage.stop { border-left-color: #8c2b2b; }

.steps { list-style: none; margin: 2rem 0; padding: 0; }
.steps li {
  display: flex;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule-soft);
  align-items: baseline;
}
.steps li:last-child { border-bottom: 0; }
.steps .n {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  min-width: 4.6rem;
  text-transform: uppercase;
  flex-shrink: 0;
}
.steps .t { flex: 1; }
.steps .t b { display: block; }
.steps .t small { color: var(--ink-faint); }
.steps li.done .t b { color: var(--ink-faint); text-decoration: line-through; }
.steps li.now { background: var(--paper-warm); margin: 0 -0.9rem; padding-left: 0.9rem; padding-right: 0.9rem; }

/* ---------- credential card ---------- */

.credcard {
  border: 1px solid var(--ink);
  padding: 1.8rem;
  margin: 1.5rem 0 2rem;
  background: var(--paper);
}
.credcard .cn {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  color: var(--navy);
  display: block;
}
.credcard .rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem 1.6rem;
  margin-top: 1.4rem;
  border-top: 1px solid var(--rule-soft);
  padding-top: 1.2rem;
}
.credcard .rows div span {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.25rem;
}

/* ---------- endorsements ---------- */

.endorsements { display: grid; gap: 1.1rem; margin: 1.5rem 0 2rem; }
.endorsement {
  border: 1px solid var(--rule);
  padding: 1.2rem 1.4rem;
}
.endorsement.held { border-left: 3px solid var(--navy); background: var(--paper-warm); }
.endorsement h3 { margin: 0 0 0.4rem; }
.endorsement .asserts { margin: 0 0 0.8rem; }
.endorsement .gate {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.endorsement ul { margin: 0.6rem 0 0.9rem 1.1rem; padding: 0; }
.endorsement li { margin-bottom: 0.25rem; }

/* ---------- forms in the portal ---------- */

.pf { max-width: var(--measure); }
.pf label {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 1.3rem 0 0.35rem;
}
.pf input[type="text"],
.pf input[type="email"],
.pf input[type="password"],
.pf select,
.pf textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
}
.pf input:focus, .pf select:focus, .pf textarea:focus {
  outline: 2px solid var(--navy);
  outline-offset: -1px;
}
.pf textarea { min-height: 7rem; resize: vertical; }
.pf .hint { font-size: 0.88rem; color: var(--ink-faint); margin: 0.35rem 0 0; }

.toggle {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.toggle:last-of-type { border-bottom: 0; }
.toggle input { margin-top: 0.25rem; flex-shrink: 0; width: 1.05rem; height: 1.05rem; }
.toggle .tx b { display: block; }
.toggle .tx small { color: var(--ink-faint); }

.msg { padding: 0.9rem 1.1rem; margin: 1.2rem 0; border: 1px solid var(--rule); }
.msg.err { border-color: #8c2b2b; color: #7a2323; background: #fdf7f7; }
.msg.ok { border-color: #1d6b45; color: #175637; background: #f5faf7; }

.rowbtns { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.6rem; }

.loading { color: var(--ink-faint); font-style: italic; }

@media (max-width: 40rem) {
  .portal-bar .wrap { align-items: flex-start; }
  .portal-bar nav ul { gap: 1rem; }
  .credcard { padding: 1.2rem; }
  .stage { padding: 1.2rem 1.1rem; }
  .steps li { flex-direction: column; gap: 0.2rem; }
  .steps .n { min-width: 0; }
}