/* ════════════════════════════════════════════════════════════════
   WEBSITE CHECKER — checker.html
   Premium dark audit tool, on-brand with Ai Gens design system
   ════════════════════════════════════════════════════════════════ */

/* ── Ambient background ──────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 45% at 20% 10%,  rgba(255,255,255,0.028) 0%, transparent 60%),
    radial-gradient(ellipse 45% 35% at 80% 80%, rgba(255,255,255,0.018) 0%, transparent 55%);
  pointer-events: none;
}

/* ── Page wrapper ────────────────────────────────────────────── */
.chk-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding-top: calc(var(--nav-top, 20px) + var(--nav-height, 52px) + 64px);
  padding-bottom: 120px;
}

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

/* ── Hero ────────────────────────────────────────────────────── */
.chk-hero {
  text-align: center;
  margin-bottom: 48px;
}

.chk-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  margin-bottom: 18px;
}

.chk-eyebrow-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  flex-shrink: 0;
}

.chk-title {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 16px;
}

.chk-subtitle {
  font-size: 15px;
  font-weight: 400;
  color: rgba(255,255,255,0.42);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Input Card ──────────────────────────────────────────────── */
.chk-input-card {
  margin-bottom: 40px;
}

.chk-input-glass {
  position: relative;
  background: rgba(255,255,255,0.042);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px;
  padding: 28px 28px 22px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.chk-input-top-highlight {
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  border-radius: 0 0 4px 4px;
  pointer-events: none;
}

.chk-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
  margin-bottom: 12px;
}

.chk-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.chk-url-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.chk-url-icon {
  position: absolute;
  left: 14px;
  color: rgba(255,255,255,0.28);
  pointer-events: none;
  flex-shrink: 0;
}

.chk-url-input {
  width: 100%;
  padding: 12px 14px 12px 38px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-family: inherit;
  font-weight: 400;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.chk-url-input::placeholder { color: rgba(255,255,255,0.22); }
.chk-url-input:focus {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.075);
}

.chk-run-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  color: rgba(255,255,255,0.90);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.chk-run-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.22);
}

.chk-run-btn:active { transform: scale(0.97); }

.chk-run-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.chk-run-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
  pointer-events: none;
}

.chk-run-arrow { transition: transform 0.2s ease; }
.chk-run-btn:hover .chk-run-arrow { transform: translateX(3px); }

/* API key row */
.chk-apikey-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.chk-apikey-input {
  flex: 1;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}
.chk-apikey-input::placeholder { color: rgba(255,255,255,0.18); }
.chk-apikey-input:focus { border-color: rgba(255,255,255,0.15); }

.chk-apikey-btn {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  color: rgba(255,255,255,0.40);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.chk-apikey-btn:hover {
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.70);
}

/* Strategy toggle */
.chk-strategy-row {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}

.chk-strategy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  font-weight: 450;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chk-strategy-btn.active {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.80);
}

.chk-strategy-btn:hover:not(.active) {
  border-color: rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.55);
}

/* ── Loading ─────────────────────────────────────────────────── */
.chk-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 64px 24px;
}

.chk-loading-ring {
  width: 48px;
  height: 48px;
}

.chk-spin-arc {
  transform-origin: center;
  animation: chk-spin 1s linear infinite;
  stroke-dashoffset: 0;
}

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

.chk-loading-text {
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
}

.chk-loading-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.30);
}

/* ── Error ───────────────────────────────────────────────────── */
.chk-error {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  background: rgba(248,113,113,0.07);
  border: 1px solid rgba(248,113,113,0.18);
  border-radius: 14px;
  font-size: 14px;
  color: rgba(248,113,113,0.85);
  margin-bottom: 24px;
}

/* ── Results ─────────────────────────────────────────────────── */
.chk-results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.chk-results-url {
  font-size: 13px;
  color: rgba(255,255,255,0.40);
  font-weight: 400;
  word-break: break-all;
}

.chk-results-time {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Score cards ─────────────────────────────────────────────── */
.chk-scores-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}

