{% extends "base.html" %}

{% block content %}
    <h1>Confirm Your Details for {{ assessment.name }}</h1>
    <p>Please confirm or update your details before starting the assessment.</p>
    <form method="POST" action="{{ url_for('main.take_assessment', token=token) }}">
        <div class="form-group">
            <label for="name">Name:</label>
            <input type="text" id="name" name="name" class="form-control" value="{{ taker.name }}" required>
        </div>
        <div class="form-group">
            <label for="email">Email (optional):</label>
            <input type="email" id="email" name="email" class="form-control" value="{{ taker.email }}">
        </div>
        <div class="form-group">
            <label for="date_of_birth">Date of Birth:</label>
            <input type="date" id="date_of_birth" name="date_of_birth" class="form-control" value="{{ taker.date_of_birth.strftime('%Y-%m-%d') if taker.date_of_birth else '' }}" required>
        </div>
        <div class="form-group">
            <label for="phone_number">Phone Number (optional):</label>
            <input type="tel" id="phone_number" name="phone_number" class="form-control" value="{{ taker.phone_number if taker.phone_number else '' }}">
        </div>
        <div class="form-group">
            <label for="center_case_id">Center Case ID:</label>
            <input type="text" id="center_case_id" name="center_case_id" class="form-control" value="{{ taker.center_case_id if taker.center_case_id else '' }}" required>
        </div>
        <div class="form-group">
            <label for="gender">Gender:</label>
            <select id="gender" name="gender" class="form-control" required>
                <option value="" disabled>Select</option>
                <option value="Male" {% if taker.gender == 'Male' %}selected{% endif %}>Male</option>
                <option value="Female" {% if taker.gender == 'Female' %}selected{% endif %}>Female</option>
                <option value="Other" {% if taker.gender == 'Other' %}selected{% endif %}>Other</option>
            </select>
        </div>
        <button type="submit" class="btn btn-primary">Proceed to Assessment</button>
    </form>
{% endblock %}
