{% extends "base.html" %}
{% block title %}{{ title }} — GMAO Collège{% endblock %}

{% block content %}
<h1 class="mb-4">{{ title }}</h1>
<div class="card"><div class="card-body">
<form method="POST">
    {{ form.hidden_tag() }}
    <div class="row">
        <div class="col-md-6 mb-3">{{ form.name.label(class="form-label fw-bold") }}{{ form.name(class="form-control") }}</div>
        <div class="col-md-6 mb-3">{{ form.trade_name.label(class="form-label") }}{{ form.trade_name(class="form-control") }}</div>
    </div>
    <div class="row">
        <div class="col-md-4 mb-3">{{ form.siret.label(class="form-label") }}{{ form.siret(class="form-control") }}</div>
        <div class="col-md-4 mb-3">{{ form.specialty.label(class="form-label") }}{{ form.specialty(class="form-select") }}</div>
        <div class="col-md-4 mb-3">{{ form.rating.label(class="form-label") }}{{ form.rating(class="form-select") }}</div>
    </div>
    <div class="row">
        <div class="col-md-4 mb-3">{{ form.contact_name.label(class="form-label") }}{{ form.contact_name(class="form-control") }}</div>
        <div class="col-md-4 mb-3">{{ form.contact_email.label(class="form-label") }}{{ form.contact_email(class="form-control") }}</div>
        <div class="col-md-4 mb-3">{{ form.contact_phone.label(class="form-label") }}{{ form.contact_phone(class="form-control") }}</div>
    </div>
    <div class="mb-3">{{ form.address.label(class="form-label") }}{{ form.address(class="form-control", rows=2) }}</div>
    <div class="mb-3">{{ form.notes.label(class="form-label") }}{{ form.notes(class="form-control", rows=3) }}</div>
    
    <hr>
    <h5 class="mb-3">Contacts techniciens supplémentaires</h5>
    <div class="row">
        <div class="col-md-4 mb-3">{{ form.tech1_name.label(class="form-label") }}{{ form.tech1_name(class="form-control") }}
            {{ form.tech1_phone.label(class="form-label mt-2") }}{{ form.tech1_phone(class="form-control") }}
            {{ form.tech1_email.label(class="form-label mt-2") }}{{ form.tech1_email(class="form-control") }}
        </div>
        <div class="col-md-4 mb-3">{{ form.tech2_name.label(class="form-label") }}{{ form.tech2_name(class="form-control") }}
            {{ form.tech2_phone.label(class="form-label mt-2") }}{{ form.tech2_phone(class="form-control") }}
            {{ form.tech2_email.label(class="form-label mt-2") }}{{ form.tech2_email(class="form-control") }}
        </div>
        <div class="col-md-4 mb-3">{{ form.tech3_name.label(class="form-label") }}{{ form.tech3_name(class="form-control") }}
            {{ form.tech3_phone.label(class="form-label mt-2") }}{{ form.tech3_phone(class="form-control") }}
            {{ form.tech3_email.label(class="form-label mt-2") }}{{ form.tech3_email(class="form-control") }}
        </div>
    </div>
    
    <div class="mt-3">
        <button type="submit" class="btn btn-primary"><i class="bi bi-check-lg"></i> Enregistrer</button>
        <a href="{{ url_for('companies.index') }}" class="btn btn-outline-secondary">Annuler</a>
    </div>
</form>
</div></div>
{% endblock %}