/* ==========================================================================
   top-raiting.ru — рейтинг сюрвейерских компаний
   Нейтральная светлая палитра, системный стек, mobile-first
   ========================================================================== */

:root {
  --c-bg: #ffffff;
  --c-bg-soft: #f7f8fa;
  --c-bg-alt: #f1f3f6;
  --c-border: #e4e7eb;
  --c-text: #1a2028;
  --c-text-soft: #4a5464;
  --c-text-mute: #7a8494;
  --c-accent: #1e5aa6;
  --c-accent-dark: #154780;
  --c-accent-soft: #e8f0fa;
  --c-gold: #e8a73a;
  --c-green: #2e8b57;
  --c-red: #c94444;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 8px 20px rgba(16, 24, 40, .06);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --container: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { color: var(--c-accent-dark); text-decoration: underline; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255, 255, 255, 0.94);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 14px 0;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--c-text);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.logo:hover { text-decoration: none; color: var(--c-text); }
.logo-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-dark) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}
.nav { display: flex; gap: 24px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  color: var(--c-text-soft);
  font-size: 15px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav a:hover { color: var(--c-accent); border-bottom-color: var(--c-accent); text-decoration: none; }
.nav a.active { color: var(--c-text); border-bottom-color: var(--c-accent); }

/* ---------- Hero / Lead ---------- */
.hero { padding: 44px 0 20px; }
.hero h1 {
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  max-width: 900px;
}
.hero-lead {
  font-size: 17px;
  color: var(--c-text-soft);
  max-width: 820px;
  margin: 0 0 24px;
}
.breadcrumbs {
  font-size: 13px;
  color: var(--c-text-mute);
  margin: 0 0 12px;
}
.breadcrumbs a { color: var(--c-text-mute); }
.breadcrumbs a:hover { color: var(--c-accent); }
.breadcrumbs span.sep { margin: 0 6px; opacity: .6; }

/* ---------- Top list (scannable list of all 20) ---------- */
.top-list-wrap {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 40px;
}
.top-list-wrap h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.top-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.top-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.top-list .place {
  display: inline-flex;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  color: var(--c-text-soft);
  font-size: 12px;
  font-weight: 600;
}
.top-list li:nth-child(-n+3) .place { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.top-list .rating { margin-left: auto; color: var(--c-gold); font-weight: 600; font-size: 13px; }
.top-list a { color: var(--c-text); font-size: 14px; }
.top-list a:hover { color: var(--c-accent); text-decoration: none; }

/* ---------- Methodology CTA ---------- */
.methodology-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--c-accent);
  font-size: 14px;
}

/* ---------- Company card ---------- */
.company-card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 0 0 24px;
  background: var(--c-bg);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 80px;
}
.company-card__head {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}
.company-card__avatar {
  width: 72px; height: 72px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--c-accent-soft), #fff);
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 24px;
  color: var(--c-accent);
  letter-spacing: -0.02em;
}
.company-card__title { margin: 0; }
.company-card__place {
  font-size: 13px;
  color: var(--c-text-mute);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.company-card__place .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--c-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.company-card__name { font-size: 22px; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.company-card__sub { margin: 2px 0 0; color: var(--c-text-soft); font-size: 14px; }

.rating-block { text-align: right; }
.rating-score {
  font-size: 28px;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1;
}
.rating-label {
  font-size: 12px;
  color: var(--c-text-mute);
  margin-top: 2px;
}

.subratings {
  display: flex;
  gap: 20px;
  margin: 14px 0 18px;
  padding: 14px 18px;
  background: var(--c-bg-soft);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.subrating {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.subrating__source {
  font-size: 12px;
  color: var(--c-text-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.subrating__value {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
}
.subrating__value .star { color: var(--c-gold); }

.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
}
.contacts-grid__row {
  display: grid;
  grid-template-columns: 140px 1fr;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  font-size: 14px;
}
.contacts-grid__row:nth-last-child(1), .contacts-grid__row:nth-last-child(2) { border-bottom: none; }
.contacts-grid__row .k { color: var(--c-text-mute); }
.contacts-grid__row .v { color: var(--c-text); }

.company-card__desc p { margin: 0 0 12px; color: var(--c-text); }
.company-card__desc p:last-child { margin-bottom: 0; }

.pros-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 8px;
}
.pros-list li {
  position: relative;
  padding-left: 28px;
  color: var(--c-text);
}
.pros-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 18px; height: 18px;
  background: var(--c-green);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='white' d='M7.5 13.6 4.2 10.3l-1.4 1.4 4.7 4.7L17.2 6l-1.4-1.4z'/></svg>") no-repeat center/contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='white' d='M7.5 13.6 4.2 10.3l-1.4 1.4 4.7 4.7L17.2 6l-1.4-1.4z'/></svg>") no-repeat center/contain;
}

.services-block { margin: 20px 0 0; }
.services-block h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text-soft);
  letter-spacing: 0.01em;
}
.services-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.services-chips a, .services-chips span {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  color: var(--c-text-soft);
  font-size: 13px;
  text-decoration: none;
}
.services-chips a:hover {
  background: var(--c-accent-soft);
  color: var(--c-accent);
  border-color: var(--c-accent);
  text-decoration: none;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--c-border);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--c-accent); color: #fff; }
