/*
 * Публичный сайт v2: сетка, секции, шапка, подвал, cookie
 * и блоки, общие для нескольких страниц (карточка статьи, CTA, FAQ).
 * Размеры — из макета (десктоп 1440, планшет 768, мобильный 375).
 */

/* ---------- Сетка ---------- */

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

.v2-section {
    padding: 80px 0;
}

.v2-section--light {
    background: var(--v2-light-bg);
    color: var(--v2-light-text);
}

/* Между заголовком секции и её содержимым в макете 80 px.
   Селектор из двух классов — иначе `.v2-title { margin: 0 }` ниже перебивает отступ. */
.v2-section .v2-section__head {
    margin-bottom: 80px;
}

@media (max-width: 1199px) {
    .v2-section { padding: 60px 0; }
    .v2-section .v2-section__head { margin-bottom: 40px; }
}

@media (max-width: 767px) {
    .v2-section { padding: 40px 0; }
    .v2-section .v2-section__head { margin-bottom: 32px; }
}

/* ---------- Типографика секций ---------- */

.v2-display {
    margin: 0;
    font-family: var(--v2-font-display);
    font-weight: 400;
    font-size: 60px;
    line-height: 1;
    letter-spacing: -0.02em;
}

.v2-title {
    margin: 0;
    font-family: var(--v2-font-heading);
    font-weight: 500;
    font-size: 44px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.v2-lead {
    margin: 0;
    font-size: 24px;
    line-height: 28.8px;
    color: var(--v2-text-secondary);
}

.v2-text {
    margin: 0;
    font-size: 18px;
    line-height: 21.6px;
    color: var(--v2-text-secondary);
}

.v2-muted {
    color: var(--v2-text-muted);
}

/* Приглушённый акцент на светлом фоне */
.v2-muted--soft {
    color: var(--v2-light-text-secondary);
}

.v2-section--light .v2-lead,
.v2-section--light .v2-text {
    color: var(--v2-light-text-secondary);
}

.v2-icon {
    flex: none;
}

@media (max-width: 1199px) {
    .v2-display { font-size: 44px; }
    .v2-title { font-size: 36px; }
}

@media (max-width: 767px) {
    .v2-display { font-size: 32px; }
    .v2-title { font-size: 24px; }
    .v2-lead { font-size: 18px; line-height: 21.6px; }
    .v2-text { font-size: 14px; line-height: 16.8px; }
}

/* ---------- Кнопки на светлых секциях ---------- */

.v2-section--light .v2-btn--outline {
    color: var(--v2-light-text);
}

.v2-section--light .v2-btn--outline:hover {
    background: rgba(0, 0, 0, .06);
}

/* ---------- Шапка ---------- */

.v2-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: rgba(0, 0, 0, .8);
    -webkit-backdrop-filter: blur(50px);
    backdrop-filter: blur(50px);
}

.v2-header.is-menu-open {
    background: #000;
}

body.is-menu-open {
    overflow: hidden;
}

.v2-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 120px;
}

.v2-header__left {
    display: flex;
    align-items: center;
    gap: 32px;
    min-width: 0;
}

.v2-header__logo {
    display: flex;
    flex: none;
}

.v2-header__logo .v2-icon {
    width: 203px;
    height: auto;
}

.v2-header__nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.v2-header__nav a {
    font-size: 18px;
    line-height: 21px;
    color: var(--v2-text);
    transition: color .15s;
}

.v2-header__nav a:hover,
.v2-header__nav a[aria-current="page"] {
    color: var(--v2-lime);
}

.v2-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---------- Переключатель языка ---------- */

.v2-lang {
    position: relative;
}

.v2-lang__toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    background: none;
    color: var(--v2-text);
    font-weight: 500;
    font-size: 18px;
    line-height: 21px;
    cursor: pointer;
    transition: color .15s;
}

.v2-lang__toggle:hover,
.v2-lang__toggle[aria-expanded="true"] {
    color: var(--v2-lime);
}

.v2-lang__chevron {
    transition: transform .15s;
}

.v2-lang__toggle[aria-expanded="true"] .v2-lang__chevron {
    transform: rotate(180deg);
}

.v2-lang__list {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 20;
    min-width: 112px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #000;
    border: 1px solid var(--v2-line-strong);
}

.v2-lang__list a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 17px;
    color: var(--v2-text);
    text-align: center;
}

.v2-lang__list a:hover {
    background: rgba(240, 240, 240, .08);
    color: var(--v2-text);
}

