/* ======= RESET & BASE ======= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0b0f19;
  --bg-card:   #111827;
  --bg-input:  #1a2236;
  --bg-hover:  #1e293b;
  --border:    #1e293b;
  --border-focus: #3b82f6;
  --text:      #e2e8f0;
  --text-dim:  #94a3b8;
  --text-muted:#64748b;
  --accent:    #3b82f6;
  --accent-hover: #2563eb;
  --green:     #22c55e;
  --green-bg:  rgba(34,197,94,.1);
  --yellow:    #eab308;
  --yellow-bg: rgba(234,179,8,.1);
  --red:       #ef4444;
  --red-bg:    rgba(239,68,68,.1);
  --cyan:      #06b6d4;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono:      'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ======= LAYOUT ======= */
.shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ======= HEADER ======= */
.header {
  padding: 24px 0 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.header-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-icon {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(59,130,246,.12);
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-lg);
  font-family: var(--mono);
}
.logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ======= NAV ======= */
.nav {
  display: flex;
  gap: 4px;
  padding-bottom: 0;
}
.nav-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.87rem;
  font-weight: 500;
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  border-radius: var(--radius) var(--radius) 0 0;
}
.nav-btn:hover { color: var(--text); background: var(--bg-hover); }
.nav-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ======= MAIN ======= */
.main { min-height: 60vh; }

/* ======= TABS ======= */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ======= CARDS ======= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ======= FORMS ======= */
.form { display: flex; flex-direction: column; gap: 14px; }
.input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 140px;
}
.input-group.grow { flex: 1; }
.input-group label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.optional {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-weight: 400;
}
input[type="text"] {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.93rem;
  font-family: var(--mono);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
input[type="text"]:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
input[type="text"]::placeholder { color: var(--text-muted); }

/* ======= TOGGLES ======= */
.toggles { display: flex; gap: 20px; }
.toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.toggle input[type="checkbox"] {
  appearance: none;
  width: 16px; height: 16px;
  border: 1.5px solid var(--text-muted);
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
}
.toggle input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ======= BUTTONS ======= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-family: var(--font);
  font-size: 0.87rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ======= RESULTS ======= */
.result-area {
  margin-top: 24px;
}

/* --- Verdict banner --- */
.verdict-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}
.verdict-banner.valid   { background: var(--green-bg);  border: 1px solid rgba(34,197,94,.25); }
.verdict-banner.risky   { background: var(--yellow-bg); border: 1px solid rgba(234,179,8,.25); }
.verdict-banner.invalid { background: var(--red-bg);    border: 1px solid rgba(239,68,68,.25); }

.verdict-icon {
  font-size: 2rem;
  line-height: 1;
}
.verdict-text h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.verdict-text .score {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* --- Score ring --- */
.score-ring {
  width: 56px;
  height: 56px;
  margin-left: auto;
  flex-shrink: 0;
}
.score-ring svg { width: 100%; height: 100%; }
.score-ring-bg { fill: none; stroke: var(--border); stroke-width: 4; }
.score-ring-fg { fill: none; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.score-ring-text {
  font-size: 14px;
  font-weight: 700;
  fill: var(--text);
  text-anchor: middle;
  dominant-baseline: central;
  font-family: var(--mono);
}

/* --- Detail sections --- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.detail-card h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--text-dim); }
.detail-row .value { font-family: var(--mono); font-size: 0.82rem; }

/* --- Tags --- */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--mono);
}
.tag-green  { background: var(--green-bg);  color: var(--green); }
.tag-yellow { background: var(--yellow-bg); color: var(--yellow); }
.tag-red    { background: var(--red-bg);    color: var(--red); }
.tag-cyan   { background: rgba(6,182,212,.1); color: var(--cyan); }
.tag-dim    { background: var(--bg-input);   color: var(--text-muted); }

/* --- Signal lists --- */
.signal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.signal-list li {
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 6px;
}
.signal-list li.strength {
  background: var(--green-bg);
  color: var(--green);
}
.signal-list li.warning {
  background: var(--yellow-bg);
  color: var(--yellow);
}
.signal-list li::before {
  margin-right: 6px;
  font-weight: 700;
}
.signal-list li.strength::before { content: '+'; }
.signal-list li.warning::before  { content: '!'; }

/* --- Candidate table --- */
.candidate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.candidate-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.candidate-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.candidate-table tr:last-child td { border-bottom: none; }
.candidate-table tr.top td { background: rgba(59,130,246,.06); }
.candidate-table .email-cell {
  font-family: var(--mono);
  color: var(--cyan);
  font-size: 0.82rem;
}
.candidate-table .source-cell {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* --- Email list (generate) --- */
.email-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.email-list li {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--cyan);
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .12s;
}
.email-list li:hover { background: var(--bg-hover); }
.email-list li .copy-hint {
  float: right;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font);
}

/* --- Provider badge --- */
.provider-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 16px;
}

/* --- DORK links --- */
.dork-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dork-list li a {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  word-break: break-all;
  transition: color .15s;
}
.dork-list li a:hover { color: var(--accent); }

/* --- Spinner --- */
.spinner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  color: var(--text-dim);
  font-size: 0.88rem;
}
.spinner::before {
  content: '';
  width: 20px; height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Error --- */
.error-box {
  padding: 16px 20px;
  background: var(--red-bg);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 0.88rem;
}

/* --- Strategy banner --- */
.strategy-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.84rem;
  margin-bottom: 16px;
}
.strategy-banner .label { color: var(--text-muted); }

/* --- Section heading --- */
.section-heading {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 24px 0 10px;
}

/* ======= FOOTER ======= */
.footer {
  padding: 32px 0;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ======= RESPONSIVE ======= */
@media (max-width: 640px) {
  .input-row { flex-direction: column; }
  .input-group { min-width: 0; width: 100%; }
  .nav { overflow-x: auto; }
  .nav-btn { font-size: 0.8rem; padding: 8px 14px; }
  .card { padding: 18px 16px; }
  .verdict-banner { flex-wrap: wrap; }
}
