/*
 * Pair design system — minimal but opinionated.
 *
 * The look matches the development branch: warm paper background, deep
 * forest-green brand, serif headlines (Georgia), 8px radii, no shadows.
 * Bootstrap 5 is loaded from CDN; this file overrides just enough of it
 * (buttons, forms, navbar) to land the brand without a full theme rebuild.
 *
 * Layout-specific helpers (`.pair-*`) are restyled in place so the existing
 * views (jobs, profile, dashboard, login, onboarding) inherit the new theme
 * without markup changes.
 */

/* -------------------------------------------------- 1. Design tokens */
:root {
  /* Warm "paper" page background. Cards and the navbar stay on `--surface`
     (white) so they pop ever so slightly against the page. */
  --page: #f7f7f4;
  --surface: #ffffff;
  --ink: #172119;
  --ink-soft: #2b3a30;
  --brand: #173d2b;
  --brand-strong: #0f2c1f;
  --muted: #626962;
  --line: #e2e2db;
  --tile: #ededea;
  --tile-warm: #f0f0eb;
  --danger: #8d2f2f;
  --success: #1d5b40;
  --warning: #5f6328;
  --focus: #315a44;
  --radius: 8px;
  --radius-pill: 999px;

  --pair-accent: var(--brand);
  --pair-accent-soft: var(--tile);
  --pair-surface: var(--page);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }

::selection { background: var(--brand); color: var(--surface); }

/* -------------------------------------------------- 2. Typography helpers */
.serif,
h1, h2, h3, h4, .pair-card h2, .pair-card h3, .pair-card h4, .pair-card h5,
.pair-hero h1 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: 0;
}

.pair-kicker {
  display: inline-block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.text-secondary,
.text-muted { color: var(--muted) !important; }

.text-brand { color: var(--brand) !important; }

/* -------------------------------------------------- 3. Global navbar */
#pair-nav.navbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  padding: 12px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

#pair-nav .container-fluid {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0;
}

#pair-nav .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin: 0;
}

#pair-nav .navbar-brand img { display: none; }

.brand-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brand);
  line-height: 1;
}

#pair-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.pair-nav-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 2px;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 120ms ease, border-color 120ms ease;
}

.pair-nav-link:hover,
.pair-nav-link:focus-visible,
.pair-nav-link.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.pair-nav-link.is-secondary { color: var(--muted); }

.pair-nav-signout {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

.pair-nav-signout:hover,
.pair-nav-signout:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
}

.pair-nav-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}

.pair-nav-help:hover,
.pair-nav-help:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
}

.pair-nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.pair-nav-chip-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.pair-nav-chip-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

@media (max-width: 720px) {
  #pair-nav-actions { gap: 10px; }
  .pair-nav-chip-label { display: none; }
  .pair-nav-link { font-size: 13px; }
  .brand-mark { font-size: 22px; }
}

/* -------------------------------------------------- 4. App shell */
#pair-app.container-fluid {
  width: min(1160px, calc(100% - 32px));
  max-width: none;
  margin: 0 auto;
  padding: 28px 0 64px;
}

/* -------------------------------------------------- 5. Cards & panels */
.pair-card,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: none !important;
  color: var(--ink);
}

.pair-card h2,
.pair-card h3,
.pair-card h4,
.pair-card h5,
.card h2,
.card h3,
.card h4,
.card h5 {
  margin-top: 0;
}

.pair-card .small,
.pair-card small {
  color: var(--muted);
}

/* -------------------------------------------------- 6. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  box-shadow: none !important;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.btn-sm {
  min-height: 34px;
  padding: 0.35rem 0.85rem;
  font-size: 13px;
}

.btn-lg {
  min-height: 50px;
  padding: 0.75rem 1.5rem;
  font-size: 16px;
}

.btn-primary,
.btn-dark {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: var(--surface) !important;
}

.btn-primary:hover,
.btn-primary:focus-visible,
.btn-dark:hover,
.btn-dark:focus-visible {
  background: var(--brand-strong) !important;
  border-color: var(--brand-strong) !important;
  color: var(--surface) !important;
}

.btn-outline-primary,
.btn-outline-dark,
.btn-outline-secondary {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  color: var(--ink) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus-visible,
.btn-outline-dark:hover,
.btn-outline-dark:focus-visible,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
  border-color: var(--brand) !important;
  color: var(--brand) !important;
  background: var(--surface) !important;
}

.btn-link {
  color: var(--muted) !important;
  text-decoration: none;
  border: 0;
  min-height: 34px;
  padding: 0.25rem 0.5rem;
}

.btn-link:hover,
.btn-link:focus-visible { color: var(--brand) !important; }

.btn:focus,
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--focus) !important;
}

.btn:disabled,
.btn.disabled { opacity: 0.55; cursor: not-allowed; }

/* -------------------------------------------------- 7. Forms */
.form-control,
.form-select {
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgba(49, 90, 68, 0.18);
  outline: none;
}

