<form id="contact_form_<?php echo $id ?>" action="<?php echo esc_url(admin_url('admin-post.php')) ?>" method="POST">
    <input type="hidden" name="action" value="syrus-contact-form-submit">
    <input type="hidden" name="contact_form_id" value="<?php echo $id ?>">
    <input type="hidden" name="n1" value="<?php echo $n1 ?>">
    <input type="hidden" name="n2" value="<?php echo $n2 ?>">

    <div class="row">
        <?php if(in_array('first_name', $fields)) { ?>
            <div class="col-6 mb-3 col-first_name">
                <label for="first_name"><?php _e('First name', 'syrus') ?><?php echo (in_array('first_name', $required_fields) ? '<span class="ms-2" style="color:red">*</span>' : '') ?></label>
                <input class="form-control" type="text" name="first_name" id="first_name" maxlength="512" <?php echo (!$isPreview && in_array('first_name', $required_fields) ? 'required' : '') ?>>
            </div>
        <?php } ?>

        <?php if(in_array('last_name', $fields)) { ?>
            <div class="col-6 mb-3 col-last_name">
                <label for="last_name"><?php _e('Last name', 'syrus') ?><?php echo (in_array('last_name', $required_fields) ? '<span class="ms-2" style="color:red">*</span>' : '') ?></label>
                <input class="form-control" type="text" name="last_name" id="last_name" maxlength="512" <?php echo (!$isPreview && in_array('last_name', $required_fields) ? 'required' : '') ?>>
            </div>
        <?php } ?>

        <?php if(in_array('number', $fields)) { ?>
            <div class="col-12 mb-3 col-number">
                <label for="number"><?php _e('Number', 'syrus') ?><?php echo (in_array('number', $required_fields) ? '<span class="ms-2" style="color:red">*</span>' : '') ?></label>
                <input class="form-control" type="tel" name="number" id="number" maxlength="512" <?php echo (!$isPreview && in_array('number', $required_fields) ? 'required' : '') ?>>
            </div>
        <?php } ?>

        <?php if(in_array('email', $fields)) { ?>
            <div class="col-12 mb-3 col-email">
                <label for="email"><?php _e('Email', 'syrus') ?><?php echo (in_array('email', $required_fields) ? '<span class="ms-2" style="color:red">*</span>' : '') ?></label>
                <input class="form-control" type="email" name="email" id="email" maxlength="512" <?php echo (!$isPreview && in_array('email', $required_fields) ? 'required' : '') ?>>
            </div>
        <?php } ?>

        <?php if(in_array('message', $fields)) { ?>
            <div class="col-12 mb-3 col-message">
                <label for="message"><?php _e('Message', 'syrus') ?><?php echo (in_array('message', $required_fields) ? '<span class="ms-2" style="color:red">*</span>' : '') ?></label>
                <textarea class="form-control" rows="3" name="message" id="message" maxlength="512" <?php echo (!$isPreview && in_array('message', $required_fields) ? 'required' : '') ?>></textarea>
            </div>
        <?php } ?>

        <?php if(!$isPreview) { ?>
            <div class="col-auto d-flex justify-content-center align-items-center mb-3">
                <?php echo $n1 . ' + ' . $n2 . ' ? ' ?>
            </div>

            <div class="col-2 mb-3">
                <input type="number" class="form-control" name="operation_result" min="0" id="" required>
            </div>

            <div class="col-12">
                <button class="btn btn-primary"><?php _e("Submit", 'syrus') ?></button>
            </div>
        <?php } ?>
    </div>
</form>