/* ==========================================================================
   TesterStack design system
   Feature agents: compose these classes; add page-specific CSS at the bottom
   of your own file or in a clearly-marked section here. No build step.
   ========================================================================== */

/* --- tokens --------------------------------------------------------------- */
:root {
  /* brand */
  --indigo: #5b5ce2;
  --indigo-dark: #4a4bc4;
  --indigo-light: #8a8bf0;
  --amber: #f6c453;

  /* match chip + nudge banner */
  --chip-bg: #fdf3dd;
  --chip-border: #d99a2b;
  --chip-text: #8a5a00;

  /* neutrals */
  --bg: #f7f6f2;
  --card: #ffffff;
  --ink: #2b2a33;
  --muted: #6f6c7a;
  --line: #e6e3db;

  /* status pills (bg / text) */
  --st-applied-bg: #e9e8f0;     --st-applied-text: #55525e;
  --st-viewed-bg: #e4ecfb;      --st-viewed-text: #2c4f9e;
  --st-shortlisted-bg: #fdf3dd; --st-shortlisted-text: #8a5a00;
  --st-hired-bg: #e2f4e4;       --st-hired-text: #2e6b3a;
  --st-not-selected-bg: #fbe7e5;--st-not-selected-text: #9c3a30;

  /* shape + type */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --font-head: "Quicksand", "Nunito", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --shadow: 0 1px 2px rgba(43, 42, 51, .06), 0 4px 16px rgba(43, 42, 51, .06);
  --shadow-lg: 0 8px 40px rgba(43, 42, 51, .16);
  --header-h: 60px;
}

/* --- reset / base ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 2rem; } h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.container { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* --- brand: logomark + wordmark ----------------------------------------------
   Pure-CSS logomark: three stacked, offset, rounded bars.
   Markup is a single empty element: <span class="logomark"></span>          */
.logomark {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: none;
}
.logomark::before, .logomark::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 7px;
  border-radius: 5px;
}
.logomark::before { /* top bar, offset right, lightest */
  top: 0; left: 4px;
  background: var(--indigo-light);
  box-shadow: -2px 9px 0 var(--indigo); /* middle bar */
}
.logomark::after {  /* bottom bar, darkest */
  top: 18px;
  background: var(--indigo-dark);
}
.logomark-lg { transform: scale(1.8); transform-origin: left center; margin: 12px 14px 12px 4px; }
.wordmark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  letter-spacing: -.01em;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }

/* --- buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;               /* mobile hit target */
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: 600 .95rem var(--font-body);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--indigo); color: #fff; }
.btn-primary:hover { background: var(--indigo-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-amber { background: var(--amber); color: var(--ink); }
.btn-amber:hover { filter: brightness(.96); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* --- pills / skill tags -------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 12px;
  border-radius: 999px;
  background: #eeeaf9;
  color: var(--indigo-dark);
  font: 500 .8rem var(--font-body);
  white-space: nowrap;
}
.pill-match { background: var(--chip-bg); color: var(--chip-text); border: 1px solid var(--chip-border); }
.pill-add { background: transparent; border: 1px dashed var(--line); color: var(--muted); cursor: pointer; }
.pill .pill-x { margin-left: 6px; cursor: pointer; font-weight: 700; }

/* --- pay badge ------------------------------------------------------------------ */
.pay-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background: var(--amber);
  color: var(--ink);
  font: 700 .9rem var(--font-body);
  white-space: nowrap;
}
.pay-badge-lg { font-size: 1.15rem; padding: 8px 16px; }

/* --- match chip (the "why you match" label) -------------------------------------- */
.match-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--chip-text);
  font: 600 .8rem var(--font-body);
  white-space: nowrap;
}
.match-chip::before { content: "\2726"; /* ✦ */ font-size: .75rem; }

