:root {
  --bg: #0A1A1A;
  --bg2: #0F2828;
  --bg3: #153838;
  --card: #0D2424;
  --accent: #10B981;
  --accent2: #34D399;
  --text: #E2E8F0;
  --muted: #94A3B8;
  --border: #1E5E4E;
  --green: #22C55E;
  --red: #EF4444;
  --orange: #F59E0B;
  --cyan: #06B6D4;
  --radius: 14px;
  --maxw: 1080px;
}

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

/* Several rules below set an explicit `display`, which would otherwise beat the
   `hidden` attribute. Keep `hidden` authoritative. */
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 26, 26, .85);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { display: flex; }
.brand-text { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.brand-accent { color: var(--accent); }

main { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px 64px; }
.view { padding-top: 48px; }

/* ---------- Hero ---------- */
.hero { text-align: center; max-width: 720px; margin: 0 auto; }
.hero h1 {
  font-size: clamp(32px, 6vw, 50px);
  font-weight: 850; letter-spacing: -.03em; line-height: 1.1;
  background: linear-gradient(135deg, var(--text) 25%, var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--muted); font-size: 17px; margin: 16px auto 34px; max-width: 600px; }

.audit-form { text-align: left; }
.url-row { display: flex; gap: 10px; }
.url-row input {
  flex: 1; min-width: 0;
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: 15px 18px; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.url-row input::placeholder { color: #4A6666; }
.url-row input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .18);
}

.quick-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.field select, .filters select {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 9px 12px; font-size: 14px; cursor: pointer;
}
.field select:focus, .filters select:focus { outline: none; border-color: var(--accent); }

.link-btn {
  background: none; border: none; color: var(--accent2);
  font-size: 13px; cursor: pointer; padding: 9px 0; text-decoration: underline;
  text-underline-offset: 3px;
}
.advanced {
  display: flex; gap: 20px; flex-wrap: wrap; align-items: center;
  margin-top: 18px; padding: 18px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
}
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.checkbox input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.checkbox em { color: var(--muted); font-style: normal; font-size: 12px; }

.form-error {
  margin-top: 14px; padding: 11px 14px; font-size: 14px;
  background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .4);
  border-radius: 9px; color: #FCA5A5;
}
.fineprint { color: var(--muted); font-size: 12.5px; margin-top: 14px; }

/* ---------- Buttons ---------- */
.btn {
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 15px 26px; font-size: 15px; font-weight: 650;
  cursor: pointer; white-space: nowrap; font-family: inherit;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #05221A; }
.btn-primary:hover { background: var(--accent2); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); padding: 10px 18px; font-size: 14px; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent2); }
.btn-small {
  padding: 8px 14px; font-size: 13px; border-radius: 9px;
  background: var(--bg3); color: var(--text); border-color: var(--border);
}
.btn-small:hover { background: var(--border); }

/* ---------- Features ---------- */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px; margin-top: 64px;
}
.feature { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feature h3 { font-size: 15px; color: var(--accent2); margin-bottom: 7px; }
.feature p { color: var(--muted); font-size: 13.5px; }

/* ---------- Progress ---------- */
.progress-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 44px 32px; text-align: center; max-width: 620px; margin: 40px auto;
}
.spinner {
  width: 42px; height: 42px; margin: 0 auto 22px;
  border: 3px solid var(--bg3); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 850ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

.progress-card h2 { font-size: 20px; font-weight: 700; }
.progress-target { color: var(--accent2); font-size: 14px; margin-top: 6px; word-break: break-all; }
.progress-track { background: var(--bg3); border-radius: 5px; height: 9px; margin: 26px 0 20px; overflow: hidden; }
.progress-fill { background: linear-gradient(90deg, var(--accent), var(--accent2)); height: 100%; width: 0; border-radius: 5px; transition: width .4s ease; }
.progress-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.progress-stats div { display: flex; flex-direction: column; }
.progress-stats strong { font-size: 22px; font-weight: 800; color: var(--accent2); }
.progress-stats span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.current-url { color: var(--muted); font-size: 12px; word-break: break-all; margin-bottom: 22px; min-height: 18px; }

/* ---------- Results ---------- */
.results-head { display: flex; gap: 34px; align-items: center; flex-wrap: wrap; margin-bottom: 32px; }
.score-block { position: relative; width: 150px; height: 150px; flex-shrink: 0; }
.score-ring circle:last-child { transition: stroke-dashoffset .9s ease, stroke .4s; }
.score-centre {
  position: absolute; inset: 0; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
}
.score-centre span { font-size: 44px; font-weight: 900; line-height: 1; }
.score-centre small { color: var(--muted); font-size: 12px; margin-top: 3px; }

.results-meta { flex: 1; min-width: 280px; }
.results-meta h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; word-break: break-all; }
.result-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.summary { color: var(--text); font-size: 14.5px; margin-top: 14px; }

.export-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.export-label { color: var(--muted); font-size: 12.5px; margin-right: 2px; }

