/* Style CSS pour le système de signatures électroniques */
/* Mobile-first design avec sécurité et légèreté */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 10px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.content {
    padding: 20px;
}

/* Page d'accueil - Liste des signataires */
.signataires-list {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.signataire-card {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.signataire-card.signed {
    border-color: #28a745;
    background-color: #f8fff9;
}

.signataire-card.signed .status {
    color: #28a745;
    font-weight: bold;
}

.signataire-card .nom {
    font-weight: 600;
    font-size: 1.1rem;
}

.signataire-card .status {
    font-size: 0.9rem;
    color: #6c757d;
}

.signataire-card .date {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-full {
    width: 100%;
    margin: 10px 0;
}

/* Document */
.document {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
    font-family: 'Times New Roman', serif;
    line-height: 1.8;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.document h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 1.4rem;
}

.document p {
    margin-bottom: 15px;
    text-align: justify;
    font-size: 1rem;
}

/* Zone de signature */
.signature-area {
    margin-top: 30px;
    padding: 20px;
    border: 2px dashed #007bff;
    border-radius: 8px;
    background-color: #f8f9ff;
}

.signature-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.signature-controls label {
    font-weight: 600;
    margin-right: 10px;
}

#signature-canvas {
    border: 2px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: crosshair;
    display: block;
    margin: 15px auto;
    touch-action: none;
}

.signature-preview {
    text-align: center;
    margin: 20px 0;
}

.signature-preview img {
    max-width: 300px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background: white;
}

/* Messages */
.alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

/* Formulaires */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Page admin */
.admin-panel {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 2rem;
    color: #007bff;
}

.stat-card p {
    margin: 0;
    color: #6c757d;
    font-weight: 600;
}

/* Responsive */
@media (min-width: 768px) {
    .container {
        margin: 20px auto;
    }
    
    .content {
        padding: 40px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .document {
        padding: 40px;
    }
    
    .signature-controls {
        justify-content: center;
    }
    
    .signataires-list {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    }
}

@media (min-width: 992px) {
    .stats {
        grid-template-columns: repeat(4, 1fr);
    }
}