textarea.form-control { min-height: 120px; resize: vertical; }

.form-label {
  margin-bottom: 6px;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
}

.form-text { color: var(--muted); }

.pair-form-error { min-height: 1.25rem; }

.input-group .btn,
.input-group .form-control { z-index: auto; }

/* nav-pills used in login pages */
.nav-pills {
  background: var(--tile);
  border-radius: var(--radius);
  padding: 4px;
  border: 1px solid var(--line);
  gap: 4px;
}

.nav-pills .nav-link {
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted);
  font-weight: 700;
  padding: 0.45rem 0.75rem;
}

.nav-pills .nav-link.active {
  background: var(--surface) !important;
  color: var(--brand) !important;
  box-shadow: none;
}

/* -------------------------------------------------- 8. Auth shells */
.pair-auth-shell {
  width: min(540px, 100%);
  margin: 24px auto 0;
}

.pair-auth-shell .pair-card { padding: 32px; }

.pair-auth-shell h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

/* "or" rule between OAuth buttons and the email form. Same pattern as the
   development branch: 1fr | label | 1fr grid with hairlines drawn via
   ::before/::after pseudo-elements. */
.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

/* LinkedIn OAuth button. Bootstrap's `btn btn-light` already gives us the
   neutral surface; we just centre the icon + label and supply the brand
   "in" mark since we don't want to depend on an SVG asset. */
.button-linkedin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.linkedin-mark {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: var(--brand);
  color: var(--surface);
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
}

/* -------------------------------------------------- 9. Landing page */
.pair-landing {
  display: grid;
  align-content: center;
  gap: 48px;
  min-height: calc(100vh - 156px);
}

.pair-landing .pair-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 42px;
  align-items: center;
  padding: 8px 0 0;
}

.pair-landing .pair-hero-copy {
  display: grid;
  gap: 22px;
  max-width: 560px;
}

.pair-landing .pair-hero-copy h1 {
  margin: 0;
  color: var(--brand);
  font-size: clamp(2.4rem, 4.6vw, 3.5rem);
  letter-spacing: -0.005em;
  line-height: 1.05;
}

.pair-landing .pair-hero-lead {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  max-width: 520px;
}

.pair-landing .pair-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pair-landing .pair-hero-mark {
  justify-self: center;
  width: min(360px, 100%);
}

.pair-landing .pair-hero-mark img {
  display: block;
  width: 100%;
  height: min(34vw, 320px);
  min-height: 220px;
  object-fit: contain;
  object-position: center;
  /* The PNG ships with a single accent — nudge it toward forest green so
     it matches the palette without a redraw. */
  filter: hue-rotate(-32deg) saturate(0.72) contrast(1.05);
  mix-blend-mode: multiply;
  opacity: 0.9;
}

/* Two role-choice cards (logged-out CTA row) */
.pair-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.pair-role-card {
  display: grid;
  align-content: space-between;
  gap: 18px;
  min-height: 200px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 140ms ease, color 140ms ease;
}

.pair-role-card:hover,
.pair-role-card:focus-visible {
  border-color: var(--brand);
  color: var(--ink);
}

.pair-role-card-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.pair-role-card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.pair-role-card-cta {
  margin: 0;
  align-self: end;
  color: var(--brand);
  font-weight: 700;
}

/* "How Pair Works" steps section */
.pair-steps {
  display: grid;
  gap: 24px;
}

.pair-steps-header {
  display: grid;
  gap: 8px;
  max-width: 680px;
}

.pair-steps-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
}