.v2-lang__list a[aria-current="true"] {
    color: var(--v2-lime);
}

/* ---------- Бургер и мобильное меню ---------- */

.v2-header__burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: -8px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--v2-text);
    cursor: pointer;
}

.v2-header__burger-close,
.v2-header.is-menu-open .v2-header__burger-open {
    display: none;
}

.v2-header.is-menu-open .v2-header__burger-close {
    display: block;
}

/* Шапка фиксирована и из-за backdrop-filter становится контейнером для position: fixed,
   поэтому панель позиционируем от неё и задаём высоту явно */
.v2-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 55;
    height: calc(100vh - 104px);
    height: calc(100dvh - 104px);
    overflow-y: auto;
    background: #000;
    border-top: 1px solid var(--v2-line);
}

.v2-menu__nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding-top: 24px;
    padding-bottom: 24px;
}

.v2-menu__nav > a,
.v2-menu__login,
.v2-menu__lang > button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 18px;
    line-height: 21px;
    color: var(--v2-text);
}

.v2-menu__lang {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.v2-menu__lang > button {
    padding: 0;
    border: 0;
    background: none;
    font-weight: 600;
    cursor: pointer;
}

.v2-menu__lang > button[aria-expanded="true"] .v2-icon {
    transform: rotate(180deg);
}

.v2-menu__lang [data-accordion-panel] {
    display: flex;
    flex-direction: column;
}

.v2-menu__lang a {
    display: flex;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
    line-height: 17px;
    color: var(--v2-text);
}

.v2-menu__lang a[aria-current="true"] {
    color: var(--v2-lime);
}

@media (max-width: 1199px) {
    .v2-header__bar { height: 104px; }
    .v2-header__nav { display: none; }
    .v2-header__burger { display: flex; }
    .v2-header__logo .v2-icon { width: 187px; }
    .v2-header__actions { gap: 8px; }
    .v2-lang__toggle { padding: 10px 8px; }
}

@media (max-width: 767px) {
    .v2-header__bar { height: 61px; gap: 8px; }
    /* В макете мобильной шапки остаются только логотип, кнопка и бургер */
    .v2-header__login,
    .v2-header .v2-lang { display: none; }
    .v2-header__logo .v2-icon { width: 133px; }
    .v2-header__burger { width: 33px; height: 33px; margin-right: 0; }
    .v2-header__actions .v2-btn { padding: 8px 12px; }
    .v2-menu {
        height: calc(100vh - 61px);
        height: calc(100dvh - 61px);
    }
}

/* ---------- Подвал ---------- */

.v2-footer {
    padding-top: 120px;
    overflow: hidden;
}

.v2-footer__top {
    display: flex;
    justify-content: space-between;
    gap: 48px;
    padding-bottom: 32px;
}

.v2-footer__info {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    gap: 64px;
}

.v2-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.v2-footer__logo {
    display: flex;
}

.v2-footer__logo .v2-icon {
    width: 203px;
    height: auto;
}

.v2-footer__copy {
    margin: 0;
    font-size: 14px;
    line-height: 16.8px;
    color: var(--v2-text-muted);
}

.v2-footer__socials {
    display: flex;
    gap: 12px;
    color: var(--v2-text);
}

.v2-footer__socials a {
    display: flex;
    transition: color .15s;
}

.v2-footer__socials a:hover {
    color: var(--v2-lime);
}

.v2-footer__lists {
    display: flex;
    flex: none;
    gap: 40px;
}

.v2-footer__list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 65px;
}

.v2-footer__list-title {
    font-weight: 600;
    font-size: 18px;
    line-height: 21.6px;
    color: var(--v2-text);
}

.v2-footer__list a {
    font-size: 15px;
    line-height: 18px;
    color: var(--v2-text-secondary);
    transition: color .15s;
}

.v2-footer__list a + a {
    margin-top: -8px;
}

.v2-footer__list a:hover {
    color: var(--v2-text);
}

/* Крупная надпись PAIRTRADING.PRO внизу страницы — обрезана нижним краем экрана */
.v2-footer__wordmark {
    display: flex;
    /*max-height: 168px;*/
    color: var(--v2-text);
}

.v2-footer__wordmark .v2-icon {
    width: 100%;
    height: auto;
}

@media (max-width: 1199px) {
    .v2-footer { padding-top: 80px; }
    .v2-footer__top { flex-direction: column; gap: 48px; }
    .v2-footer__info { gap: 40px; }
    /*.v2-footer__wordmark { max-height: 112px; }*/
}

