/* Внешний контейнер формы на сайте */
.fbte-form-container {
    max-width: 600px;
    margin: 30px auto;
    padding: 35px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02), 0 0 0 1px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

/* Сброс бокс-модели для элементов внутри формы */
.fbte-form-container *,
.fbte-form-container *::before,
.fbte-form-container *::after {
    box-sizing: border-box;
}

.fbte-form {
    width: 100%;
}

.fbte-form-group {
    margin-bottom: 24px;
}

/* Обычные текстовые ярлыки */
.fbte-form-group label {
    display: block;
    font-weight: 600;
    font-size: 13.5px;
    color: #334155;
    margin-bottom: 8px;
    text-align: left;
    letter-spacing: -0.01em;
}

/* Одиночный чекбокс согласия (кастомное выравнивание) */
.fbte-checkbox-label {
    display: inline-flex !important;
    align-items: flex-start;
    font-weight: 500 !important;
    font-size: 13.5px !important;
    color: #475569 !important;
    cursor: pointer;
    user-select: none;
    line-height: 1.45;
    margin-bottom: 0 !important;
}

.fbte-checkbox-label input[type="checkbox"] {
    margin: 2px 12px 0 0 !important;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    transition: all 0.2s;
}

.fbte-checkbox-label input[type="checkbox"]:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

/* Группа переключателей множественного выбора (Multi-checkbox) */
.fbte-multicheckbox-group-label {
    margin-bottom: 6px !important;
}

.fbte-multicheckbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.fbte-multicheckbox-label {
    display: inline-flex !important;
    align-items: center;
    font-weight: 500 !important;
    font-size: 13.5px !important;
    color: #475569 !important;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0 !important;
    line-height: 1.45;
}

.fbte-multicheckbox-label input[type="checkbox"] {
    margin: 0 12px 0 0 !important;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    transition: all 0.2s;
}

.fbte-multicheckbox-label input[type="checkbox"]:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

/* Маркер обязательного поля */
.fbte-required {
    color: #ef4444;
    margin-left: 2px;
}

/* Основные стили текстовых полей */
.fbte-form-group input[type="text"],
.fbte-form-group input[type="email"],
.fbte-form-group input[type="tel"],
.fbte-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14.5px;
    color: #1e293b;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease-in-out;
    font-family: inherit;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* Контейнер международного ввода телефона intl-tel-input на всю ширину поля */
.fbte-form-group .iti {
    width: 100%;
}

