* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; background: #0e0f12; color: #e5e7eb; }
.container { max-width: 900px; margin: 0 auto; padding: 40px 20px; min-height: 100vh; display: flex; flex-direction: column; }

header { text-align: center; margin-bottom: 40px; }
.brand-wordmark { font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 1.4rem; color: #d4af37; letter-spacing: 1px; margin-bottom: 16px; }
header h1 { font-family: 'Montserrat', sans-serif; font-size: 2.5rem; font-weight: 800; margin: 0 0 10px; letter-spacing: -0.02em; color: #fff; }
header p { color: #9ca3af; font-size: 1.1rem; }

.audit-form { display: flex; gap: 12px; max-width: 600px; margin: 0 auto 40px; }
.audit-form input {
  flex: 1; padding: 14px 20px; border: 2px solid #2a2c34; border-radius: 12px;
  font-size: 16px; outline: none; transition: border-color 0.2s; background: #16171c; color: #e5e7eb;
}
.audit-form input::placeholder { color: #6b7280; }
.audit-form input:focus { border-color: #d4af37; }
.audit-form button {
  padding: 14px 28px; background: #d4af37; color: #0e0f12; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 700; cursor: pointer; transition: background 0.2s; white-space: nowrap;
}
.audit-form button:hover { background: #FFD700; }
.audit-form button:disabled { background: #555; color: #999; cursor: not-allowed; }

#loading { text-align: center; padding: 40px 0; }
.loading-text { color: #9ca3af; font-size: 15px; }
.spinner {
  width: 48px; height: 48px; border: 4px solid #2a2c34; border-top-color: #d4af37;
  border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-steps {
  display: flex; flex-direction: column; gap: 8px; max-width: 320px;
  margin: 24px auto 0; text-align: left;
}
.step {
  padding: 10px 16px; background: #16171c; border-radius: 8px; color: #6b7280;
  font-size: 14px; transition: all 0.3s ease;
}
.step.active { background: #d4af37; color: #0e0f12; font-weight: 600; }

.error-box {
  max-width: 500px; margin: 0 auto; padding: 24px; background: #1c1416;
  border: 1px solid #7f1d1d; border-radius: 12px; text-align: center;
}
.error-box strong { color: #f87171; font-size: 18px; }
.error-box p { color: #fca5a5; margin: 8px 0 16px; }
.error-box button {
  padding: 10px 24px; background: #d4af37; color: #0e0f12; border: none;
  border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 700;
}

.results-header { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; }
.score-circle {
  width: 100px; height: 100px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: white; flex-shrink: 0;
}
.score-good { background: #16a34a; }
.score-ok { background: #d97706; }
.score-bad { background: #dc2626; }
.score-circle span:first-child { font-size: 32px; font-weight: 800; line-height: 1; }
.score-label { font-size: 10px; text-transform: uppercase; opacity: 0.9; letter-spacing: 0.5px; }

.results-meta h2 { font-size: 1.5rem; font-weight: 700; color: #fff; }
.results-meta p { color: #9ca3af; font-size: 15px; }

.download-buttons { display: flex; gap: 12px; margin-bottom: 24px; }
.btn {
  padding: 12px 24px; border-radius: 10px; text-decoration: none; font-weight: 600;
  font-size: 14px; transition: all 0.2s; display: inline-block; cursor: pointer; border: none;
}
.btn-primary { background: #d4af37; color: #0e0f12; }
.btn-primary:hover { background: #FFD700; }
.btn-secondary { background: #16171c; color: #e5e7eb; border: 2px solid #2a2c34; }
.btn-secondary:hover { background: #1f2027; border-color: #d4af37; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: #16171c; border: 1px solid #2a2c34; border-radius: 12px;
  padding: 20px; text-align: center;
}
.stat-value { font-size: 28px; font-weight: 800; color: #fff; }
.stat-label { font-size: 11px; text-transform: uppercase; color: #9ca3af; margin-top: 4px; letter-spacing: 0.5px; }

.result-section { margin-bottom: 24px; }
.result-section h3 {
  font-size: 1.1rem; margin-bottom: 12px; padding-bottom: 8px; color: #fff;
  border-bottom: 2px solid #2a2c34;
}
.result-section h4 {
  font-size: 0.95rem; margin: 16px 0 8px; color: #cbd5e1;
}
.result-item {
  padding: 10px 16px; margin-bottom: 4px; border-radius: 8px;
  font-size: 14px; border-left: 4px solid; line-height: 1.5;
}
.result-item.issue { background: #1c1416; border-color: #dc2626; color: #fca5a5; }
.result-item.warning { background: #1c1810; border-color: #d97706; color: #fcd34d; }
.result-item.pass { background: #101c14; border-color: #16a34a; color: #86efac; }

.overview-table table {
  width: 100%; border-collapse: collapse; background: #16171c;
  border: 1px solid #2a2c34; border-radius: 8px; overflow: hidden;
}
.overview-table td {
  padding: 10px 16px; border-bottom: 1px solid #2a2c34; font-size: 14px;
}
.overview-table td:first-child { width: 180px; color: #9ca3af; }

.keyword-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.keyword-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: #16171c; border: 1px solid #2a2c34; border-radius: 20px;
  padding: 6px 14px; font-size: 13px;
}
.kw-pos { font-weight: 700; font-size: 12px; }
.kw-text { font-weight: 500; }
.kw-vol { font-size: 11px; color: #9ca3af; }

.data-table {
  width: 100%; border-collapse: collapse; background: #16171c;
  border: 1px solid #2a2c34; border-radius: 8px; overflow: hidden;
  margin-bottom: 16px;
}
.data-table th {
  background: #0e0f12; color: #d4af37; padding: 10px 16px; text-align: left;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table td {
  padding: 8px 16px; border-bottom: 1px solid #2a2c34; font-size: 14px;
}
.data-table tr:nth-child(even) td { background: #1f2027; }

.run-another { text-align: center; margin-top: 32px; }

footer {
  text-align: center; margin-top: auto; padding-top: 40px;
  color: #6b7280; font-size: 13px;
}
footer strong { color: #d4af37; }

@media (max-width: 640px) {
  header h1 { font-size: 1.8rem; }
  .audit-form { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .results-header { flex-direction: column; text-align: center; }
  .download-buttons { flex-direction: column; }
  .download-buttons .btn { text-align: center; }
}