/* --- source badge ------------------------------------------------------------------ */
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef0ee;
  color: var(--muted);
  font: 500 .75rem var(--font-body);
  white-space: nowrap;
}
.source-badge.external { background: #e8ecf4; color: #41546f; }

/* --- status pills ------------------------------------------------------------------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font: 600 .78rem var(--font-body);
  white-space: nowrap;
}
.status-applied      { background: var(--st-applied-bg);      color: var(--st-applied-text); }
.status-viewed       { background: var(--st-viewed-bg);       color: var(--st-viewed-text); }
.status-shortlisted  { background: var(--st-shortlisted-bg);  color: var(--st-shortlisted-text); }
.status-hired        { background: var(--st-hired-bg);        color: var(--st-hired-text); }
.status-not-selected { background: var(--st-not-selected-bg); color: var(--st-not-selected-text); }

/* 4-dot progress meter for the applications tracker */
.progress-dots { display: inline-flex; gap: 5px; }
.progress-dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line);
}
.progress-dots i.on { background: var(--indigo); }

/* --- cards --------------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.gig-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  transition: box-shadow .15s, border-color .15s;
}
.gig-card:hover { border-color: #d8d4c8; box-shadow: var(--shadow-lg); }
.gig-card .gig-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.gig-card .gig-title { font-family: var(--font-head); font-size: 1.05rem; margin: 0; }
.gig-card .gig-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gig-card .gig-actions { margin-top: auto; display: flex; gap: 8px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* --- strength / progress bar ----------------------------------------------------------- */
.strength-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.strength-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--indigo));
}
/* dashed amber nudge strip ("complete your profile") */
.nudge {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1.5px dashed var(--chip-border);
  border-radius: var(--radius);
  background: var(--chip-bg);
  color: var(--chip-text);
}

/* --- filter chips ------------------------------------------------------------------------ */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: 500 .85rem var(--font-body);
  cursor: pointer;
  user-select: none;
}
.chip:hover { border-color: var(--indigo); }
.chip.active { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- segmented toggle ---------------------------------------------------------------------- */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: #edece6;
  border-radius: 999px;
}
.segmented button {
  min-height: 34px;
  padding: 6px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 .85rem var(--font-body);
  cursor: pointer;
}
.segmented button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* --- forms ------------------------------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font: 600 .85rem var(--font-body); }
.field .hint { margin-top: 4px; font-size: .78rem; color: var(--muted); }
.input, .field input[type="text"], .field input[type="email"],
.field input[type="password"], .field input[type="number"],
.field select, .field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: 400 .95rem var(--font-body);
}
.field textarea { min-height: 110px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--indigo-light);
  outline-offset: 1px;
  border-color: var(--indigo);
}
.field .error { margin-top: 4px; font-size: .78rem; color: var(--st-not-selected-text); }

/* --- modal ---------------------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(43, 42, 51, .45);
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(460px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.modal .modal-close {
  float: right;
  border: 0;
  background: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

/* --- drawer (gig detail from the feed: right panel / mobile bottom sheet) --------------------------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: none;
  background: rgba(43, 42, 51, .35);
}
.drawer-backdrop.open { display: block; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 56;
  width: min(47%, 560px);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  padding: 24px;
  transform: translateX(100%);
  transition: transform .2s ease-out;
}
.drawer.open { transform: translateX(0); }

/* --- empty state ------------------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
}
.empty-state .empty-ill {
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, #eeeaf9, var(--chip-bg));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
}
.empty-state h3 { color: var(--ink); }
.empty-state .btn { margin-top: 10px; }

/* --- sticky apply bar (mobile gig detail) -------------------------------------------------------------- */
.apply-bar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(43, 42, 51, .08);
}

/* --- site header/footer (public shell) ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand-cluster { display: flex; align-items: center; gap: 10px; }
.site-nav { display: flex; align-items: center; gap: 14px; }
.nav-user { font-weight: 600; }
.site-main { padding: 40px 0 80px; min-height: 60vh; }
.site-footer { padding: 24px 0; border-top: 1px solid var(--line); }
.hero { text-align: center; padding: 48px 0 24px; }
.hero-preview { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }

/* --- worker app shell: top tabs on desktop, bottom tab bar on mobile ---------------------------------------
   Markup:
   <nav class="app-tabs"><a class="tab active">For you</a> ... </nav>        */
