/* ============================================================================
   m2-doc.css — текстовые (юридические/справочные) страницы в новом дизайне m2.
   Используется на /terms/ (условия использования). Пригодится и для /privacy/,
   /company/, /how/ и т.п. Подключать после modern.css.
   Читаемая одна колонка, типографика прозы: h2, ul/li, b, ссылки.
   ============================================================================ */

/* Компактная синяя шапка-полоса без большой формы поиска.
   Ширину верхней полосы приравниваем к телу (--maxw): иначе .m2-top .wrap = 1300px
   и заголовок/крошки/лого «торчат» левее контента (.wrap = 1160px). Единый левый край. */
.m2-doc-top { padding-bottom: 8px; }
.m2-doc-top .wrap { max-width: var(--maxw); }
.m2-doc-hero { padding: 18px 0 4px; }
.m2-doc-hero h1 { margin: 0; font-size: clamp(26px, 4.4vw, 40px); font-weight: 800; letter-spacing: -.02em; color: var(--ink); }

/* Хлебные крошки (светлая шапка m2-top → тёмный текст) */
.m2-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; margin: 0 0 6px; }
.m2-crumbs a { color: var(--muted); text-decoration: none; }
.m2-crumbs a:hover { color: var(--brand); text-decoration: underline; }
.m2-crumbs .sep { color: var(--muted); opacity: .6; }
.m2-crumbs .cur { color: var(--ink); }

/* Контейнер контента — карточка на светлом фоне.
   Селектор `.m2 .wrap.m2-doc-wrap` (0,3,0) сильнее `.m2 .wrap{padding:0 20px}` (0,2,0)
   из modern.css — иначе вертикальный padding сбрасывался в 0 и футер «прибивался». */
.m2 .wrap.m2-doc-wrap { padding: 34px 20px 72px; }
.m2-doc { max-width: 820px; background: var(--card); border: 1px solid var(--line);
   border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 40px; }

/* Типографика прозы */
.m2-doc { color: #33465e; font-size: 16px; line-height: 1.75; }
.m2-doc h2 { color: var(--ink); font-size: 20px; font-weight: 800; letter-spacing: -.01em;
   margin: 30px 0 10px; }
.m2-doc h2:first-child { margin-top: 0; }
.m2-doc b, .m2-doc strong { color: var(--ink); font-weight: 800; }
.m2-doc p { margin: 0 0 14px; }
.m2-doc a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.m2-doc ul { margin: 8px 0 18px; padding: 0; list-style: none; }
.m2-doc li { position: relative; padding: 0 0 10px 26px; }
.m2-doc li::before { content: ""; position: absolute; left: 6px; top: 11px;
   width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

@media (max-width: 640px) {
   .m2-doc-wrap { padding: 22px 0 40px; }
   .m2-doc { padding: 22px 18px; font-size: 15.5px; border-radius: 14px; }
   .m2-doc h2 { font-size: 18px; }
}

/* ---------- Страница 404 (используется и как /404.php) ---------- */
.m2-404 { text-align: center; padding: 24px 0 8px; }
.m2-404-code { font-size: clamp(150px, 38vw, 380px); font-weight: 800; line-height: .95;
   letter-spacing: -.04em; margin: 0; color: var(--brand);
   display: inline-flex; align-items: center; gap: .06em; }
.m2-404-code .pl { font-size: .58em; transform: translateY(-.06em); }
.m2-404 h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -.02em;
   margin: 14px 0 8px; color: var(--ink); }
.m2-404 p { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 16px; line-height: 1.7; }
.m2-404-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 24px 0 4px; }
.m2-404-btns a { text-decoration: none; font-weight: 700; font-size: 15px; border-radius: 12px;
   padding: 12px 22px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
   box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
.m2-404-btns a:hover { transform: translateY(-1px); border-color: var(--brand); }
.m2-404-btns a.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.m2-404-btns a.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.m2-404-sub { text-align: center; margin: 40px 0 14px; }
.m2-404-sub h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 4px; color: var(--ink); }
.m2-404-sub p { color: var(--muted); font-size: 15px; margin: 0; }

@media (max-width: 640px) {
   .m2-404-btns a { flex: 1 1 100%; padding: 13px 18px; }
}

/* ---------- Две колонки: текст + форма (страница /company/) ---------- */
.m2-doc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start;
   max-width: 1000px; }
.m2-doc-cols .m2-doc { max-width: none; }
@media (max-width: 860px) { .m2-doc-cols { grid-template-columns: 1fr; } }

