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

:root {
  --blue: #1a6cf7;
  --blue-dark: #0f4fc9;
  --blue-light: #e8f0fe;
  --green: #16a34a;
  --green-light: #dcfce7;
  --amber: #d97706;
  --amber-light: #fef3c7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-900: #111827;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden { display: none !important; }

/* ─── Hero ─── */
.hero {
  background: linear-gradient(135deg, #0f1f5c 0%, #1a3a9e 50%, #1a6cf7 100%);
  color: #fff;
  padding: 80px 20px 70px;
  text-align: center;
}

.badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 14px;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 62px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 14px;
}

.accent { color: #7dd3fc; }

.tagline {
  font-size: clamp(16px, 2.5vw, 20px);
  opacity: 0.85;
  margin-bottom: 36px;
}

/* Search box */
.search-box {
  display: flex;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto 12px;
}

.input-wrap {
  flex: 1;
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  pointer-events: none;
}

#urlInput {
  width: 100%;
  padding: 14px 14px 14px 44px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-size: 16px;
  background: #fff;
  color: var(--gray-900);
  outline: none;
  transition: border-color 0.2s;
}

#urlInput:focus { border-color: #7dd3fc; }

#auditBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: #7dd3fc;
  color: #0c1f5c;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
}

#auditBtn:hover { background: #38bdf8; }
#auditBtn:active { transform: scale(0.98); }
#auditBtn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.hint {
  font-size: 13px;
  opacity: 0.6;
}

/* ─── Features Strip ─── */
.features-strip {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 20px 0;
}

.features-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--gray-600);
  font-weight: 500;
}

.feature svg {
  width: 18px;
  height: 18px;
  color: var(--blue);
}

/* ─── Loading ─── */
.loading-section { padding: 60px 0; text-align: center; }

.loader-wrap { display: inline-block; }

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

#loadingText {
  color: var(--gray-600);
  margin-bottom: 16px;
  font-size: 15px;
}

.progress-bar {
  width: 260px;
  height: 4px;
  background: var(--gray-200);
  border-radius: 100px;
  overflow: hidden;
  margin: 0 auto;
}

.progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 100px;
  transition: width 0.4s ease;
  width: 0%;
}

/* ─── Results ─── */
.results-section { padding: 40px 0 60px; }

.score-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.score-left { text-align: center; flex-shrink: 0; }

.score-circle {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 8px;
}

.score-ring {
  width: 120px;
  height: 120px;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--gray-100);
  stroke-width: 10;
}

.ring-fill {
  fill: none;
  stroke: var(--blue);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1s ease, stroke 0.5s;
}

.score-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: 800;
  color: var(--gray-900);
}

.score-label {
  font-size: 13px;
  color: var(--gray-400);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.score-right { flex: 1; min-width: 200px; }

.audited-url {
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
  word-break: break-all;
  margin-bottom: 12px;
}

.summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
}

.pill.pass { background: var(--green-light); color: var(--green); }
.pill.warn { background: var(--amber-light); color: var(--amber); }
.pill.fail { background: var(--red-light); color: var(--red); }

.score-desc { font-size: 14px; color: var(--gray-600); }

/* ─── Checks Grid ─── */
.checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.check-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-left: 4px solid transparent;
}

.check-card.pass { border-left-color: var(--green); }
.check-card.warn { border-left-color: var(--amber); }
.check-card.fail { border-left-color: var(--red); }

.check-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}

.check-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.pass .check-icon { background: var(--green-light); color: var(--green); }
.warn .check-icon { background: var(--amber-light); color: var(--amber); }
.fail .check-icon { background: var(--red-light); color: var(--red); }

.check-name {
  font-size: 14px;
  font-weight: 600;
}

.check-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pass .check-badge { background: var(--green-light); color: var(--green); }
.warn .check-badge { background: var(--amber-light); color: var(--amber); }
.fail .check-badge { background: var(--red-light); color: var(--red); }

.check-body {
  padding: 0 16px 14px;
  border-top: 1px solid var(--gray-100);
}

.check-value {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 10px;
  word-break: break-word;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.check-tip {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 6px;
  line-height: 1.5;
}

.chevron { transition: transform 0.2s; font-size: 12px; color: var(--gray-400); }
.check-card.open .chevron { transform: rotate(180deg); }

/* ─── Export Row ─── */
.export-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }

/* ─── How it works ─── */
.how-section {
  background: #fff;
  padding: 64px 20px;
  border-top: 1px solid var(--gray-200);
}

.section-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 40px;
  letter-spacing: -0.01em;
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.step {
  text-align: center;
  max-width: 200px;
}

.step-num {
  width: 44px;
  height: 44px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-size: 18px;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.step h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--gray-600); }

.step-arrow {
  font-size: 24px;
  color: var(--gray-400);
  margin-top: 12px;
  flex-shrink: 0;
}

/* ─── Footer ─── */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  text-align: center;
  padding: 28px 20px;
  font-size: 14px;
}

.footer a { color: #7dd3fc; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .search-box { flex-direction: column; }
  #auditBtn { justify-content: center; }
  .score-card { flex-direction: column; text-align: center; }
  .summary-pills { justify-content: center; }
  .checks-grid { grid-template-columns: 1fr; }
  .step-arrow { transform: rotate(90deg); }
}

@media print {
  .hero, .features-strip, .how-section, .footer, .export-row { display: none !important; }
  .results-section { padding: 0; }
  .check-card { box-shadow: none; border: 1px solid var(--gray-200); page-break-inside: avoid; }
}