.btn--primary:hover { background: var(--c-accent-dark); color: #fff; }
.btn--ghost { background: var(--c-bg); color: var(--c-text); border-color: var(--c-border); }
.btn--ghost:hover { border-color: var(--c-accent); color: var(--c-accent); background: var(--c-accent-soft); }
.btn--wa { background: #25D366; color: #fff; }
.btn--wa:hover { background: #1aa851; color: #fff; }
.btn--tg { background: #2AABEE; color: #fff; }
.btn--tg:hover { background: #1f8cc7; color: #fff; }

.company-card__more { margin-top: 14px; font-size: 14px; }
.company-card__more a { color: var(--c-accent); }

/* External ratings block */
.ext-ratings-compact {
  margin: 16px 0 0;
  padding: 14px 16px;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}
.ext-rating { white-space: nowrap; }
.ext-rating strong { color: var(--c-text); }
.ext-reviews {
  margin: 22px 0 0;
  padding: 18px 20px;
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
.ext-reviews h3 { margin: 0 0 10px; font-size: 15px; color: var(--c-text-soft); font-weight: 600; }
.ext-ratings {
  font-size: 14px;
  line-height: 1.9;
  margin-bottom: 10px;
}
.reviews-summary {
  font-size: 14px;
  color: var(--c-text);
  margin: 10px 0;
}
.review-quote {
  margin: 14px 0 10px;
  padding: 14px 16px;
  background: var(--c-bg);
  border-left: 3px solid var(--c-accent);
  border-radius: var(--radius-sm);
}
.review-quote blockquote {
  margin: 0 0 6px;
  font-style: italic;
  color: var(--c-text);
  font-size: 14px;
}
.review-quote figcaption {
  font-size: 12.5px;
  color: var(--c-text-mute);
}

/* Reviews inside card */
.reviews-block { margin-top: 22px; }
.reviews-block h3 { margin: 0 0 12px; font-size: 15px; color: var(--c-text-soft); font-weight: 600; }
.review {
  padding: 14px 16px;
  background: var(--c-bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  margin-bottom: 10px;
}
.review__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.review__author { font-weight: 600; font-size: 14px; }
.review__rating { color: var(--c-gold); font-weight: 600; font-size: 14px; }
.review__text { font-size: 14px; color: var(--c-text); line-height: 1.55; margin: 0; }
.review__date { font-size: 12px; color: var(--c-text-mute); margin-top: 6px; }

/* ---------- Methodology callout ---------- */
.methodology-card {
  background: var(--c-accent-soft);
  border: 1px solid #cfdff4;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 40px 0;
}
.methodology-card h2 { margin: 0 0 10px; color: var(--c-accent-dark); font-size: 22px; }
.methodology-card p { color: var(--c-text); margin: 0 0 10px; }

/* ---------- Criteria grid ---------- */
.criteria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.criterion {
  padding: 18px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
.criterion__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--c-accent-soft);
  color: var(--c-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-weight: 700;
}
.criterion__title { font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.criterion__text { color: var(--c-text-soft); font-size: 14px; margin: 0; }

/* ---------- Comparison table ---------- */
.compare-wrap {
  overflow-x: auto;
  margin: 40px 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-bg);
}
.compare-title { padding: 20px 22px 0; margin: 0; font-size: 20px; }
.compare-sub { padding: 4px 22px 16px; color: var(--c-text-mute); font-size: 14px; margin: 0; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 800px;
}
.compare-table th, .compare-table td {
  padding: 12px 14px;
  text-align: left;
  border-top: 1px solid var(--c-border);
}
.compare-table th {
  background: var(--c-bg-soft);
  font-weight: 600;
  white-space: nowrap;
}
.compare-table td.rating-cell { color: var(--c-gold); font-weight: 600; }
.compare-table tbody tr:hover { background: var(--c-bg-soft); }

/* ---------- FAQ ---------- */
.faq-section { margin: 50px 0; }
.faq-section h2 { font-size: 26px; margin: 0 0 20px; letter-spacing: -0.01em; }
.faq-item {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--c-bg);
}
.faq-item summary {
  padding: 16px 22px 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 52px;
  color: var(--c-text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) rotate(0);
  width: 14px; height: 14px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%237a8494' d='M8 10.3 3.7 6l1-1L8 8.3 11.3 5l1 1z'/></svg>") no-repeat center/contain;
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(180deg); }
.faq-item .answer { padding: 0 22px 18px; color: var(--c-text-soft); }
.faq-item .answer p { margin: 0 0 10px; }
.faq-item .answer p:last-child { margin-bottom: 0; }

/* ---------- Tag cloud ---------- */
.tag-cloud-section {
  margin: 50px 0;
  padding: 30px;
  background: var(--c-bg-soft);
  border-radius: var(--radius-lg);
}
.tag-cloud-section h2 { font-size: 20px; margin: 0 0 14px; }
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.tag-cloud a {
  display: inline-flex;
  padding: 8px 14px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--c-text);
  transition: all .15s;
}
.tag-cloud a:hover {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
  text-decoration: none;
}

/* ---------- Offer / disclaimer callout ---------- */
.offer-box {
  margin: 40px 0;
  padding: 24px 28px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-accent);
  border-radius: var(--radius);
}
.offer-box h3 { margin: 0 0 8px; font-size: 16px; }
.offer-box p { margin: 0 0 8px; color: var(--c-text-soft); font-size: 14px; }
.offer-box p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 80px;
  background: #0f1723;
  color: #c6ccd6;
  padding: 44px 0 20px;
}
.site-footer a { color: #c6ccd6; }
.site-footer a:hover { color: #fff; }
.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 34px;
}
.footer-col h4 {
  margin: 0 0 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; font-size: 14px; }
.footer-col li a { text-decoration: none; }
.footer-col li a:hover { text-decoration: underline; color: #fff; }
.footer-tagline { font-size: 14px; margin: 8px 0 14px; line-height: 1.6; color: #9fa7b4; max-width: 380px; }
.footer-bottom {
  padding-top: 22px;
  border-top: 1px solid #1f2a3d;
  font-size: 12.5px;
  color: #8b93a1;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}
.footer-disclaimer {
  font-size: 12.5px;
  color: #9fa7b4;
  max-width: 760px;
  line-height: 1.6;
  margin: 0 0 20px;
}

/* ---------- Company detail (company/*.html) ---------- */
.company-hero {
  padding: 30px 0 20px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 30px;
}
.company-hero h1 {
  font-size: clamp(24px, 3vw, 34px);
  margin: 10px 0 4px;
  letter-spacing: -0.015em;
}
.company-hero .subtitle {
  color: var(--c-text-soft);
  font-size: 16px;
  margin: 0 0 16px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
}
.two-col .sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}
.sidebar-card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--c-bg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.sidebar-card h3 { margin: 0 0 10px; font-size: 15px; }

/* Tag page */
.tag-hero { padding: 30px 0; }
.tag-hero h1 { font-size: clamp(24px, 3vw, 32px); margin: 10px 0 10px; }
.tag-hero p { color: var(--c-text-soft); max-width: 780px; }

/* ---------- Generic content pages ---------- */
.content-page { padding: 20px 0 40px; max-width: 820px; }
.content-page h1 { font-size: clamp(26px, 3.4vw, 36px); margin: 0 0 16px; letter-spacing: -0.01em; }
.content-page h2 { font-size: 22px; margin: 32px 0 10px; letter-spacing: -0.005em; }
.content-page h3 { font-size: 18px; margin: 24px 0 8px; }
.content-page p { margin: 0 0 14px; }
.content-page ul { padding-left: 22px; margin: 10px 0 16px; }
.content-page li { margin-bottom: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .two-col .sidebar { position: static; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .company-card { padding: 22px; }
  .company-card__head { grid-template-columns: 56px 1fr; gap: 14px; }
  .company-card__avatar { width: 56px; height: 56px; font-size: 20px; }
  .rating-block {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
  }
  .rating-score { font-size: 22px; }
  .contacts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero { padding: 24px 0 10px; }
  .header-row { flex-wrap: wrap; gap: 12px; }
  .nav { order: 3; width: 100%; gap: 14px; }
  .nav a { font-size: 14px; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 20px; }
  .top-list { grid-template-columns: 1fr; }
  .company-card { padding: 18px; border-radius: var(--radius); }
  .contacts-grid__row { grid-template-columns: 110px 1fr; padding: 10px 12px; }
  .card-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 480px) {
  .footer-cols { grid-template-columns: 1fr; }
  .subratings { gap: 12px; padding: 12px; }
  .methodology-card { padding: 22px; }
  .tag-cloud-section { padding: 20px; }
}

/* ---------- Utility ---------- */
.muted { color: var(--c-text-mute); }
.small { font-size: 13px; }
.center { text-align: center; }
hr.divider { border: none; border-top: 1px solid var(--c-border); margin: 32px 0; }
