/* Scan page — builds on landing.css tokens */

.scan-hero { text-align: center; padding: 64px 0 36px; }
.scan-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.scan-hero .hero-subtitle { margin: 16px auto 0; max-width: 560px; }

.scan-main { max-width: 760px; padding-bottom: 90px; }

/* Tabs */
.scan-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin: 26px 0 30px;
}
.scan-tab {
  padding: 10px 20px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 0.95rem; font-weight: 600;
  transition: all 0.15s ease;
}
.scan-tab:hover { color: var(--text); border-color: rgba(99,102,241,0.4); }
.scan-tab.active {
  background: linear-gradient(100deg, rgba(99,102,241,0.25), rgba(168,85,247,0.2));
  border-color: rgba(99,102,241,0.6); color: var(--text);
}

/* Panels */
.scan-panel { display: none; }
.scan-panel.active { display: block; }

.panel-label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 650; margin-bottom: 10px;
}
.char-count { color: var(--text-dim); font-size: 0.82rem; font-weight: 400; }

textarea {
  width: 100%; min-height: 200px; resize: vertical;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font: inherit; font-size: 0.95rem; padding: 16px;
}
textarea:focus { outline: none; border-color: rgba(99,102,241,0.6); }

.panel-hint { color: var(--text-dim); font-size: 0.83rem; margin: 10px 0; }
.panel-hint.dim { opacity: 0.65; margin-top: 2px; }

.scan-btn { margin-top: 8px; width: 100%; }
.scan-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Dropzones */
.dropzone {
  border: 2px dashed rgba(255,255,255,0.18); border-radius: var(--radius);
  background: var(--card); padding: 40px 24px; text-align: center; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: var(--card-hover); }
.dropzone.has-file { border-color: rgba(52,211,153,0.5); }
.dropzone .panel-hint { margin: 6px 0 0; }
.drop-icon { font-size: 2.4rem; margin-bottom: 10px; }

.file-chip {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 12px;
  background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.35);
  border-radius: 999px; padding: 7px 14px; font-size: 0.85rem;
}
.file-chip[hidden] { display: none; }
.chip-x { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 0.9rem; }
.chip-x:hover { color: var(--red); }

/* Loading */
/* Progress panel. Left-aligned rather than centred: it is a list of steps to
   read, not a single status line. */
.scan-loading {
  margin-top: 22px; padding: 22px 24px; border-radius: var(--radius);
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.09);
  color: var(--text-dim);
}
.spinner {
  width: 28px; height: 28px; flex: none;
  border: 3px solid rgba(255,255,255,0.12); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.sp-head { display: flex; align-items: center; gap: 14px; }
.sp-title { font-size: 1.02rem; font-weight: 650; color: var(--text); margin: 0; }
.sp-meta {
  margin: 2px 0 0; font-size: 0.82rem; color: var(--text-dim);
  font-variant-numeric: tabular-nums; /* stops the elapsed clock jittering */
}

.sp-stages { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 9px; }
.sp-stages li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.9rem; line-height: 1.45;
  transition: color 0.3s ease, opacity 0.3s ease;
}
.sp-mark {
  flex: none; width: 17px; height: 17px; margin-top: 2px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.66rem; font-weight: 700;
  border: 1.5px solid rgba(255,255,255,0.16);
}
.sp-done { color: var(--text-dim); }
.sp-done .sp-mark { background: var(--green); border-color: var(--green); color: #04140a; }
/* The active step gets the only bright text, so the eye lands on what is
   happening now without needing to scan the whole list. */
.sp-active { color: var(--text); font-weight: 550; }
.sp-active .sp-mark {
  border-color: var(--accent);
  animation: sp-pulse 1.4s ease-in-out infinite;
}
@keyframes sp-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,92,246,0.45); }
  50%      { box-shadow: 0 0 0 5px rgba(139,92,246,0); }
}
.sp-todo { opacity: 0.42; }

/* Quieter than .sp-note on purpose. This is a standing clarification about what
   the ticks mean, not an alert — it should be findable by anyone who wonders,
   without competing with the overrun warning below it. */
.sp-basis {
  margin: 14px 0 0; font-size: 0.78rem; line-height: 1.45;
  color: var(--text-dim); opacity: 0.75;
}

.sp-note {
  margin: 16px 0 0; padding-top: 14px; font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.07); color: var(--amber, #f59e0b);
}

/* Respect a reduced-motion preference: the spinner and pulse are decorative,
   and the step list already communicates progress without them. */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
  .sp-active .sp-mark { animation: none; border-color: var(--accent); }
  .sp-stages li { transition: none; }
}