/* ---------- Форма обратной связи (.m2-form) ---------- */
.m2-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
   box-shadow: var(--shadow); padding: 28px; }
.m2-form h2 { margin: 0 0 4px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.m2-form .m2-form-lead { margin: 0 0 18px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.m2-field-row { margin: 0 0 16px; }
.m2-field-row label { display: block; font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.m2-form input[type="text"], .m2-form input[type="email"], .m2-form textarea {
   width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: #fff;
   border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px;
   outline: none; transition: border-color .12s ease, box-shadow .12s ease; }
.m2-form textarea { min-height: 140px; resize: vertical; }
.m2-form input:focus, .m2-form textarea:focus { border-color: var(--brand);
   box-shadow: 0 0 0 3px rgba(255, 90, 60, .14); }
.m2-form input.err, .m2-form textarea.err { border-color: #e24b4a; box-shadow: 0 0 0 3px rgba(226, 75, 74, .12); }
.m2-field-row .m2-hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.m2-form-btn { appearance: none; border: 0; font: inherit; font-weight: 800; font-size: 15px;
   color: #fff; background: var(--brand); border-radius: 12px; padding: 13px 26px; cursor: pointer;
   transition: background .12s ease, transform .12s ease; }
.m2-form-btn:hover { background: var(--brand-dark); }
.m2-form-btn:active { transform: scale(.98); }
.m2-form-btn[disabled] { opacity: .55; cursor: default; }
.m2-form-note { margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line);
   font-size: 14px; color: var(--muted); line-height: 1.6; }
.m2-form-msg { margin: 12px 0 0; font-size: 15px; font-weight: 700; }
.m2-form-msg.ok { color: #1d9e75; }
.m2-form-msg.bad { color: #e24b4a; }
.m2-form-done { text-align: center; padding: 36px 10px; }
.m2-form-done .ic { font-size: 42px; line-height: 1; }
.m2-form-done b { display: block; margin-top: 10px; font-size: 18px; color: var(--ink); }
@media (max-width: 640px) { .m2-form { padding: 20px 18px; } }

/* ============================================================================
   Страница «Как это работает» — /how/  (.m2-how-*)
   ============================================================================ */

/* Вводный блок «кто мы» */
.m2-how-intro { max-width: 760px; margin: 0 0 8px; }
.m2-how-intro p { color: #33465e; font-size: 17px; line-height: 1.75; margin: 0 0 14px; }
.m2-how-intro .lead { font-size: 19px; color: var(--ink); font-weight: 700; }

/* Плитки-преимущества «кто мы такие» */
.m2-feats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 26px 0 10px; }
.m2-feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
   box-shadow: var(--shadow); padding: 20px 18px; }
.m2-feat .ic { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
   border-radius: 11px; background: rgba(255, 90, 60, .1); color: var(--brand); margin-bottom: 12px; }
.m2-feat .ic svg { width: 22px; height: 22px; }
.m2-feat b { display: block; font-size: 16px; color: var(--ink); font-weight: 800; margin-bottom: 3px; }
.m2-feat span { color: var(--muted); font-size: 14px; line-height: 1.55; }
@media (max-width: 860px) { .m2-feats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .m2-feats { grid-template-columns: 1fr; } }

/* Заголовок секции внутри страницы */
.m2-how-h2 { font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; letter-spacing: -.02em;
   color: var(--ink); margin: 46px 0 6px; }
.m2-how-h2-sub { color: var(--muted); font-size: 16px; margin: 0 0 26px; }

/* Шаги поиска (свои имена — .m2-step/.m2-steps заняты в modern.css) */
.m2-how-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.m2-how-step { position: relative; display: block; background: var(--card); border: 1px solid var(--line);
   border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 20px 22px; }
.m2-how-step-num { position: absolute; top: 16px; right: 18px; font-size: 30px; font-weight: 800;
   color: rgba(255, 90, 60, .16); line-height: 1; letter-spacing: -.03em; }
.m2-how-step-art { height: 96px; margin: 2px 0 16px; }
.m2-how-step-art svg { width: 140px; height: 96px; display: block; }
.m2-how-step b { display: block; font-size: 17px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.m2-how-step p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
@media (max-width: 860px) { .m2-how-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .m2-how-steps { grid-template-columns: 1fr; } }

/* Финальный призыв + встроенная форма поиска.
   Класс .m2-top нужен только ради оранжевого акцента выпадашек формы, но его голубой
   градиент тут не нужен — гасим фон в ровный (--bg), чтобы посреди страницы не начинался
   второй градиент. */
.m2-how-searchband { background: var(--bg); margin-top: 12px; padding-top: 4px; }
.m2-how-cta { text-align: center; margin: 40px 0 4px; }
.m2-how-cta h2 { font-size: clamp(22px, 3.4vw, 28px); font-weight: 800; letter-spacing: -.02em;
   color: var(--ink); margin: 0 0 8px; }
.m2-how-cta p { color: var(--muted); font-size: 16px; margin: 0 0 20px; }
.m2-how-cta a { display: inline-block; text-decoration: none; font-weight: 800; font-size: 16px;
   color: #fff; background: var(--brand); border-radius: 12px; padding: 15px 34px; box-shadow: var(--shadow);
   transition: background .12s ease, transform .12s ease; }
.m2-how-cta a:hover { background: var(--brand-dark); transform: translateY(-1px); }

/* ------------------------------------------------------------------
   Каталог стран/городов — /countries/  (.m2-ctry-*)
   Живой поиск (поле) + алфавитный многоколоночный список с флагами.
   ------------------------------------------------------------------ */
.m2-ctry { margin-top: 4px; }

/* Поле живого поиска */
.m2-ctry-search { position: relative; max-width: 560px; margin: 0 0 26px; }
.m2-ctry-search-wide { max-width: 672px; } /* каталог городов: длиннее плейсхолдер (ввод двух городов) */
.m2-ctry-search-ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.m2-ctry-search input {
   width: 100%; box-sizing: border-box; height: 52px; padding: 0 44px 0 46px;
   font: inherit; font-size: 16px; color: var(--ink); background: var(--card);
   border: 1px solid var(--line); border-radius: 14px; outline: none;
   box-shadow: 0 1px 2px rgba(15,31,51,.04); transition: border-color .12s ease, box-shadow .12s ease;
}
.m2-ctry-search input::placeholder { color: #9aa3b8; }
.m2-ctry-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,90,60,.14); }
.m2-ctry-clear {
   position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
   width: 28px; height: 28px; border: none; background: #eef2f8; color: #66758c;
   border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer;
   display: flex; align-items: center; justify-content: center; padding: 0;
}
.m2-ctry-clear:hover { background: #e3e9f2; color: var(--ink); }
.m2-ctry-clear[hidden] { display: none; }

/* Многоколоночный алфавитный список (перетекает по колонкам) */
.m2-ctry-cols { column-count: 4; column-gap: 34px; }
.m2-ctry-group { break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid;
   margin: 0 0 20px; display: inline-block; width: 100%; }
.m2-ctry-letter { display: block; font-size: 18px; font-weight: 800; color: var(--brand);
   letter-spacing: -.01em; margin: 0 0 6px; }
/* Ссылки-строки: ПРАВИЛО сайта — текстовые ссылки чёрные и подчёркнутые (не кнопки).
   Перебиваем глобальное оранжевое .m2 a специфичностью (класс-родитель). */
.m2-ctry-cols a.m2-ctry-item { display: flex; align-items: center; gap: 9px; padding: 4px 0;
   color: var(--ink); text-decoration: underline; text-underline-offset: 2px;
   text-decoration-color: rgba(15,31,51,.28); font-size: 15px; line-height: 1.35; cursor: pointer; }
.m2-ctry-cols a.m2-ctry-item:hover { color: var(--ink); text-decoration-color: var(--ink); }
.m2-ctry-item .flag { flex: none; box-shadow: 0 0 0 1px rgba(15,31,51,.08); border-radius: 1px; }
/* Логотип авиакомпании в каталоге /airlines/ (аналог флага у стран/городов) */
.m2-air-logo { flex: none; width: 22px; height: 22px; border-radius: 4px; object-fit: contain;
   background: #fff; box-shadow: 0 0 0 1px rgba(15,31,51,.08); }

.m2-ctry-empty { color: var(--muted); font-size: 16px; padding: 8px 0 20px; }

/* Результаты серверного поиска (города/маршруты) — те же колонки, что и каталог */
.m2-ctry-results { margin-top: 2px; }
.m2-ctry-route { break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid;
   display: inline-block; width: 100%; }

@media (max-width: 900px) { .m2-ctry-cols { column-count: 3; column-gap: 26px; } }
@media (max-width: 640px) { .m2-ctry-cols { column-count: 2; column-gap: 20px; } }
@media (max-width: 400px) { .m2-ctry-cols { column-count: 1; } }