.pair-steps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
}

.pair-steps-section { display: grid; gap: 20px; }

.pair-step-list { display: grid; gap: 22px; }

.pair-step-item {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.pair-step-item h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
}

.pair-step-item p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 860px) {
  .pair-landing {
    align-content: start;
    gap: 40px;
    min-height: auto;
  }

  .pair-landing .pair-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: left;
  }

  .pair-landing .pair-hero-mark {
    justify-self: start;
    width: min(260px, 100%);
  }

  .pair-landing .pair-hero-mark img { height: 200px; min-height: 0; }

  .pair-role-grid,
  .pair-steps-grid {
    grid-template-columns: 1fr;
  }

  .pair-landing .pair-hero-copy h1 { font-size: clamp(2rem, 7vw, 2.6rem); }
}

/* -------------------------------------------------- 10. Jobs split-pane */
.pair-jobs-split {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 992px) {
  .pair-jobs-split {
    grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
  }

  /* Detail pane: sticky next to the list AND capped at viewport height
     so a long job description scrolls inside the pane instead of pushing
     the apply button off-screen. */
  .pair-jobs-detail {
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 5rem - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

@media (max-width: 991.98px) {
  /* On small screens the list stays inline and the selected job opens in
     a full-screen modal, so the desktop detail pane disappears entirely. */
  .pair-jobs-detail {
    display: none;
  }
  .pair-job-modal .modal-dialog {
    margin: 0 !important;
    max-width: none !important;
    width: 100vw !important;
    height: 100% !important;
  }
  .pair-job-modal .modal-content {
    border: 0 !important;
    border-radius: 0 !important;
    height: 100% !important;
  }
}

.pair-job-modal .modal-body {
  /* Modal-shell inset: keeps the detail card clear of the viewport edge. */
  padding: 24px 28px 36px !important;
  background: var(--page);
}

.pair-job-modal .modal-body .pair-card {
  border: 0;
  box-shadow: none;
  /* Inner card gutter so the badge/header/apply row stay off the edge. */
  padding: 18px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pair-job-modal .modal-body .pair-card > * {
  margin-bottom: 0 !important;
}

/* Keep the title/close affordance aligned with the body inset. */
.pair-job-modal .modal-header {
  padding: 18px 24px;
}

.pair-job-modal .modal-dialog-scrollable .modal-body {
  overscroll-behavior: contain;
}

.pair-jobs-split .min-w-0 { min-width: 0; }

/* Job card "frame": the artwork (or a neutral tile when there's no GenUI
   tag) sits on the outer card and wraps the inner white card with a 14px
   pattern border. This keeps every card visually consistent whether or not
   the LLM produced an artwork tag. */
.pair-job-frame {
  position: relative;
  display: block;
  cursor: pointer;
  border-radius: calc(var(--radius) + 4px);
  padding: 14px;
  background: var(--tile);
  border: 1px solid var(--line);
  transition: transform 120ms ease, box-shadow 160ms ease,
    border-color 160ms ease;
  overflow: hidden;
}

.pair-job-frame:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 55%, transparent);
  outline-offset: 2px;
}

.pair-job-frame:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 44, 31, 0.08);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}

.pair-job-frame.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), 0 6px 18px rgba(15, 44, 31, 0.10);
}

.pair-job-frame-bg {
  position: absolute;
  inset: 0;
  background-color: var(--tile);
  background-repeat: repeat;
  background-position: center;
  background-size: auto;
  opacity: 0.85;
  z-index: 0;
}

.pair-job-frame.has-artwork .pair-job-frame-bg {
  /* Recolor the SVG patterns toward the brand palette so they read as one
     family rather than seven different stock vectors. */
  filter: hue-rotate(95deg) saturate(0.55) contrast(0.95);
  mix-blend-mode: multiply;
  opacity: 0.7;
}

.pair-job-frame-inner {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 1px 0 rgba(15, 44, 31, 0.04);
}

.pair-job-frame-inner .min-w-0 { min-width: 0; }

/* "Applied" chip shown on the card next to the company name when the
   student has already submitted an application for that job. */
