/* nerezidentu.ru — светлая тема.
   Бумага с холодным оттенком, чернильный синий, бирюза плиточной керамики, шафран для выделений. */
:root {
  --paper: #f4f7f9;
  --surface: #ffffff;
  --ink: #10202e;
  --muted: #4f6172;
  --line: #d8e2ea;
  --teal: #0a7f7c;
  --teal-dark: #065957;
  --teal-soft: #e1f4f2;
  --stub: #eef7f7;
  --saffron: #f2a93b;
  --saffron-soft: #fff4dc;
  --saffron-ink: #6b4300;
  --rose: #a63a28;
  --rose-soft: #fceeea;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal-dark); text-underline-offset: 3px; }
a:hover { color: var(--teal); }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 4px; }
.container { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
html:not(.js) .js-only { display: none; }

/* ---------- шапка ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo__text { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; }
.nav a:hover { background: var(--teal-soft); color: var(--teal-dark); }
.nav a[aria-current="page"] { background: var(--teal-soft); color: var(--teal-dark); }
.nav-toggle { display: none; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }

/* ---------- первый экран ---------- */
.hero { position: relative; overflow: hidden; background: var(--paper); border-bottom: 1px solid var(--line); }
.hero::before {
  content: ""; position: absolute; inset: 0; background: url("/assets/img/pattern.svg") repeat; background-size: 96px 96px;
  -webkit-mask-image: linear-gradient(100deg, transparent 38%, #000 100%);
  mask-image: linear-gradient(100deg, transparent 38%, #000 100%);
  pointer-events: none;
}
.hero__inner { position: relative; padding-top: 44px; padding-bottom: 44px; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.hero__title { margin: 0 0 16px; max-width: 760px; font-size: clamp(1.7rem, 3.8vw, 2.5rem); line-height: 1.12; letter-spacing: -.024em; font-weight: 800; }
.hero__lead { margin: 0 0 26px; max-width: 640px; font-size: 1.15rem; color: var(--muted); }
.flags-row { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 20px; }
.flags-row a { display: grid; justify-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .92rem; }
.flags-row img { width: 64px; height: 64px; border-radius: 50%; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line); transition: box-shadow .15s; }
.flags-row a:hover img, .flags-row a[aria-current="page"] img { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--teal); }
.hero__date { margin: 0; font-size: .9rem; color: var(--muted); }

/* ---------- секции ---------- */
.section { padding: 48px 0; }
.section--offers { background: var(--paper); }
.section--article { background: var(--surface); border-top: 1px solid var(--line); }
.section__title { margin: 0 0 10px; font-size: clamp(1.35rem, 2.6vw, 1.75rem); line-height: 1.2; letter-spacing: -.018em; }
.section__lead { margin: 0 0 22px; max-width: 760px; color: var(--muted); font-size: 1.05rem; }

/* ---------- фильтр ---------- */
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; }
.chip:hover { border-color: var(--teal); }
.chip.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }
.filter__count { margin-left: auto; font-size: .9rem; color: var(--muted); }

/* ---------- плитка оффера (билет) ---------- */
.offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; }
.offer { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: border-color .15s; }
.offer:hover { border-color: var(--teal); }
.offer[hidden] { display: none; }
.offer__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; min-height: 68px; }
.offer__name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.offer__logo { display: block; max-height: 36px; max-width: 62%; width: auto; height: auto; object-fit: contain; object-position: left center; }
.offer__badge { flex: none; background: var(--saffron-soft); color: var(--saffron-ink); border-radius: 6px; padding: 4px 9px; font-size: .8rem; font-weight: 700; }
.offer__body { display: grid; grid-template-columns: 1fr 1fr; border-top: 2px dashed var(--line); }
.offer__col { display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; }
.offer__col + .offer__col { border-left: 2px dashed var(--line); }
.offer__label { font-size: .85rem; color: var(--muted); }
/* ПСК и ставка — один шрифт, размер и цвет (требование законодательства и партнёров) */
.offer__line { font-size: 1rem; font-weight: 400; line-height: 1.3; color: var(--ink); }
.offer__line--sum { font-weight: 700; }
.offer__sub { font-size: .85rem; color: var(--muted); line-height: 1.35; }
.offer__stub { margin-top: auto; background: var(--stub); border-top: 1px solid var(--line); padding: 14px 18px 16px; display: grid; gap: 10px; }
.offer__age { margin: 0; font-size: .95rem; }
.offer__flags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.offer__flags img { display: block; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.offer__warn { margin: 0; font-size: .75rem; line-height: 1.35; color: var(--muted); }

.btn { display: block; text-align: center; text-decoration: none; background: var(--teal); color: #fff; font-weight: 800; font-size: 1.05rem; padding: 14px 18px; border-radius: 10px; transition: background .15s; }
.btn:hover { background: var(--teal-dark); color: #fff; }

.disclaimer { margin-top: 22px; padding: 14px 18px; border-left: 4px solid var(--line); background: #fff; font-size: .88rem; color: var(--muted); border-radius: 0 10px 10px 0; }
.disclaimer p { margin: 0 0 6px; }
.disclaimer p:last-child { margin: 0; }

/* ---------- статья ---------- */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { margin: 2.2em 0 .6em; font-size: clamp(1.25rem, 2.4vw, 1.55rem); line-height: 1.25; letter-spacing: -.015em; scroll-margin-top: 84px; }
.prose > h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; font-size: 1.075rem; line-height: 1.7; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; font-size: 1.075rem; line-height: 1.65; }
.prose li { margin-bottom: .45em; }

ul.check { list-style: none; padding: 0; }
ul.check li { position: relative; padding-left: 36px; }
ul.check li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); font-weight: 800; font-size: .9rem; line-height: 24px; text-align: center; }

ol.steps { list-style: none; padding: 0; counter-reset: step; }
ol.steps li { counter-increment: step; position: relative; padding: 0 0 18px 52px; margin: 0; }
ol.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: #fff; font-weight: 800; line-height: 36px; text-align: center; }
ol.steps li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 38px; bottom: 2px; width: 2px; background: var(--teal-soft); }
ol.steps strong { display: block; }

