/* ==========================================================================
   Лендинг «Выручка по степени готовности» / ФСБУ 9/2025
   (page-templates/tpl-fsbu-efir.php)

   Дизайн в инлайн-стилях шаблона; здесь — выделения в заголовках, hover,
   анимации, карточки вопросов и стилизация CF7-формы.
   Всё scoped под .fsb-landing.
   ========================================================================== */

/* Плавающие иконки вокруг фото спикера. */
@keyframes fsb-floaty {
    0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
    50%      { transform: translateY(-11px) rotate(var(--r, 0deg)); }
}

/* Лёгкое «встряхивание» невалидного поля при появлении ошибки. */
@keyframes fsb-shake {
    10%, 90%       { transform: translateX(-1px); }
    20%, 80%       { transform: translateX(2px); }
    30%, 50%, 70%  { transform: translateX(-4px); }
    40%, 60%       { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
    .fsb-landing *,
    .fsb-landing *::before,
    .fsb-landing *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* --------------------------------------------------------------------------
   Выделения внутри заголовков (задаются в ACF как inline-HTML)
   -------------------------------------------------------------------------- */

/* Бордовая плашка «БЕСПЛАТНО» в H1. */
.fsb-landing .fsb-hl {
    display: inline-block;
    background: #99354b;
    color: #fff;
    padding: 0 12px;
    border-radius: 10px;
    transform: rotate(-1.5deg);
}

.fsb-landing .fsb-hl-burgundy { color: #99354b; }
.fsb-landing .fsb-hl-green    { color: #32770a; }

/* --------------------------------------------------------------------------
   Раскладка, которую перекрывает мобильный медиазапрос

   Держим её здесь, а не в инлайновых стилях шаблона: инлайновый стиль
   специфичнее любого правила из файла, и медиазапрос его не перебьёт
   (на этом уже спотыкались — карточка спикера не скрывалась на мобиле).
   -------------------------------------------------------------------------- */
.fsb-landing .fsb-speaker-wrap {
    display: flex;
    justify-content: center;
}

.fsb-landing .fsb-benefit {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
}

.fsb-landing .fsb-cta,
.fsb-landing .fsb-cta-white {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fsb-landing .fsb-cta       { padding: 16px 38px; }
.fsb-landing .fsb-cta-white { padding: 14px 28px; }

/* --------------------------------------------------------------------------
   Hover
   -------------------------------------------------------------------------- */
.fsb-landing .fsb-cta:hover {
    background: #7d2a3d;
    color: #fff;
    transform: translateY(-2px);
}

.fsb-landing .fsb-cta-white:hover {
    background: #f3e9eb;
    color: #99354b;
    transform: translateY(-2px);
}

.fsb-landing .fsb-speaker-name:hover { color: #99354b; }

/* --------------------------------------------------------------------------
   Плавающие иконки вокруг карточки спикера
   -------------------------------------------------------------------------- */
.fsb-landing .fsb-bubble {
    position: absolute;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(var(--r, 0deg));
}

/* Пузырь 1 — зелёный (основной). */
.fsb-landing .fsb-ib1 {
    top: -18px;
    left: -18px;
    width: 54px;
    height: 54px;
    --r: -9deg;
    background: linear-gradient(150deg, #4f9e1e, #1e4a05);
    box-shadow: 0 12px 24px rgba(20, 50, 5, .38), inset 0 2px 4px rgba(255, 255, 255, .45);
    animation: fsb-floaty 5s ease-in-out infinite;
}

/* Пузырь 2 — винный (акцент). */
.fsb-landing .fsb-ib2 {
    top: 28%;
    right: -20px;
    width: 52px;
    height: 52px;
    --r: 7deg;
    background: linear-gradient(150deg, #c25470, #7d2a3d);
    box-shadow: 0 12px 24px rgba(90, 20, 40, .42), inset 0 2px 4px rgba(255, 255, 255, .45);
    animation: fsb-floaty 6s ease-in-out infinite .8s;
}

/* Пузырь 3 — зелёный тёмный. */
.fsb-landing .fsb-ib3 {
    bottom: 20%;
    left: -22px;
    width: 50px;
    height: 50px;
    --r: -6deg;
    background: linear-gradient(150deg, #255a06, #1e4a05);
    box-shadow: 0 12px 24px rgba(20, 50, 5, .38), inset 0 2px 4px rgba(255, 255, 255, .45);
    animation: fsb-floaty 5.4s ease-in-out infinite .4s;
}

/* --------------------------------------------------------------------------
   Карточки «7 вопросов»
   -------------------------------------------------------------------------- */
.fsb-landing .fsb-q-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8e4e0;
    border-radius: 16px;
    padding: 22px 20px;
}

/* Фоновый номер вопроса. */
.fsb-landing .fsb-q-card::before {
    content: attr(data-num);
    position: absolute;
    top: -6px;
    right: 12px;
    font-size: 52px;
    font-weight: 800;
    color: #f3e9eb;
    line-height: 1;
}

/* Нечётные вопросы — зелёный заголовок, чётные — винный. */
.fsb-landing .fsb-q-card h3 {
    position: relative;
    margin: 0 0 8px;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.35;
    color: #1e4a05;
}

.fsb-landing .fsb-q-card:nth-child(even) h3 { color: #99354b; }

.fsb-landing .fsb-q-card p {
    position: relative;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #414141;
}

/* --------------------------------------------------------------------------
   Форма регистрации (CF7) — тёмная, как в макете:
   стеклянный блок на зелёной подложке, поля светлым по тёмному.
   -------------------------------------------------------------------------- */
.fsb-landing .fsb-reg-card .fsb-form-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fsb-landing .fsb-reg-card .fsb-field { display: block; }

.fsb-landing .fsb-reg-card .fsb-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    color: rgba(255, 255, 255, .85);
    margin-bottom: 5px;
}

.fsb-landing .fsb-reg-card .fsb-req { color: #f9c8d3; }

.fsb-landing .fsb-reg-card .fsb-optional {
    font-size: 11.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, .45);
    margin-left: 4px;
}

/* CF7 оборачивает контрол в span.wpcf7-form-control-wrap */
.fsb-landing .fsb-reg-card .wpcf7-form-control-wrap { display: block; }

.fsb-landing .fsb-reg-card input[type="text"],
.fsb-landing .fsb-reg-card input[type="email"],
.fsb-landing .fsb-reg-card input[type="tel"] {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 15px;
    font-size: 15px;
    font-family: inherit;
    border: 1.5px solid rgba(255, 255, 255, .25);
    border-radius: 9px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    transition: border-color .2s;
}

.fsb-landing .fsb-reg-card input[type="text"]::placeholder,
.fsb-landing .fsb-reg-card input[type="email"]::placeholder,
.fsb-landing .fsb-reg-card input[type="tel"]::placeholder {
    color: rgba(255, 255, 255, .45);
}

.fsb-landing .fsb-reg-card input[type="text"]:focus,
.fsb-landing .fsb-reg-card input[type="email"]:focus,
.fsb-landing .fsb-reg-card input[type="tel"]:focus {
    outline: none;
    border-color: rgba(194, 84, 112, .8);
}

.fsb-landing .fsb-reg-card input.wpcf7-not-valid {
    border-color: #f9c8d3;
    background: rgba(208, 52, 44, .18);
    box-shadow: 0 0 0 3px rgba(249, 200, 211, .18);
    animation: fsb-shake .4s ease both;
}

/* Согласия (чекбоксы)
   ---------------------------------------------------------------------------
   Сам чекбокс НЕ переопределяем: глобальный компонент темы (forms.css, «Кастомный
   чекбокс согласия») даёт 20×20 с зелёной рамкой и зелёным квадратом при отметке —
   он должен выглядеть так же, как на всех остальных формах сайта.

   А вот «пилюлю» вокруг строки снимаем. Глобальное правило
   `.wpcf7-acceptance .wpcf7-list-item label` красит строку в белый и скругляет
   на 30px — на белых карточках «Цифрового рубля» и финдиректора это незаметно,
   а на нашей тёмной форме превращается в белую полосу с невидимым текстом. */
.fsb-landing .fsb-reg-card .fsb-consents {
    margin-top: 18px;
}

/* CF7 заворачивает оба согласия в один <p> и разделяет их <br>, поэтому
   flex-gap на контейнере не срабатывает — раскладываем сам параграф. */
.fsb-landing .fsb-reg-card .fsb-consents > p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fsb-landing .fsb-reg-card .fsb-consents > p > br { display: none; }

.fsb-landing .fsb-reg-card .fsb-consents .wpcf7-list-item {
    display: block;
    margin: 0;
}

.fsb-landing .fsb-reg-card .fsb-consents .wpcf7-list-item label {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    width: 100%;
    /* Снимаем оформление «пилюли» от общего компонента согласий. */
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.fsb-landing .fsb-reg-card .fsb-consents .wpcf7-list-item-label {
    font-size: 13.5px;
    line-height: 1.45;
    color: rgba(255, 255, 255, .75);
}

.fsb-landing .fsb-reg-card .fsb-consents a {
    color: rgba(249, 200, 211, .9);
    font-weight: 600;
}

/* Невалидное согласие: подсветка чекбокса + подсказка под строкой. */
.fsb-landing .fsb-reg-card .fsb-consents .wpcf7-acceptance { display: block; }

.fsb-landing .fsb-reg-card .fsb-consents input[type="checkbox"].wpcf7-not-valid {
    outline: 2px solid #f9c8d3;
    outline-offset: 2px;
    border-radius: 3px;
}

.fsb-landing .fsb-reg-card .fsb-consents .wpcf7-not-valid-tip {
    margin-top: 8px;
    padding-left: 32px; /* выровнять под текст согласия (чекбокс 20px + gap 12px) */
}

/* Кнопка отправки */
.fsb-landing .fsb-reg-card .fsb-submit,
.fsb-landing .fsb-reg-card input.wpcf7-submit {
    width: 100%;
    margin-top: 20px;
    background: #99354b;
    color: #fff;
    font-weight: 700;
    /* input[type=submit] по умолчанию не переносит текст: длинная надпись
       обрезалась бы по краю кнопки на узких экранах. */
    font-size: clamp(15px, 4.3vw, 17px);
    font-family: inherit;
    white-space: normal;
    line-height: 1.25;
    padding: 16px 14px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(153, 53, 75, .46);
    transition: background .2s, transform .15s;
}

.fsb-landing .fsb-reg-card .fsb-submit:hover,
.fsb-landing .fsb-reg-card input.wpcf7-submit:hover {
    background: #7d2a3d;
    transform: translateY(-2px);
}

/* Подсказка-ошибка под полем (иконка ⚠ + светлый текст на тёмном фоне). */
.fsb-landing .fsb-reg-card .wpcf7-not-valid-tip {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #f9c8d3;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 7px;
}

.fsb-landing .fsb-reg-card .wpcf7-not-valid-tip::before {
    content: "";
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 1px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f9c8d3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Итоговое сообщение CF7 (успех/ошибка) — цвет по data-status формы. */
.fsb-landing .fsb-reg-card .wpcf7-response-output {
    margin: 18px 0 0;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}

.fsb-landing .fsb-reg-card form[data-status="sent"] .wpcf7-response-output {
    border: 1px solid rgba(163, 204, 136, .8);
    background: rgba(163, 204, 136, .16);
    color: #d6ecc6;
}

.fsb-landing .fsb-reg-card form[data-status="invalid"] .wpcf7-response-output,
.fsb-landing .fsb-reg-card form[data-status="unaccepted"] .wpcf7-response-output,
.fsb-landing .fsb-reg-card form[data-status="spam"] .wpcf7-response-output,
.fsb-landing .fsb-reg-card form[data-status="failed"] .wpcf7-response-output,
.fsb-landing .fsb-reg-card form[data-status="aborted"] .wpcf7-response-output {
    border: 1px solid rgba(249, 200, 211, .7);
    background: rgba(208, 52, 44, .18);
    color: #f9c8d3;
}

/* --------------------------------------------------------------------------
   Мобильные уточнения (значения из макета)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    /* Карточка спикера в макете на мобиле скрыта — иначе hero уезжает на два экрана. */
    .fsb-landing .fsb-speaker-wrap { display: none; }

    /* Плашка «цена → выгода» переносится в колонку. */
    .fsb-landing .fsb-benefit {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Полоса-призыв: текст и кнопка друг под другом. */
    .fsb-landing .fsb-call { flex-direction: column; }

    /* Кнопки во всю ширину; горизонтальные отступы уменьшены,
       иначе длинная надпись не влезает в одну строку на 375 px. */
    .fsb-landing .fsb-cta,
    .fsb-landing .fsb-cta-white {
        width: 100%;
        justify-content: center;
        padding-left: 20px;
        padding-right: 20px;
    }
}
