File size: 38,282 Bytes
dbdf7da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1553fbb
dbdf7da
1553fbb
dbdf7da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1553fbb
dbdf7da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14f9a83
dbdf7da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1553fbb
dbdf7da
 
 
 
 
 
 
 
 
 
 
 
1553fbb
dbdf7da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1553fbb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dbdf7da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1553fbb
 
dbdf7da
 
 
 
 
 
1553fbb
dbdf7da
1553fbb
dbdf7da
 
1553fbb
dbdf7da
1553fbb
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>EasyLoc - Gestion des locations saisonnières</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .tab-active {
            border-bottom: 3px solid #f97316;
            color: #f97316;
            font-weight: 600;
        }
        .contract-section {
            margin-bottom: 1.5rem;
        }
        .signature-placeholder {
            border-bottom: 1px dashed #000;
            display: inline-block;
            min-width: 200px;
        }
        .bold-text {
            font-weight: bold;
        }
    </style>
</head>
<body class="bg-gray-50">
    <div class="container mx-auto px-4 py-8 max-w-6xl">
        <header class="mb-10">
            <div class="flex justify-between items-center">
                <div class="flex items-center">
                    <i class="fas fa-home text-orange-500 text-4xl mr-3"></i>
                    <h1 class="text-3xl font-bold text-gray-800">Easy<span class="text-orange-500">Loc</span></h1>
                </div>
                <div class="bg-orange-100 text-orange-800 px-4 py-2 rounded-full text-sm font-medium">
                    <i class="fas fa-user-circle mr-2"></i>
                    <span>Mon compte</span>
                </div>
            </div>
            <p class="text-gray-600 mt-2">Gérez vos contrats de location saisonnière en toute simplicité</p>
        </header>

        <div class="bg-white rounded-xl shadow-md overflow-hidden">
            <!-- Navigation tabs -->
            <div class="border-b border-gray-200">
                <nav class="flex">
                    <button id="tab1-btn" class="tab-active px-6 py-4 text-center focus:outline-none">
                        <i class="fas fa-user-tie mr-2"></i>Propriétaire
                    </button>
                    <button id="tab2-btn" class="px-6 py-4 text-center text-gray-500 focus:outline-none">
                        <i class="fas fa-users mr-2"></i>Locataire
                    </button>
                    <button id="tab3-btn" class="px-6 py-4 text-center text-gray-500 focus:outline-none">
                        <i class="fas fa-file-contract mr-2"></i>Contrat
                    </button>
                </nav>
            </div>

            <!-- Tab content -->
            <div class="p-8">
                <!-- Propriétaire Tab -->
                <div id="tab1-content" class="tab-content">
                    <h2 class="text-2xl font-bold text-gray-800 mb-6">Informations du propriétaire</h2>
                    
                    <form id="owner-form" class="space-y-6">
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div>
                                <label for="owner-lastname" class="block text-sm font-medium text-gray-700 mb-1">Nom*</label>
                                <input type="text" id="owner-lastname" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                            </div>
                            <div>
                                <label for="owner-firstname" class="block text-sm font-medium text-gray-700 mb-1">Prénom*</label>
                                <input type="text" id="owner-firstname" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                            </div>
                        </div>
                        
                        <div>
                            <label for="owner-address" class="block text-sm font-medium text-gray-700 mb-1">Adresse*</label>
                            <input type="text" id="owner-address" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                        </div>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div>
                                <label for="owner-phone" class="block text-sm font-medium text-gray-700 mb-1">Téléphone*</label>
                                <input type="tel" id="owner-phone" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                            </div>
                            <div>
                                <label for="owner-email" class="block text-sm font-medium text-gray-700 mb-1">Email*</label>
                                <input type="email" id="owner-email" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                            </div>
                        </div>
                        
                        <div class="pt-6 border-t border-gray-200">
                            <h3 class="text-lg font-medium text-gray-800 mb-4">Informations sur le logement</h3>
                            
                            <div class="mb-6">
                                <label for="property-address" class="block text-sm font-medium text-gray-700 mb-1">Adresse du logement*</label>
                                <input type="text" id="property-address" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                            </div>
                            
                            <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
                                <div>
                                    <label for="rental-start" class="block text-sm font-medium text-gray-700 mb-1">Date de début*</label>
                                    <input type="date" id="rental-start" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                                </div>
                                <div>
                                    <label for="rental-end" class="block text-sm font-medium text-gray-700 mb-1">Date de fin*</label>
                                    <input type="date" id="rental-end" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                                </div>
                            </div>
                            
                            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                                <div>
                                    <label for="daily-rate" class="block text-sm font-medium text-gray-700 mb-1">Tarif journalier (€)*</label>
                                    <input type="number" id="daily-rate" min="0" step="0.01" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                                </div>
                                <div>
                                    <label for="cleaning-fee" class="block text-sm font-medium text-gray-700 mb-1">Frais de ménage (€)*</label>
                                    <input type="number" id="cleaning-fee" min="0" step="0.01" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                                </div>
                            </div>
                        </div>
                        
                        <div class="pt-6 border-t border-gray-200">
                            <div class="bg-orange-50 p-4 rounded-lg">
                                <h4 class="font-medium text-orange-800 mb-2">Récapitulatif financier</h4>
                                <div class="grid grid-cols-2 gap-4">
                                    <div>
                                        <p class="text-sm text-gray-600">Durée du séjour</p>
                                        <p id="stay-duration" class="font-medium">-</p>
                                    </div>
                                    <div>
                                        <p class="text-sm text-gray-600">Prix location</p>
                                        <p id="rental-price" class="font-medium">-</p>
                                    </div>
                                    <div>
                                        <p class="text-sm text-gray-600">Frais de ménage</p>
                                        <p id="cleaning-fee-display" class="font-medium">-</p>
                                    </div>
                                    <div>
                                        <p class="text-sm text-gray-600">Total</p>
                                        <p id="total-price" class="font-bold text-orange-600 text-lg">-</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="flex justify-end pt-6">
                            <button type="button" id="next-to-tenant" class="px-6 py-2 bg-orange-600 text-white font-medium rounded-md hover:bg-orange-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500">
                                Suivant <i class="fas fa-arrow-right ml-2"></i>
                            </button>
                        </div>
                    </form>
                </div>

                <!-- Locataire Tab -->
                <div id="tab2-content" class="tab-content hidden">
                    <h2 class="text-2xl font-bold text-gray-800 mb-6">Informations du locataire</h2>
                    
                    <form id="tenant-form" class="space-y-6">
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div>
                                <label class="block text-sm font-medium text-gray-700 mb-2">Civilité*</label>
                                <div class="flex space-x-4">
                                    <label class="inline-flex items-center">
                                        <input type="radio" name="tenant-civility" value="Madame" class="h-4 w-4 text-orange-600 focus:ring-orange-500 border-gray-300" checked>
                                        <span class="ml-2 text-gray-700">Madame</span>
                                    </label>
                                    <label class="inline-flex items-center">
                                        <input type="radio" name="tenant-civility" value="Monsieur" class="h-4 w-4 text-orange-600 focus:ring-orange-500 border-gray-300">
                                        <span class="ml-2 text-gray-700">Monsieur</span>
                                    </label>
                                </div>
                            </div>
                            <div></div>
                        </div>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div>
                                <label for="tenant-lastname" class="block text-sm font-medium text-gray-700 mb-1">Nom*</label>
                                <input type="text" id="tenant-lastname" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                            </div>
                            <div>
                                <label for="tenant-firstname" class="block text-sm font-medium text-gray-700 mb-1">Prénom*</label>
                                <input type="text" id="tenant-firstname" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                            </div>
                        </div>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div>
                                <label for="tenant-phone" class="block text-sm font-medium text-gray-700 mb-1">Téléphone*</label>
                                <input type="tel" id="tenant-phone" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                            </div>
                            <div>
                                <label for="tenant-email" class="block text-sm font-medium text-gray-700 mb-1">Email*</label>
                                <input type="email" id="tenant-email" required class="w-full px-4 py-2 border border-gray-300 rounded-md focus:ring-orange-500 focus:border-orange-500">
                            </div>
                        </div>
                        
                        <div class="pt-6 border-t border-gray-200">
                            <h3 class="text-lg font-medium text-gray-800 mb-4">Paiement</h3>
                            
                            <div class="mb-6">
                                <label for="deposit-amount" class="block text-sm font-medium text-gray-700 mb-1">Montant de l'acompte (30% du total, arrondi à la dizaine supérieure)</label>
                                <input type="number" id="deposit-amount" min="0" step="10" readonly class="w-full px-4 py-2 border border-gray-300 rounded-md bg-gray-100">
                            </div>
                            
                            <div class="bg-orange-50 p-4 rounded-lg">
                                <h4 class="font-medium text-orange-800 mb-2">Récapitulatif financier</h4>
                                <div class="grid grid-cols-2 gap-4">
                                    <div>
                                        <p class="text-sm text-gray-600">Total à payer</p>
                                        <p id="total-price-display" class="font-medium">-</p>
                                    </div>
                                    <div>
                                        <p class="text-sm text-gray-600">Acompte (30%)</p>
                                        <p id="deposit-display" class="font-medium">-</p>
                                    </div>
                                    <div>
                                        <p class="text-sm text-gray-600">Solde à payer</p>
                                        <p id="balance-due" class="font-bold text-orange-600 text-lg">-</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="flex justify-between pt-6">
                            <button type="button" id="back-to-owner" class="px-6 py-2 border border-gray-300 text-gray-700 font-medium rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500">
                                <i class="fas fa-arrow-left mr-2"></i> Retour
                            </button>
                            <button type="button" id="next-to-contract" class="px-6 py-2 bg-orange-600 text-white font-medium rounded-md hover:bg-orange-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500">
                                Générer le contrat <i class="fas fa-file-contract ml-2"></i>
                            </button>
                        </div>
                    </form>
                </div>

                <!-- Contrat Tab -->
                <div id="tab3-content" class="tab-content hidden">
                    <div class="flex justify-between items-center mb-6">
                        <h2 class="text-2xl font-bold text-gray-800">Contrat de location</h2>
                        <div class="space-x-2">
                            <button id="export-word" class="px-4 py-2 bg-blue-600 text-white font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
                                <i class="fas fa-file-word mr-2"></i>Exporter en Word
                            </button>
                            <button id="export-pdf" class="px-4 py-2 bg-orange-600 text-white font-medium rounded-md hover:bg-orange-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500">
                                <i class="fas fa-file-pdf mr-2"></i>Exporter en PDF
                            </button>
                        </div>
                    </div>
                    
                    <div id="contract-content" class="bg-white p-8 border border-gray-200 rounded-lg">
                        <div class="text-center mb-8">
                            <h1 class="text-2xl font-bold">CONTRAT DE LOCATION SAISONNIÈRE</h1>
                        </div>
                        
                        <div class="contract-section">
                            <p>ENTRE LES SOUSSIGNÉS,</p>
                            <p id="contract-owner-info" class="ml-8 my-2">
                                <span id="owner-civility">Madame</span> <span class="signature-placeholder" id="owner-name">[NOM Prénom]</span>, demeurant <span id="owner-address-display">[adresse]</span><br>
                                Numéro de téléphone portable: <span id="owner-phone-display">[téléphone]</span><br>
                                Email: <span id="owner-email-display">[email]</span><br>
                                ci-après dénommé(e) « Le Bailleur »
                            </p>
                            <p>D'UNE PART</p>
                            <p>ET</p>
                            <p id="contract-tenant-info" class="ml-8 my-2">
                                <span id="tenant-civility-display">Madame</span> <span class="signature-placeholder" id="tenant-name">[NOM Prénom]</span><br>
                                Numéro de téléphone portable: <span id="tenant-phone-display">[téléphone]</span><br>
                                Email: <span id="tenant-email-display">[email]</span><br>
                                ci-après dénommé(e) « Le Preneur »
                            </p>
                            <p>D'AUTRE PART</p>
                            <p class="mt-4">Il a été convenu entre les parties que le Bailleur loue au Preneur le logement tel que décrit ci-dessous aux conditions suivantes :</p>
                        </div>
                        
                        <div class="contract-section">
                            <h3 class="font-bold">1. OBJET DU CONTRAT DE LOCATION</h3>
                            <p>Les locaux objet du présent contrat sont loués meublés à titre saisonnier.</p>
                        </div>
                        
                        <div class="contract-section">
                            <h3 class="font-bold">2. DÉSIGNATION DU LOGEMENT</h3>
                            <h4 class="font-bold mt-2">2.1. Adresse du logement :</h4>
                            <p id="property-address-display" class="ml-8">[adresse du logement]</p>
                        </div>
                        
                        <div class="contract-section">
                            <h3 class="font-bold">3. DURÉE DE LA LOCATION SAISONNIÈRE</h3>
                            <p>Le Bailleur loue au Preneur le logement du <span id="rental-start-display" class="bold-text">[date début]</span> au <span id="rental-end-display" class="bold-text">[date fin]</span>, soit une durée maximum de <span id="stay-duration-display" class="bold-text">[X]</span> nuitées.</p>
                            <p class="mt-2">Lors du début de la location, le Bailleur ou son représentant remettra au Preneur les clefs et les instructions relative au logement.</p>
                        </div>
                        
                        <div class="contract-section">
                            <h3 class="font-bold">4. PRIX DE LOCATION AND CHARGES</h3>
                            <p>Les Parties ont convenu de fixer le loyer à <span id="total-price-contract" class="bold-text">[montant]</span> Euros pour l'intégralité de la durée de la location décrite au paragraphe 3.</p>
                            <p class="mt-2">Le loyer ci-dessus comprend, pour toute la durée de la location, le paiement des charges locatives et des fournitures disponibles rappelées ci-après :</p>
                            <ul class="list-disc ml-8 mt-2">
                                <li>Eau de ville</li>
                                <li>Electricité</li>
                                <li>Chauffage</li>
                                <li>Internet</li>
                                <li>Forfait ménage avant le séjour</li>
                                <li>Taxes de séjour</li>
                            </ul>
                            <p class="mt-2">Le Bailleur remettra au Preneur sur demande une quittance pour tout versement effectué.</p>
                        </div>
                        
                        <div class="contract-section">
                            <h3 class="font-bold">5. RÉSERVATION</h3>
                            <p>Afin de procéder à la réservation du logement, le Preneur retourne le présent contrat paraphé à chaque page et signé accompagné du versement d'acompte à hauteur de <span id="deposit-amount-display" class="bold-text">[montant]</span> euros.</p>
                        </div>
                        
                        <div class="contract-section">
                            <h3 class="font-bold">6. RÈGLEMENT DU PRIX</h3>
                            <p>Le solde du montant du loyer indiqué au paragraphe 4, soit <span id="balance-due-display" class="bold-text">[montant]</span> Euros, sera versé par le Preneur au plus tard lors de l'entrée dans le logement. Les chèques ne sont plus acceptés.</p>
                        </div>
                        
                        <div class="contract-section">
                            <h3 class="font-bold">7. ÉTAT DES LIEUX ET INVENTAIRES</h3>
                            <p>Un état des lieux et un inventaire du mobilier mis à disposition du Preneur est effectué lors de l'entrée dans le logement.</p>
                            <p class="mt-2">Un état des lieux et un inventaire seront établis après le départ des preneurs.</p>
                        </div>
                        
                        <div class="contract-section">
                            <h3 class="font-bold">8. DÉCLARATION DU BAILLEUR</h3>
                            <p>Le Bailleur déclare être propriétaire du logement et en avoir la libre disposition et la pleine jouissance durant la période définite au paragraphe 3.</p>
                        </div>
                        
                        <div class="contract-section">
                            <h3 class="font-bold">9. OBLIGATIONS DU PRENEUR</h3>
                            <ul class="list-disc ml-8 space-y-2">
                                <li>Le Preneur usera paisiblement du logement loué et du mobilier et équipements suivant la destination qui leur a été donnée par le bail et répondra des dégradations et pertes qui pourraient survenir pendant la durée du contrat dans les locaux dont il a la jouissance exclusive.</li>
                                <li>Le Preneur entretiendra le logement loué et le rendra en bon état de propreté et de réparations locatives en fin de contrat. Si des objets figurant à l'inventaire sont brisés ou détériorés, le Bailleur pourra réclamer leur valeur de remplacement.</li>
                                <li>Il devra éviter tout bruit de nature à gêner les voisins, notamment ceux émis par les appareils de radio, télévision et autres.</li>
                                <li>Le Preneur ne pourra exercer aucun recours contre le Bailleur en cas de vol et déprédations dans les lieux loués.</li>
                                <li>Il respectera le nombre de personnes maximum pouvant entrer dans les lieux, conformément au descriptif qui lui a été remis.</li>
                                <li>Le preneur ne pourra s'opposer à la visite des locaux si le Bailleur ou son mandataire en font la demande.</li>
                            </ul>
                        </div>
                        
                        <div class="contract-section">
                            <h3 class="font-bold">10. ANNULATION</h3>
                            <p>La signature du contrat engage les deux parties de manière irrévocable. Aucune résiliation n'est possible sauf accord écrit des parties. If the Preneur renonce à la location, il reste redevable de la totalité du loyer.</p>
                        </div>
                        
                        <div class="contract-section">
                            <h3 class="font-bold">11. RÉSILIATION DE PLEIN DROIT</h3>
                            <p>En cas de manquement par le Preneur à l'une des obligations contractuelles, le présent bail sera résilié de plein droit. Cette résiliation prendra effet après un délai de 48 heures après une simple sommation par lettre recommandée ou lettre remise en main propre restée infructueuse.</p>
                        </div>
                        
                        <div class="contract-section mt-12">
                            <div class="text-center italic mb-8">"Lu et approuvé"</div>
                            
                            <div class="flex justify-between">
                                <div class="text-center">
                                    <p id="owner-signature-name" class="font-medium">[NOM Prénom]</p>
                                    <div class="mt-8 mb-2">……………………………………</div>
                                    <p>Le Bailleur</p>
                                    <p class="mt-2">Date : <span id="contract-date">[date]</span></p>
                                </div>
                                
                                <div class="text-center">
                                    <p id="tenant-signature-name" class="font-medium">[NOM Prénom]</p>
                                    <div class="mt-8 mb-2">……………………………………</div>
                                    <p>Le Preneur</p>
                                    <p class="mt-2">Date : …………………</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="flex justify-between pt-6">
                        <button type="button" id="back-to-tenant" class="px-6 py-2 border border-gray-300 text-gray-700 font-medium rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500">
                            <i class="fas fa-arrow-left mr-2"></i> Retour
                        </button>
                        <button type="button" id="save-contract" class="px-6 py-2 bg-orange-600 text-white font-medium rounded-md hover:bg-orange-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500">
                            <i class="fas fa-save mr-2"></i> Enregistrer le contrat
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // Tab navigation
        document.getElementById('tab1-btn').addEventListener('click', () => {
            showTab('tab1');
        });
        
        document.getElementById('tab2-btn').addEventListener('click', () => {
            showTab('tab2');
        });
        
        document.getElementById('tab3-btn').addEventListener('click', () => {
            showTab('tab3');
        });
        
        document.getElementById('next-to-tenant').addEventListener('click', () => {
            if (validateOwnerForm()) {
                calculatePrices();
                showTab('tab2');
            } else {
                alert('Veuillez remplir tous les champs obligatoires.');
            }
        });
        
        document.getElementById('back-to-owner').addEventListener('click', () => {
            showTab('tab1');
        });
        
        document.getElementById('next-to-contract').addEventListener('click', () => {
            if (validateTenantForm()) {
                generateContract();
                showTab('tab3');
            } else {
                alert('Veuillez remplir tous les champs obligatoires.');
            }
        });
        
        document.getElementById('back-to-tenant').addEventListener('click', () => {
            showTab('tab2');
        });
        
        function showTab(tabName) {
            // Hide all tab contents
            document.querySelectorAll('.tab-content').forEach(tab => {
                tab.classList.add('hidden');
            });
            
            // Show selected tab content
            document.getElementById(`${tabName}-content`).classList.remove('hidden');
            
            // Update tab navigation styling
            document.querySelectorAll('nav button').forEach(btn => {
                btn.classList.remove('tab-active', 'text-orange-500');
                btn.classList.add('text-gray-500');
            });
            
            document.getElementById(`${tabName}-btn`).classList.add('tab-active', 'text-orange-500');
            document.getElementById(`${tabName}-btn`).classList.remove('text-gray-500');
        }
        
        // Form validation
        function validateOwnerForm() {
            const requiredFields = [
                'owner-lastname', 'owner-firstname', 'owner-address',
                'owner-phone', 'owner-email', 'property-address',
                'rental-start', 'rental-end', 'daily-rate', 'cleaning-fee'
            ];
            
            for (const fieldId of requiredFields) {
                const field = document.getElementById(fieldId);
                if (!field.value.trim()) {
                    field.focus();
                    return false;
                }
            }
            return true;
        }
        
        function validateTenantForm() {
            const requiredFields = [
                'tenant-lastname', 'tenant-firstname', 'tenant-phone', 'tenant-email'
            ];
            
            for (const fieldId of requiredFields) {
                const field = document.getElementById(fieldId);
                if (!field.value.trim()) {
                    field.focus();
                    return false;
                }
            }
            return true;
        }
        
        // Calculate rental prices when dates or rates change
        document.getElementById('rental-start').addEventListener('change', calculatePrices);
        document.getElementById('rental-end').addEventListener('change', calculatePrices);
        document.getElementById('daily-rate').addEventListener('input', calculatePrices);
        document.getElementById('cleaning-fee').addEventListener('input', calculatePrices);
        
        // Calculate rental prices
        function calculatePrices() {
            const startDate = new Date(document.getElementById('rental-start').value);
            const endDate = new Date(document.getElementById('rental-end').value);
            
            if (isNaN(startDate.getTime()) || isNaN(endDate.getTime())) return;
            
            // Calculate duration in days
            const timeDiff = endDate.getTime() - startDate.getTime();
            const dayDiff = Math.ceil(timeDiff / (1000 * 3600 * 24));
            
            if (dayDiff <= 0) {
                alert('La date de fin doit être postérieure à la date de début.');
                return;
            }
            
            const dailyRate = parseFloat(document.getElementById('daily-rate').value) || 0;
            const cleaningFee = parseFloat(document.getElementById('cleaning-fee').value) || 0;
            const rentalPrice = dayDiff * dailyRate;
            const totalPrice = rentalPrice + cleaningFee;
            
            // Calculate deposit (30% rounded up to nearest 10)
            const depositAmount = Math.ceil(totalPrice * 0.3 / 10) * 10;
            
            // Update display
            document.getElementById('stay-duration').textContent = `${dayDiff} nuitée${dayDiff > 1 ? 's' : ''}`;
            document.getElementById('rental-price').textContent = `${rentalPrice.toFixed(2)} €`;
            document.getElementById('cleaning-fee-display').textContent = `${cleaningFee.toFixed(2)} €`;
            document.getElementById('total-price').textContent = `${totalPrice.toFixed(2)} €`;
            
            // Update tenant tab display
            document.getElementById('total-price-display').textContent = `${totalPrice.toFixed(2)} €`;
            document.getElementById('deposit-amount').value = depositAmount;
            document.getElementById('deposit-display').textContent = `${depositAmount.toFixed(2)} €`;
            document.getElementById('balance-due').textContent = `${(totalPrice - depositAmount).toFixed(2)} €`;
        }
        
        // Generate contract content
        function generateContract() {
            // Owner info
            document.getElementById('owner-name').textContent = `${document.getElementById('owner-lastname').value} ${document.getElementById('owner-firstname').value}`;
            document.getElementById('owner-address-display').textContent = document.getElementById('owner-address').value;
            document.getElementById('owner-phone-display').textContent = document.getElementById('owner-phone').value;
            document.getElementById('owner-email-display').textContent = document.getElementById('owner-email').value;
            document.getElementById('owner-signature-name').textContent = `${document.getElementById('owner-lastname').value} ${document.getElementById('owner-firstname').value}`;
            
            // Tenant info
            const tenantCivility = document.querySelector('input[name="tenant-civility"]:checked').value;
            document.getElementById('tenant-civility-display').textContent = tenantCivility;
            document.getElementById('tenant-name').textContent = `${document.getElementById('tenant-lastname').value} ${document.getElementById('tenant-firstname').value}`;
            document.getElementById('tenant-phone-display').textContent = document.getElementById('tenant-phone').value;
            document.getElementById('tenant-email-display').textContent = document.getElementById('tenant-email').value;
            document.getElementById('tenant-signature-name').textContent = `${document.getElementById('tenant-lastname').value} ${document.getElementById('tenant-firstname').value}`;
            
            // Property info
            document.getElementById('property-address-display').textContent = document.getElementById('property-address').value;
            
            // Rental dates
            const startDate = new Date(document.getElementById('rental-start').value);
            const endDate = new Date(document.getElementById('rental-end').value);
            const timeDiff = endDate.getTime() - startDate.getTime();
            const dayDiff = Math.ceil(timeDiff / (1000 * 3600 * 24));
            
            const options = { day: 'numeric', month: 'long', year: 'numeric' };
            document.getElementById('rental-start-display').textContent = startDate.toLocaleDateString('fr-FR', options);
            document.getElementById('rental-end-display').textContent = endDate.toLocaleDateString('fr-FR', options);
            document.getElementById('stay-duration-display').textContent = dayDiff;
            
            // Prices
            document.getElementById('total-price-contract').textContent = document.getElementById('total-price').textContent;
            document.getElementById('deposit-amount-display').textContent = document.getElementById('deposit-amount').value;
            
            const balanceDue = parseFloat(document.getElementById('balance-due').textContent);
            document.getElementById('balance-due-display').textContent = balanceDue.toFixed(2);
            
            // Contract date
            const today = new Date();
            document.getElementById('contract-date').textContent = today.toLocaleDateString('fr-FR', options);
        }
        
        // Export to PDF (placeholder)
        document.getElementById('export-pdf').addEventListener('click', () => {
            alert('Fonctionnalité PDF à implémenter');
        });
        
        // Export to Word (placeholder)
        document.getElementById('export-word').addEventListener('click', () => {
            alert('Fonctionnalité Word à implémenter');
        });
        
        // Save contract (placeholder)
        document.getElementById('save-contract').addEventListener('click', () => {
            alert('Contrat enregistré avec succès !');
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=pointvirgule/easyloc" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>