*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-light: #f0fdf4;
  --bg: #f8f9fc;
  --surface: #ffffff;
  --text: #141b2d;
  --text-secondary: #5a6378;
  --border: #e2e6ee;
  --critical: #dc2626;
  --critical-bg: #fef2f2;
  --high: #ea580c;
  --high-bg: #fff7ed;
  --medium: #ca8a04;
  --medium-bg: #fefce8;
  --good: #16a34a;
  --good-bg: #f0fdf4;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -5px rgba(0,0,0,0.03);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo-accent {
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--primary-light);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

/* Hero */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  margin-bottom: 24px;
  letter-spacing: 0.3px;
}

.hero h1 {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  color: var(--text);
}

.gradient {
  background: linear-gradient(135deg, #16a34a, #0d9488);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  max-width: 580px;
  margin: 0 auto 40px;
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* URL Form */
.url-form {
  max-width: 600px;
  margin: 0 auto;
}

.input-group {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}

.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.input-icon {
  display: flex;
  padding: 0 12px;
  color: var(--text-secondary);
}

.input-group input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 4px;
  font-size: 16px;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
}

.input-group input::placeholder {
  color: #a0a8b8;
}

.input-group button {
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  justify-content: center;
}

.input-group button:hover:not(:disabled) {
  background: var(--primary-dark);
}

.input-group button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
}

/* Progress */
.progress-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.progress-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.progress-pct {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 28px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #0d9488);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.progress-phases {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.4;
  transition: all 0.3s;
}

.phase.active {
  opacity: 1;
}

.phase.done {
  opacity: 0.6;
}

.phase.done .phase-check {
  opacity: 1;
}

.phase-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.3s;
}

.phase.active .phase-icon {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.2);
}

.phase.done .phase-icon {
  background: var(--good);
  color: white;
}

.phase-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.phase-check {
  font-size: 14px;
  color: var(--good);
  opacity: 0;
  transition: opacity 0.3s;
}

.phase-connector {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 8px;
  margin-bottom: 28px;
}

.progress-msg {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Results */
.results-header {
  margin-bottom: 32px;
}

.results-header h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.result-url {
  font-size: 15px;
  color: var(--primary);
  font-weight: 500;
  word-break: break-all;
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.summary-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.sc-value {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}

.sc-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-card.critical .sc-value { color: var(--critical); }
.summary-card.high .sc-value { color: var(--high); }
.summary-card.medium .sc-value { color: var(--medium); }
.summary-card.good .sc-value { color: var(--good); }

/* Positives */
.positives-card {
  background: var(--good-bg);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 28px;
}

.positives-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--good);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-icon {
  font-weight: 900;
}

.positives-card ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.positives-card li {
  background: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #bbf7d0;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.tab-badge {
  background: var(--border);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.tab.active .tab-badge {
  background: var(--primary-light);
  color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Issues Table */
.issues-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.issues-table th {
  background: #f4f5f8;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.issues-table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.issues-table tr:last-child td {
  border-bottom: none;
}

.issues-table .detail-cell {
  color: var(--text-secondary);
  font-size: 13px;
}

.severity-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sev-critical { background: var(--critical-bg); color: var(--critical); }
.sev-high { background: var(--high-bg); color: var(--high); }
.sev-medium { background: var(--medium-bg); color: var(--medium); }
.sev-low { background: #f3f4f6; color: var(--text-secondary); }

.empty-row {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 40px !important;
}

/* Details */
.details-section {
  margin-top: 32px;
}

.details-section h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.detail-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-value {
  font-weight: 500;
  color: var(--text);
  max-width: 60%;
  text-align: right;
  word-break: break-all;
}

/* Actions */
.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 40px;
  padding: 32px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Error */
.error-card {
  background: var(--critical-bg);
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}

.error-card h2 {
  color: var(--critical);
  margin-bottom: 12px;
}

.error-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Footer */
.footer {
  margin-top: 80px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Section spacing */
.section {
  padding: 24px 0 60px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 26px; }
  .hero { padding: 40px 0 32px; }
  .hero-sub { font-size: 15px; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .summary-card { padding: 16px; }
  .sc-value { font-size: 28px; }
  .details-grid { grid-template-columns: 1fr; }
  .progress-phases { flex-wrap: wrap; gap: 4px; justify-content: center; }
  .phase-connector { display: none; }
  .phase { min-width: 70px; }
  .phase-icon { width: 32px; height: 32px; }
  .phase-label { font-size: 10px; }
  .actions { flex-direction: column; align-items: stretch; }
  .actions .btn { justify-content: center; }
  .issues-table th:nth-child(5),
  .issues-table td:nth-child(5) { display: none; }
  .issues-table { font-size: 13px; }
  .issues-table th,
  .issues-table td { padding: 10px 10px; }
  .input-group { flex-wrap: nowrap; }
  .input-group input { font-size: 15px; padding: 12px 4px; }
  .input-group button { min-width: 0; padding: 10px 16px; font-size: 14px; }
  .input-icon { padding: 0 8px; }
  .progress-card { padding: 24px 16px; }
  .progress-header h2 { font-size: 16px; }
  .progress-pct { font-size: 22px; }
  .results-header h2 { font-size: 22px; }
  .auth-banner { flex-direction: column; align-items: stretch; text-align: center; font-size: 13px; padding: 12px 16px; }
  .auth-banner a { margin-left: 0; justify-content: center; }
  .quota-banner { flex-direction: column; align-items: stretch; text-align: center; gap: 8px; }
  .quota-banner a { margin-left: 0; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 22px; letter-spacing: -0.3px; }
  .hero-badge { font-size: 11px; padding: 4px 12px; }
  .hero-sub { font-size: 14px; }
  .summary-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .summary-card { padding: 12px; }
  .sc-value { font-size: 24px; }
  .sc-label { font-size: 11px; }
  .issues-table { font-size: 12px; }
  .issues-table th,
  .issues-table td { padding: 8px 8px; }
  .issues-table th:nth-child(2),
  .issues-table td:nth-child(2) { display: none; }
  .severity-tag { font-size: 10px; padding: 2px 6px; }
  .tab { font-size: 12px; padding: 10px 12px; }
  .input-group button { padding: 10px 14px; font-size: 13px; }
  .input-group input { font-size: 14px; }
  .tabs { gap: 2px; padding: 3px; }
  .actions { padding: 20px 16px; }
  .progress-phases { gap: 2px; }
  .phase { min-width: 60px; }
  .phase-icon { width: 28px; height: 28px; }
  .issues-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .detail-item { flex-direction: column; gap: 4px; }
  .detail-value { max-width: 100%; text-align: left; }
}

.auth-banner {
  display: flex; align-items: center; gap: 10px;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  padding: 12px 20px; border-radius: 10px; margin-bottom: 20px;
  font-size: 14px; color: #166534; flex-wrap: wrap;
}
.auth-banner svg { flex-shrink: 0; }
.auth-banner a { margin-left: auto; }
.auth-btn {
  display: inline-flex; align-items: center;
  padding: 6px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  background: var(--primary); color: #fff; transition: all .15s;
}
.auth-btn:hover { background: var(--primary-dark); }
.auth-btn-outline {
  background: transparent; color: var(--primary); border: 1.5px solid var(--primary);
}
.auth-btn-outline:hover { background: var(--primary-light); }

.quota-banner {
  display: flex; align-items: center; gap: 10px;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  padding: 10px 20px; border-radius: 10px; margin-bottom: 20px;
  font-size: 13px; color: #166534;
}
.quota-banner a { margin-left: auto; }
