/* ============================================================
   SignalRank — design tokens
   A data-first SEO tool. Palette reads "analytics ledger":
   paper background, ink text, signal-green for good, amber for
   caution, red for failing checks. Monospace is reserved for
   numeric data (scores, positions) to separate it from prose.
   ============================================================ */
:root {
  --ink:        #1B2430;
  --ink-soft:   #4A5568;
  --paper:      #F5F6F3;
  --panel:      #FFFFFF;
  --line:       #DCE1DE;
  --line-soft:  #EAEDEA;
  --green:      #3E7C4A;
  --green-bg:   #E7F2E8;
  --amber:      #B97A16;
  --amber-bg:   #FBF0DD;
  --red:        #B23B3B;
  --red-bg:     #FBE9E9;
  --navy:       #0F1720;

  --font-body: -apple-system, "Segoe UI", "IBM Plex Sans", Arial, sans-serif;
  --font-data: "IBM Plex Mono", "SF Mono", Consolas, monospace;

  --radius: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 32, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4em; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
p  { margin: 0 0 0.8em; color: var(--ink-soft); max-width: 68ch; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--navy);
  color: #EDEFEA;
  border-bottom: 1px solid #000;
}
.topbar__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.brand__mark { color: #6FBF7A; font-size: 0.9em; }

.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav__link {
  color: #C7CCC5;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.nav__link:hover { background: rgba(255,255,255,0.08); color: #fff; }

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

.plan-pill {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  color: #EDEFEA;
}
.plan-pill--premium { background: #7A5A16; border-color: #B97A16; color: #FBE9C6; }

/* ---------- Layout ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 32px 24px 80px; }
.page--narrow { max-width: 460px; }

.hero { margin-bottom: 28px; }
.hero__eyebrow { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 6px; }

.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.card--stat { display: flex; flex-direction: column; gap: 4px; }
.card--stat .stat__value { font-family: var(--font-data); font-size: 1.9rem; font-weight: 600; }
.card--stat .stat__label { color: var(--ink-soft); font-size: 0.85rem; }

.module-card {
  display: block;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.module-card:hover { border-left-color: var(--navy); }
.module-card h3 { margin-bottom: 6px; }
.module-card p { margin: 0; font-size: 0.88rem; }

/* ---------- Status rows (audit / on-page results) ---------- */
.check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: var(--panel);
  margin-bottom: 8px;
}
.check-row__badge {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}
.check-row--pass { border-left: 3px solid var(--green); }
.check-row--pass .check-row__badge { background: var(--green); }
.check-row--warn { border-left: 3px solid var(--amber); }
.check-row--warn .check-row__badge { background: var(--amber); }
.check-row--fail { border-left: 3px solid var(--red); }
.check-row__badge { background: var(--red); }
.check-row--fail .check-row__badge { background: var(--red); }
.check-row__body strong { display: block; font-size: 0.92rem; margin-bottom: 2px; }
.check-row__body span { font-size: 0.85rem; color: var(--ink-soft); }

/* ---------- Score ring (simple numeric, no svg needed) ---------- */
.score-badge {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 2.1rem;
  width: 96px; height: 96px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 6px solid var(--green-bg);
  color: var(--green);
}
.score-badge--warn { border-color: var(--amber-bg); color: var(--amber); }
.score-badge--fail { border-color: var(--red-bg); color: var(--red); }

/* ---------- Forms ---------- */
label { display: block; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: #fff;
  color: var(--ink);
  margin-bottom: 16px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid #99C2A2;
  outline-offset: 1px;
  border-color: var(--green);
}
.field-hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: -12px; margin-bottom: 16px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: #000; }
.btn--outline { background: transparent; color: var(--ink); }
.btn--outline:hover { background: var(--line-soft); }
.btn--accent { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn--accent:hover { background: #9C6512; }
.btn--sm { padding: 6px 12px; font-size: 0.8rem; }
.btn--full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
th { color: var(--ink-soft); font-weight: 600; font-size: 0.8rem; }
td.num, th.num { font-family: var(--font-data); text-align: right; }

/* ---------- Limit / upgrade banner ---------- */
.limit-banner {
  border: 1px dashed #C9A15A;
  background: var(--amber-bg);
  color: #6B4B0E;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.87rem;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* ---------- Misc ---------- */
.muted { color: var(--ink-soft); }
.tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--line-soft);
  color: var(--ink-soft);
  margin-left: 6px;
}
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-box {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid #EAB8B8;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.success-box {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid #B6D8BB;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer__inner {
  max-width: 1180px; margin: 0 auto; padding: 20px 24px;
  color: var(--ink-soft); font-size: 0.82rem;
}

/* ---------- Auth pages ---------- */
.auth-card { margin-top: 60px; }
.auth-switch { text-align: center; font-size: 0.88rem; color: var(--ink-soft); margin-top: 14px; }
.auth-switch a { color: var(--green); font-weight: 600; }
