/* ============================================================
   INFOPORT — светлая fintech-тема (мята + тил, в духе референса)
   ============================================================ */

/* ---------- Шрифт: Manrope (локально) ---------- */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/manrope-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/manrope-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/manrope-cyrillic-500-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../fonts/manrope-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/manrope-cyrillic-600-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../fonts/manrope-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/manrope-cyrillic-700-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/manrope-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../fonts/manrope-cyrillic-800-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../fonts/manrope-latin-800-normal.woff2') format('woff2'); }

:root {
  --bg: #ffffff;
  --bg-mint: #ecf5f0;          /* светло-мятная подложка hero */
  --surface: #ffffff;
  --ink: #1a1f28;              /* почти чёрный */
  --text-2: #5b6570;           /* серый вторичный */
  --text-3: #98a1a9;           /* приглушённый */
  --border: #e8ebed;
  --border-2: #d9dee1;
  --accent: #2fa08e;           /* тил */
  --accent-hover: #26866f;
  --accent-soft: #e7f4f0;
  --blue: #4e7cff;             /* синий для "NEW"-акцентов */
  --blue-soft: #edf2ff;
  --pos: #2fa08e;              --pos-bg: #e7f4f0;
  --neg: #e15a6b;              --neg-bg: #fdeef0;
  --amber: #d98a00;            --amber-bg: #fff5e3;
  --dark: #0f1d23;             /* тёмный футер */
  --radius: 20px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(20, 32, 28, .04), 0 10px 30px -12px rgba(20, 32, 28, .08);
  --shadow-lg: 0 4px 10px rgba(20, 32, 28, .05), 0 24px 60px -20px rgba(20, 32, 28, .16);
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 24px; height: 68px; }
.logo { display: flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.logo:hover { color: var(--ink); }
.logo img { width: 36px; height: 36px; display: block; }
.logo b { font-weight: 800; color: var(--ink); }
.logo .accent { color: var(--ink); }   /* одноцветный wordmark, как в референсе */
.nav { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.nav a {
  color: var(--ink); font-weight: 600; font-size: 14.5px;
  padding: 9px 14px; border-radius: 10px; transition: .15s;
}
.nav a:hover { background: #f2f5f4; color: var(--ink); }

/* ---------- Хиро ---------- */
.hero {
  padding: 72px 0 22px;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(47, 160, 142, .14), transparent 60%),
    radial-gradient(900px 460px at 88% -14%, rgba(78, 124, 255, .10), transparent 60%),
    linear-gradient(180deg, var(--bg-mint) 0%, #ffffff 86%);
}
.hero h1 {
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.08; letter-spacing: -.028em; font-weight: 800;
  margin: 0 auto 18px; max-width: 900px; text-align: center;
}
.hero h1 .grad { color: var(--accent); }
.hero .sub {
  color: var(--text-2); font-size: 17px; max-width: 700px;
  margin: 0 auto 44px; text-align: center;
}

/* Сводка — крупные числа без карточек, как в референсе */
.stats {
  display: grid; grid-template-columns: repeat(4, auto); gap: 28px 72px;
  justify-content: center; margin: 0 auto 30px; text-align: center;
}
.stat { padding: 6px 8px; }
.stat .value { font-size: clamp(28px, 3.1vw, 42px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat .label { font-size: 14px; font-weight: 600; color: var(--text-2); margin-top: 4px; }
.stat .hint { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }

/* ---------- Панель фильтров ---------- */
.filters {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 20px;
}
.filters .row { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; }
.filters .row + .row { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.f-group { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.f-label { font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.f-label small { text-transform: none; letter-spacing: 0; color: var(--text-3); font-weight: 500; }

.input, select.input {
  height: 42px; border: 1px solid var(--border-2); border-radius: var(--radius-s);
  background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500;
  padding: 0 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 160, 142, .16); }
.input::placeholder { color: var(--text-3); font-weight: 400; }
.search-wrap { position: relative; flex: 1 1 240px; }
.search-wrap .input { width: 100%; padding-left: 38px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.range-pair { display: flex; align-items: center; gap: 6px; }
.range-pair .input { width: 92px; }
.range-pair span { color: var(--text-3); }

/* Чипы */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid transparent; background: #f2f4f5; color: var(--ink);
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 8px 15px; border-radius: 10px; cursor: pointer; transition: .15s;
  user-select: none;
}
.chip:hover { background: #e9edec; }
.chip.on { background: var(--accent); color: #fff; }
.chip-preset { background: #fff; border-color: var(--border-2); color: var(--text-2); }
.chip-preset:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.chip-preset.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.f-actions { display: flex; gap: 10px; margin-left: auto; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--radius-s);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: .15s;
  border: 1px solid transparent; background: #f2f4f5; color: var(--ink);
}
.btn:hover { background: #e9edec; color: var(--ink); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

/* ---------- Таблица ---------- */
.table-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 56px;
}
.table-meta {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  font-size: 13.5px; color: var(--text-2);
}
.table-meta b { color: var(--ink); }
.table-meta .right { margin-left: auto; color: var(--text-3); font-size: 12.5px; }
.table-scroll { overflow-x: auto; }
table.countries { border-collapse: collapse; width: 100%; min-width: 1280px; }
.countries th, .countries td { padding: 12px 14px; text-align: left; white-space: nowrap; }
.countries thead th {
  position: sticky; top: 0; z-index: 3;
  background: #f8fafa; color: var(--text-2);
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
.countries th.sortable { cursor: pointer; user-select: none; transition: color .15s; }
.countries th.sortable:hover { color: var(--accent); }
.countries th.sortable::after { content: '↕'; opacity: .35; margin-left: 5px; font-size: 11px; }
.countries th.sort-asc::after { content: '↑'; opacity: 1; color: var(--accent); }
.countries th.sort-desc::after { content: '↓'; opacity: 1; color: var(--accent); }
.countries tbody tr { border-bottom: 1px solid #eff2f3; transition: background .1s; }
.countries tbody tr:last-child { border-bottom: 0; }
.countries tbody tr:hover { background: #f6faf8; }
.countries td.num, .countries th.num { text-align: right; font-variant-numeric: tabular-nums; }
.countries td.num { font-weight: 600; }
.countries td.rank { color: var(--text-3); font-size: 12.5px; text-align: right; width: 40px; font-variant-numeric: tabular-nums; font-weight: 400; }
.countries td .pos { color: var(--pos); }
.countries td .neg { color: var(--neg); }

/* Колонка страны — липкая слева */
.countries th.c-country, .countries td.c-country {
  position: sticky; left: 0; z-index: 2; background: var(--surface);
  box-shadow: inset -1px 0 0 var(--border);
  min-width: 230px;
}
.countries thead th.c-country { z-index: 4; background: #f8fafa; }
.countries tbody tr:hover td.c-country { background: #f6faf8; }
.c-country a { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.c-country a:hover .cname { color: var(--accent); }
.flag {
  width: 30px; height: 22.5px; border-radius: 4px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(20, 32, 28, .12); flex: none; display: block;
}
.c-country .cname { font-weight: 700; font-size: 14.5px; line-height: 1.25; display: block; }
.c-country .cname-en { font-size: 11.5px; color: var(--text-3); display: block; font-weight: 500; }
.cell-sub { display: block; font-size: 11.5px; color: var(--text-3); }
td.c-langs, td.c-curr { max-width: 210px; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; color: var(--text-2); }

/* Бейджи дохода */
.badge {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 4px 11px; border-radius: 8px; line-height: 1.5;
}
.badge-high         { color: var(--pos); background: var(--pos-bg); }
.badge-upper_middle { color: var(--blue); background: var(--blue-soft); }
.badge-lower_middle { color: var(--amber); background: var(--amber-bg); }
.badge-low          { color: var(--neg); background: var(--neg-bg); }
.badge-na           { color: var(--text-3); background: #f2f4f5; }

.empty-row td { text-align: center !important; padding: 48px 20px !important; color: var(--text-3); }

/* ---------- Мобильные карточки стран ---------- */
.cards { display: none; }
.card-item {
  display: block; background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; box-shadow: var(--shadow); color: inherit; transition: border-color .15s;
}
.card-item:active, .card-item:hover { border-color: var(--accent); color: inherit; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head .flag { width: 34px; height: 25.5px; }
.card-head .n { display: block; font-weight: 800; font-size: 15.5px; line-height: 1.15; color: var(--ink); }
.card-head .en { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.card-head .badge { margin-left: auto; flex: none; }
.card-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; }
.cm .k { display: block; font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.cm .v { display: block; font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.cm .v .pos { color: var(--pos); } .cm .v .neg { color: var(--neg); }

/* Сортировка для мобильного вида */
.m-sort { display: none; align-items: center; gap: 8px; }
.m-sort select { height: 38px; }

/* ---------- Страница страны ---------- */
.breadcrumbs { font-size: 13.5px; color: var(--text-3); padding: 20px 0 0; }
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs a:hover { color: var(--accent); }
.country-hero {
  display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; margin: 18px 0 20px;
}
.country-hero .flag-big {
  width: 132px; height: 99px; border-radius: 14px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(20, 32, 28, .1), 0 12px 30px -8px rgba(20, 32, 28, .22);
}
.country-hero h1 { margin: 0 0 2px; font-size: clamp(26px, 3.4vw, 40px); letter-spacing: -.025em; line-height: 1.08; font-weight: 800; }
.country-hero .name-en { color: var(--text-3); font-size: 15px; margin: 0 0 12px; font-weight: 500; }
.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tag {
  display: inline-block; font-size: 12.5px; font-weight: 700;
  background: #f2f4f5; color: var(--text-2);
  padding: 5px 12px; border-radius: 8px;
}
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 28px; flex: 1 1 340px; min-width: 260px; }
.fact .k { font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.fact .v { font-weight: 700; font-size: 14.5px; }

h2.section-title { font-size: 24px; letter-spacing: -.02em; margin: 36px 0 16px; font-weight: 800; }
h2.section-title small { color: var(--text-3); font-weight: 500; font-size: 14px; margin-left: 8px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 16px 18px;
}
.kpi .k { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.kpi .v { font-size: 23px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .y { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.kpi .v .pos { color: var(--pos); } .kpi .v .neg { color: var(--neg); }

.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.chart-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 18px 18px 10px;
}
.chart-card h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 700; }
.chart-card .cur { font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; }
.chart-card .cur b { color: var(--accent); font-weight: 800; }
.chart-card svg { width: 100%; height: auto; display: block; }

.neighbors { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.neighbor {
  display: inline-flex; align-items: center; gap: 8px;
  background: #f2f4f5; border: 1px solid transparent; border-radius: 10px;
  padding: 7px 14px 7px 8px; font-size: 13.5px; font-weight: 600; color: var(--ink);
  transition: .15s;
}
.neighbor:hover { background: var(--accent-soft); color: var(--accent); }
.neighbor img { width: 22px; height: 16.5px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(20, 32, 28, .1); }

.pager { display: flex; justify-content: space-between; gap: 12px; margin: 30px 0 56px; }
.pager a { max-width: 48%; }

.note {
  background: var(--amber-bg); border: 1px solid #f3dfae; color: #8a6100;
  border-radius: var(--radius-s); padding: 10px 14px; font-size: 13.5px; margin: 14px 0;
}

/* ---------- О проекте ---------- */
.about-card {
  background: linear-gradient(150deg, #edf1f8 0%, #e9f3ed 100%);
  border: 0; border-radius: 24px;
  padding: 34px 36px; margin-bottom: 24px;
}
.about-card h2 { margin-top: 0; letter-spacing: -.02em; font-weight: 800; font-size: 26px; }
.about-card p { color: #454f58; max-width: 880px; }
.about-card p b { color: var(--ink); }

/* ---------- Тёмная CTA-плашка ---------- */
.cta-band {
  border-radius: 24px; padding: 34px 38px;
  background: linear-gradient(100deg, #8fcbad 0%, #2c6b5d 38%, #14322c 78%, #0f2b26 100%);
  color: #fff;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  margin-bottom: 56px;
}
.cta-band h2 { margin: 0 0 6px; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.02em; font-weight: 800; }
.cta-band p { margin: 0; color: rgba(255, 255, 255, .82); font-size: 15px; }
.cta-band .btn-cta {
  margin-left: auto;
  display: inline-flex; align-items: center;
  height: 48px; padding: 0 26px; border-radius: 12px;
  background: #4da593; color: #fff; font-weight: 700; font-size: 15px;
  transition: .15s; border: 0;
}
.cta-band .btn-cta:hover { background: #5db4a2; color: #fff; }

/* ---------- Подвал (тёмный) ---------- */
.site-footer { background: var(--dark); padding: 36px 0 44px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.site-footer .col { max-width: 680px; }
.site-footer p { margin: 5px 0; color: #7c8890; font-size: 13px; }
.site-footer .logo { font-size: 17px; margin-bottom: 8px; }
.site-footer .logo img { width: 28px; height: 28px; }
.site-footer .logo b, .site-footer .logo .accent { color: #fff; }

/* ---------- Адаптив ---------- */
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(2, auto); gap: 24px 56px; }
}
/* Планшеты и телефоны: таблица -> карточки */
@media (max-width: 740px) {
  .table-scroll { display: none; }
  .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; padding: 12px; }
  .m-sort { display: flex; flex: 1 1 100%; }
  .m-sort select { flex: 1; min-width: 0; }
  .table-meta .right { display: none; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .hero { padding-top: 40px; }
  .hero .sub { margin-bottom: 30px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 18px 20px; }
  .stat .value { font-size: 24px; }
  .filters { padding: 16px; }
  .f-actions { margin-left: 0; width: 100%; }
  .f-actions .btn { flex: 1; justify-content: center; }
  .country-hero { padding: 20px; gap: 18px; }
  .country-hero .flag-big { width: 96px; height: 72px; }
  .nav a { padding: 8px 10px; }
  .cta-band { padding: 26px 22px; }
  .cta-band .btn-cta { margin-left: 0; width: 100%; justify-content: center; }
  .about-card { padding: 24px 20px; }
}
@media print {
  .site-header, .filters, .f-actions, .site-footer, .pager, .cta-band { display: none !important; }
}
