<?php

/** @var yii\web\View $this */
/** @var common\forms\LeadForm $form */

use common\models\Lead;
use yii\bootstrap5\ActiveForm;
use yii\bootstrap5\Html;
use yii\helpers\Url;
?>

<?php $f = ActiveForm::begin(['id' => 'lead-form']) ?>

<div class="row g-3">
    <div class="col-md-6">
        <?= $f->field($form, 'name')->textInput(['placeholder' => 'Full name']) ?>
    </div>
    <div class="col-md-6">
        <?= $f->field($form, 'phone')->textInput(['placeholder' => '+91 XXXXX XXXXX']) ?>
    </div>
    <div class="col-md-6">
        <?= $f->field($form, 'email')->input('email', ['placeholder' => 'email@example.com']) ?>
    </div>
    <div class="col-md-3">
        <?= $f->field($form, 'source')->dropDownList([
            '' => '— Select Source —',
            'website'  => 'Website',
            'referral' => 'Referral',
            'social'   => 'Social Media',
            'walk-in'  => 'Walk-in',
            'other'    => 'Other',
        ]) ?>
    </div>
    <div class="col-md-3">
        <?= $f->field($form, 'status')->dropDownList(Lead::statusLabels()) ?>
    </div>
    <div class="col-md-6">
        <?= $f->field($form, 'interest')->textInput(['placeholder' => 'Weight loss, muscle gain…']) ?>
    </div>
    <div class="col-md-6">
        <?= $f->field($form, 'message')->textarea(['rows' => 3, 'placeholder' => 'Additional message…']) ?>
    </div>
</div>

<div class="d-flex gap-2 mt-3">
    <?= Html::submitButton('<i class="bi bi-check-lg"></i> Save Lead', ['class' => 'btn btn-primary']) ?>
    <?= Html::a('Cancel', Url::to(['/lead/index']), ['class' => 'btn btn-outline-secondary']) ?>
</div>

<?php ActiveForm::end() ?>
