/* ============================================================
   MexMigrate — фирменный стиль, mobile-first
   Палитра: глубокий бирюзовый (агава), терракота, песок
   ============================================================ */
:root {
    --teal: #0f6b5c;
    --teal-dark: #0a4c41;
    --terra: #d95d39;
    --terra-dark: #b8462a;
    --sand: #faf6ef;
    --ink: #1f2a2e;
    --ink-soft: #4a5a60;
    --line: #e6e0d4;
    --white: #ffffff;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(15, 107, 92, .10);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--sand);
    line-height: 1.65;
    font-size: 17px;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; color: var(--ink); }
h1 { font-size: 1.75rem; margin: .4em 0 .6em; }
h2 { font-size: 1.35rem; margin: 1.4em 0 .5em; }
h3 { font-size: 1.12rem; margin: 1.2em 0 .4em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em 1.3em; }
li { margin-bottom: .35em; }
table { width: 100%; border-collapse: collapse; margin: 1em 0 1.4em; font-size: .95rem; display: block; overflow-x: auto; }
th, td { padding: .6em .8em; border: 1px solid var(--line); text-align: left; }
th { background: var(--teal); color: var(--white); font-weight: 600; }
tr:nth-child(even) td { background: #f3efe6; }
strong { font-weight: 700; }

.container { max-width: 860px; margin: 0 auto; padding: 0 18px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--teal); color: #fff; padding: 10px 16px; z-index: 200; }
.skip-link:focus { left: 0; }

/* ---------- Кнопки ---------- */
.btn {
    display: inline-block; padding: 13px 26px; border-radius: 999px;
    font-weight: 700; font-size: 1rem; border: 2px solid transparent;
    cursor: pointer; text-align: center; transition: background .2s, transform .1s;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--accent { background: var(--terra); color: #fff; }
.btn--accent:hover { background: var(--terra-dark); color: #fff; }
.btn--ghost { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; padding: 9px 18px; font-size: .92rem; }
.btn--ghost:hover { border-color: #fff; color: #fff; }

/* ---------- Шапка ---------- */
.header {
    position: sticky; top: 0; z-index: 100;
    background: var(--white); box-shadow: 0 1px 0 var(--line);
}
.header__inner {
    max-width: 1200px; margin: 0 auto; padding: 10px 16px;
    display: flex; align-items: center; gap: 14px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo__text { font-weight: 800; font-size: 1.15rem; color: var(--teal-dark); line-height: 1.1; display: flex; flex-direction: column; }
.logo__text small { font-weight: 500; font-size: .62rem; color: var(--ink-soft); letter-spacing: .02em; }
.header__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header__phone { display: none; font-weight: 700; color: var(--teal-dark); white-space: nowrap; }
.header__btn { display: none; padding: 10px 18px; font-size: .92rem; white-space: nowrap; }

/* Бургер */
.burger {
    width: 46px; height: 46px; border: none; background: var(--teal); border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer;
}
.burger span { display: block; width: 22px; height: 2.5px; background: #fff; border-radius: 2px; transition: transform .25s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Меню: мобильное по умолчанию ---------- */
.nav {
    display: none; position: fixed; inset: 66px 0 0 0; z-index: 99;
    background: var(--white); overflow-y: auto; padding: 8px 0 40px;
    border-top: 1px solid var(--line);
}
.nav.open { display: block; }
.nav__list { list-style: none; margin: 0; }
.nav__list--lvl1, .nav__list--lvl2 { display: none; background: #f6f2e9; }
.nav__item--open > .nav__list { display: block; }
.nav__row { display: flex; align-items: stretch; }
.nav__link { flex: 1; display: block; padding: 14px 18px; font-weight: 600; color: var(--ink); font-size: 1.02rem; }
.nav__list--lvl1 .nav__link { padding-left: 34px; font-weight: 500; font-size: .97rem; }
.nav__list--lvl2 .nav__link { padding-left: 50px; font-size: .95rem; }
.nav__item--active > .nav__row > .nav__link { color: var(--terra); }
.nav__toggle {
    width: 52px; border: none; background: transparent; cursor: pointer; color: var(--ink-soft);
    display: flex; align-items: center; justify-content: center;
}
.nav__toggle svg { transition: transform .2s; }
.nav__item--open > .nav__row > .nav__toggle svg { transform: rotate(180deg); }
.nav__cta-mobile { padding: 18px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); margin-top: 10px; }
.nav__phone { font-weight: 700; color: var(--teal-dark); text-align: center; padding: 8px; }

/* ---------- Хлебные крошки ---------- */
.breadcrumbs { font-size: .85rem; margin: 14px 0 4px; color: var(--ink-soft); }
.breadcrumbs ol { list-style: none; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumbs li { display: flex; align-items: center; margin: 0; }
.breadcrumbs li + li::before { content: "›"; margin: 0 7px; color: #b9b0a0; }
.breadcrumbs .current { color: var(--ink); }

/* ---------- Контент ---------- */
main { padding-bottom: 40px; }
.lead { font-size: 1.12rem; color: var(--ink-soft); }
.note, .warning {
    border-radius: var(--radius); padding: 14px 18px; margin: 1.2em 0; font-size: .97rem;
}
.note { background: #e8f3f0; border-left: 4px solid var(--teal); }
.warning { background: #fdf0e9; border-left: 4px solid var(--terra); }
.card-grid { display: grid; gap: 14px; margin: 1.2em 0; }
.card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

/* ---------- FAQ ---------- */
.faq { margin: 1.6em 0; }
.faq__item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.faq__item summary { padding: 15px 18px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; font-size: 1.4rem; color: var(--terra); flex-shrink: 0; }
.faq__item[open] summary::after { content: "−"; }
.faq__answer { padding: 0 18px 16px; color: var(--ink-soft); }

/* ---------- Читайте также ---------- */
.related { background: #eef6f3; border-radius: var(--radius); padding: 18px 22px; margin: 2em 0; }
.related__title { margin-top: 0; font-size: 1.1rem; }
.related__list { margin-bottom: 0; }
.related__list a { font-weight: 600; }

/* ---------- CTA и формы ---------- */
.cta {
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: #fff; border-radius: var(--radius); padding: 28px 22px; margin: 2.2em 0;
}
.cta__title { color: #fff; margin-top: 0; }
.cta__text { color: rgba(255,255,255,.9); }
.lead-form__row { margin-bottom: 14px; }
.lead-form__label { display: block; font-weight: 600; font-size: .92rem; color: inherit; }
.cta .lead-form__label { color: #fff; }
.lead-form__input {
    width: 100%; margin-top: 6px; padding: 13px 15px; border-radius: 10px;
    border: 1.5px solid var(--line); font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
.lead-form__input:focus { outline: 2px solid var(--terra); border-color: transparent; }
.lead-form__textarea { resize: vertical; min-height: 84px; }
.lead-form__consent { display: flex; gap: 10px; align-items: flex-start; font-size: .82rem; margin: 12px 0 16px; color: rgba(255,255,255,.85); }
.lead-form__consent input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; accent-color: var(--terra); }
.lead-form__consent a { color: #fff; text-decoration: underline; }
.lead-form__submit { width: 100%; font-size: 1.06rem; padding: 15px; }
.hp-field { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* Форма на обычной странице (не в CTA) */
.form-page .lead-form__label { color: var(--ink); }
.form-page .lead-form__consent { color: var(--ink-soft); }
.form-page .lead-form__consent a { color: var(--teal); }

/* ---------- Подвал ---------- */
.footer { background: var(--teal-dark); color: rgba(255,255,255,.85); margin-top: 30px; }
.footer__inner {
    max-width: 1200px; margin: 0 auto; padding: 40px 18px 24px;
    display: grid; gap: 28px;
}
.footer a { color: #fff; }
.footer__heading { color: #fff; font-size: 1rem; margin: 0 0 10px; }
.footer__col ul { list-style: none; margin: 0; }
.footer__col li { margin-bottom: 8px; }
.footer__tagline, .footer__contacts { font-size: .92rem; }
.footer__messenger { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.15); padding: 16px 18px; font-size: .8rem; color: rgba(255,255,255,.6); }
.footer__bottom p { max-width: 1200px; margin: 0 auto; }
.logo--footer .logo__text { color: #fff; }

/* ---------- Главная ---------- */
.hero {
    background: linear-gradient(160deg, var(--teal) 0%, var(--teal-dark) 70%);
    color: #fff; padding: 46px 0 42px; margin-bottom: 8px;
}
.hero h1 { color: #fff; font-size: 1.9rem; }
.hero .lead { color: rgba(255,255,255,.92); }
.hero__actions { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.hero__actions .btn { width: 100%; }
.section-list { display: grid; gap: 14px; margin: 1.4em 0; }
.section-card {
    display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow); color: var(--ink);
}
.section-card:hover { text-decoration: none; border-color: var(--teal); }
.section-card h2 { margin: 0 0 6px; color: var(--teal-dark); font-size: 1.2rem; }
.section-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Планшет ---------- */
@media (min-width: 640px) {
    h1 { font-size: 2.1rem; }
    .card-grid { grid-template-columns: 1fr 1fr; }
    .section-list { grid-template-columns: 1fr 1fr; }
    .hero__actions { flex-direction: row; }
    .hero__actions .btn { width: auto; }
    .footer__inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

/* ---------- Десктоп: горизонтальное меню ---------- */
@media (min-width: 1024px) {
    .header__btn { display: inline-block; }
    .burger { display: none; }
    .nav { display: block; position: static; overflow: visible; padding: 0; border: none; background: transparent; }
    .nav__cta-mobile { display: none; }
    .nav__list--lvl0 { display: flex; align-items: center; gap: 2px; }
    .nav__list--lvl0 > .nav__item { position: relative; }
    .nav__row { display: block; }
    .nav__list--lvl0 .nav__link { padding: 10px 9px; font-size: .92rem; border-radius: 8px; white-space: nowrap; }
    .nav__list--lvl0 .nav__link:hover { background: #eef6f3; text-decoration: none; }
    .nav__list--lvl0 .nav__toggle { display: none; }

    /* выпадающие уровни */
    .nav__list--lvl1, .nav__list--lvl2 {
        display: none; position: absolute; top: 100%; left: 0; min-width: 250px;
        background: var(--white); border: 1px solid var(--line); border-radius: 10px;
        box-shadow: var(--shadow); padding: 6px; z-index: 120;
    }
    .nav__list--lvl1 .nav__link, .nav__list--lvl2 .nav__link { padding: 9px 14px; font-size: .93rem; white-space: normal; border-radius: 7px; }
    .nav__item:hover > .nav__list, .nav__item:focus-within > .nav__list { display: block; }
    .nav__list--lvl1 .nav__item { position: relative; }
    .nav__list--lvl2 { top: -7px; left: 100%; }
    .nav__list--lvl1 .nav__item--has-children > .nav__row > .nav__link::after { content: "›"; float: right; color: var(--terra); }
}

/* Телефон в шапке — только на широких экранах */
@media (min-width: 1240px) {
    .header__phone { display: inline-block; }
}