.pair-applied-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
  padding: 0.05rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-pill, 999px);
  color: #1f6b3a;
  background: color-mix(in srgb, #1f6b3a 12%, var(--surface));
  border: 1px solid color-mix(in srgb, #1f6b3a 25%, var(--line));
  letter-spacing: 0.02em;
}

.pair-applied-chip-tick {
  font-size: 0.85em;
  line-height: 1;
}

.pair-job-frame.is-applied .pair-job-frame-inner {
  background: color-mix(in srgb, #1f6b3a 4%, var(--surface));
}

/* Prominent circular match-score badge on the right of every card. */
.pair-match-score {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  --score-bg: var(--brand);
  --score-fg: #ffffff;
  --score-glow: rgba(23, 61, 43, 0.22);
}

.pair-match-score[data-tier="strong"] { --score-bg: var(--brand); }
.pair-match-score[data-tier="good"]   { --score-bg: #2f7a52; }
.pair-match-score[data-tier="fair"]   { --score-bg: #b88a1f; --score-glow: rgba(184, 138, 31, 0.28); }
.pair-match-score[data-tier="low"]    { --score-bg: #8a8f86; --score-glow: rgba(98, 105, 98, 0.25); }

.pair-match-score-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--score-bg);
  color: var(--score-fg);
  display: grid;
  place-items: center;
  line-height: 1;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px var(--score-glow),
    inset 0 0 0 2px rgba(255, 255, 255, 0.12);
  font-feature-settings: "tnum" 1;
  text-align: center;
}

.pair-match-score-value {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  display: inline-block;
}

.pair-match-score-pct {
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 1px;
  opacity: 0.9;
  vertical-align: baseline;
}

.pair-match-score-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Indeterminate progress bar shown while we wait for /api/jobs and (on
   Layout B) the GenUI personalization pass. */
.pair-loading-banner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.pair-progress-track {
  position: relative;
  height: 4px;
  background: var(--tile);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.pair-progress-bar {
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--brand) 50%,
    transparent 100%
  );
  animation: pair-progress-slide 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes pair-progress-slide {
  0%   { left: -40%; }
  100% { left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .pair-progress-bar {
    animation: none;
    left: 0;
    width: 30%;
    opacity: 0.7;
  }
}

/* Skeleton loading cards shown while we wait for /api/jobs (and for the
   GenUI personalization pass on Layout B). Keeps the page from flashing
   plain → personalized. */
.pair-job-skeleton {
  pointer-events: none;
}

.pair-skeleton-line {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--tile) 0%,
    var(--tile-warm) 50%,
    var(--tile) 100%
  );
  background-size: 200% 100%;
  animation: pair-skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes pair-skeleton-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pair-skeleton-line { animation: none; }
}

/* GenUI emphasis chips on job detail */
.pair-emphasis {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-pill);
  background: var(--tile);
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
}

.pair-emphasis-active {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 1px 0 rgba(23, 61, 43, 0.04),
    inset 0 0 0 1px rgba(23, 61, 43, 0.08);
}

.pair-emphasis-icon {
  margin-right: 0.3rem;
  font-size: 0.85em;
  filter: grayscale(0.15);
}

/* ----- Layout B: rich GenUI detail pane -------------------------------- */

.pair-detail-rich {
  position: relative;
}

/* Subtle accent strip on the left edge to signal the curated view. */
.pair-detail-rich::before {
  content: "";
  position: absolute;
  inset: 16px auto 16px 0;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    var(--brand) 0%,
    color-mix(in srgb, var(--brand) 50%, transparent) 100%
  );
  opacity: 0.85;
}

.pair-genui-section-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin: 0 0 0.6rem;
}

.pair-genui-skill-count {
  font-family: var(--bs-font-sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
}

/* Personalised summary card */
.pair-genui-summary {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--brand) 5%, var(--surface)) 0%,
    var(--surface) 100%
  );
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.pair-genui-summary-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 0.25rem;
}

.pair-genui-summary-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink);
}

/* Why-this-fits-you reasons */
.pair-genui-reasons {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 0.95rem;
}

.pair-genui-reason-list {
  display: grid;
  gap: 0.45rem;
}

.pair-genui-reason-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 0.5rem;
  font-size: 0.92rem;
  line-height: 1.4;
  color: var(--ink);
}

