/* SEO Checker - style.css
   Author: Adil Makhdoom (https://theadil.me)
   License: MIT
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

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

:root {
  --ink:         #0d1117;
  --ink-soft:    #3d4451;
  --ink-mute:    #7a8394;
  --border:      #e2e6ec;
  --surface:     #ffffff;
  --bg:          #f5f7fa;

  --blue:        #1a6cf5;
  --blue-hover:  #0f57d4;
  --blue-tint:   #eef4ff;

  --green:       #0d9e6e;
  --green-tint:  #e8faf4;

  --amber:       #c97d0a;
  --amber-tint:  #fef8ec;

  --red:         #d63b3b;
  --red-tint:    #fef1f1;

  --radius-sm:   6px;
  --radius:      12px;
  --radius-lg:   18px;
  --shadow-xs:   0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.07);
  --shadow-md:   0 4px 20px rgba(0,0,0,.09);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---- HEADER ---- */
header {
  background: var(--ink);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 30px;
  height: 30px;
  background: var(--blue);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-mark svg { width: 16px; height: 16px; fill: #fff; }

.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.header-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue);
  background: rgba(26,108,245,.18);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ---- HERO ---- */
.hero {
  background: var(--ink);
  padding: 72px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle grid texture */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Accent glow behind headline */
.hero::after {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse at center, rgba(26,108,245,.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 20px;
}

.hero-eyebrow span {
  width: 20px;
  height: 1px;
  background: var(--blue);
  display: inline-block;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.hero h1 em {
  font-style: normal;
  color: var(--blue);
}

.hero-sub {
  font-size: 1.05rem;
  color: #8d9ab0;
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* Input area */
.input-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  padding: 8px 8px 8px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 620px;
  margin: 0 auto;
  backdrop-filter: blur(8px);
  transition: border-color .2s, box-shadow .2s;
}

.input-card:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,108,245,.25);
}

#url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.97rem;
  font-family: inherit;
  color: #fff;
  min-width: 0;
}

#url-input::placeholder { color: #5a6880; }

#audit-btn {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, transform .15s;
  letter-spacing: -0.01em;
}

#audit-btn:hover  { background: var(--blue-hover); }
#audit-btn:active { transform: scale(0.97); }
#audit-btn:disabled { background: #334; cursor: not-allowed; transform: none; color: #667; }

.hero-trust {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.trust-item {
  font-size: 0.75rem;
  color: #5a6880;
  display: flex;
  align-items: center;
  gap: 5px;
}

.trust-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

/* ---- MAIN ---- */
main {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* Only show vertical padding when there is something to show */
#loader,
#results {
  padding-top: 40px;
  padding-bottom: 80px;
}

#error-box {
  margin-top: 24px;
}

/* ---- ERROR ---- */
#error-box {
  display: none;
  background: var(--red-tint);
  border: 1px solid #f5c6c6;
  border-radius: var(--radius);
  padding: 14px 18px;
  color: var(--red);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 24px;
}

/* ---- LOADER ---- */
#loader {
  display: none;
  text-align: center;
  padding: 64px 0;
}

.spinner-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
}

.spinner-track {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--border);
}

.spinner-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--blue);
  animation: spin .75s linear infinite;
}

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

.loader-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.loader-sub {
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin-top: 4px;
}

/* ---- RESULTS ---- */
#results { display: none; }

/* Score panel */
.score-panel {
  background: var(--ink);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 36px;
  position: relative;
  overflow: hidden;
}

.score-panel::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 40px solid rgba(255,255,255,.03);
  pointer-events: none;
}

/* SVG ring score */
.score-ring-wrap {
  flex-shrink: 0;
  position: relative;
  width: 110px;
  height: 110px;
}

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

.score-ring-bg  { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 8; }
.score-ring-val { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.4,0,.2,1), stroke .4s; }

