/* Portal-specific additions on top of portal.css (the mockup's styles).
   The strict CSP forbids inline style attributes, so the mockup's inline styles live here. */

/* The hidden attribute must win over component display rules such as .field { display: flex }. */
[hidden] {
  display: none !important;
}
.kg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.logo-link .kg-logo {
  height: 40px;
  width: auto;
  color: var(--kg-black);
}

/* Environment strip: the "Dev" or "Shadow mode" pill (spec section 3), styled like the mockup's sample-data strip */
.env-strip .wrap {
  min-height: 40px;
}

/* Sign-in card frame, from the mockup's effects block (the rest is at the end of this file) */
.signin .signin-card {
  position: relative;
  background: var(--kg-white);
  border: 1px solid var(--kg-rule);
  border-radius: 6px;
  padding: 40px 36px 28px;
  width: 100%;
}
.signin-card .kg-logo-v {
  width: 120px;
  height: auto;
  color: var(--kg-black);
}

/* Utilities replacing the mockup's inline styles */
.btn-block {
  width: 100%;
}
.mt-12 {
  margin-top: 12px;
}
.mt-24 {
  margin-top: 24px;
}
.inline-form {
  display: inline;
  margin: 0;
}

/* Sign out lives in the user chip on wide screens and in the menu on narrow ones,
   where the mockup hides the chip's text (portal.css, max-width 960px) */
.primary-nav .nav-signout {
  display: none;
}
@media (max-width: 960px) {
  .primary-nav .nav-signout {
    display: block;
    padding: 8px 12px;
  }
}

/* Dev persona switcher: the mockup's "Preview as" plus a Switch button (works without JS).
   On narrow screens it takes the full row and the select shrinks to fit. */
.env-strip .preview-as {
  max-width: 100%;
}
@media (max-width: 720px) {
  .env-strip .preview-as {
    width: 100%;
  }
  .env-strip .preview-as select {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }
}

/* Recommendation for Hire form, review and confirmation (mockup inline styles moved here) */
.lede {
  margin: 8px 0 24px;
}
.lead {
  font-size: 18px;
}
.narrow {
  max-width: 760px;
}
.m-0 {
  margin: 0;
}
.mt-8 {
  margin-top: 8px;
}
.mb-16 {
  margin-bottom: 16px;
}
.strong {
  font-weight: 600;
}
.font-normal {
  font-weight: 400;
}
.text-black {
  color: var(--kg-black);
}
.note-count {
  font-weight: 600;
}
.plain-list {
  margin: 0;
  padding-left: 18px;
}
.error-summary {
  border-color: var(--kg-critical);
  background: var(--kg-white);
  margin-bottom: 24px;
}
.error-summary .note-label {
  color: var(--kg-critical);
}
.posting-row {
  flex-wrap: nowrap;
  gap: 8px;
}
.posting-row .input {
  flex: 1;
  min-width: 0;
}
/* Responsibilities grouped under the posting's own subheadings (decision D28) */
.resp-group-title {
  font-weight: 600;
  color: var(--kg-black);
  margin: 12px 0 0;
}
.resp-group:first-child .resp-group-title {
  margin-top: 0;
}
@media (max-width: 720px) {
  .posting-row {
    flex-wrap: wrap;
  }
}

/* ---------- Request detail page (mockup 6.3) ---------- */
/* The viewer's tabs are links so they work without JS; style them like the mockup's buttons. */
.viewer-tabs a {
  padding: 12px;
  font: 600 15px var(--kg-font);
  color: var(--kg-slate);
  position: relative;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.viewer-tabs a[aria-selected='true'] {
  color: var(--kg-black);
}
.viewer-tabs a[aria-selected='true']::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 3px;
  background: var(--kg-blue);
}
.viewer-tab-label {
  padding: 12px;
  font-weight: 600;
  color: var(--kg-black);
}
.viewer-stage.viewer-stage-pdf {
  padding: 0;
  max-height: none;
  overflow: hidden;
}
.viewer-frame {
  display: block;
  width: 100%;
  height: min(80vh, 920px);
  border: 0;
  background: var(--kg-white);
}
.rec-toolbar [aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}
.decision-comment {
  margin-bottom: 16px;
}
.label-note {
  font-weight: 400;
}
.panel-title {
  font-size: 21px;
}
.toast .icon {
  flex: none;
}
@media (max-width: 720px) {
  .viewer-frame {
    height: 60vh;
  }
}

/* ---------- Pipeline (mockup 6.4) ---------- */
/* Filters and sorting are links (GET), so they work without JS; style them like the mockup's buttons. */
.seg a {
  padding: 10px 12px;
  font: 600 15px var(--kg-font);
  color: var(--kg-slate);
  position: relative;
  min-height: 44px;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.seg a::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 3px;
  background: transparent;
}
.seg a[aria-current='page'] {
  color: var(--kg-black);
}
.seg a[aria-current='page']::after {
  background: var(--kg-blue);
}
a.sort-btn {
  text-decoration: none;
}
.flag-list summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--kg-blue-ink);
  white-space: nowrap;
}
.flag-list ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 14px;
  white-space: normal;
}
.assign-row {
  gap: 8px;
  flex-wrap: nowrap;
}
.assign-row .input {
  min-width: 150px;
}
.copy-link {
  margin-left: 4px;
}
.recruiter-tools {
  border-top: 1px solid var(--kg-rule);
  padding-top: 16px;
}
.recruiter-tools summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--kg-black);
}
.recruiter-tools details + details {
  margin-top: 12px;
}
.recruiter-tools form {
  margin-top: 12px;
}
.assign-row-detail {
  align-items: flex-end;
  gap: 12px;
}
.assign-row-detail .grow {
  flex: 1;
  min-width: 200px;
}
.status-actions {
  gap: 8px 12px;
}

/* ---------- WCAG 2.1 AA contrast on tinted surfaces (decision D52) ---------- */
/* --kg-blue-ink (#007AA3) is 4.3:1 on --kg-blue-mist; text needs 4.5:1. One darker step of the same
   blue is used for text on the mist surface only. The mockup's tokens themselves are unchanged. */
:root {
  --kg-blue-ink-on-mist: #00698c;
}
.note .note-label,
.note a {
  color: var(--kg-blue-ink-on-mist);
}

/* ============================================================
   3D effects layer (three.js, D58), from the mockup's #fx-style. Additive: src/public/js/fx.js
   adds the canvases, and the portal works the same without them (reduced motion, no WebGL).
   ============================================================ */
.blue-field {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.blue-field .wrap {
  position: relative;
  z-index: 1;
  min-height: 300px;
}
.fx-canvas-host {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.fx-canvas-host canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.fx-hero-host {
  opacity: 0;
  transition: opacity 600ms var(--ease);
}
.fx-hero-host.on {
  opacity: 1;
}
@media (max-width: 720px) {
  .blue-field .wrap {
    min-height: 240px;
  }
  .fx-hero-host.on {
    opacity: 0.45;
  }
}
.signin {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.signin .signin-card {
  position: relative;
  z-index: 1;
}
.fx-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  pointer-events: none;
  display: none;
}
.fx-overlay.on {
  display: block;
}
.fx-overlay canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