/* Выпадающий список (Select) */
.fbte-form-group select {
    width: 100%;
    padding: 10px 35px 10px 14px;
    font-size: 14.5px;
    color: #1e293b;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    appearance: none; /* Сбрасываем стрелку браузера */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3D%22www.w3.org%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23475569%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 15px;
    transition: all 0.2s ease-in-out;
    font-family: inherit;
    height: auto !important;
    line-height: normal !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* Группа переключателей (Radio) */
.fbte-radio-group-label {
    margin-bottom: 6px !important;
}

.fbte-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.fbte-radio-label {
    display: inline-flex !important;
    align-items: center;
    font-weight: 500 !important;
    font-size: 13.5px !important;
    color: #475569 !important;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0 !important;
}

.fbte-radio-label input[type="radio"] {
    margin: 0 12px 0 0 !important;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    border: 1.5px solid #cbd5e1;
    transition: all 0.2s;
}

.fbte-radio-label input[type="radio"]:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

/* Инпут загрузки файла */
.fbte-form-group input[type="file"] {
    width: 100%;
    padding: 16px;
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    transition: all 0.2s;
}

.fbte-form-group input[type="file"]:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

.fbte-file-info {
    display: block;
    font-size: 11.5px;
    color: #64748b;
    margin-top: 6px;
    text-align: left;
}

/* Плавная анимация фокуса */
.fbte-form-group input[type="text"]:focus,
.fbte-form-group input[type="email"]:focus,
.fbte-form-group input[type="tel"]:focus,
.fbte-form-group select:focus,
.fbte-form-group input[type="file"]:focus,
.fbte-form-group textarea:focus {
    border-color: #3182ce;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.fbte-form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* Поддержка плавной условной логики (эффект появления) */
.fbte-form-group {
    transition: opacity 0.2s ease-in-out;
}

/* Зона кнопки отправки */
.fbte-form-submit {
    margin-top: 30px;
    text-align: right;
}

/* Интерактивная кнопка отправки */
.fbte-submit-btn {
    display: inline-block;
    padding: 11px 26px;
    font-size: 14.5px;
    font-weight: 600;
    color: #ffffff;
    background-color: #3182ce;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 6px -1px rgba(49, 130, 206, 0.2), 0 2px 4px -1px rgba(49, 130, 206, 0.1);
}

.fbte-submit-btn:hover {
    background-color: #2b6cb0;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(49, 130, 206, 0.25);
}

.fbte-submit-btn:active {
    transform: translateY(1px);
}

/* Состояние кнопки при отправке данных */
.fbte-submit-btn:disabled {
    background-color: #cbd5e0;
    color: #718096;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Стиль заблокированной после отправки кнопки */
.fbte-submit-btn.fbte-locked-btn {
    background-color: #718096 !important;
    color: #e2e8f0 !important;
    cursor: not-allowed !important;
    transform: none !important;
    opacity: 0.8;
}

/* Контейнер для отображения статуса отправки внутри формы */
.fbte-form-response-message {
    margin-top: 24px;
    display: none;
}

/* Стили плашек уведомлений */
.fbte-msg-box {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

.fbte-success-msg {
    background-color: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #22543d;
}

.fbte-error-msg {
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    color: #742a2a;
}

/* Сообщение, если форма пустая */
.fbte-no-fields-msg {
    color: #64748b;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Темная подложка-оверлей при выводе Toast */
.fbte-toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.3);
    z-index: 999998;
    display: none;
    backdrop-filter: blur(4px); /* Эффект размытия заднего фона */
}

/* Модальное Toast-уведомление ровно по центру экрана */
.fbte-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
    max-width: 400px;
    width: 85%;
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    animation: fbteZoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.fbte-toast-success {
    background-color: rgba(32, 116, 75, 0.95);
    border: 1px solid rgba(72, 187, 120, 0.4);
}

.fbte-toast-error {
    background-color: rgba(147, 34, 34, 0.95);
    border: 1px solid rgba(245, 101, 101, 0.4);
}

.fbte-toast-icon {
    font-size: 20px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.fbte-toast-text {
    line-height: 1.55;
}

/* Экран успеха при блокировке формы (вместо полей) */
.fbte-success-screen {
    text-align: center;
    padding: 40px 20px;
    animation: fbteFadeInScreen 0.4s ease-out;
}

.fbte-success-icon-large {
    font-size: 44px;
    font-weight: bold;
    color: #16a34a;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    width: 80px;
    height: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 22px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
}

.fbte-success-text-large {
    font-size: 17.5px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.55;
}

/* Стили шкалы прогресса и кнопок шагов для многошаговых форм */
.fbte-form-progress-bar-wrap {
    margin-bottom: 30px;
}

.fbte-form-progress-bar-bg {
    background-color: #f1f5f9;
    border-radius: 9999px;
    height: 6px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 8px;
}

.fbte-form-progress-bar-fill {
    background: linear-gradient(90deg, #3182ce, #4299e1);
    height: 100%;
    border-radius: 9999px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.fbte-form-progress-text {
    font-size: 12.5px;
    font-weight: 600;
    color: #64748b;
    text-align: right;
    letter-spacing: -0.01em;
}

/* Стили для вложенной навигации шагов */
.fbte-step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
}

.fbte-step-1 .fbte-step-navigation {
    justify-content: flex-end;
}

.fbte-prev-step-btn,
.fbte-next-step-btn {
    display: inline-block;
    padding: 10px 22px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-family: inherit;
}

.fbte-prev-step-btn {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
}

.fbte-prev-step-btn:hover {
    background-color: #f8fafc;
    color: #1e293b;
}

.fbte-next-step-btn {
    background-color: #3182ce;
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(49, 130, 206, 0.15);
}

.fbte-next-step-btn:hover {
    background-color: #2b6cb0;
    transform: translateY(-1px);
}

.fbte-next-step-btn:active {
    transform: translateY(1px);
}

/* Сохранение визуального форматирования текста уведомлений из WYSIWYG */
.fbte-toast-text p,
.fbte-success-text-large p {
    margin: 0 0 10px 0 !important;
    text-align: inherit;
}
.fbte-toast-text p:last-child,
.fbte-success-text-large p:last-child {
    margin-bottom: 0 !important;
}
.fbte-toast-text ul,
.fbte-success-text-large ul,
.fbte-toast-text ol,
.fbte-success-text-large ol {
    margin: 0 0 10px 20px !important;
    padding: 0 !important;
    list-style-type: disc !important;
    text-align: left;
}
.fbte-toast-text ol,
.fbte-success-text-large ol {
    list-style-type: decimal !important;
}
.fbte-toast-text li,
.fbte-success-text-large li {
    margin-bottom: 4px !important;
    font-size: inherit;
    color: inherit;
}
.fbte-toast-text strong,
.fbte-success-text-large strong {
    font-weight: bold !important;
}
.fbte-toast-text em,
.fbte-success-text-large em {
    font-style: italic !important;
}

/* Контейнер виджета Cloudflare Turnstile */
.fbte-turnstile-container {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    margin-bottom: 15px;
}

/* Анимации появления */
@keyframes fbteZoomIn {
    from {
        transform: translate(-50%, -50%) scale(0.92);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fbteFadeInScreen {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}