.score-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-num   { font-size: 2rem; font-weight: 900; color: #fff; line-height: 1; letter-spacing: -0.04em; }
.score-denom { font-size: 0.65rem; font-weight: 600; color: #5a6880; letter-spacing: .04em; }

.score-info { flex: 1; }
.score-info h2 { font-size: 1.4rem; font-weight: 800; color: #fff; letter-spacing: -0.02em; margin-bottom: 4px; }
.score-url { font-size: 0.78rem; color: #5a6880; margin-bottom: 16px; word-break: break-all; }

.stat-pills { display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pill-pass { background: rgba(13,158,110,.18); color: #34d39a; }
.pill-pass .pill-dot { background: #34d39a; }

.pill-warn { background: rgba(201,125,10,.18); color: #f5a623; }
.pill-warn .pill-dot { background: #f5a623; }

.pill-fail { background: rgba(214,59,59,.18); color: #f87171; }
.pill-fail .pill-dot { background: #f87171; }

/* Actions */
.actions-row {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.btn-ghost:hover { border-color: var(--ink); color: var(--ink); background: var(--bg); }

/* Section cards */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.section-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.section-head h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.section-tally {
  margin-left: auto;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.tally-good { background: var(--green-tint); color: var(--green); }
.tally-mid  { background: var(--amber-tint); color: var(--amber); }
.tally-bad  { background: var(--red-tint);   color: var(--red); }

/* Check rows */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}

.check-row:last-child { border-bottom: none; }
.check-row:hover { background: #fafbfc; }

.check-status {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.st-pass { background: var(--green-tint); color: var(--green); }
.st-fail { background: var(--red-tint);   color: var(--red); }
.st-warn { background: var(--amber-tint); color: var(--amber); }
.st-info { background: var(--blue-tint);  color: var(--blue); }

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

.check-label {
  font-size: 0.845rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.check-value {
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin-top: 2px;
  word-break: break-word;
}

.check-tip {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--amber);
  background: var(--amber-tint);
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.5;
}

.check-tip.tip-red { color: var(--red); background: var(--red-tint); }

/* ---- CONTENT SECTIONS ---- */

.content-sections {
  background: #fff;
  border-top: 1px solid var(--border);
}

.cs-section {
  padding: 80px 24px;
  border-bottom: 1px solid var(--border);
}

.cs-inner {
  max-width: 1040px;
  margin: 0 auto;
}

.cs-inner--narrow {
  max-width: 740px;
}

.cs-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}

.cs-h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 14px;
}

.cs-lead {
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 48px;
}

/* How it works */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.step-num {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--blue);
  background: var(--blue-tint);
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.step-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.step-card p {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.65;
}

/* Platforms */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.platform-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  transition: box-shadow .2s, border-color .2s;
}

.platform-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #c8d4e8;
}

.platform-card--featured {
  border-color: var(--blue);
  background: var(--blue-tint);
}

.platform-badge {
  position: absolute;
  top: -11px;
  left: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--blue);
  color: #fff;
  padding: 3px 10px;
  border-radius: 20px;
}

.platform-icon {
  font-size: 1.4rem;
  margin-bottom: 10px;
  display: block;
}

.platform-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.platform-card p {
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 14px;
}

.platform-checks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.platform-checks li {
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding-left: 14px;
  position: relative;
  line-height: 1.5;
}

.platform-checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

/* What we check */
.checks-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.check-category {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.cc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.cc-icon {
  font-size: 1.2rem;
}

.check-category h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.check-category > p {
  font-size: 0.83rem;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 14px;
}

.check-category ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.check-category li {
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}

.check-category li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
}

.check-category li strong {
  color: var(--ink);
  font-weight: 600;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child { border-bottom: none; }

.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  gap: 16px;
  transition: background .15s;
  letter-spacing: -0.01em;
}

.faq-q::-webkit-details-marker { display: none; }

.faq-q::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--ink-mute);
  flex-shrink: 0;
  transition: transform .2s;
}

details[open] .faq-q { background: var(--bg); }
details[open] .faq-q::after { transform: rotate(45deg); }

.faq-q:hover { background: var(--bg); }

.faq-a {
  padding: 0 22px 18px;
  background: var(--bg);
}

.faq-a p {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.75;
}

.faq-a a { color: var(--blue); font-weight: 600; }

/* Responsive for content sections */
@media (max-width: 860px) {
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .cs-section { padding: 56px 16px; }
  .steps-grid { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: 1fr; }
  .checks-grid { grid-template-columns: 1fr; }
}

/* ---- FOOTER ---- */
footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--ink-mute);
  background: var(--surface);
}

footer a { color: var(--blue); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  header { padding: 0 16px; }
  .hero { padding: 52px 16px 60px; }
  .input-card { flex-direction: column; padding: 12px; align-items: stretch; }
  #audit-btn { text-align: center; }
  .score-panel { flex-direction: column; align-items: flex-start; gap: 20px; }
  .score-ring-wrap { width: 90px; height: 90px; }
  .score-ring-wrap svg { width: 90px; height: 90px; }
}