.callout { margin: 1.6em 0; padding: 16px 20px; border-left: 5px solid var(--saffron); background: var(--saffron-soft); border-radius: 0 12px 12px 0; }
.callout__title { display: block; margin-bottom: 4px; font-weight: 800; }
.callout p { margin: 0; font-size: 1.02rem; line-height: 1.6; }
.callout--warn { border-left-color: var(--rose); background: var(--rose-soft); }
.callout--tip { border-left-color: var(--teal); background: var(--teal-soft); }

.pullquote { position: relative; margin: 1.8em 0; padding: 6px 0 6px 56px; font-family: var(--serif); font-size: 1.45rem; line-height: 1.4; font-style: italic; }
.pullquote::before { content: "«"; position: absolute; left: 0; top: -14px; font-size: 4.5rem; line-height: 1; color: var(--saffron); font-style: normal; }
.pullquote p { margin: 0; font-size: inherit; line-height: inherit; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; margin: 1.6em 0; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.fact { background: #fff; padding: 18px; }
.fact strong { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--teal-dark); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.fact span { display: block; margin-top: 6px; font-size: .92rem; color: var(--muted); line-height: 1.4; }

.table-wrap { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--line); border-radius: 12px; }
table.compare { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .93rem; }
.compare th, .compare td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.compare thead th { background: var(--teal-soft); color: var(--teal-dark); font-weight: 800; white-space: nowrap; }
.compare tbody th { font-weight: 800; white-space: nowrap; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.compare tbody tr:nth-child(even) { background: #f8fafb; }

.countries { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 1.4em 0; }
.country { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.country:hover { border-color: var(--teal); }
.country img { flex: none; border-radius: 50%; }
.country__text { display: grid; gap: 2px; font-size: .9rem; color: var(--muted); line-height: 1.35; }
.country__text strong { color: var(--ink); font-size: 1rem; }

/* ---------- FAQ ---------- */
.faq { margin: 1.2em 0; border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary { position: relative; list-style: none; cursor: pointer; padding: 16px 40px 16px 0; font-size: 1.08rem; font-weight: 700; line-height: 1.4; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font-size: 1.7rem; font-weight: 400; color: var(--teal); transition: transform .2s; }
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__a p { margin: 0 0 16px; font-size: 1.03rem; }

.legal { margin: 1.4em 0 0; border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px; background: #fff; }
.legal summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.legal p, .legal li { font-size: .92rem; color: var(--muted); }
.legal ul { padding-left: 1.2em; margin: 0 0 12px; }

/* ---------- подвал ---------- */
.site-footer { background: #e9eff3; border-top: 1px solid var(--line); padding: 40px 0 28px; font-size: .94rem; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; margin-bottom: 24px; }
.site-footer__about { margin: 10px 0 0; max-width: 360px; color: var(--muted); }
.site-footer__title { margin: 0 0 8px; font-weight: 800; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer__legal { border-top: 1px solid var(--line); padding-top: 18px; color: var(--muted); font-size: .86rem; }
.site-footer__legal p { margin: 0 0 8px; max-width: 900px; }
.site-footer__legal strong { color: var(--ink); }
.site-footer__copy { margin-top: 12px; }

/* ---------- 404 ---------- */
.notfound { padding: 80px 0; text-align: left; }
.notfound h1 { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.02em; }

/* ---------- мобильная версия ---------- */
@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; align-items: stretch; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 12px 14px; }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px; }
  .site-header__inner { position: relative; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .hero__inner { padding-top: 30px; padding-bottom: 32px; }
  .section { padding: 36px 0; }
  .pullquote { font-size: 1.2rem; padding-left: 44px; }
}
@media (max-width: 400px) {
  .offers { grid-template-columns: 1fr; }
  .flags-row { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Дата актуализации — справа под списком офферов и под таблицей */
.updated-note { margin: 12px 0 0; text-align: right; font-size: .85rem; color: var(--muted); }

/* Содержание статьи (сворачивается) */
.toc { margin: 1.4em 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 0 20px; }
.toc summary { position: relative; list-style: none; cursor: pointer; padding: 14px 32px 14px 0; font-weight: 800; font-size: 1.05rem; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; position: absolute; right: 4px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(45deg); transition: transform .2s; }
.toc[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.toc__list { margin: 0; padding: 0 0 16px 1.4em; }
.toc__list li { margin: 0; padding: 5px 0; line-height: 1.4; }
.toc__list a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.toc__list a:hover { color: var(--teal-dark); border-bottom-color: var(--teal); }
