/* ── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #1A0008;
  --bg-card: #240010;
  --bg-input: #2e0016;
  --border: #4A0018;
  --border-light: #5a0020;
  --primary: #EAB308;
  --primary-hover: #ca9a07;
  --primary-fg: #1A0008;
  --secondary: #C41230;
  --text: #f5f0f2;
  --text-muted: #9a7080;
  --text-dim: #6a4050;
  --green: #22c55e;
  --radius: 8px;
  --radius-sm: 5px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { font-size: 13px; }

body {
  width: 360px;
  min-height: 200px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; flex-direction: column; }

/* ── Header ────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.header-logo { display: flex; align-items: center; gap: 8px; }

.logo-mark {
  width: 24px; height: 24px;
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -0.5px;
}

.logo-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--text); background: var(--bg-input); }

/* ── Screens ───────────────────────────────────────────────────────── */
.screen { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.hidden { display: none !important; }

/* ── Auth Screen ───────────────────────────────────────────────────── */
.auth-hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 8px; padding: 12px 0 4px;
}
.auth-icon {
  width: 48px; height: 48px;
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.auth-title { font-size: 15px; font-weight: 700; color: var(--text); }
.auth-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.6; max-width: 260px; }
.auth-footer { font-size: 11px; color: var(--text-muted); text-align: center; }
.auth-footer a { color: var(--primary); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Form Elements ─────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12.5px;
  font-family: var(--font);
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.15s;
}
.form-input::placeholder { color: var(--text-dim); }
.form-input:focus { border-color: var(--primary); }

.prospect-row { display: flex; gap: 6px; }
.half { flex: 1; }
.mt-2 { margin-top: 6px; }
.mt-3 { margin-top: 10px; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary);
  color: var(--primary-fg);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--font);
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  width: 100%;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font);
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}
.btn-secondary:hover { border-color: var(--primary); background: rgba(234,179,8,0.05); }

.btn-autofill {
  background: rgba(10,102,194,0.15);
  color: #60a5fa;
  border: 1px solid rgba(10,102,194,0.3);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font);
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-autofill:hover { background: rgba(10,102,194,0.25); }

/* ── Section ───────────────────────────────────────────────────────── */
.section { display: flex; flex-direction: column; gap: 6px; }
.section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── LinkedIn Banner ───────────────────────────────────────────────── */
.linkedin-banner {
  display: flex; align-items: center; gap: 8px;
  background: rgba(10,102,194,0.08);
  border: 1px solid rgba(10,102,194,0.2);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 11.5px;
  color: #93c5fd;
}
.linkedin-banner span { flex: 1; }

/* ── Loading ───────────────────────────────────────────────────────── */
.state-loading {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 20px 0;
}
.spinner {
  width: 24px; height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 12px; color: var(--text-muted); }

/* ── Result Card ───────────────────────────────────────────────────── */
.result-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.result-avatar {
  width: 36px; height: 36px;
  background: var(--primary);
  color: var(--primary-fg);
  border-radius: 50%;
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  shrink: 0;
}
.result-info { flex: 1; min-width: 0; }
.result-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-score-wrap { text-align: center; shrink: 0; }
.result-score { font-size: 18px; font-weight: 800; color: var(--primary); line-height: 1; }
.result-score-label { font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Intent Signals ────────────────────────────────────────────────── */
.signals-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.signal-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(234,179,8,0.1);
  border: 1px solid rgba(234,179,8,0.2);
  color: var(--primary);
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px;
}
.signal-chip.green {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.2);
  color: #4ade80;
}
.signal-chip.blue {
  background: rgba(96,165,250,0.1);
  border-color: rgba(96,165,250,0.2);
  color: #93c5fd;
}
.no-signals { font-size: 11.5px; color: var(--text-dim); font-style: italic; }

/* ── Research Summary ──────────────────────────────────────────────── */
.research-summary {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.65;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

/* ── News List ─────────────────────────────────────────────────────── */
.news-list { display: flex; flex-direction: column; gap: 6px; }
.news-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.news-item a {
  font-size: 12px; font-weight: 600; color: var(--text);
  text-decoration: none; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.news-item a:hover { color: var(--primary); }
.news-item-meta { font-size: 10.5px; color: var(--text-dim); margin-top: 2px; }

/* ── Actions Row ───────────────────────────────────────────────────── */
.actions-row { display: flex; gap: 6px; }
.flex-1 { flex: 1; }

/* ── Success Banner ────────────────────────────────────────────────── */
.success-banner {
  display: flex; align-items: center; gap: 7px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px; color: #4ade80;
}
.success-banner a { color: #4ade80; font-weight: 600; }

/* ── Error State ───────────────────────────────────────────────────── */
.state-error {
  display: flex; align-items: center; gap: 8px;
  background: rgba(196,18,48,0.08);
  border: 1px solid rgba(196,18,48,0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px; color: #f87171;
}

/* ── Footer ────────────────────────────────────────────────────────── */
.popup-footer {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 14px 10px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.footer-link {
  font-size: 11px; color: var(--text-muted); text-decoration: none;
  transition: color 0.15s;
}
.footer-link:hover { color: var(--primary); }
.footer-link-btn {
  background: none; border: none; cursor: pointer;
  font-size: 11px; color: var(--text-muted); font-family: var(--font);
  transition: color 0.15s;
}
.footer-link-btn:hover { color: #f87171; }
.footer-sep { color: var(--text-dim); font-size: 11px; }
