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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-image {
    max-height: 60px;
    max-width: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.btn-nouveau {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-nouveau:hover {
    background-color: #0052a3;
}

/* Main Title */
.main-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #333;
}

/* Form Sections Container */
.form-sections-container {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    align-items: flex-start;
}

/* Form Sections */
.form-section {
    flex: 1;
    padding: 25px;
    background-color: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.form-section-client {
    order: 1;
}

.form-section-sample {
    order: 2;
}

.form-section-logistique {
    margin-top: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
    border-bottom: 2px solid #0066cc;
    padding-bottom: 10px;
    flex: 1;
}

.btn-nouveau-section {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    margin-left: 15px;
    white-space: nowrap;
}

.btn-nouveau-section:hover {
    background-color: #0052a3;
}

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

.email-form-group {
    position: relative;
}

.email-recipient-option {
    margin-bottom: 6px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    line-height: 1.2;
    margin: 0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin: 0;
    padding: 0;
    border: 2px solid #777;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transform: translateY(-2px);
}

.checkbox-label input[type="checkbox"]:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.checkbox-label input[type="checkbox"]::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background-color: transparent;
    transition: background-color 0.15s ease;
}

.checkbox-label input[type="checkbox"]:checked {
    border-color: #0066cc;
}

.checkbox-label input[type="checkbox"]:checked::after {
    background-color: #0066cc;
}

.recipient-notice {
    font-size: 12px;
    color: #c05621;
    margin-bottom: 6px;
}

.recipient-notice.is-visible {
    display: block;
}

.recipient-notice[hidden] {
    display: none !important;
}

.email-feedback {
    font-size: 12px;
    margin-top: 6px;
    color: #666;
    min-height: 16px;
}

.email-feedback.error {
    color: #c0392b;
}

.email-feedback.success {
    color: #1e7e34;
}

.input-valid {
    border-color: #28a745 !important;
}

.input-error {
    border-color: #dc3545 !important;
}

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

.required-marker {
    color: #dc3545;
    font-weight: 700;
    font-size: 0.85em;
    vertical-align: super;
    margin-left: 2px;
}

.required-note {
    font-size: 12px;
    color: #666;
    margin-top: -20px;
    margin-bottom: 30px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="datetime-local"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

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

.champ-verrouille {
    background-color: #e6e6e6 !important;
    cursor: not-allowed;
}

.code-group {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.code-group input {
    flex: 1;
}

.btn-verifier {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.btn-verifier:hover {
    background-color: #0052a3;
}

.btn-verifier:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.logistique-intro {
    font-size: 14px;
    color: #444;
    margin-bottom: 16px;
}

.logistique-form-intro {
    font-size: 14px;
    color: #333;
    margin: 0 0 20px;
    line-height: 1.5;
}

.btn-logistique {
    width: 100%;
    background-color: #004a94;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-logistique:hover,
.btn-logistique:focus-visible {
    background-color: #00386f;
    outline: none;
}

.btn-logistique[aria-expanded="true"] {
    background-color: #002d58;
}

.logistique-form {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #d9d9d9;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

.logistique-form.is-open {
    max-height: 2000px;
    opacity: 1;
}
.logistique-field label {
    font-size: 14px;
    color: #333;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.logistique-field-info {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
    font-style: italic;
}

.logistique-field textarea,
.logistique-field input[type="text"],
.logistique-field input[type="tel"],
.logistique-field input[type="email"],
.logistique-field input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.logistique-period-options {
    display: flex;
    gap: 16px;
    margin-top: 10px;
}

.logistique-period-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #333;
}

.required-note-logistique {
    margin-top: 16px;
    text-align: left;
}

.logistique-field textarea:focus,
.logistique-field input:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.1);
}

.logistique-actions {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    margin-top: 8px;
}

.btn-logistique-send {
    background-color: #0f9d58;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-logistique-send:hover {
    background-color: #0c7a43;
}

.btn-logistique-send:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.btn-envoyer {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-top: auto;
    align-self: flex-start;
}

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

.btn-envoyer:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Actions client - boutons de sauvegarde/chargement */
.client-actions {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-save-client,
.btn-load-client {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-save-client {
    background-color: #0066cc;
    color: white;
}

.btn-save-client:hover {
    background-color: #0052a3;
}

.btn-load-client {
    background-color: #6c757d;
    color: white;
}

.btn-load-client:hover {
    background-color: #5a6268;
}

.btn-save-client:disabled,
.btn-load-client:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Response Area */
.response-area {
    margin-top: 20px;
    margin-bottom: 30px;
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.response-area h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.response-content {
    padding: 15px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    min-height: 50px;
}

.response-content.success {
    border-color: #28a745;
    background-color: #d4edda;
    color: #155724;
}

.response-content.error {
    border-color: #dc3545;
    background-color: #f8d7da;
    color: #721c24;
}

.response-content.info {
    border-color: #0066cc;
    background-color: #d1ecf1;
    color: #0c5460;
}

.btn-primary,
.btn-secondary {
    border: none;
    border-radius: 4px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.btn-primary {
    background-color: #0066cc;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0052a3;
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #cacaca;
}

/* Footer */
.footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: left;
}

.footer p {
    font-size: 12px;
    color: #666;
}

.legal-link {
    border: none;
    background: none;
    padding: 0;
    margin-top: 8px;
    font-size: 12px;
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
    display: inline-block;
}

.legal-link:hover,
.legal-link:focus {
    color: #004a94;
    outline: none;
}

body.legal-modal-open {
    overflow: hidden;
}

.legal-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1100;
}

.legal-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.legal-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 0;
}

.legal-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    padding: 32px 36px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.legal-modal__close {
    position: absolute;
    top: 12px;
    right: 16px;
    border: none;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: #333;
    cursor: pointer;
}

.legal-modal__body {
    margin-top: 12px;
}

.legal-modal__title {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin-bottom: 16px;
}

.legal-modal__content {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
}

.legal-modal__content a {
    color: #0066cc;
    text-decoration: underline;
    word-break: break-word;
}

.legal-modal__content strong {
    font-weight: 600;
}

.confirmation-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1200;
}

.confirmation-modal.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.confirmation-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.confirmation-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 10px;
    padding: 28px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.confirmation-modal__title {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    margin-bottom: 12px;
}

.confirmation-modal__text {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.5;
}

.confirmation-modal__notice {
    font-size: 13px;
    color: #c05621;
    margin-bottom: 18px;
}

.confirmation-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.confirmation-modal__notice.is-emphasis {
    font-weight: 600;
}

.turnstile-container {
    display: none;
}

body.email-modal-open {
    overflow: hidden;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Responsive: empiler les blocs sur petits écrans */
@media (max-width: 768px) {
    .form-sections-container {
        flex-direction: column;
    }
    
    .form-section-client {
        order: 1;
    }
    
    .form-section-sample {
        order: 2;
    }

    .btn-logistique {
        font-size: 14px;
    }
}

