/* ==========================================================================
   Liberty Legal — основной стиль
   Тема: чёрный фон + СИНИЙ акцент. Мобайл-first.
   Акцентный цвет меняется одной переменной --accent ниже.
   ========================================================================== */

:root {
    --bg:        #0a0b0d;
    --bg-alt:    #0f1013;
    --card:      #17181c;
    --card-2:    #1c1e23;
    --line:      #2a2c32;
    --text:      #f4f5f7;
    --muted:     #d9dde9;
    --muted-2:   #71747d;

    --accent:      #2f7dff;   /* основной синий */
    --accent-600:  #1f66e6;
    --accent-soft: rgba(47, 125, 255, 0.14);
    --error:       #ff5a5a;
    --ok:          #35c06a;

    --radius:   24px;
    --radius-sm:14px;
    --container: 1500px;
    --header-h: 84px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; overflow-x: hidden; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

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

/* --- Секции ---------------------------------------------------------------- */
.section { padding: 64px 0; }
.section:nth-child(even) { background: var(--bg-alt); }

.section__title {
    margin: 0 0 36px;
    font-size: clamp(26px, 5.2vw, 52px);
    line-height: 1.08;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.section__title--marker .marker { color: var(--accent); }

.accent { color: var(--accent); }

.num {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.15em;
    letter-spacing: .5px;
    white-space: nowrap;
}
.num--top    { display: inline-block; margin-bottom: 10px; font-size: 18px; }
.num--bottom { display: block; margin-top: 18px; font-size: 20px; text-align: left; }

/* --- Кнопки ---------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 30px;
    border-radius: 999px;
    border: 1.5px solid transparent;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s, transform .1s;
    text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn--accent {
    background: var(--accent);
    color: #fff;
}
.btn--accent:hover { background: var(--accent-600); }
.btn--outline {
    background: transparent;
    border-color: rgba(47, 125, 255, .55);
    color: var(--text);
}
.btn--outline:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ==========================================================================
   Шапка + мобильное меню
   ========================================================================== */
.site-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 40;
    height: var(--header-h);
    display: flex;
    align-items: center;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo { display: inline-flex; align-items: center; gap: 12px; color: #fff; }
.logo__img { height: 66px; width: auto; }
.logo__mark { height: 44px; width: auto; color: #fff; }
.logo__text { display: flex; flex-direction: column; line-height: 1; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.35); }
.logo__name { font-size: 22px; font-weight: 700; }
.logo__sub  { font-size: 18px; font-weight: 500; font-style: italic; }

.site-nav { display: flex; gap: 30px; }
.site-nav__link {
    color: rgba(255,255,255,.85);
    font-size: 15px;
    font-weight: 500;
    transition: color .2s;
}
.site-nav__link:hover { color: var(--accent); }

.burger {
    display: none;
    width: 44px; height: 44px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.burger span {
    display: block;
    height: 2.5px;
    width: 100%;
    background: #fff;
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}

.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(8, 9, 11, .98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
.mobile-nav.open { opacity: 1; visibility: visible; }
.mobile-nav__close {
    position: absolute;
    top: 22px; right: 24px;
    background: transparent; border: none;
    color: #fff; font-size: 40px; line-height: 1; cursor: pointer;
}
.mobile-nav__link { color: #fff; font-size: 22px; font-weight: 600; }
.mobile-nav__link:hover { color: var(--accent); }
.mobile-nav__list { display: flex; flex-direction: column; gap: 28px; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
    position: relative;
    min-height: 640px;
    display: flex;
    align-items: center;
    padding: calc(var(--header-h) + 40px) 0 60px;
    overflow: hidden;
}
.hero__bg {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(90deg, rgba(8,9,11,.96) 0%, rgba(8,9,11,.7) 42%, rgba(8,9,11,.25) 100%),
                      url('../img/hero_bg.png');
    background-size: cover;
    background-position: center right;
    z-index: 0;
}
.hero__inner { position: relative; z-index: 1; }
.hero__content { max-width: 620px; }
.hero__kicker {
    margin: 0 0 22px;
    color: rgba(255,255,255,.8);
    text-transform: uppercase;
    font-weight: 500;
    font-size: clamp(13px, 2vw, 17px);
    letter-spacing: .5px;
    max-width: 480px;
}
.hero__title {
    margin: 0 0 34px;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.05;
    font-size: clamp(26px, 6.4vw, 62px);
    overflow-wrap: break-word;
    word-break: break-word;
}
.hero__line { display: block; }
.hero__line.accent { color: var(--accent); position: relative; }
.hero__line.accent::before { content: '// '; }

.hero__form { max-width: 520px; }

/* ==========================================================================
   Форма заявки
   ========================================================================== */
.lead-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    background: rgba(18, 19, 23, .72);
    backdrop-filter: blur(6px);
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.field { position: relative; }
.field__input {
    width: 100%;
    padding: 15px 18px;
    background: #ffffff;
    border: 1.5px solid #ffffff;
    border-radius: 12px;
    color: #16171c;
    font-size: 15px;
    transition: border-color .2s, box-shadow .2s;
}
.field__input::placeholder { color: #8b8e97; }
.field__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field.invalid .field__input { border-color: var(--error); box-shadow: 0 0 0 3px rgba(255,90,90,.18); }
.field.valid   .field__input { border-color: var(--ok); }
.field__error {
    display: none;
    margin-top: 6px;
    color: var(--error);
    font-size: 13px;
    line-height: 1.35;
}
.field.invalid .field__error { display: block; }

.lead-form__submit { width: 100%; margin-top: 4px; padding: 16px; font-size: 16px; }
.lead-form__status {
    margin: 4px 0 0;
    font-size: 14px;
    min-height: 0;
}
.lead-form__status.ok    { color: var(--ok); }
.lead-form__status.err   { color: var(--error); }

/* ==========================================================================
   Общие карточки: угловая стрелка, скроллер
   ========================================================================== */
.corner-arrow {
    position: absolute;
    top: 14px; right: 14px;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(10,11,13,.55);
    border: 1px solid rgba(47,125,255,.55);
    color: var(--accent);
    font-size: 20px;
}

/* --- Универсальный слайдер (свайп мышью и пальцем, без стрелок) ----------- */
.slider {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scroll-padding-left: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge */
    cursor: grab;
}
.slider::-webkit-scrollbar { display: none; }
.slider.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.slider.dragging * { pointer-events: none; }

/* Ширина карточек = сколько видно за раз */
.slider > * {
    flex: 0 0 84%;
    max-width: 440px;
    scroll-snap-align: start;
}
@media (min-width: 640px) {
    .slider > * { flex-basis: 47%; max-width: none; }
}
@media (min-width: 901px) {
    .slider > * { flex-basis: 31%; }
}

/* Отзывы — карточки шире, по 2 в ряд на десктопе */
.reviews .slider > * { max-width: none; }
@media (min-width: 901px) { .reviews .slider > * { flex-basis: 48%; } }

/* Видео-карточки узкие и фиксированной ширины */
.info .slider > * { flex: 0 0 300px; max-width: 340px; }

/* --- Case card ------------------------------------------------------------- */
.case-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.case-card__media { position: relative; aspect-ratio: 5 / 4; }
.case-card__media img { width: 100%; height: 100%; object-fit: cover; }
.case-card__body { padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.case-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.case-card__title { margin: 0; font-size: 20px; font-weight: 700; text-transform: uppercase; }
.case-card__text { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.case-card .btn { align-self: center; margin-top: 6px; min-width: 190px; }

/* ==========================================================================
   Преимущества
   ========================================================================== */
.adv-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
}
.adv-card__title { margin: 0 0 10px; font-size: 20px; font-weight: 700; }
.adv-card__text  { margin: 0; color: var(--muted); font-size: 15px; }
.adv-card__note  { margin: 12px 0 0; color: var(--muted-2); font-size: 13px; font-style: italic; }

/* ==========================================================================
   О нас
   ========================================================================== */
.about__inner { display: grid; grid-template-columns: 1fr; gap: 30px; }
.about__p { margin: 0 0 16px; color: var(--muted); font-size: 16px; }
.about__btn { margin-top: 8px; }
.about__media img {
    width: 100%;
    border-radius: var(--radius);
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* ==========================================================================
   Информативный блок (видео)
   ========================================================================== */
.video-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    max-width: 340px;
    cursor: pointer;
    background: var(--card);
}
.video-card__media {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    transition: transform .4s;
}
.video-card:hover .video-card__media { transform: scale(1.05); }
.video-card__overlay {
    position: absolute; inset: 0;
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 12px;
    padding: 22px;
    background: linear-gradient(180deg, rgba(10,11,13,0) 40%, rgba(10,11,13,.85) 100%);
}
.video-card__title { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.video-card__author { color: var(--accent); font-size: 14px; }
.play-btn {
    flex: 0 0 auto;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(47,125,255,.4);
    transition: transform .2s, background .2s;
}
.video-card:hover .play-btn { transform: scale(1.08); background: var(--accent-600); }
.play-btn svg { width: 24px; height: 24px; margin-left: 3px; }

/* ==========================================================================
   Как мы работаем
   ========================================================================== */
.step-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex; flex-direction: column;
}
.step-card__media { position: relative; aspect-ratio: 16 / 10; }
.step-card__media img { width: 100%; height: 100%; object-fit: cover; }
.step-card__body { padding: 22px 22px 24px; }
.step-card__title { margin: 0 0 12px; font-size: 20px; font-weight: 700; text-transform: uppercase; }
.step-card__text  { margin: 0; color: var(--muted); font-size: 15px; }

/* ==========================================================================
   Команда
   ========================================================================== */
.team-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px 16px 24px;
}
.team-card__media {
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #d9dbe0;
    margin-bottom: 18px;
}
.team-card__media img { width: 100%; height: 100%; object-fit: cover; }
.team-card__name { margin: 0 0 6px; font-size: 22px; font-weight: 700; text-transform: uppercase; padding: 0 6px; }
.team-card__role { margin: 0 0 18px; color: var(--muted); font-size: 15px; padding: 0 6px; min-height: 48px; }
.team-card .btn { width: 100%; }

/* ==========================================================================
   Отзывы
   ========================================================================== */
.review-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.review-card__top { display: flex; align-items: center; gap: 18px; }
.review-card__avatar {
    flex: 0 0 auto;
    width: 96px; height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--card-2);
}
.review-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.review-card__name { margin: 0 0 8px; font-size: 24px; font-weight: 700; }
.review-card__short { margin: 0; color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: .3px; }
.review-card__bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.review-card__bottom .btn { min-width: 160px; }

.stars { display: inline-flex; gap: 6px; }
.star { width: 24px; height: 24px; fill: #3a3d44; }
.star--on { fill: var(--accent); }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-list { display: flex; flex-direction: column; gap: 14px; }
.faq-item {
    background: var(--card);
    border-radius: 18px;
    overflow: hidden;
}
.faq-item__q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 24px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}
.faq-item__icon {
    flex: 0 0 auto;
    position: relative;
    width: 22px; height: 22px;
}
.faq-item__icon::before,
.faq-item__icon::after {
    content: '';
    position: absolute;
    background: var(--text);
    transition: transform .3s, opacity .3s;
}
.faq-item__icon::before { top: 50%; left: 0; width: 100%; height: 2px; transform: translateY(-50%); }
.faq-item__icon::after  { left: 50%; top: 0; height: 100%; width: 2px; transform: translateX(-50%); }
.faq-item.open .faq-item__icon::after { transform: translateX(-50%) rotate(90deg); opacity: 0; }

.faq-item__a {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
}
.faq-item__a-inner {
    padding: 0 24px 22px;
    color: var(--muted);
    font-size: 15px;
}

/* ==========================================================================
   Сертификация
   ========================================================================== */
.cert-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.cert-card__media {
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 3 / 4;
    margin-bottom: 18px;
    background: var(--card-2);
}
.cert-card__media img { width: 100%; height: 100%; object-fit: cover; }
.cert-card__title { margin: 0 0 10px; font-size: 19px; font-weight: 700; }
.cert-card__text  { margin: 0; color: var(--muted); font-size: 15px; }

/* ==========================================================================
   Контактная секция
   ========================================================================== */
.contact__inner { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
.contact__media img { width: 100%; border-radius: var(--radius); object-fit: cover; }
.contact__text { margin: 0 0 20px; color: var(--muted); }
.contact .lead-form { background: var(--card); }

/* ==========================================================================
   Модалка
   ========================================================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal.open { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(6,7,9,.8); backdrop-filter: blur(3px); }
.modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1120px;
    max-height: 90vh;
    overflow-y: auto;
    background: #121317;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 44px;
}
.modal__close {
    position: absolute;
    top: 16px; right: 18px;
    background: transparent; border: none;
    color: #fff; font-size: 34px; line-height: 1; cursor: pointer;
    z-index: 2;
}

/* Специалист (team popup) */
.specialist { display: grid; grid-template-columns: 1fr; gap: 26px; }
.specialist__name { margin: 0 0 18px; font-size: clamp(26px, 5vw, 40px); font-weight: 600; }
.specialist__p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.specialist__subtitle { margin: 22px 0 12px; color: var(--accent); font-size: 15px; text-transform: uppercase; font-weight: 700; letter-spacing: .4px; }
.specialist__list { margin: 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.specialist__list li { margin-bottom: 6px; }
.specialist__photo { border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1 / 1; background: #d9dbe0; }
.specialist__photo img { width: 100%; height: 100%; object-fit: cover; }
.specialist__edu { background: var(--card); border-radius: var(--radius-sm); padding: 22px; margin-top: 18px; }

/* Отзыв (review popup) */
.review-full__head {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px 18px;
    margin-bottom: 22px;
}
.review-full__avatar { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; grid-row: span 2; }
.review-full__avatar img { width: 100%; height: 100%; object-fit: cover; }
.review-full__title { margin: 0; font-size: clamp(24px, 4vw, 34px); font-weight: 600; }
.review-full__short { margin: 0; color: var(--text); font-size: 16px; text-transform: uppercase; letter-spacing: .3px; }
.review-full__text { margin: 0 0 28px; color: var(--muted); font-size: 15px; }
.review-full__foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }

/* Видео в модалке */
.modal-video { width: 100%; aspect-ratio: 16 / 9; }
.modal-video iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius-sm); }

/* ==========================================================================
   Страница "Спасибо"
   ========================================================================== */
.thanks {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
}
.thanks__bg {
    position: absolute; inset: 0;
    background-image: linear-gradient(90deg, rgba(8,9,11,.95), rgba(8,9,11,.55)), url('../img/hero_bg.png');
    background-size: cover; background-position: center;
    z-index: 0;
}
.thanks__inner { position: relative; z-index: 1; padding: 60px 20px; }
.thanks__logo { margin-bottom: 50px; }
.thanks__box { max-width: 620px; }
.thanks__title { margin: 0 0 20px; font-size: clamp(28px, 5vw, 48px); font-weight: 700; }
.thanks__text { margin: 0 0 32px; color: var(--muted); font-size: 18px; }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 900px) {
    .site-nav { display: none; }
    .burger   { display: flex; }
    body.menu-open { overflow: hidden; }
    .modal__dialog {
        padding: 20px;
    }
}

@media (min-width: 640px) {
    .lead-form { grid-template-columns: 1fr 1fr; }
    .lead-form__submit,
    .lead-form__status { grid-column: 1 / -1; }
}

@media (min-width: 901px) {
    :root { --header-h: 96px; }

    .section { padding: 90px 0; }

    /* На ПК — без «магнита»: слайдер катится свободно */
    .slider { scroll-snap-type: none; }

    .about__inner {
        grid-template-columns: 1.15fr .85fr;
        align-items: center;
        gap: 50px;
    }
    .contact__inner { grid-template-columns: .9fr 1.1fr; gap: 40px; }

    .specialist { grid-template-columns: 1.1fr .9fr; }
    .specialist__right { display: flex; flex-direction: column; }
}

@media (min-width: 1100px) {
    .hero__bg {
        background-image: linear-gradient(90deg, rgba(8,9,11,.95) 0%, rgba(8,9,11,.55) 45%, rgba(8,9,11,.15) 100%),
                          url('../img/hero_bg.png');
    }
}

/* Мобильный фон hero */
@media (max-width: 700px) {
    .hero__bg {
        background-image: linear-gradient(180deg, rgba(8,9,11,.55) 0%, rgba(8,9,11,.82) 55%, rgba(8,9,11,.95) 100%),
                          url('../img/hero_bg_mob.png');
        background-position: center top;
    }
    .hero { min-height: auto; }
}

/* Узкие телефоны — чуть уменьшаем крупный текст, чтобы ничего не обрезалось */
@media (max-width: 430px) {
    .hero__title  { font-size: 25px; }
    .hero__kicker { font-size: 12px; }
    .container    { padding: 0 16px; }
}

/* Уважение к настройке "меньше движения" */
@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; }
}
