/* ATS CV Checker — DanGPT dark theme. Fonts self-hosted (GDPR). */

:root {
  --bg: var(--dg-bg);
  --surface: var(--dg-surface);
  --surface-2: var(--dg-surface-2);
  --line: var(--dg-border);
  --ink: var(--dg-text);
  --muted: var(--dg-muted);
  --faint: var(--dg-faint);
  --accent: var(--dg-accent);
  --accent-btn: var(--dg-accent-btn);
  --green: var(--dg-ok);    --green-soft: var(--dg-ok-soft);     --green-border: var(--dg-ok-line);
  --amber: var(--dg-warn);  --amber-soft: var(--dg-warn-soft);   --amber-border: var(--dg-warn-line);
  --red: var(--dg-danger);  --red-soft: var(--dg-danger-soft);   --red-border: var(--dg-danger-line);
  --sans: var(--dg-sans);
  --display: var(--dg-display);
  --mono: var(--dg-mono);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 36px 24px 60px; }
header p { color: var(--muted); margin-top: 8px; max-width: 620px; font-size: 15px; line-height: 1.55; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 34px; height: 34px; border-radius: 8px; background: var(--accent-btn); display: grid; place-items: center; color: #fff; font-family: var(--mono); font-weight: 600; font-size: 15px; }
h1 { font-family: var(--display); font-size: 24px; font-weight: 700; margin: 0; color: var(--ink); }
h2 { font-family: var(--display); font-size: 16px; font-weight: 600; margin: 0; color: var(--ink); }
h3 { font-family: var(--display); font-size: 15px; margin: 0; color: var(--ink); }
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
@media (max-width: 860px) { .panels { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.panel { display: flex; flex-direction: column; }
.step { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 600; margin-right: 8px; }
.drop { margin-top: 14px; border: 1.5px dashed var(--dg-border-2); background: var(--surface-2); border-radius: 10px; padding: 22px 16px; text-align: center; cursor: pointer; transition: all 150ms ease; }
.drop.over { border-color: var(--accent); background: rgba(0,144,216,.08); }
.drop .main { font-size: 14px; font-weight: 500; color: var(--ink); }
.drop .sub { font-size: 12px; color: var(--faint); margin-top: 4px; font-family: var(--mono); }
.drop .file { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink); }
.drop button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 2px 8px; font-size: 12px; cursor: pointer; color: var(--muted); margin-left: 10px; }
.drop button:hover { color: var(--ink); border-color: var(--dg-border-2); }
.or { font-size: 12px; color: var(--faint); margin: 12px 0 6px; text-align: center; }
textarea { width: 100%; flex: 1; min-height: 180px; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 13px; font-family: var(--sans); line-height: 1.5; resize: vertical; }
textarea::placeholder { color: var(--faint); }
#jobspec { min-height: 268px; margin-top: 14px; }
textarea:focus, button:focus-visible, .drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; align-items: center; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.run { background: var(--accent-btn); color: #fff; border: none; border-radius: 10px; padding: 13px 28px; font-size: 15px; font-weight: 600; font-family: var(--display); cursor: pointer; transition: background .15s; }
.run:hover:not(:disabled) { background: var(--accent); }
.run:disabled { background: var(--surface-2); color: var(--faint); cursor: not-allowed; }
.status { font-size: 13px; color: var(--faint); }
.status.busy { color: var(--muted); font-family: var(--mono); }
.error { margin-top: 16px; background: var(--red-soft); border: 1px solid var(--red-border); color: var(--red); border-radius: 10px; padding: 12px 16px; font-size: 14px; display: none; }
/* results */
#results { margin-top: 40px; display: none; }
.kicker { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.meter-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.meter-hint { font-size: 13px; color: var(--faint); margin-top: 2px; }
.meter-top { display: flex; align-items: baseline; gap: 14px; margin-top: 14px; }
.meter-num { font-family: var(--mono); font-size: 56px; font-weight: 600; line-height: 1; }
.meter-denom { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.badge { margin-left: auto; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.segs { display: flex; gap: 3px; margin-top: 14px; }
.segs div { flex: 1; height: 18px; border-radius: 2px; background: var(--surface-2); }
.scale { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.verdict { margin: 20px 0 0; padding: 16px 24px; font-size: 15px; line-height: 1.55; color: var(--dg-text-dim); }
.terminal { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin-top: 20px; color: var(--dg-text-dim); font-family: var(--mono); font-size: 13px; line-height: 1.8; }
.terminal .t-head { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.terminal .row { display: flex; gap: 12px; }
/* flex items default to min-width:auto, so a long email or URL would push
   the whole page sideways instead of wrapping */
.terminal .row > span { min-width: 0; overflow-wrap: anywhere; }
.terminal .k { color: var(--muted); min-width: 110px; flex-shrink: 0; }
.terminal .warn { color: var(--amber); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 6px; font-family: var(--mono); overflow-wrap: anywhere; }
.chip.good { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-border); }
.chip.bad { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-border); }
.none { font-size: 13px; color: var(--faint); }
.check { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.check:first-child { border-top: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.check .head { display: flex; justify-content: space-between; gap: 12px; }
.check .name { font-weight: 600; font-size: 14px; color: var(--ink); }
.check .score { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.check p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.subtle { color: var(--faint); font-weight: 400; font-size: 13px; }
ol.recs { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 10px; }
ol.recs li { font-size: 14px; line-height: 1.55; color: var(--dg-text-dim); }
.footnote { margin-top: 18px; font-size: 12.5px; color: var(--faint); line-height: 1.5; }
.mt20 { margin-top: 20px; }
.back-link { display: inline-block; margin-bottom: 18px; font-size: 13px; color: var(--muted); text-decoration: none; }
.back-link strong { color: var(--accent); font-weight: 400; }
.back-link:hover { color: var(--ink); }
/* ── Scanning overlay ─────────────────────────────────────────────────── */
.scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--dg-scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.scan-overlay[hidden] { display: none; }
.scan-modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 40px 30px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  animation: scanModalIn 0.3s ease;
}
@keyframes scanModalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.scan-doc {
  position: relative;
  width: 92px;
  height: 116px;
  margin: 0 auto 24px;
  background: var(--surface-2);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
}
.scan-doc-line { height: 5px; border-radius: 3px; background: var(--dg-border-2); }
.scan-doc-line.w50 { width: 50%; }
.scan-doc-line.w60 { width: 60%; }
.scan-doc-line.w70 { width: 70%; }
.scan-doc-line.w80 { width: 80%; }
.scan-doc-line.w85 { width: 85%; }
.scan-doc-line.w90 { width: 90%; }
.scan-beam {
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 14px 3px rgba(0, 144, 216, 0.55);
  animation: scanSweep 2.2s ease-in-out infinite;
}
@keyframes scanSweep {
  0%   { top: -6px; }
  50%  { top: 116px; }
  100% { top: -6px; }
}
.scan-title { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 18px; }
.scan-steps {
  list-style: none;
  margin: 0 auto 18px;
  padding: 0;
  max-width: 280px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.scan-steps li {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  transition: color 0.3s;
}
.scan-steps li::before { content: "○ "; }
.scan-steps li.active { color: var(--accent); }
.scan-steps li.active::before { content: "▸ "; }
.scan-steps li.active::after {
  content: "…";
  animation: scanDots 1.2s steps(4, end) infinite;
  display: inline-block;
  width: 14px;
  overflow: hidden;
  vertical-align: bottom;
}
@keyframes scanDots {
  0% { width: 0; }
  100% { width: 14px; }
}
.scan-steps li.done { color: var(--green); }
.scan-steps li.done::before { content: "✓ "; }
.scan-hint { font-size: 12px; color: var(--faint); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .scan-beam, .scan-steps li.active::after { animation: none !important; }
  .scan-modal { animation: none; }
}