.score-bars {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 16px; margin-bottom: 28px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.score-bar-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.score-bar-label b { font-weight: 700; }
.score-bar-track { background: var(--bg3); border-radius: 4px; height: 7px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 4px; transition: width .7s ease; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 30px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column;
}
.stat-card strong { font-size: 28px; font-weight: 850; color: var(--accent2); }
.stat-card span { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-card.critical strong { color: var(--red); }
.stat-card.warning strong { color: var(--orange); }
.stat-card.info strong { color: var(--cyan); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); padding: 11px 18px; font-size: 14.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; margin-bottom: -1px;
}
.tab.active { color: var(--accent2); border-bottom-color: var(--accent); }

.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.filter-count { color: var(--muted); font-size: 13px; }

/* ---------- Issues ---------- */
.issue-list { display: flex; flex-direction: column; gap: 10px; }
.issue {
  background: var(--card); border: 1px solid var(--border);
  border-left-width: 3px; border-radius: 10px; overflow: hidden;
}
.issue.critical { border-left-color: var(--red); }
.issue.warning  { border-left-color: var(--orange); }
.issue.info     { border-left-color: var(--cyan); }

.issue-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px 18px; background: none; border: none; cursor: pointer;
  text-align: left; font-family: inherit; color: var(--text);
}
.issue-head:hover { background: rgba(255, 255, 255, .022); }
.badge {
  font-size: 10.5px; font-weight: 750; padding: 3px 9px; border-radius: 5px;
  text-transform: uppercase; letter-spacing: .04em; color: #fff; flex-shrink: 0;
}
.badge.critical { background: var(--red); }
.badge.warning  { background: var(--orange); }
.badge.info     { background: var(--cyan); }
.issue-title { flex: 1; font-size: 14.5px; font-weight: 600; min-width: 0; }
.issue-cat { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }
.chevron { color: var(--muted); flex-shrink: 0; transition: transform .2s; font-size: 12px; }
.issue.open .chevron { transform: rotate(90deg); }

.issue-body { padding: 0 18px 18px; display: grid; gap: 13px; }
.issue-body dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 3px; }
.issue-body dd { font-size: 14px; }
.issue-body .fix { color: var(--accent2); }
.issue-body .url { font-size: 12.5px; color: var(--muted); word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- Pages table ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.pages-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 760px; }
.pages-table th {
  text-align: left; padding: 12px 14px; color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  background: var(--bg2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.pages-table td { padding: 11px 14px; border-bottom: 1px solid rgba(30, 94, 78, .35); vertical-align: top; }
.pages-table tr:last-child td { border-bottom: none; }
.pages-table .col-url { max-width: 300px; word-break: break-all; color: var(--muted); font-size: 12px; }
.pages-table .col-title { max-width: 260px; }
.pages-table .num { text-align: center; white-space: nowrap; }
.status-ok { color: var(--green); font-weight: 700; }
.status-redirect { color: #3B82F6; font-weight: 700; }
.status-client { color: var(--orange); font-weight: 700; }
.status-server { color: var(--red); font-weight: 700; }
.flag { color: var(--red); font-weight: 700; }
.empty { color: var(--muted); text-align: center; padding: 40px; font-size: 14px; }

/* ---------- Error ---------- */
.error-card {
  background: var(--card); border: 1px solid rgba(239, 68, 68, .4);
  border-radius: var(--radius); padding: 40px; text-align: center; max-width: 560px; margin: 40px auto;
}
.error-card h2 { font-size: 21px; margin-bottom: 12px; }
.error-card p { color: var(--muted); font-size: 15px; margin-bottom: 24px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 22px 24px; text-align: center; }
.site-footer p { color: var(--muted); font-size: 12.5px; max-width: var(--maxw); margin: 0 auto; }
.site-footer code { background: var(--bg2); padding: 2px 6px; border-radius: 4px; font-size: 11.5px; }

@media (max-width: 620px) {
  .url-row { flex-direction: column; }
  .progress-stats { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .results-head { gap: 22px; }
  main { padding: 0 16px 48px; }
  .view { padding-top: 32px; }
}

/* ---------- Brilliant Hosting promotion ---------- */
.header-actions { display: flex; align-items: center; gap: 14px; }
.byline { color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.byline strong { color: var(--accent2); font-weight: 650; }
.byline:hover strong { text-decoration: underline; text-underline-offset: 3px; }

.hero-byline { color: var(--muted); font-size: 13.5px; margin-top: 26px; }
.hero-byline a { color: var(--accent2); font-weight: 650; text-decoration: none; }
.hero-byline a:hover { text-decoration: underline; text-underline-offset: 3px; }

.cta-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-top: 34px; padding: 26px 28px;
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(52,211,153,.05));
}
.cta-copy h3 { font-size: 18px; font-weight: 750; margin-bottom: 6px; }
.cta-copy p { color: var(--muted); font-size: 14px; max-width: 560px; }
.cta-card .btn { flex-shrink: 0; }

.footer-brand { color: var(--text) !important; font-size: 13.5px !important; margin-bottom: 8px; }
.footer-brand a { color: var(--accent2); font-weight: 650; text-decoration: none; }
.footer-brand a:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 620px) {
  .byline { display: none; }
  .cta-card { flex-direction: column; align-items: flex-start; }
  .cta-card .btn { width: 100%; }
}

/* ---------- "It's free" messaging ---------- */
.free-badge {
  display: inline-block; margin-bottom: 18px;
  padding: 6px 15px; border-radius: 999px;
  background: rgba(16, 185, 129, .14); border: 1px solid rgba(16, 185, 129, .45);
  color: var(--accent2); font-size: 12.5px; font-weight: 650; letter-spacing: .01em;
}
.hero-sub strong { color: var(--accent2); font-weight: 700; }
.free-tag {
  font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent2); background: rgba(16,185,129,.14);
  border: 1px solid rgba(16,185,129,.4); padding: 3px 8px; border-radius: 5px;
}