/* Error */
.scan-error {
  margin-top: 22px; padding: 16px 20px; border-radius: var(--radius);
  background: rgba(248,113,113,0.08); border: 1px solid rgba(248,113,113,0.35);
  color: #fca5a5; font-size: 0.92rem;
}

.scan-quota {
  margin-top: 14px; text-align: center;
  color: var(--muted, #94a3b8); font-size: 0.85rem;
}
.scan-quota a { color: #a5b4fc; text-decoration: underline; }

/* Results */
.scan-results { margin-top: 36px; }
.result-top {
  display: flex; gap: 32px; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 30px;
}
.gauge { position: relative; width: 130px; height: 130px; flex-shrink: 0; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 10; }
.gauge-bg { stroke: rgba(255,255,255,0.08); }
.gauge-fill {
  stroke: var(--green); stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}
.gauge-fill.ai { stroke: var(--red); }
/* Amber, not a blend of red and green: an undecided result is its own state and
   shouldn't read as a weak version of either verdict. */
.gauge-fill.inconclusive { stroke: var(--amber, #f59e0b); }
.gauge-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.gauge-score { font-size: 1.6rem; font-weight: 800; }
.gauge-label { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; }

.result-summary h2 { font-size: 1.5rem; margin-bottom: 8px; }
.verdict-ai { color: var(--red); }
.verdict-human { color: var(--green); }
.verdict-inconclusive { color: var(--amber, #f59e0b); }
.result-summary p { color: var(--text-dim); font-size: 0.95rem; }

/* Quieter than the summary above it, but deliberately not as faint as .sp-basis: this
   is a standing qualification of the number a reader is acting on, not incidental
   small print, so it stays legible rather than decorative. The top border separates it
   from the verdict sentence so it reads as a caveat on the result rather than as more
   of the result. */
.result-side-note {
  margin: 8px 0 0;
  font-size: 0.88rem !important;
  line-height: 1.45;
  color: var(--text-dim);
  border-left: 3px solid var(--border);
  padding-left: 10px;
}
.result-side-note p { margin: 0; }
.result-side-note ul {
  margin: 8px 0 0; padding-left: 1.1em;
}

.result-estimate {
  margin: 12px 0 0; padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem !important; line-height: 1.5;
  color: var(--text-dim); opacity: 0.85;
}

.known-limits-list {
  list-style: none; display: flex; flex-direction: column; gap: 10px;
  font-size: 0.88rem; line-height: 1.45; color: var(--text-dim);
}
.known-limits-list li { padding-left: 0; }

.result-block {
  margin-top: 20px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 26px;
}
.result-block h3 { margin-bottom: 14px; font-size: 1rem; }

.signal-list { list-style: none; display: flex; flex-direction: column; gap: 9px; font-size: 0.9rem; }
.signal-list li { padding-left: 4px; }
.sig-positive { color: var(--green); }
.sig-warning { color: var(--amber); }
.sig-negative { color: var(--red); }
.sig-neutral { color: var(--text-dim); }

/* Detector rows */
.det-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.det-row:last-child { border-bottom: none; }
.det-top { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 7px; }
.det-name { font-weight: 600; }
.det-verdict { font-weight: 700; font-size: 0.83rem; }
.v-ai { color: var(--red); }
.v-human { color: var(--green); }
.det-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.det-fill { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.f-ai { background: linear-gradient(90deg, #f87171, #fb923c); }
.f-human { background: linear-gradient(90deg, #34d399, #6ee7b7); }
.det-note { color: var(--text-dim); font-size: 0.8rem; margin-top: 6px; }
.det-meta { color: var(--text-dim); font-size: 0.78rem; margin-top: 6px; }
/* Monospaced figures so the sum reads as arithmetic to be checked. */
.det-math {
  margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 0.8rem; line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
/* Prose, not arithmetic — no tabular figures, and it must survive on its own when
   renderVoteMath declines to print a formula. */
.det-panel {
  margin: 12px 0 0; color: var(--text-dim); font-size: 0.8rem; line-height: 1.55;
}
/* renderVoteMath hides itself whenever the sum would not reproduce the headline, so
   the panel note has to take over the separating rule in that case. */
#detector-math[hidden] + .det-panel {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}

/* Upsell */
.result-upsell {
  margin-top: 24px; text-align: center;
  background: linear-gradient(160deg, rgba(99,102,241,0.12), rgba(168,85,247,0.08));
  border: 1px solid rgba(99,102,241,0.35);
  border-radius: var(--radius); padding: 30px;
}
.result-upsell p { color: var(--text-dim); font-size: 0.92rem; margin: 8px 0 18px; }

@media (max-width: 620px) {
  .result-top { flex-direction: column; text-align: center; }
}
