/* KaaryaSatya Verify — shared design tokens & components.
   Palette reused verbatim from frontend/index.html's --e-* tokens (the dark
   Prive Secure app surface) so this module feels like the same product. */

:root {
  --e-bg: #0B0E16;
  --e-bg-raised: #131826;
  --e-bg-raised-2: #1A2032;
  --e-border: #262E42;
  --e-ink: #ECE8DD;
  --e-ink-soft: #8990A3;
  --e-gold: #B8923D;
  --e-gold-300: #D9BC78;
  --e-clay: #C97A55;
  --e-good: #3FBF7F;
  --e-warn: #E2B24B;
  --e-bad: #E2554F;
  --e-grey: #757C8C;

  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--e-bg);
  color: var(--e-ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; margin: 0 0 0.4em; color: #fff; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.75em; color: var(--e-ink-soft); }
a { color: var(--e-gold-300); }
small { color: var(--e-ink-soft); }
code, .mono { font-family: var(--mono); }

/* ── Layout ─────────────────────────────────────────────────────────── */
.page { min-height: 100%; display: flex; flex-direction: column; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; width: 100%; }
.container-narrow { max-width: 480px; margin: 0 auto; padding: 0 24px; width: 100%; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }
.review-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .review-grid { grid-template-columns: 1fr; } }
.doc-text {
  white-space: pre-wrap; word-break: break-word; font-size: 0.92rem; line-height: 1.7;
  max-height: 70vh; overflow-y: auto; padding: 4px;
}
.spacer { flex: 1; }
.center-screen {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 16px;
}

/* ── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
  border-bottom: 1px solid var(--e-border);
  background: rgba(11, 14, 22, 0.9);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 20;
}
.navbar .container { display: flex; align-items: center; gap: 14px; height: 62px; }
.navbar .brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; color: #fff; text-decoration: none; }
.navbar .brand img { height: 30px; width: 30px; border-radius: 50%; }
.navbar .brand .tag { color: var(--e-gold-300); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; font-family: var(--sans); font-weight: 600; }
.navbar nav { display: flex; gap: 18px; align-items: center; }
.navbar nav a { color: var(--e-ink-soft); text-decoration: none; font-size: 0.92rem; }
.navbar nav a:hover { color: var(--e-ink); }

/* ── Card ───────────────────────────────────────────────────────────── */
.card {
  background: var(--e-bg-raised);
  border: 1px solid var(--e-border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-tight { padding: 16px; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }

/* ── Forms ──────────────────────────────────────────────────────────── */
label { display: block; font-size: 0.82rem; color: var(--e-ink-soft); margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  background: var(--e-bg);
  border: 1px solid var(--e-border);
  color: var(--e-ink);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: var(--sans);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--e-gold);
}
textarea { resize: vertical; min-height: 80px; }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.help-text { font-size: 0.78rem; color: var(--e-ink-soft); margin-top: 4px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input { width: auto; margin-top: 3px; }
.checkbox-row label { margin: 0; color: var(--e-ink); font-size: 0.88rem; }

/* ── Field label row: label + required marker + info tooltip ──────────── */
.field-label-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; position: relative; }
.field-label-row label { margin-bottom: 0; }
.required-mark { color: var(--e-bad); font-weight: 700; }
.required-mark-either { color: var(--e-warn); font-weight: 700; }
.field-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.78rem; color: var(--e-ink-soft); }
.field-legend .required-mark, .field-legend .required-mark-either { margin-right: 3px; }
.info-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%; background: var(--e-bg-raised-2);
  border: 1px solid var(--e-border); color: var(--e-ink-soft); font-size: 0.68rem; font-style: italic;
  font-family: var(--serif); cursor: help; flex-shrink: 0; user-select: none;
}
.info-icon:hover, .info-icon:focus { color: var(--e-ink); border-color: var(--e-gold-300); outline: none; }
/* Anchored to .field-label-row (full field width), not the icon itself —
   an icon-centered tooltip can walk off-screen on narrow viewports since
   the icon sits near the right edge of its row; the row's own width is
   already guaranteed on-screen by normal block layout. */
