/* ============================================================
   AI Lead Qualification & Follow-Up Router — Design System
   ============================================================ */

/* ── Fonts ────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  --bg-base:        #0b0d13;
  --bg-card:        #13161f;
  --bg-card-hover:  #181c28;
  --bg-input:       #0f1117;
  --border:         rgba(255,255,255,0.07);
  --border-focus:   rgba(99,102,241,0.6);

  --text-primary:   #f0f2f8;
  --text-secondary: #8b90a7;
  --text-muted:     #555a70;

  --accent:         #6366f1;
  --accent-hover:   #4f52d9;
  --accent-glow:    rgba(99,102,241,0.18);

  --hot:            #f43f5e;
  --hot-bg:         rgba(244,63,94,0.12);
  --warm:           #f59e0b;
  --warm-bg:        rgba(245,158,11,0.12);
  --cold:           #64748b;
  --cold-bg:        rgba(100,116,139,0.12);

  --green:          #10b981;
  --green-bg:       rgba(16,185,129,0.10);

  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      16px;
  --radius-xl:      20px;

  --shadow-card:    0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.5);
  --shadow-focus:   0 0 0 3px rgba(99,102,241,0.25);

  --transition:     all 0.18s ease;
  --transition-btn: all 0.15s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Typography ───────────────────────────────────────────── */
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); }

p { color: var(--text-secondary); }
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: #818cf8; }

/* ── Layout Utilities ─────────────────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}
.container--wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Navigation ───────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,13,19,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.nav-logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
}
.nav-link:hover { color: var(--text-primary); background: var(--border); }
.nav-link.active { color: var(--text-primary); }

/* ── Pages ────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ── Hero Section ─────────────────────────────────────────── */
.hero {
  padding: 56px 0 48px;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-glow);
  border: 1px solid rgba(99,102,241,0.3);
  color: #a5b4fc;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.hero h1 {
  margin-bottom: 12px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.hero h1 span { color: var(--accent); }
.hero-sub {
  font-size: 1.0rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 12px;
  line-height: 1.7;
}
.hero-trust {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0;
  letter-spacing: 0.01em;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
}

/* ── Form ─────────────────────────────────────────────────── */
.form-section {
  padding: 0 0 52px;
}
.form-header {
  margin-bottom: 28px;
}
.form-header h2 { font-size: 1.25rem; margin-bottom: 6px; }
.form-header p { font-size: 0.875rem; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .full-width { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.form-label .required { color: var(--accent); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 11px 14px;
  transition: var(--transition);
  outline: none;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;

}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  background: #12151e;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input.error { border-color: var(--hot); }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b90a7' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-select option { background: var(--bg-card); }
.form-textarea { resize: vertical; min-height: 90px; line-height: 1.6; }

.input-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.error-msg { font-size: 0.75rem; color: var(--hot); display: none; }
.form-group.has-error .error-msg { display: block; }
.form-group.has-error .form-input { border-color: var(--hot); }

/* ── Sample Lead Buttons ──────────────────────────────────── */
.sample-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.sample-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.sample-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.sample-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  font-family: inherit;
}
.sample-btn-hot {
  color: var(--hot);
  border-color: rgba(244,63,94,0.35);
}
.sample-btn-hot:hover {
  background: var(--hot-bg);
  border-color: rgba(244,63,94,0.6);
  box-shadow: 0 0 12px rgba(244,63,94,0.15);
}
.sample-btn-warm {
  color: var(--warm);
  border-color: rgba(245,158,11,0.35);
}
.sample-btn-warm:hover {
  background: var(--warm-bg);
  border-color: rgba(245,158,11,0.6);
  box-shadow: 0 0 12px rgba(245,158,11,0.15);
}
.sample-btn-cold {
  color: var(--cold);
  border-color: rgba(100,116,139,0.35);
}
.sample-btn-cold:hover {
  background: var(--cold-bg);
  border-color: rgba(100,116,139,0.6);
}
.sample-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sample-btn-hot .sample-dot { background: var(--hot); }
.sample-btn-warm .sample-dot { background: var(--warm); }
.sample-btn-cold .sample-dot { background: var(--cold); }

/* ── Submit Button ────────────────────────────────────────── */
.submit-area {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 13px 28px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(99,102,241,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 11px 20px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-secondary:hover { color: var(--text-primary); border-color: rgba(255,255,255,0.18); background: rgba(255,255,255,0.05); transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(0); }

.submit-note { font-size: 0.78rem; color: var(--text-muted); }

/* ── Loading Overlay ──────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,13,19,0.92);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.loading-overlay.active { display: flex; }
.loading-spinner {
  width: 56px;
  height: 56px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-steps { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.loading-step {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: var(--transition);
  opacity: 0;
  transform: translateY(4px);
}
.loading-step.active {
  color: var(--text-secondary);
  opacity: 1;
  transform: translateY(0);
}
.loading-step.done {
  color: var(--green);
  opacity: 1;
  transform: translateY(0);
}
.loading-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }

/* ── Result Page ──────────────────────────────────────────── */
.result-page { padding: 48px 0 80px; }
.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}
.result-header-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}
.result-header-back:hover { color: var(--text-primary); }

/* ── Score Card ───────────────────────────────────────────── */
.result-top {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}
.score-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
}
.score-gauge {
  position: relative;
  width: 140px;
  height: 140px;
}
.score-gauge svg { transform: rotate(-90deg); }
.score-gauge-track { fill: none; stroke: var(--border); stroke-width: 8; }
.score-gauge-bar {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4,0,0.2,1);
}
.score-number {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-value {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}
.score-max { font-size: 0.75rem; color: var(--text-muted); line-height: 1; }

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 40px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.priority-badge.hot { background: var(--hot-bg); color: var(--hot); border: 1px solid rgba(244,63,94,0.3); }
.priority-badge.warm { background: var(--warm-bg); color: var(--warm); border: 1px solid rgba(245,158,11,0.3); }
.priority-badge.cold { background: var(--cold-bg); color: var(--cold); border: 1px solid rgba(100,116,139,0.3); }

.score-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

/* ── Fit Summary ──────────────────────────────────────────── */
.fit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.fit-card h4 { margin-bottom: 12px; }
.fit-card p { font-size: 0.93rem; line-height: 1.75; color: var(--text-secondary); }

/* ── Signals Grid ─────────────────────────────────────────── */
.signals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.signals-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.signals-card h4 { margin-bottom: 14px; }
.signal-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.signal-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.signal-icon { flex-shrink: 0; font-size: 0.9rem; line-height: 1.5; }

/* ── Action Card ──────────────────────────────────────────── */
.action-card {
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(99,102,241,0.04));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.action-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.action-body h3 { font-size: 0.9rem; color: var(--text-secondary); font-weight: 600; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.action-body p { font-size: 0.95rem; color: var(--text-primary); line-height: 1.6; }

/* ── Email Draft ──────────────────────────────────────────── */
.email-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.email-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.email-card-header h3 { font-size: 1rem; font-weight: 700; }
.email-body {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.85;
  white-space: pre-wrap;
  font-family: inherit;
}
.copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.copy-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); border-color: rgba(255,255,255,0.15); }
.copy-btn.copied { color: var(--green); border-color: rgba(16,185,129,0.4); }