@media (max-width: 640px) {
  .chk-scores-grid { grid-template-columns: repeat(2, 1fr); }
}

.chk-score-card {
  position: relative;
  background: rgba(255,255,255,0.040);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 22px 16px 18px;
  text-align: center;
  overflow: hidden;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.chk-score-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
}

.chk-score-card:hover {
  background: rgba(255,255,255,0.058);
  border-color: rgba(255,255,255,0.12);
}

/* Score ring (drawn by canvas) */
.chk-ring-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
}

.chk-ring-canvas {
  width: 72px;
  height: 72px;
  display: block;
}

.chk-ring-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

.chk-score-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
}

/* ── Core Web Vitals ─────────────────────────────────────────── */
.chk-section {
  margin-bottom: 40px;
}

.chk-section-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.30);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.chk-vitals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 520px) {
  .chk-vitals-grid { grid-template-columns: repeat(2, 1fr); }
}

.chk-vital-card {
  position: relative;
  background: rgba(255,255,255,0.038);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px 16px 14px;
  overflow: hidden;
}

.chk-vital-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 14px 14px 0 0;
  opacity: 0.55;
}

.chk-vital-card.good::before  { background: #34d399; }
.chk-vital-card.needs-improvement::before { background: #fbbf24; }
.chk-vital-card.poor::before  { background: #f87171; }

.chk-vital-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 4px;
}

.chk-vital-name {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 2px;
}

.chk-vital-desc {
  font-size: 11px;
  color: rgba(255,255,255,0.22);
  line-height: 1.4;
}

.chk-vital-status {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
}

.good    .chk-vital-status { background: rgba(52,211,153,0.12); color: #34d399; }
.needs-improvement .chk-vital-status { background: rgba(251,191,36,0.12); color: #fbbf24; }
.poor    .chk-vital-status { background: rgba(248,113,113,0.12); color: #f87171; }

/* ── Opportunities list ──────────────────────────────────────── */
.chk-opps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chk-opp-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  transition: background 0.2s ease;
}

.chk-opp-item:hover { background: rgba(255,255,255,0.052); }

.chk-opp-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  margin-top: 1px;
}

.chk-opp-icon.impact-high  { background: rgba(248,113,113,0.12); }
.chk-opp-icon.impact-med   { background: rgba(251,191,36,0.10); }
.chk-opp-icon.impact-low   { background: rgba(148,163,184,0.10); }

.chk-opp-body { flex: 1; min-width: 0; }

.chk-opp-title {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.80);
  margin-bottom: 3px;
  line-height: 1.4;
}

.chk-opp-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.32);
  line-height: 1.5;
}

.chk-opp-saving {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 500;
  color: rgba(251,191,36,0.75);
  white-space: nowrap;
  margin-top: 2px;
}

/* ── Passed audits ───────────────────────────────────────────── */
.chk-passed-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

@media (max-width: 520px) {
  .chk-passed-list { grid-template-columns: 1fr; }
}

.chk-passed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.028);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.48);
}

.chk-passed-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(52,211,153,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chk-passed-check svg { display: block; }

/* ── CTA block ───────────────────────────────────────────────── */
.chk-cta-block {
  margin-top: 56px;
  padding: 40px 32px;
  background: rgba(255,255,255,0.040);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.chk-cta-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
}

.chk-cta-text {
  font-size: 17px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.chk-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 40px;
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.chk-cta-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.24);
}

/* ── Hidden utility ──────────────────────────────────────────── */
[hidden] { display: none !important; }

/* ── Mobile adjustments ──────────────────────────────────────── */
@media (max-width: 640px) {
  .chk-page { padding-top: calc(var(--nav-top, 16px) + var(--nav-height, 48px) + 40px); }
  .chk-input-glass { padding: 20px 16px 16px; }
  .chk-input-row { flex-direction: column; }
  .chk-run-btn { justify-content: center; }
  .chk-cta-block { padding: 28px 20px; }
}
