{% extends "base.html" %}

{% block content %}
<div class="container">
    <h1>DoctorCheck - Évaluation de santé</h1>
    <form id="health-form" method="post">
        {% csrf_token %}
        <label for="age">Âge :</label>
        <input type="number" id="age" name="age" required min="1" max="150"><br><br>

        <label for="systolic_bp">Tension systolique (mmHg) :</label>
        <input type="number" id="systolic_bp" name="systolic_bp" required min="50" max="300"><br><br>

        <label for="diastolic_bp">Tension diastolique (mmHg) :</label>
        <input type="number" id="diastolic_bp" name="diastolic_bp" required min="30" max="200"><br><br>

        <label><input type="checkbox" id="has_headache" name="has_headache"> Maux de tête</label><br>
        <label><input type="checkbox" id="has_fatigue" name="has_fatigue"> Fatigue</label><br><br>

        <button type="submit">Évaluer ma santé</button>
    </form>

    {% if result %}
        <div id="result" class="result">
            <h2>Résultat :</h2>
            <p>{{ result }}</p>
        </div>
    {% endif %}
</div>
{% endblock %}
