/* ============================================================================
   Блок «Куратор услуги» (FW-503)
   Внешний вид — как подпись автора в блоге (blog-post-author): фото + кликабельное
   имя/должность слева. Справа — кнопка «Задать вопрос куратору», открывающая модалку.
   Контейнер повторяет .header__container, поэтому левый край фото совпадает с лого
   FITTIN в шапке, а правый край кнопки — с кнопкой «Обсудить проект».
   Вертикальные отступы не задаём — их даёт flex-gap родительской <main>.
   ============================================================================ */

.service-curator {
    background: #ffffff;
}

/* Десктоп: подтягиваем #contact ближе к куратору. main.audit-koda-page —
   flex с row-gap:100px (общий для всех секций), поэтому уменьшаем именно
   отступ ПОСЛЕ куратора отрицательным margin. На ≤900px gap уже 70px — не трогаем. */
@media (min-width: 901px) {
    .service-curator {
        margin-bottom: -50px;
    }
}

/* Нестандартный каркас razrabotka-tz (body.product-template-page): <main> без
   flex-gap, у секций обнулён вертикальный padding (css/razrabotka-tz.css), а ритм
   задаётся margin-top самих секций (100px десктоп / 50px мобайл). Блок куратора тоже
   живёт внутри <main>, поэтому повторяем этот ритм сверху — иначе он слипается с FAQ. */
.product-template-page .service-curator {
    margin-top: 100px;
}

@media (max-width: 900px) {
    .product-template-page .service-curator {
        margin-top: 50px;
    }
}

/* Каркас <main class="article-page"> без flex-gap (обычный block-поток):
   mobilnye-prilozheniya-ecommerce, kastomnye-sajty. Общего gap между секциями нет,
   а #contact на этих страницах идёт с margin-top:0 — поэтому глобальный
   margin-bottom:-50px тянет форму на блок (наезд). Модификатор задаёт ритм сам:
   ~100px сверху от FAQ и ~50px снизу до формы. Правило идёт ПОСЛЕ глобального
   (та же специфичность) и потому перебивает его margin-bottom на ≥901px. */
.service-curator--standalone {
    margin-top: 100px;
    margin-bottom: 50px;
}

@media (max-width: 900px) {
    .service-curator--standalone {
        margin-top: 50px;
        margin-bottom: 50px;
    }
}

/* На block-страницах секция FAQ перед куратором тащит СВОИ нижние паддинги
   (на разных страницах разные: mobilnye 50px, kastomnye 130px), из-за чего зазор
   над куратором плывёт и не совпадает с ритмом эталона audit-koda (100/50).
   Гасим нижний паддинг ровно той FAQ-секции, за которой СРАЗУ идёт
   standalone-куратор (точечно через :has, без классов на body) — тогда весь
   отступ сверху задаёт только margin-top куратора. Флекс-страницы не затронуты:
   там у куратора нет класса --standalone. */
.faq-section:has(+ .service-curator--standalone) {
    padding-bottom: 0;
}

.faq-section:has(+ .service-curator--standalone) .faq-section__container {
    padding-bottom: 0;
}

/* Контейнер 1:1 с .header__container (см. css/header.css) — для совпадения отступов */
.service-curator__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.service-curator__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

/* — Левая часть: подпись куратора как в блоге — */
.service-curator__person {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.service-curator__avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e6e6e6;
    flex-shrink: 0;
    display: block;
}

.service-curator__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.service-curator__name {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
    color: #444444;
}

.service-curator__person:hover .service-curator__name {
    text-decoration: underline;
}

/* Куратор без страницы /author/ (имя не кликабельно): убираем намёк на ссылку */
.service-curator__person--static {
    cursor: default;
}

.service-curator__person--static:hover .service-curator__name {
    text-decoration: none;
}

.service-curator__position {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0.02em;
    color: #888888;
}

/* — Правая часть: кнопка как «Обсудить проект» — */
.service-curator__ask {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 14px 32px;
    border-radius: 999px;
    border: none;
    background-color: #FF6B00;
    color: #ffffff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.service-curator__ask:hover {
    background-color: #E05F00;
    transform: translateY(-1px);
}