.pair-genui-reason-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  margin-top: 1px;
  border: 1px solid color-mix(in srgb, var(--success) 28%, transparent);
}

/* Skill chips, with a "matched against your CV" treatment */
.pair-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--tile);
  color: var(--muted);
  border: 1px solid var(--line);
  line-height: 1;
}

.pair-skill-chip.is-matched {
  background: color-mix(in srgb, var(--success) 10%, var(--surface));
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 18%, transparent);
}

.pair-skill-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

/* Collapsible full description */
.pair-genui-description {
  border-top: 1px dashed var(--line);
  padding-top: 0.85rem;
}

.pair-genui-description-toggle {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem 0.3rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line));
  transition: background-color 120ms ease, border-color 120ms ease;
}

.pair-genui-description-toggle::-webkit-details-marker { display: none; }
.pair-genui-description-toggle:hover {
  background: color-mix(in srgb, var(--brand) 11%, var(--surface));
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
}

.pair-genui-description-toggle-icon {
  display: inline-block;
  transition: transform 160ms ease;
}

details[open] > .pair-genui-description-toggle .pair-genui-description-toggle-icon {
  transform: rotate(180deg);
}

.pair-genui-description-body {
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.55;
  /* Cap the description height so long postings stay scrollable inside
     the sticky detail card instead of pushing the apply button below
     the viewport. */
  max-height: min(50vh, 28rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  /* pre-wrap preserves the paragraph breaks the company entered, but we
     do NOT want it to preserve the template-literal indentation that
     wrapped the content in markup; the JS therefore trims the string and
     emits it with no surrounding whitespace inside this div. */
  white-space: pre-wrap;
}

.pair-company-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Refund link on the unlocked applicant card. The previous "muted text
   wrapping a default-styled <a>" rendered as flat gray on the cream
   background and didn't read as clickable; this gives it a real link
   color + hover underline so recruiters can find it. */
.pair-refund-link {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: rgba(36, 92, 53, 0.32);
  text-underline-offset: 2px;
  font-weight: 500;
}
.pair-refund-link:hover,
.pair-refund-link:focus {
  color: var(--brand);
  text-decoration-color: var(--brand);
}

/* -------------------------------------------------- 11. Modals (Bootstrap) */
.modal-content {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px -34px rgba(23, 33, 25, 0.42);
}

.modal-header,
.modal-footer {
  border-color: var(--line);
}

.modal-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  color: var(--ink);
}

/* -------------------------------------------------- 12. Misc utilities */
.alert {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--tile);
  color: var(--ink);
}

.alert-warning {
  background: #fbf6e6;
  border-color: #e3d790;
  color: #5f5012;
}

.alert-danger {
  background: #fbecec;
  border-color: #e3b9b9;
  color: #6e2424;
}

.alert-success {
  background: #e8f3ec;
  border-color: #afd2bb;
  color: #1d4f37;
}

hr { border-color: var(--line); opacity: 1; }

.badge {
  font-weight: 700;
  border-radius: var(--radius);
  padding: 0.35em 0.6em;
}

.badge.bg-light { background: var(--tile) !important; color: var(--muted) !important; }
.badge.bg-primary { background: var(--brand) !important; color: var(--surface) !important; }
.badge.bg-success-subtle { background: #e8f3ec !important; }
.badge.text-success-emphasis { color: var(--success) !important; }
.badge.bg-secondary-subtle { background: var(--tile) !important; }
.badge.text-secondary-emphasis { color: var(--muted) !important; }
.badge.bg-primary-subtle { background: var(--tile-warm) !important; }
.badge.text-primary-emphasis { color: var(--brand) !important; }

/* -------------------------------------------------- 13. List groups */
.list-group {
  border-radius: var(--radius);
  overflow: hidden;
}

.list-group-item {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  padding: 14px 16px;
  transition: background 120ms ease, border-color 120ms ease;
}

.list-group-item-action:hover,
.list-group-item-action:focus-visible {
  background: var(--tile);
  color: var(--ink);
}

.list-group-item.active,
.list-group-item-action.active {
  background: var(--surface) !important;
  color: var(--brand) !important;
  border-color: var(--brand) !important;
  box-shadow: inset 4px 0 0 var(--brand);
}

.list-group-item.active .text-muted,
.list-group-item-action.active .text-muted {
  color: var(--brand) !important;
  opacity: 0.8;
}

/* -------------------------------------------------- 14. Tabs (used by login) */
.nav-tabs {
  border-bottom: 1px solid var(--line);
  gap: 4px;
}

.nav-tabs .nav-link {
  color: var(--muted);
  font-weight: 700;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}

.nav-tabs .nav-link.active {
  color: var(--brand);
  background: var(--surface);
  border-color: var(--line);
  border-bottom-color: var(--surface);
}

/* -------------------------------------------------- 14. Help / testing-guide modal */
.pair-help-modal .modal-content {
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--line);
  background: var(--surface);
}

