/* ==========================================================================
   Лендинг «Роль финдиректора» (page-templates/tpl-fin-director.php)
   Дизайн в инлайн-стилях шаблона; здесь — выделения в заголовках, hover,
   анимации и стилизация CF7-формы. Всё scoped под .fd-landing.
   ========================================================================== */

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

/* Лёгкое «встряхивание» невалидного поля при появлении ошибки. */
@keyframes fd-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) {
    .fd-landing *,
    .fd-landing *::before,
    .fd-landing *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

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

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

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

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

.fd-landing .fd-cta-green:hover {
    background: #255a06;
    color: #fff;
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Форма регистрации (CF7) — под дизайн лендинга
   -------------------------------------------------------------------------- */
.fd-landing .fd-reg-card .fd-form-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.fd-landing .fd-reg-card .fd-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #414141;
    margin-bottom: 6px;
}

.fd-landing .fd-reg-card .fd-req {
    color: #99354b;
}

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

.fd-landing .fd-reg-card input[type="text"],
.fd-landing .fd-reg-card input[type="email"],
.fd-landing .fd-reg-card input[type="tel"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    border: 1.5px solid #e3ded9;
    border-radius: 11px;
    background: #faf8f6;
    color: #111;
    transition: border-color .15s;
    box-sizing: border-box;
}

.fd-landing .fd-reg-card input[type="text"]:focus,
.fd-landing .fd-reg-card input[type="email"]:focus,
.fd-landing .fd-reg-card input[type="tel"]:focus {
    outline: none;
    border-color: #32770a;
}

.fd-landing .fd-reg-card input.wpcf7-not-valid {
    border-color: #d0342c;
    background: #fdf3f2;
    box-shadow: 0 0 0 3px rgba(208, 52, 44, .12);
    animation: fd-shake .4s ease both;
}

/* Согласия (чекбоксы) */
.fd-landing .fd-reg-card .fd-consents {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

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

.fd-landing .fd-reg-card .fd-consents .wpcf7-list-item label {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    cursor: pointer;
    /* Снимаем padding 16px/20px от общих стилей форм темы — строки согласий
       выглядели растянутыми. Расстояние между ними задаёт gap контейнера. */
    padding: 0;
}

.fd-landing .fd-reg-card .fd-consents input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    accent-color: #32770a;
    flex-shrink: 0;
    cursor: pointer;
}

.fd-landing .fd-reg-card .fd-consents .wpcf7-list-item-label {
    font-size: 13.5px;
    color: #414141;
    line-height: 1.45;
}

.fd-landing .fd-reg-card .fd-consents a {
    color: #32770a;
    font-weight: 600;
}

/* Невалидное согласие: подсветка чекбокса + подсказка под строкой. */
.fd-landing .fd-reg-card .fd-consents .wpcf7-acceptance {
    display: block;
}
.fd-landing .fd-reg-card .fd-consents input[type="checkbox"].wpcf7-not-valid {
    outline: 2px solid #d0342c;
    outline-offset: 2px;
    border-radius: 3px;
}
.fd-landing .fd-reg-card .fd-consents .wpcf7-not-valid-tip {
    margin-top: 8px;
    padding-left: 31px; /* выровнять под текст согласия (чекбокс 20px + gap 11px) */
}

/* Кнопка отправки */
.fd-landing .fd-reg-card .fd-submit,
.fd-landing .fd-reg-card input.wpcf7-submit {
    width: 100%;
    margin-top: 24px;
    background: #32770a;
    color: #fff;
    font-weight: 700;
    /* По умолчанию input[type=submit] не переносит текст, и длинная надпись
       «Зарегистрироваться на эфир» обрезалась бы по краю кнопки на узких экранах.
       white-space:normal разрешает перенос, кегль дополнительно уменьшается. */
    font-size: clamp(15px, 4.3vw, 19px);
    font-family: inherit;
    white-space: normal;
    line-height: 1.25;
    padding: 17px 14px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(50, 119, 10, .32);
    transition: background .2s, transform .15s;
}

.fd-landing .fd-reg-card .fd-submit:hover,
.fd-landing .fd-reg-card input.wpcf7-submit:hover {
    background: #255a06;
    transform: translateY(-2px);
}

/* Подсказка-ошибка под полем (иконка ⚠ + красный текст). */
.fd-landing .fd-reg-card .wpcf7-not-valid-tip {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #d0342c;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 7px;
}
.fd-landing .fd-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='%23d0342c' 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 формы. */
.fd-landing .fd-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;
}
.fd-landing .fd-reg-card form[data-status="sent"] .wpcf7-response-output {
    border: 1px solid #32770a;
    background: #eef6e7;
    color: #255a06;
}
.fd-landing .fd-reg-card form[data-status="invalid"] .wpcf7-response-output,
.fd-landing .fd-reg-card form[data-status="unaccepted"] .wpcf7-response-output,
.fd-landing .fd-reg-card form[data-status="spam"] .wpcf7-response-output,
.fd-landing .fd-reg-card form[data-status="failed"] .wpcf7-response-output,
.fd-landing .fd-reg-card form[data-status="aborted"] .wpcf7-response-output {
    border: 1px solid #d0342c;
    background: #fdf3f2;
    color: #b02a25;
}

/* --------------------------------------------------------------------------
   Мобильные уточнения
   -------------------------------------------------------------------------- */

/* Карточки уровней переносятся в колонку — стрелка между ними разворачивается вниз. */
@media (max-width: 900px) {
    .fd-landing .fd-level-arrow {
        width: 100%;
        padding: 2px 0;
    }
    .fd-landing .fd-level-arrow svg {
        transform: rotate(90deg);
    }
}

@media (max-width: 640px) {
    /* Кнопки во всю ширину. Горизонтальные отступы уменьшены — иначе
       «Регистрация на эфир» не влезает в одну строку на 375 px. */
    .fd-landing .fd-cta,
    .fd-landing .fd-cta-green {
        width: 100%;
        justify-content: center;
        padding-left: 20px;
        padding-right: 20px;
    }
}