/* ── Result Actions ───────────────────────────────────────── */
.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Admin Dashboard ──────────────────────────────────────── */
.admin-page { padding: 40px 0 80px; }
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.admin-header h2 { font-size: 1.5rem; margin-bottom: 2px; }

.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}
.filter-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-btn.hot.active { background: var(--hot); border-color: var(--hot); }
.filter-btn.warm.active { background: var(--warm); border-color: var(--warm); }
.filter-btn.cold.active { background: var(--cold); border-color: var(--cold); }

/* ── Leads Table ──────────────────────────────────────────── */
.leads-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.leads-table {
  width: 100%;
  border-collapse: collapse;
}
.leads-table th {
  padding: 13px 20px;
  text-align: left;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.leads-table th:hover { color: var(--text-secondary); }
.leads-table td {
  padding: 15px 20px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.leads-table tr:last-child td { border-bottom: none; }
.leads-table tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}
.leads-table tbody tr:hover { background: rgba(255,255,255,0.04); }
.leads-table tbody tr:hover .table-name { color: #fff; }

.table-name { font-weight: 600; color: var(--text-primary); transition: color 0.12s; }
.table-company { color: var(--text-secondary); font-size: 0.8rem; }
.table-score {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.03em;
}
.table-date { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }

.badge-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-sm.hot { background: var(--hot-bg); color: var(--hot); }
.badge-sm.warm { background: var(--warm-bg); color: var(--warm); }
.badge-sm.cold { background: var(--cold-bg); color: var(--cold); }

.color-hot { color: var(--hot); }
.color-warm { color: var(--warm); }
.color-cold { color: var(--cold); }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 32px;
}
.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state h3 { font-size: 1.05rem; margin-bottom: 8px; color: var(--text-primary); }
.empty-state p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 24px; }

/* ── Lead Detail Modal ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
@media (min-width: 768px) {
  .modal-overlay { align-items: center; }
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 740px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.modal-body { padding: 24px 28px 28px; display: flex; flex-direction: column; gap: 20px; }

/* ── Modal Tabs ───────────────────────────────────────────── */
.modal-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.modal-tab {
  flex: 1;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.modal-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.modal-tab-content { display: none; }
.modal-tab-content.active { display: block; }

/* ── Event Log ────────────────────────────────────────────── */
.event-log { display: flex; flex-direction: column; gap: 0; }
.event-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.event-item:last-child { border-bottom: none; }
.event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 5px;
  flex-shrink: 0;
}
.event-type {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  margin-bottom: 2px;
}
.event-time { font-size: 0.75rem; color: var(--text-muted); }