.pair-help-modal .pair-help-header {
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
  gap: 12px;
}

.pair-help-modal .pair-help-header .modal-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  margin: 0;
}

.pair-help-modal .pair-help-kicker {
  display: inline-block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}

.pair-help-modal .pair-help-progress {
  margin-bottom: 0;
}

.pair-help-modal .pair-help-body {
  padding-top: 18px;
  padding-bottom: 18px;
  color: var(--ink);
  line-height: 1.55;
}

.pair-help-modal .pair-help-body p + p {
  margin-top: 10px;
}

.pair-help-modal .pair-help-list {
  margin: 8px 0 16px;
  padding-left: 1.2rem;
}

.pair-help-modal .pair-help-list li {
  margin-bottom: 6px;
}

.pair-help-modal .pair-help-alias {
  margin: 16px 0 18px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}

.pair-help-modal .pair-help-alias > p {
  margin-bottom: 8px;
}

.pair-help-modal .pair-help-alias > p:last-child {
  margin-bottom: 0;
}

.pair-help-modal .pair-help-alias-value strong {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  color: var(--brand);
  font-size: 15px;
  letter-spacing: 0.03em;
}

.pair-help-modal .pair-help-reopen {
  color: var(--muted);
  font-size: 14px;
  margin-top: 14px;
}

.pair-help-modal .pair-help-footer {
  border-top: 1px solid var(--line);
  justify-content: space-between;
}

.pair-help-modal .pair-help-footer [data-help-back] {
  margin-right: auto;
}

/* ------------------------------------------------------------------------
   Floating "feedback form" bubble (bottom-right of every signed-in page)
   ------------------------------------------------------------------------ */
.pair-feedback-bubble {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1040; /* below Bootstrap modals (1055) but above sticky panels */
  display: flex;
  align-items: stretch;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-pill, 999px);
  box-shadow: 0 8px 24px rgba(20, 40, 30, 0.18), 0 2px 6px rgba(20, 40, 30, 0.12);
  overflow: hidden;
  max-width: min(22rem, calc(100vw - 2.5rem));
  animation: pair-feedback-bubble-in 220ms ease-out both;
}

@keyframes pair-feedback-bubble-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pair-feedback-bubble-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.65rem 0.85rem 0.65rem 1rem;
  color: inherit;
  text-decoration: none;
  line-height: 1.2;
  flex: 1 1 auto;
  min-width: 0;
}

.pair-feedback-bubble-link:hover,
.pair-feedback-bubble-link:focus-visible {
  color: inherit;
  background: color-mix(in srgb, var(--brand) 80%, white);
  outline: none;
  text-decoration: none;
}

.pair-feedback-bubble-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  font-weight: 600;
}

.pair-feedback-bubble-cta {
  font-size: 0.92rem;
  font-weight: 600;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.pair-feedback-bubble-arrow {
  font-size: 0.85em;
  opacity: 0.85;
}

.pair-feedback-bubble-close {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.75;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.7rem;
  cursor: pointer;
  border-left: 1px solid color-mix(in srgb, white 28%, transparent);
}

.pair-feedback-bubble-close:hover,
.pair-feedback-bubble-close:focus-visible {
  opacity: 1;
  outline: none;
  background: color-mix(in srgb, black 10%, transparent);
}

@media (max-width: 480px) {
  .pair-feedback-bubble {
    bottom: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
    max-width: none;
  }
  .pair-feedback-bubble-eyebrow { font-size: 0.7rem; }
  .pair-feedback-bubble-cta { font-size: 0.88rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pair-feedback-bubble { animation: none; }
}