.app-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.app-tabs .tab {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 18px;
  color: var(--muted);
  font: 600 .9rem var(--font-body);
  border-bottom: 2px solid transparent;
}
.app-tabs .tab:hover { color: var(--ink); text-decoration: none; }
.app-tabs .tab.active { color: var(--indigo); border-bottom-color: var(--indigo); }
.app-tabs .tab .tab-icon { display: none; }

.bottom-tabs { display: none; }

/* --- employer / admin shell: top bar + left sidebar ---------------------------------------------------------
   Markup:
   <div class="shell-side">
     <aside class="side-nav"><a class="side-link active">Listings</a> ...</aside>
     <section class="side-main"> ... </section>
   </div>                                                                      */
.shell-side { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.side-nav {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font: 600 .9rem var(--font-body);
}
.side-link:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.side-link.active { background: #eeeaf9; color: var(--indigo-dark); }
.side-link .count { margin-left: auto; font-size: .78rem; color: var(--muted); }
.top-bar-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: #eeeaf9;
  color: var(--indigo-dark);
  font: 600 .75rem var(--font-body);
}

/* --- toast -------------------------------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: 500 .88rem var(--font-body);
  box-shadow: var(--shadow-lg);
  animation: toast-in .18s ease-out;
}
.toast.toast-success { background: var(--st-hired-text); }
.toast.toast-error { background: var(--st-not-selected-text); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* --- responsive: <=768px -------------------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .site-main { padding-bottom: 120px; } /* room for bottom tabs / apply bar */

  /* worker app: top tabs collapse into a bottom tab bar */
  .app-tabs { display: none; }
  .bottom-tabs {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    display: flex;
    background: var(--card);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bottom-tabs .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px;               /* >44px hit target */
    color: var(--muted);
    font: 600 .7rem var(--font-body);
  }
  .bottom-tabs .tab .tab-icon { font-size: 1.15rem; }
  .bottom-tabs .tab.active { color: var(--indigo); }
  .bottom-tabs .tab:hover { text-decoration: none; }

  /* drawer becomes a bottom sheet (~80% height) */
  .drawer {
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 80vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
  }
  .drawer.open { transform: translateY(0); }

  /* employer/admin sidebar stacks above content */
  .shell-side { grid-template-columns: 1fr; }
  .side-nav { position: static; display: flex; overflow-x: auto; }
  .side-link { white-space: nowrap; }

  .card-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.6rem; }
}

/* --- Vantora brand: post-apply handoff + direct-gig brand card -------------- */
/* Tokens match the Vantora identity (dev2.cornerstonegigs.com): indigo #4f46e5
   → violet #7c3aed gradient, 11px-tile mark. */
:root {
  --vantora-indigo: #4f46e5;
  --vantora-violet: #7c3aed;
}

.btn-vantora {
  background: linear-gradient(135deg, var(--vantora-indigo), var(--vantora-violet));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.32);
}
.btn-vantora:hover { filter: brightness(1.06); color: #fff; }

.vantora-mark { width: 34px; height: 34px; flex: none; }

/* brand card on the gig detail apply rail */
.vantora-brand {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius, 12px);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.07), rgba(124, 58, 237, 0.07));
}
.vantora-brand b { display: block; }
.vantora-brand .small { display: block; margin-top: 2px; }

/* handoff modal */
.modal.handoff { text-align: center; }
.handoff-hero { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; }
.handoff-hero h2 { margin: 0; }
.handoff-hero p { margin: 0; }
.handoff-mark-wrap { position: relative; display: inline-flex; }
.handoff-mark-wrap .vantora-mark { width: 52px; height: 52px; }
.handoff-check {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #17a34a;
  color: #fff;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  border: 2px solid #fff;
}
.modal.handoff .btn-vantora { margin-bottom: 10px; }
