/* Стилизация формы Битрикс24 под существующую форму */

/* Основной контейнер формы */
.b24-form-wrapper {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%) !important;
    border-radius: 24px !important;
    padding: 48px 40px !important;
    color: white !important;
    text-align: center !important;
    border: none !important;
    box-shadow: none !important;
}

.b24-form-wrapper .b24-form-header-padding {
    display: none !important;
}

.b24-form-wrapper .b24-form-content {
    padding: 0 !important;
}

/* Поля ввода */
.b24-form-wrapper .b24-form-field {
    margin-bottom: 16px !important;
}

.b24-form-wrapper .b24-form-control {
    width: 100% !important;
    padding: 16px 20px !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1a1a1a !important;
    transition: background 0.3s ease !important;
    outline: none !important;
    font-family: 'Inter', sans-serif !important;
}

.b24-form-wrapper .b24-form-control:focus {
    background: white !important;
    box-shadow: none !important;
}

/* Скрываем лейблы Битрикс24 и используем placeholder */
.b24-form-wrapper .b24-form-control-label {
    display: none !important;
}

/* Добавляем placeholder через CSS */
.b24-form-wrapper .b24-form-control::placeholder {
    color: #999 !important;
    font-size: 16px !important;
    font-family: 'Inter', sans-serif !important;
}

.b24-form-wrapper .b24-form-control[name="name"]::placeholder {
    content: "Имя" !important;
}

.b24-form-wrapper .b24-form-control[name="phone"]::placeholder {
    content: "Телефон" !important;
}

.b24-form-wrapper .b24-form-control-required {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Ошибки */
.b24-form-wrapper .b24-form-control-alert-message {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 14px !important;
    margin-top: 8px !important;
    font-family: 'Inter', sans-serif !important;
    text-align: left !important;
}

/* Чекбокс */
.b24-form-wrapper .b24-form-control-agreement {
    margin-bottom: 24px !important;
}

.b24-form-wrapper .b24-form-control-agreement .b24-form-control-container {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    text-align: left !important;
}

.b24-form-wrapper .b24-form-control-agreement input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    appearance: none !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

.b24-form-wrapper .b24-form-control-agreement input[type="checkbox"]:checked {
    background: white !important;
    border-color: white !important;
}

.b24-form-wrapper .b24-form-control-agreement input[type="checkbox"]:checked::after {
    content: '✓' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    color: #4285f4 !important;
    font-size: 12px !important;
    font-weight: bold !important;
}

.b24-form-wrapper .b24-form-control-desc {
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.95) !important;
    line-height: 1.4 !important;
    font-family: 'Inter', sans-serif !important;
    text-align: left !important;
}

.b24-form-wrapper .b24-form-field-agreement-link {
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: underline !important;
}

.b24-form-wrapper .b24-form-field-agreement-link:hover {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* Кнопка отправки */
.b24-form-wrapper .b24-form-btn {
    background: white !important;
    color: #4285f4 !important;
    border: none !important;
    padding: 16px 32px !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    font-family: 'Inter', sans-serif !important;
    text-transform: none !important;
}

.b24-form-wrapper .b24-form-btn:hover {
    background: #f8f9fa !important;
    transform: translateY(-2px) !important;
}

.b24-form-wrapper .b24-form-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Состояния формы */
.b24-form-wrapper .b24-form-success {
    text-align: center !important;
    padding: 40px 20px !important;
}

.b24-form-wrapper .b24-form-success-icon {
    width: 60px !important;
    height: 60px !important;
    background: white !important;
    border-radius: 50% !important;
    margin: 0 auto 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.b24-form-wrapper .b24-form-success-icon::after {
    content: '✓' !important;
    color: #34a853 !important;
    font-size: 24px !important;
    font-weight: bold !important;
}

.b24-form-wrapper .b24-form-state-text {
    font-family: 'Inter', sans-serif !important;
    color: white !important;
}

.b24-form-wrapper .b24-form-state-text p {
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

/* Подпись формы - скрываем полностью */
.b24-form-wrapper .b24-form-sign {
    display: none !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .b24-form-wrapper {
        padding: 40px 24px !important;
    }
}

@media (max-width: 480px) {
    .b24-form-wrapper {
        padding: 32px 20px !important;
    }
}