/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: white;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    padding: 30px 20px;
    background-color: #fff;
    border-bottom: 3px solid #2c5aa0;
}

/* Contact header */
.contact-header {
    background-color: #f8f9fa;
    padding: 10px 20px;
    margin: -30px -20px 20px -20px;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.9rem;
    color: #666;
}

.contact-header p {
    margin: 2px 0;
}

.contact-header a {
    color: #2c5aa0;
    text-decoration: none;
}

.contact-header a:hover {
    text-decoration: underline;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    color: #2c5aa0;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.main-title {
    font-size: 2.8rem;
    font-weight: bold;
    color: #2c5aa0;
    margin: 15px 0;
    letter-spacing: 1px;
}

.subtitle-detail {
    font-size: 1.1rem;
    color: #666;
    margin: 5px 0;
    font-weight: 500;
}

.strategy-title {
    font-size: 1.3rem;
    color: #2c5aa0;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.strategy-subtitle {
    font-size: 1rem;
    color: #555;
    margin: 5px 0;
    font-style: italic;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.4;
    margin: 10px 0;
}

/* Section logos */
.logos-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.logo {
    max-height: 60px;
    max-width: 120px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

/* Form sections */
.registration-form {
    padding: 0 40px 40px;
}

.form-section {
    margin-bottom: 40px;
    padding: 30px 0;
    border-bottom: 1px solid #e0e0e0;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h2 {
    background-color: #f0b90b;
    color: white;
    padding: 10px 20px;
    margin: -10px 0 30px 0;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Form layout */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group-large {
    grid-column: span 2;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 5px rgba(44, 90, 160, 0.3);
}

.form-group input:required,
.form-group select:required {
    border-left: 3px solid #f0b90b;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Charte section */
.charter-content {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

/* Section engagements de la commune */
.commune-engagement {
    background-color: #e8f4fd;
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
    border: 1px solid #b3d9f2;
}

.commune-engagement h3 {
    color: #1a73a8;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.commune-engagement ol {
    padding-left: 20px;
}

.commune-engagement li {
    margin-bottom: 12px;
    line-height: 1.5;
}

.commune-engagement ul {
    margin: 8px 0;
    padding-left: 20px;
}

.commune-engagement ul li {
    margin-bottom: 6px;
}

.charter-content h3 {
    color: #2c5aa0;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.charter-content ol {
    padding-left: 20px;
}

.charter-content li {
    margin-bottom: 10px;
    line-height: 1.5;
}

/* Signature section */
.signature-section {
    background-color: #f8f9ff;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #2c5aa0;
}

.signature-section h3 {
    color: #2c5aa0;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

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

#signatureCanvas {
    border: 2px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: crosshair;
    display: block;
    margin: 0 auto;
}

.signature-buttons {
    margin-top: 10px;
}

.signature-buttons button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.signature-buttons button:hover {
    background-color: #c82333;
}

/* RGPD section */
.rgpd-info {
    background-color: #e8f4f8;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    margin: 20px 0;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 4px;
    transform: scale(1.2);
}

.checkbox-group label {
    line-height: 1.4;
    font-size: 15px;
}

.rgpd-details {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.rgpd-details ul {
    margin: 10px 0;
    padding-left: 20px;
}

.rgpd-details li {
    margin-bottom: 5px;
}

/* Submit button */
.form-submit {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #2c5aa0;
}

.submit-button {
    background: linear-gradient(135deg, #2c5aa0, #1a4480);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
}

.submit-button:hover {
    background: linear-gradient(135deg, #1a4480, #2c5aa0);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 90, 160, 0.4);
}

.submit-button:active {
    transform: translateY(0);
}

/* Validation styles */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #dc3545;
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.3);
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
}

/* SIRET validation styles */
.siret-priority {
    background-color: #f8f9ff;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #2c5aa0;
    margin-bottom: 30px;
}

.siret-priority label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c5aa0;
}

.siret-priority input {
    font-size: 1.1rem;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 100%;
    margin-top: 8px;
}

.siret-priority input:focus {
    border-color: #2c5aa0;
    box-shadow: 0 0 10px rgba(44, 90, 160, 0.3);
}

.siret-help {
    font-size: 0.9rem;
    color: #666;
    font-weight: normal;
}

.validation-message {
    font-size: 14px;
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 3px;
    display: none;
}

.validation-message.success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    display: block;
}

.validation-message.error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    display: block;
}

.validation-message.loading {
    color: #0c5460;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    display: block;
}

/* Success message */
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
}

/* Loading spinner */
.loading {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c5aa0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        margin: 0;
    }

    .registration-form {
        padding: 0 20px 40px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-group-large {
        grid-column: span 1;
    }

    header h1 {
        font-size: 2rem;
    }

    .main-title {
        font-size: 2.2rem;
    }

    .logos-section {
        gap: 15px;
    }

    .logo {
        max-height: 50px;
        max-width: 100px;
    }

    #signatureCanvas {
        width: 100%;
        max-width: 350px;
    }

    .form-section h2 {
        margin-left: -20px;
        margin-right: -20px;
        padding-left: 20px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 1.6rem;
        letter-spacing: 1px;
    }

    .subtitle {
        font-size: 1rem;
    }

    .registration-form {
        padding: 0 15px 30px;
    }

    .form-section {
        padding: 20px 0;
    }

    .form-section h2 {
        font-size: 1rem;
        margin-left: -15px;
        margin-right: -15px;
        padding: 8px 15px;
    }

    .charter-content,
    .signature-section,
    .rgpd-info {
        padding: 20px 15px;
    }

    #signatureCanvas {
        width: 100%;
        height: 150px;
    }
}