/* ---------------------------------------------------------------
   Smart Resume Screener — visual language
   A "case file" aesthetic: paper background, ink-forest text,
   a deep teal for filed/approved states, and a hand-stamp signature
   element for match scores. Deliberately not templated-generic.
------------------------------------------------------------------ */

:root {
  --paper: #F7F5F0;
  --paper-raised: #FFFFFF;
  --ink: #1F2A24;
  --ink-soft: #55625A;
  --line: #DEDACD;
  --teal: #2B6E5C;
  --teal-deep: #1B4A3E;
  --amber: #C9762E;
  --red-stamp: #A3402F;
  --radius: 3px;
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper-raised);
}

.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-mark { color: var(--teal); font-size: 1.1rem; }
.brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.api-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-soft);
}
.dot.online { background: var(--teal); }
.dot.offline { background: var(--red-stamp); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 0;
  min-height: calc(100vh - 60px);
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

.pane { padding: 2rem; }
.intake { border-right: 1px solid var(--line); background: var(--paper-raised); }

.pane-header { margin-bottom: 1rem; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
}
.pane-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0.25rem 0 0.75rem 0;
}

/* ---------- Cards / forms ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.field { display: block; margin-bottom: 1rem; }
.field span {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}
.field input, .field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: var(--paper); width: 100%; }
.btn.accent { background: var(--teal); color: white; }
.btn.small { padding: 0.35rem 0.7rem; font-size: 0.75rem; }

/* ---------- Dropzone ---------- */
.dropzone {
  text-align: center;
  padding: 1.75rem 1rem;
  cursor: pointer;
  border: 1px dashed var(--line);
}
.dropzone:hover { border-color: var(--teal); }
.dropzone p { margin: 0.2rem 0; }
.dropzone .hint { color: var(--ink-soft); font-size: 0.78rem; }

.upload-log { list-style: none; padding: 0; margin: 0.75rem 0 0 0; }
.upload-log li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
}
.upload-log li.ok { color: var(--teal-deep); }
.upload-log li.err { color: var(--red-stamp); }

/* ---------- Results pane ---------- */
.results .pane-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }

.empty-state {
  margin-top: 3rem;
  text-align: center;
  color: var(--ink-soft);
}
.empty-state .hint { font-size: 0.85rem; }

.candidate-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }

.candidate-card {
  position: relative;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 1rem;
  align-items: center;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.candidate-card:hover { border-color: var(--teal); box-shadow: 0 2px 10px rgba(31,42,36,0.06); }

/* Signature element: the "stamp" — an ink-stamped score, slightly rotated,
   double-ring like a real approval stamp. This is the one bold flourish. */
.stamp {
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.05rem;
  transform: rotate(-8deg);
  position: relative;
}
.stamp::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.5;
}
.stamp.pending { color: var(--ink-soft); border-style: dashed; }
.stamp.high { color: var(--teal); }
.stamp.mid { color: var(--amber); }
.stamp.low { color: var(--red-stamp); }

.candidate-main .name { font-weight: 600; font-size: 1rem; }
.candidate-main .meta { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.15rem; }
.candidate-main .justification {
  font-size: 0.83rem;
  color: var(--ink);
  margin-top: 0.45rem;
  max-width: 60ch;
}
.tags { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  background: rgba(43,110,92,0.08);
  color: var(--teal-deep);
}
.tag.missing { background: rgba(163,64,47,0.08); color: var(--red-stamp); }

.badge-shortlisted {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(31,42,36,0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  z-index: 50;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--paper-raised);
  border-radius: var(--radius);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
}
.modal-close {
  position: absolute; top: 0.75rem; right: 1rem;
  background: none; border: none;
  font-size: 1.5rem; cursor: pointer;
  color: var(--ink-soft);
}
.modal-card h3 { font-family: var(--font-display); margin-top: 0; }
.modal-card .section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--teal);
  margin: 1.25rem 0 0.4rem 0;
}
.modal-card pre {
  white-space: pre-wrap;
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: var(--paper);
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  max-height: 240px;
  overflow-y: auto;
}
.candidate-actions {
  display: flex;
  gap: 8px;
  align-self: flex-start;
}

.delete-btn {
  border: 1px solid #d66;
  color: #b33;
  background: white;
  cursor: pointer;
}

.delete-btn:hover {
  background: #fff1f1;
}
.score-breakdown {
  display: flex;
  gap: 10px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.score-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 90px;
  background: #fafafa;
}

.score-item span {
  font-size: 12px;
  opacity: 0.65;
}

.score-item strong {
  font-size: 14px;
}

.overall-score {
  font-size: 18px;
  margin: 8px 0 12px;
}

.detail-breakdown {
  margin-bottom: 20px;
}
/* =========================================================
   Logout Button
   ========================================================= */

.logout-btn {
  appearance: none;
  border: 1px solid rgba(40, 117, 102, 0.35);
  background: #eef4f1;
  color: #286f61;

  padding: 9px 17px;
  border-radius: 6px;

  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;

  cursor: pointer;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.logout-btn:hover {
  background: #286f61;
  color: #ffffff;
  border-color: #286f61;
}

.logout-btn:active {
  transform: translateY(1px);
}

.logout-btn:focus-visible {
  outline: 2px solid rgba(40, 117, 102, 0.35);
  outline-offset: 2px;
}