@media (max-width: 767px) {
    .v2-footer { padding-top: 40px; }
    .v2-footer__top { gap: 32px; }
    .v2-footer__brand { gap: 16px; }
    .v2-footer__logo .v2-icon { width: 160px; }
    .v2-footer__lists { flex-direction: column; gap: 32px; }
    .v2-footer__list { gap: 16px; }
    .v2-footer__list a + a { margin-top: -4px; }
    /*.v2-footer__wordmark { max-height: 48px; }*/
}

/* ---------- Баннер cookie ---------- */

.v2-cookie {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    padding: 28px 0;
    background: var(--v2-lime);
    color: var(--v2-light-text);
}

.v2-cookie__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 46px;
}

.v2-cookie__text {
    margin: 0;
    font-size: 18px;
    line-height: 21.6px;
    color: var(--v2-light-text);
}

.v2-cookie__text a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.v2-cookie__text a:hover {
    text-decoration: none;
}

.v2-cookie__actions {
    display: flex;
    flex: none;
    gap: 12px;
}

/* «Принять все» — тёмная кнопка, «Отклонить все» — контурная с чёрной рамкой */
.v2-cookie .v2-btn--outline {
    color: var(--v2-light-text);
}

.v2-cookie .v2-btn--outline:hover {
    background: rgba(0, 0, 0, .06);
}

@media (max-width: 1199px) {
    .v2-cookie { padding: 28px 0; }
    .v2-cookie__inner { flex-direction: column; align-items: flex-start; gap: 24px; }
}

@media (max-width: 767px) {
    .v2-cookie { padding: 20px 0; }
    .v2-cookie__inner { align-items: stretch; gap: 20px; }
    .v2-cookie__text { font-size: 14px; line-height: 16.8px; }
    .v2-cookie__actions { gap: 8px; }
    .v2-cookie__actions .v2-btn { flex: 1; }
}

/* ---------- Преимущества (главная, скринеры) ---------- */

.v2-benefits__title {
    max-width: 665px;
}

.v2-benefits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
    padding: 0;
    list-style: none;
}

.v2-benefit {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 28px;
    /* Карточки стоят вплотную: правой границы нет, её даёт соседняя карточка */
    border: 1px solid var(--v2-line-strong);
    border-right: 0;
}

.v2-benefits .v2-benefit:last-child {
    border-right: 1px solid var(--v2-line-strong);
}

.v2-benefit > .v2-icon {
    color: var(--v2-lime);
}

.v2-benefit h3 {
    margin: 0 0 16px;
    font-weight: 600;
    font-size: 24px;
    line-height: 28.8px;
    color: var(--v2-text);
}

.v2-benefit p {
    margin: 0;
    font-size: 18px;
    line-height: 21.6px;
    color: var(--v2-text-muted);
}

@media (max-width: 1199px) {
    /* Карточки не помещаются в ширину экрана — в макете это горизонтальная лента */
    .v2-scroller {
        overflow-x: auto;
        scrollbar-width: none;
        padding-right: 0;
    }

    .v2-scroller::-webkit-scrollbar { display: none; }

    .v2-benefits { display: flex; width: max-content; }
    .v2-benefit { width: 351px; gap: 20px; padding: 24px; }
    .v2-benefits .v2-benefit:last-child { margin-right: var(--v2-gutter); }
}

@media (max-width: 767px) {
    .v2-benefit { width: 263px; gap: 14px; padding: 16px; }
    .v2-benefit h3 { margin-bottom: 12px; font-size: 18px; line-height: 21.6px; }
    .v2-benefit p { font-size: 14px; line-height: 16.8px; }
}

/* ---------- Карточка статьи ---------- */

.v2-post {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px;
    /* Карточки стоят вплотную: правой границы нет, её даёт соседняя карточка */
    border: 1px solid var(--v2-line);
    border-right: 0;
}

.v2-post__image {
    height: 140px;
    margin-bottom: 8px;
    overflow: hidden;
    background: #D9D9D9;
}

.v2-post__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}

.v2-post:hover .v2-post__image img {
    transform: scale(1.03);
}

.v2-post__title {
    margin: 0;
    font-family: var(--v2-font-body);
    font-weight: 600;
    font-size: 24px;
    line-height: 28.8px;
    letter-spacing: -0.03em;
    color: var(--v2-text-muted);
}

.v2-post__date {
    font-weight: 600;
    font-size: 18px;
    line-height: 21.6px;
    color: var(--v2-text-muted);
}

.v2-post__more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 24px;
    font-weight: 600;
    font-size: 18px;
    line-height: 21px;
    justify-content: space-between;
}