/* ── Input Detail Grid ────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-item.full { grid-column: 1 / -1; }
.detail-key {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.detail-val { font-size: 0.875rem; color: var(--text-primary); line-height: 1.5; }

.stat-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  flex: 1;
  min-width: 130px;
  box-shadow: var(--shadow-card);
}
.stat-item .stat-num { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin-bottom: 6px; }
.stat-item .stat-lbl { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }


/* ── Footer (old rule — superseded by appended footer styles) ─ */

/* ── Toast ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  max-width: 300px;
}
@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast.success { border-color: rgba(16,185,129,0.4); }
.toast.error { border-color: rgba(244,63,94,0.4); }

/* ── API Key Banner (soft) ────────────────────────────────── */
.api-banner-soft {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
}
.api-banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warm);
  flex-shrink: 0;
  opacity: 0.7;
}

/* ── Hero Credibility Line ────────────────────────────────── */
.hero-credibility {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.75;
  margin: -12px auto 20px;
  letter-spacing: 0.01em;
}

/* ── Form Micro-copy ──────────────────────────────────────── */
.form-micro-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 14px;
  margin-bottom: 0;
  line-height: 1.6;
}

/* ── How It Works ─────────────────────────────────────────── */
.how-it-works {
  padding: 56px 0 72px;
  text-align: center;
}
.how-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.how-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}
.how-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 120px;
  max-width: 180px;
  padding: 20px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.how-step:hover { background: rgba(255,255,255,0.03); }
.how-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: var(--transition);
}
.how-step:hover .how-icon {
  border-color: rgba(99,102,241,0.35);
  box-shadow: 0 0 12px rgba(99,102,241,0.12);
}
.how-step-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.how-step-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: center;
}
.how-connector {
  width: 32px;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
  margin-bottom: 28px;
}

/* ── Confidence Signal ────────────────────────────────────── */
.confidence-signal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.71rem;
  color: var(--text-muted);
  margin-top: 14px;
  letter-spacing: 0.04em;
}
.confidence-signal::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

/* ── Impact Card ──────────────────────────────────────────── */
.impact-card {
  background: var(--bg-card);
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.impact-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.impact-icon { font-size: 1.1rem; line-height: 1; }
.impact-header h4 { margin-bottom: 0; color: var(--green); }
.impact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.impact-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.87rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.impact-list li::before {
  content: '↑';
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
  font-size: 0.75rem;
  line-height: 1.6;
}

/* ── System Status Badge ──────────────────────────────────── */
.system-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  white-space: nowrap;
}
.system-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: pulse 2.5s infinite;
}

/* ── Fit Card enhancement ────────────────────────────────── */
.fit-card { display: flex; flex-direction: column; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 0 16px; }
  .container, .container--wide { padding: 0 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full-width { grid-column: 1; }
  .result-top { grid-template-columns: 1fr; }
  .signals-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.full { grid-column: 1; }
  .hero { padding: 40px 0 32px; }
  .card { padding: 20px; }
  .modal { max-height: 85vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .how-steps { gap: 4px; }
  .how-connector { display: none; }
  .how-step { min-width: 100px; padding: 14px 8px; }
  .suited-grid { grid-template-columns: 1fr; }
  .cta-card { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ── Section Label (shared) ────────────────────────────────── */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── How It Works upgrade ──────────────────────────────────── */
.how-it-works { padding: 40px 0 56px; text-align: center; }
.how-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}
.how-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 130px;
  max-width: 190px;
  padding: 22px 14px;
  border-radius: var(--radius-md);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.how-step:hover { background: rgba(255,255,255,0.03); box-shadow: 0 0 0 1px var(--border); }
.how-icon {
  width: 52px;
  height: 52px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.how-step:hover .how-icon {
  border-color: rgba(99,102,241,0.4);
  box-shadow: 0 0 14px rgba(99,102,241,0.14);
}
.how-step-num {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.how-step-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.45;
  text-align: center;
}
.how-connector {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--border), rgba(255,255,255,0.04));
  flex-shrink: 0;
  margin-top: 46px;
}

/* ── Best Suited For ───────────────────────────────────────── */
.suited-section {
  padding: 0 0 48px;
}
.suited-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.suited-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  transition: border-color 0.18s, background 0.18s;
}
.suited-item:hover {
  border-color: rgba(99,102,241,0.25);
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.suited-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── CTA Block ─────────────────────────────────────────────── */
.cta-section { padding: 0 0 72px; }
.cta-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-card);
}
.cta-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.cta-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}
.cta-btn {
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}

/* ── Footer Enhancement ────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-proof {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.8;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}
.footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Workflow Outcome ──────────────────────────────────────── */
.workflow-outcome {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.outcome-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.outcome-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.outcome-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.outcome-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin: 0;
  line-height: 1.6;
}

/* ── Admin Proof Note ──────────────────────────────────────── */
.admin-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.admin-proof-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* ── Empty State sub ───────────────────────────────────────── */
.empty-state-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: -10px;
  margin-bottom: 20px;
}