.info-icon .info-tooltip {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; margin: 0 auto;
  width: min(230px, 100%); background: var(--e-bg-raised); border: 1px solid var(--e-border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 8px 10px; font-size: 0.76rem; font-style: normal; font-family: var(--sans);
  color: var(--e-ink-soft); line-height: 1.4; opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.15s ease; z-index: 30; text-align: left;
}
.info-icon:hover .info-tooltip, .info-icon:focus .info-tooltip { opacity: 1; visibility: visible; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease, opacity 0.15s ease;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--e-gold); color: #1a1305; }
.btn-secondary { background: transparent; color: var(--e-ink); border-color: var(--e-border); }
.btn-danger { background: var(--e-bad); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }

/* ── Badges (verification verdicts) ────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-green { background: rgba(63, 191, 127, 0.14); color: var(--e-good); }
.badge-amber { background: rgba(226, 178, 75, 0.14); color: var(--e-warn); }
.badge-red { background: rgba(226, 85, 79, 0.14); color: var(--e-bad); }
.badge-grey { background: rgba(117, 124, 140, 0.16); color: var(--e-grey); }
.badge-neutral { background: rgba(217, 188, 120, 0.12); color: var(--e-gold-300); }

/* ── Highlight spans (overlay viewer) ──────────────────────────────── */
.hl { border-radius: 4px; padding: 1px 3px; cursor: pointer; border-bottom: 2px solid; }
.hl-green { background: rgba(63, 191, 127, 0.16); border-color: var(--e-good); }
.hl-amber { background: rgba(226, 178, 75, 0.18); border-color: var(--e-warn); }
.hl-red { background: rgba(226, 85, 79, 0.18); border-color: var(--e-bad); }
.hl-grey { background: rgba(117, 124, 140, 0.18); border-color: var(--e-grey); }
.hl-unverified { background: rgba(217, 188, 120, 0.06); border-color: var(--e-ink-soft); border-bottom-style: dashed; }
.hl.active { outline: 2px solid var(--e-gold-300); outline-offset: 1px; }

/* ── Table ──────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--e-border); }
th { color: var(--e-ink-soft); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }
.table-wrap { overflow-x: auto; }

/* ── Alerts / banners ───────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.86rem; border: 1px solid;
}
.alert-info { background: rgba(217, 188, 120, 0.08); border-color: var(--e-border); color: var(--e-ink-soft); }
.alert-error { background: rgba(226, 85, 79, 0.1); border-color: rgba(226, 85, 79, 0.4); color: #ffb3af; }
.alert-success { background: rgba(63, 191, 127, 0.1); border-color: rgba(63, 191, 127, 0.4); color: #a9f0c6; }

/* ── Misc ───────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.qr-box { background: #fff; padding: 12px; border-radius: var(--radius-sm); display: inline-block; }
.qr-box img { display: block; width: 180px; height: 180px; }
.divider { height: 1px; background: var(--e-border); margin: 20px 0; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--e-bg-raised-2); border: 1px solid var(--e-border); font-size: 0.74rem; color: var(--e-ink-soft); }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(236, 232, 221, 0.25); border-top-color: var(--e-gold-300);
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress {
  height: 8px; background: var(--e-bg); border: 1px solid var(--e-border); border-radius: 999px; overflow: hidden;
}
.progress > div { height: 100%; background: var(--e-gold); transition: width 0.3s ease; }
.footer-note { text-align: center; padding: 24px; color: var(--e-ink-soft); font-size: 0.78rem; }
.link-btn { background: none; border: none; color: var(--e-gold-300); cursor: pointer; font-size: 0.86rem; padding: 0; }

/* ── Tooltip side-panel (overlay viewer detail) ────────────────────── */
.detail-panel {
  position: sticky; top: 78px; background: var(--e-bg-raised);
  border: 1px solid var(--e-border); border-radius: var(--radius);
  padding: 18px; max-height: calc(100vh - 100px); overflow-y: auto;
}
.detail-panel .placeholder { color: var(--e-ink-soft); font-size: 0.86rem; }
.reason-list { margin: 10px 0 0; padding-left: 18px; font-size: 0.86rem; color: var(--e-ink-soft); }
.reason-list li { margin-bottom: 4px; }
.excerpt-box {
  background: var(--e-bg); border: 1px solid var(--e-border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 0.84rem; font-style: italic; color: var(--e-ink-soft); margin-top: 8px;
}

/* ── Slide-over side panel (candidate detail, opened from a table row) ─ */
.slide-over-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 40;
}
.slide-over-backdrop.open { opacity: 1; pointer-events: auto; }
.slide-over {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(880px, 96vw);
  background: var(--e-bg); border-left: 1px solid var(--e-border); box-shadow: var(--shadow);
  transform: translateX(100%); transition: transform 0.25s ease; z-index: 41;
  display: flex; flex-direction: column;
}
.slide-over.open { transform: translateX(0); }
.slide-over-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--e-border); flex-shrink: 0;
}
.slide-over-body { flex: 1; overflow-y: auto; padding: 20px; }
.slide-over-close {
  background: none; border: 1px solid var(--e-border); color: var(--e-ink-soft);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1;
}
.slide-over-close:hover { color: var(--e-ink); border-color: var(--e-ink-soft); }
@media (max-width: 640px) {
  .slide-over { width: 100vw; }
}

/* ── Verification hover tooltip (candidate-review.js) ──────────────── */
.verification-tooltip {
  position: fixed; z-index: 60; max-width: 320px; background: var(--e-bg-raised);
  border: 1px solid var(--e-border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 12px 14px; font-size: 0.84rem; pointer-events: none;
}
.verification-tooltip.hidden { display: none; }

/* ── Pricing table ──────────────────────────────────────────────────── */
.pricing-table th, .pricing-table td { vertical-align: top; }
.pricing-rate { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--e-gold-300); white-space: nowrap; }
.pricing-row-current td { background: rgba(63, 191, 127, 0.06); }

/* ── Document chooser (multi-resume selection) ─────────────────────── */
.doc-chooser { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.doc-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: var(--e-bg-raised-2); border: 1px solid var(--e-border); border-radius: 999px;
  color: var(--e-ink-soft); font-size: 0.82rem; cursor: pointer;
}
.doc-chip.active { border-color: var(--e-gold-300); color: var(--e-ink); }
.doc-chip-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