.v2-post__more .v2-icon {
    transition: transform .2s;
}

.v2-post:hover .v2-post__more .v2-icon {
    transform: translateX(4px);
}

@media (max-width: 1199px) {
    .v2-post { gap: 16px; padding: 24px; }
    .v2-post__title { font-size: 18px; line-height: 21.6px; }
    .v2-post__date { font-size: 14px; line-height: 16.8px; }
    .v2-post__more { padding-top: 12px; }
}

@media (max-width: 767px) {
    .v2-post { gap: 12px; padding: 12px; }
    .v2-post__image { margin-bottom: 0; }
    .v2-post__more { padding-top: 16px; }
}

/* ---------- Секция «Начать работу» ---------- */

.v2-cta {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 700px;
    overflow: hidden;
    background: #000;
}

.v2-cta__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #000;
    pointer-events: none;
}

.v2-cta__content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding-block: 80px;
    text-align: center;
}

.v2-cta__eyebrow {
    max-width: 844px;
}

.v2-cta__title {
    max-width: 996px;
    font-size: 60px;
}

.v2-cta__eyebrow + .v2-cta__title {
    margin-top: -24px;
}

@media (max-width: 1199px) {
    .v2-cta__content { gap: 40px; padding-block: 40px; }
    .v2-cta__title { font-size: 44px; }
    .v2-cta__eyebrow + .v2-cta__title { margin-top: -16px; }
}

@media (max-width: 767px) {
    .v2-cta__content { gap: 32px; padding-block: 40px; }
    .v2-cta__title { font-size: 32px; }
    .v2-cta__eyebrow + .v2-cta__title { margin-top: -12px; }
}

/* ---------- FAQ ---------- */

.v2-faq {
    display: flex;
    gap: 80px;
}

.v2-faq__title {
    flex: none;
    width: 347px;
}

.v2-faq__list {
    flex: 1;
    min-width: 0;
}

.v2-faq__item {
    border-top: 1px solid var(--v2-line-strong);
}

.v2-faq__item h3 {
    margin: 0;
}

.v2-faq__item button {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    padding: 28px;
    padding-inline: 28px;
    border: 0;
    background: none;
    color: inherit;
    font-weight: 600;
    font-size: 24px;
    line-height: 28.8px;
    letter-spacing: -0.03em;
    text-align: left;
    cursor: pointer;
}

/* Раскрытие — как в прототипе Figma: Smart Animate 0.3 с, линейно. Высота «по содержимому»
   анимируется через grid-template-rows 0fr → 1fr; текст проявляется, «плюс» сменяется «минусом» */
.v2-faq__icon {
    position: relative;
    flex: none;
    width: 34px;
    height: 34px;
}

.v2-faq__icon .v2-icon {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: opacity .3s linear, transform .3s linear;
}

.v2-faq__minus {
    opacity: 0;
    transform: rotate(-90deg);
}

.v2-faq__item.is-open .v2-faq__plus {
    opacity: 0;
    transform: rotate(90deg);
}

.v2-faq__item.is-open .v2-faq__minus {
    opacity: 1;
    transform: none;
}

.v2-faq__answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .3s linear;
}

.v2-faq__item.is-open .v2-faq__answer {
    grid-template-rows: 1fr;
}

.v2-faq__answer-inner {
    min-height: 0;
    overflow: hidden;
}

.v2-faq__answer p {
    margin: 0;
    padding: 0 28px 28px;
    font-size: 18px;
    line-height: 21.6px;
    color: var(--v2-text-muted);
    opacity: 0;
    transition: opacity .3s linear;
}

.v2-faq__item.is-open .v2-faq__answer p {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .v2-faq__answer,
    .v2-faq__answer p,
    .v2-faq__icon .v2-icon {
        transition: none;
    }
}

@media (max-width: 1199px) {
    .v2-faq { flex-direction: column; gap: 40px; }
    .v2-faq__title { width: auto; }
    .v2-faq__item button { gap: 16px; padding: 20px; font-size: 20px; line-height: 24px; }
    .v2-faq__answer p { padding: 0 20px 20px; }
}

@media (max-width: 767px) {
    .v2-faq { gap: 32px; }
    .v2-faq__item button { padding: 16px 0; font-size: 16px; line-height: 19.2px; }
    .v2-faq__icon { width: 24px; height: 24px; }
    .v2-faq__answer p { padding: 0 0 16px; font-size: 14px; line-height: 16.8px; }
}
