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

* { box-sizing: border-box; }

:root {
  --ink: #16273F;
  --body: #33404F;
  --muted: #8791A0;
  --muted2: #5B6675;
  --muted3: #98A2B0;
  --card-border: #EAEDF3;
  --panel-border: #E7EBF1;
  --red: #E8402A;
}

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: "Mulish", system-ui, sans-serif;
  color: var(--body);
  background: linear-gradient(180deg, #F5F3FB 0%, #F1F6F6 100%);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
body.auth-pending .app-shell { display: none; }

.app-shell .rm-header-inner,
.app-shell .rm-footer-inner { max-width: 90%; }

@keyframes seoFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ------------------------------- Hero ------------------------------- */
.seo-hero-inner { max-width: 90%; margin: 0 auto; padding: 34px 32px 4px; }
.seo-title {
  font-family: "Poppins", sans-serif; font-weight: 700; font-size: 38px;
  line-height: 1.05; letter-spacing: -0.5px; color: var(--ink); margin: 0 0 6px; padding-top: 4px;
}
.seo-url { font-size: 15.5px; color: var(--muted2); padding-bottom: 8px; }

/* ------------------------------- Main ------------------------------- */
.seo-main { flex: 1; max-width: 90%; width: 100%; margin: 0 auto; padding: 28px 32px 56px; }
.seo-panel { animation: seoFadeUp 0.35s ease both; }

.seo-notice {
  background: #fff; border: 1px solid var(--card-border); border-radius: 18px;
  box-shadow: 0 4px 16px rgba(18,38,63,0.05); padding: 56px 20px; text-align: center;
  color: var(--muted); font-size: 15px;
}

/* ------------------------------- Summary ------------------------------- */
.seo-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; margin-bottom: 28px; }
.seo-stat {
  background: #fff; border: 1px solid var(--card-border); border-radius: 18px;
  box-shadow: 0 4px 16px rgba(18,38,63,0.05); padding: 22px;
}
.seo-stat-label { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.seo-stat-value { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 32px; color: var(--ink); line-height: 1; letter-spacing: -0.5px; }
.seo-stat-sub { font-size: 12.5px; color: var(--muted3); margin-top: 8px; }

/* ------------------------------- Pages list ------------------------------- */
.seo-section-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 20px; color: var(--ink); margin: 0 0 16px; }
.seo-list { display: flex; flex-direction: column; gap: 14px; }
.seo-page {
  background: #fff; border: 1px solid var(--card-border); border-radius: 16px;
  box-shadow: 0 4px 16px rgba(18,38,63,0.05); overflow: hidden;
}
.seo-page-head {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; gap: 18px; align-items: center;
  width: 100%; text-align: left; background: none; border: none; padding: 18px 22px;
}
.seo-page-head:hover { background: #FBFCFE; }
.seo-page-info { min-width: 0; }
.seo-page-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 15.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-page-url { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-score { text-align: center; min-width: 62px; }
.seo-score-value { font-family: "Poppins", sans-serif; font-weight: 800; font-size: 22px; line-height: 1; }
.seo-score-label { font-size: 11px; color: var(--muted3); font-weight: 600; margin-top: 3px; }
.seo-counts { display: flex; gap: 8px; }
.seo-count {
  display: inline-flex; align-items: center; gap: 5px; font-family: "Poppins", sans-serif;
  font-weight: 700; font-size: 12.5px; padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.seo-count.critical { color: #D14545; background: #FCECEC; border: 1px solid #F5D5D5; }
.seo-count.warning { color: #B5772E; background: #FCF6E4; border: 1px solid #F1E7C4; }
.seo-count.notice { color: #5B6675; background: #F1F4F9; border: 1px solid #E5E9F0; }
.seo-count.clean { color: #1F8A5B; background: #E7F7F1; border: 1px solid #CDEDE1; }
.seo-chevron { color: var(--muted3); transition: transform .18s ease; }
.seo-page.open .seo-chevron { transform: rotate(90deg); }

.seo-page-body { border-top: 1px solid #F1F4F8; padding: 8px 22px 20px; }
.seo-meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.seo-tag {
  font-family: "Poppins", sans-serif; font-weight: 700; font-size: 11.5px; padding: 4px 10px;
  border-radius: 999px; border: 1px solid #E5E9F0; background: #F6F8FB; color: var(--muted2);
}
.seo-tag.ok { color: #1F8A5B; background: #E7F7F1; border-color: #CDEDE1; }
.seo-tag.bad { color: #D14545; background: #FCECEC; border-color: #F5D5D5; }

.seo-check {
  display: grid; grid-template-columns: auto minmax(0,1fr); gap: 12px; align-items: start;
  padding: 12px 0; border-top: 1px solid #F4F6FA;
}
.seo-sev {
  font-family: "Poppins", sans-serif; font-weight: 700; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 4px 9px; border-radius: 7px; white-space: nowrap; margin-top: 1px;
}
.seo-sev.critical { color: #D14545; background: #FCECEC; border: 1px solid #F5D5D5; }
.seo-sev.warning { color: #B5772E; background: #FCF6E4; border: 1px solid #F1E7C4; }
.seo-sev.notice { color: #5B6675; background: #F1F4F9; border: 1px solid #E5E9F0; }
.seo-check-title { font-family: "Poppins", sans-serif; font-weight: 700; font-size: 14.5px; color: var(--ink); }
.seo-check-cat { font-size: 11.5px; color: var(--muted3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-left: 8px; }
.seo-check-detail { font-size: 13.5px; color: var(--body); margin-top: 3px; }
.seo-check-value { font-size: 13px; color: var(--muted2); margin-top: 4px; word-break: break-word; }
.seo-check-value code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; background: #EEF1F6; padding: 1px 6px; border-radius: 5px; }
.seo-check-rec { font-size: 13px; color: #1F6E4A; margin-top: 4px; }
.seo-passed { font-size: 13px; color: #1F8A5B; font-weight: 600; margin-top: 14px; }
.seo-loading { color: var(--muted); font-size: 14px; padding: 10px 0; }

@media (max-width: 1000px) { .seo-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) {
  .seo-page-head { grid-template-columns: 1fr auto; }
  .seo-counts { display: none; }
}
@media (max-width: 640px) {
  .seo-hero-inner, .seo-main { padding-left: 20px; padding-right: 20px; }
  .seo-stats { grid-template-columns: 1fr; }
}