.service-curator__ask:focus-visible {
    outline: 2px solid #FF6B00;
    outline-offset: 3px;
}

/* Контейнер шапки между 1200–1400px имеет padding 30px — повторяем для совпадения */
@media (max-width: 1400px) {
    .service-curator__container {
        padding: 0 30px;
    }
}

@media (max-width: 1200px) {
    .service-curator__container {
        padding: 0 20px;
    }
}

@media (max-width: 600px) {
    .service-curator__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .service-curator__ask {
        width: 100%;
    }
}

/* ============================================================================
   Модальное окно «Задать вопрос куратору»
   Своя обёртка (.curator-modal*), НЕ .modal-feedback — иначе CTA из header-include.js
   привяжется к этой форме. Поля/чекбокс/кнопка повторяют блок «Обсудим проект».
   ============================================================================ */

.curator-modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10060;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    justify-content: center;
}

.curator-modal.active {
    display: flex;
    opacity: 1;
}

.curator-modal__content {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    margin: auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.curator-modal.active .curator-modal__content {
    transform: translateY(0);
}

.curator-modal__close {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.curator-modal__close::before,
.curator-modal__close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: #333333;
    top: 50%;
    left: 50%;
}

.curator-modal__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.curator-modal__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.curator-modal__title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    margin: 0 0 24px;
}

.curator-modal__form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.curator-modal__group {
    position: relative;
    width: 100%;
}

/* Поля — как .form-input в «Обсудим проект»: подчёркивание, без рамки */
.curator-modal__input {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #333333;
    border-radius: 0;
    font-size: 16px;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.6;
    color: #333333;
    background-color: transparent;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.curator-modal__input:focus {
    border-bottom-color: #FF6B00;
    box-shadow: none;
}

.curator-modal__input::placeholder {
    color: #999999;
}

.curator-modal__textarea {
    min-height: 88px;
    resize: vertical;
    line-height: 1.5;
}

/* Счётчик символов под полем вопроса (лимит 500) */
.curator-modal__counter {
    display: block;
    margin-top: 6px;
    text-align: right;
    font-size: 12px;
    line-height: 1;
    color: #999999;
}

/* Чекбокс согласия — как в «Обсудим проект» */
.curator-modal__checkbox-container {
    display: flex;
    align-items: flex-start;
    position: relative;
    gap: 8px;
    font-size: 14px;
    line-height: 1.4;
    color: #666666;
    cursor: pointer;
}

.curator-modal__checkbox-container input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.curator-modal__checkmark {
    position: relative;
    flex-shrink: 0;
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
}

.curator-modal__checkbox-container:hover input[type="checkbox"] ~ .curator-modal__checkmark {
    border-color: #FF6B00;
}

.curator-modal__checkbox-container input[type="checkbox"]:checked ~ .curator-modal__checkmark {
    background-color: #FF6B00;
    border-color: #FF6B00;
}

.curator-modal__checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.curator-modal__checkbox-container input[type="checkbox"]:checked ~ .curator-modal__checkmark::after {
    display: block;
}

.curator-modal__checkbox-text {
    flex: 1;
    min-width: 0;
}

.curator-modal__privacy-link {
    color: #FF6B00;
    text-decoration: none;
}

.curator-modal__privacy-link:hover {
    text-decoration: underline;
}

/* Кнопка отправки — как .submit-button в «Обсудим проект» */
.curator-modal__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding: 14px 36px;
    border: none;
    border-radius: 999px;
    background-color: #FF6B00;
    color: #ffffff;
    font-size: 16px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.curator-modal__submit:hover {
    background-color: #E05F00;
}

.curator-modal__submit:disabled {
    opacity: 0.7;
    cursor: default;
}

@media (max-width: 600px) {
    .curator-modal__content {
        padding: 32px 22px;
    }

    .curator-modal__title {
        font-size: 20px;
        padding: 0 34px;
        margin-bottom: 20px;
    }

    .curator-modal__submit {
        width: 100%;
    }
}
