/* Style général */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: #fafafa;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.form-header {
    background: none;
    color: white;
    padding: 0;
    text-align: center;
    margin: -20px -20px 30px -20px;
    position: relative;
}

.header-image {
    width: 80vw;
    height: 35vh;
    max-width: none;
    min-height: 200px;
    margin-left: calc(-50vw + 50%);
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.form-header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    font-weight: 300;
}

.form-header p {
    opacity: 0.9;
    font-size: 1.1em;
}

.form-content {
    padding: 40px;
}

.form-section {
    margin-bottom: 30px;
}

.section-title {
    color: #2c5aa0;
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e6ff;
}

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

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-col {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    font-weight: 600;
    color: #2c5aa0;
    margin-bottom: 8px;
    font-size: 0.95em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8f0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
    transform: scale(1.2);
}

/* Upload de fichiers */
.upload-section {
    margin-top: 40px;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.upload-item {
    border: 2px dashed #d1d9e6;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8fafc;
    position: relative;
}

.upload-item:hover {
    border-color: #2c5aa0;
    background: #f0f4ff;
}

.upload-item.dragover {
    border-color: #2c5aa0;
    background: #e6edff;
    transform: scale(1.02);
}

.upload-item h3 {
    color: #2c5aa0;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.upload-item input[type="file"] {
    display: none;
}

.upload-btn {
    display: inline-block;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3c72 100%);
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-decoration: none;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 90, 160, 0.3);
}

.file-info {
    margin-top: 15px;
    padding: 10px;
    background: #e6f3ff;
    border-radius: 8px;
    font-size: 0.9em;
    color: #2c5aa0;
}

.file-preview {
    max-width: 100px;
    max-height: 100px;
    margin: 10px auto;
    border-radius: 8px;
}

/* Calendrier et horaire */
.datetime-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    align-items: end;
}

/* Boutons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3c72 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(44, 90, 160, 0.3);
}

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

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

.form-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #e1e8f0;
}

/* Messages */
.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

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

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

.message.info {
    background: #cce7ff;
    color: #004085;
    border: 1px solid #b3d7ff;
}

/* Formulaire client (lecture seule) */
.readonly-form {
    background: #f8f9fa;
}

.readonly-field {
    background: #e9ecef !important;
    cursor: not-allowed;
}

.readonly-section {
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    background: #f8f9fa;
}

.readonly-section h3 {
    color: #495057;
    margin-bottom: 15px;
}

.readonly-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.readonly-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #2c5aa0;
}

.readonly-item strong {
    color: #2c5aa0;
    display: block;
    font-size: 0.9em;
    margin-bottom: 5px;
}

/* Nouveau style pour le récapitulatif en texte */
.readonly-recap {
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 20px;
}

.readonly-recap p {
    margin: 0;
    line-height: 1.6;
    font-size: 1.05em;
    color: #495057;
}

.highlight-rdv {
    background: linear-gradient(120deg, #2c5aa0 0%, #4a90e2 100%);
    color: white !important;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.05em;
    display: inline-block;
    margin: 0 2px;
    box-shadow: 0 2px 4px rgba(44, 90, 160, 0.2);
}

/* Statut des documents */
.document-status {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.status-item {
    display: block;
    padding: 20px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: 140px;
    position: relative;
}

.status-item.completed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-item.pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.status-item.dragover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(44, 90, 160, 0.2);
}

.status-icon {
    font-size: 1.2em;
}

.status-label {
    font-size: 1.1em;
    font-weight: 600;
}

.status-message {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.status-message p {
    margin: 0 0 10px 0;
    color: #495057;
}

.status-message small {
    display: block;
    margin-top: 10px;
    font-style: italic;
}

/* Nouveaux styles pour les status-items avec upload intégré */
.status-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.upload-btn-small {
    display: block;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3c72 100%);
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9em;
    text-decoration: none;
    text-align: center;
    margin-top: 15px;
    width: 100%;
    box-sizing: border-box;
}

.upload-btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(44, 90, 160, 0.3);
}

.doc-description {
    margin: 8px 0;
    color: #666;
    font-size: 0.9em;
    line-height: 1.4;
}

.status-item .file-info {
    background: #e6f3ff;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 8px 0;
    font-size: 0.9em;
    color: #2c5aa0;
}

.status-item .file-info strong {
    color: #1e3c72;
}

/* Animation pour le bouton modifié */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(230, 126, 34, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(230, 126, 34, 0); }
    100% { box-shadow: 0 0 0 0 rgba(230, 126, 34, 0); }
}

/* Styles pour la section statut employeur */
.section-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    font-size: 16px;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.checkbox-label:hover {
    background: #e6f3ff;
    border-color: #2c5aa0;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: #2c5aa0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-text {
    color: #2c5aa0;
    font-weight: 600;
}

.checkbox-text {
    color: #495057;
    font-size: 15px;
    transition: all 0.3s ease;
}

.adresse-employeur-section {
    margin-top: 20px;
    padding: 20px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.adresse-employeur-section label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.adresse-employeur-section textarea {
    width: 100%;
    box-sizing: border-box;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.adresse-employeur-section textarea:focus {
    border-color: #2c5aa0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

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

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .form-content {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .datetime-group {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .upload-grid {
        grid-template-columns: 1fr;
    }
    
    .form-header {
        margin: -10px -10px 20px -10px;
    }
    
    .header-image {
        max-height: 20vh;
    }
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e1e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2c5aa0, #1e3c72);
    width: 0%;
    transition: width 0.3s ease;
} 

/* Style pour la case Statut employeur avec disposition flex */
.status-employeur {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    min-height: 180px !important;
}

.status-left {
    flex: 0 0 35%;
}

.status-right {
    flex: 1;
    padding-left: 15px;
}

/* Styles pour la checkbox inline */
.checkbox-group-inline {
    margin-bottom: 15px;
}

.checkbox-label-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9em;
}

.checkbox-label-inline:hover {
    background: #e9ecef;
    border-color: #2c5aa0;
}

.checkbox-label-inline input[type="checkbox"] {
    width: auto;
    margin: 0;
    transform: scale(1.2);
}

/* Styles pour la zone d'adresse inline */
.adresse-employeur-inline {
    margin-top: 10px;
}

.label-inline {
    display: block;
    font-weight: 600;
    color: #2c5aa0;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.textarea-inline {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8f0;
    border-radius: 8px;
    font-size: 0.9em;
    transition: all 0.3s ease;
    background: white;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}

.textarea-inline:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .status-employeur {
        flex-direction: column !important;
        gap: 15px;
    }
    
    .status-left, .status-right {
        flex: 1 1 auto;
    }
    
    .status-right {
        padding-left: 0;
        border-left: none;
        border-top: 2px solid #e9ecef;
        padding-top: 15px;
    }
} 

/* Modifications pour la case Statut employeur - Positionnement exact */

/* Label checkbox */
.status-right .checkbox-group-inline label{
 transform:translatex(-111px) translatey(75px);
 width:112px;
 font-size:10px;
 position:relative;
 top:-61px;
 left:50px;
 padding-left:7px;
}

/* Status right */
.status-grid .status-item .status-right{
 transform:translatex(80px) translatey(-29px);
 width:117px;
 margin-bottom:1px;
}

/* Adresse employeur - Partie 1 du formulaire (index.php) */
#adresse_employeur{
 transform:translatex(0px) translatey(-31px);
 width:722px !important;
}

/* Adresse employeur - Partie 2 du formulaire (client.php) */
.status-right #adresse_employeur{
 transform:translatex(-241px) translatey(25px);
 width:287px !important;
 padding-top:0px;
 padding-right:0px;
 padding-left:6px;
 border-width:0px;
 min-height:3px;
 height:39px;
 position:relative;
 top:30px;
}

/* Small Tag */
#adresseEmployeurSection small{
 transform:translatex(-230px) translatey(-34px);
 display:none !important;
}

/* Small Tag */
.container .form-content .document-status .status-grid .status-item .status-right #adresseEmployeurSection small{
 width:202% !important;
}

/* Label adresse employeur - Partie 2 uniquement */
#adresseEmployeurSection label{
 display:none;
}

/* Label adresse employeur - Partie 1 (index.php) - Toujours visible */
.form-content .form-group label[for="adresse_employeur"]{
 display:block !important;
}

/* Label */
#clientForm .form-group:nth-child(4) label{
 position:relative;
 top:16px;
}

/* Adresse employeur */
#adresse_employeur{
 position:relative;
 top:41px;
}

/* Field help */
#clientForm .form-group .field-help{
 display:none;
}

/* Modification pour l'image du header sur les deux formulaires - Responsive */
.container .form-header img{
 /* Styles simplifiés pour diagnostiquer le problème */
 width: 100%;
 max-width: 800px;
 height: auto;
 display: block;
 margin: 20px auto;
 border-radius: 10px;
 box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Commentaires temporaires des styles responsifs complexes 
@media screen and (max-width: 1366px) {
 .container .form-header img{
  transform: translatex(371px) translatey(35px);
  width: 659px;
 }
}

@media (min-width:1367px) and (max-width:1920px){
 .container .form-header img{
  transform:translatex(-0.27300000000002456px) translatey(36px);
 }
}

@media screen and (min-width: 1921px) {
 .container .form-header img{
  transform: translatex(calc(50vw - 329px)) translatey(35px);
  width: 659px;
 }
}
*/

/* Status item */
.document-status .status-grid .status-item{
 padding-bottom:0px;
 height:187px;
}

/* Adaptation mobile pour la grille à 2 colonnes */
@media (max-width: 768px) {
 .status-grid {
  grid-template-columns: 1fr;
 }
}

@media (min-width: 769px) and (max-width: 1024px) {
 .status-grid {
  grid-template-columns: repeat(2, 1fr);
 }
}

/* Span Tag */
.checkbox-group-inline .checkbox-label-inline span{
 font-size:10px;
}

/* Paragraph */
.status-grid .status-left p{
 display:none;
}

/* Upload small */
.status-grid .status-item:nth-child(2) .upload-btn-small{
 transform:translatex(3px) translatey(19px);
}

/* Link déconnexion */
.form-header div a{
 display:inline-block;
 transform:translatex(-79px) translatey(477px);
}

/* Corrections des boutons "Remplacer" quand tous les documents sont validés */

/* Upload small - Position par défaut pour tous */
.status-grid .status-item .upload-btn-small{
 transform:translatex(0px) translatey(0px) !important;
}

/* Upload small - Permis de conduire */
.status-grid .status-item:nth-child(2) .upload-btn-small{
 transform:translatex(3px) translatey(0px) !important;
}

/* Upload small - Avis d'imposition */
.status-grid .status-item:nth-child(3) .upload-btn-small{
 transform:translatex(0px) translatey(-19px) !important;
}

/* Position des checkboxes */

/* Checkbox formulaire client - Premier élément */
#clientForm .checkbox-item:nth-child(1) input[type=checkbox]{
 position:relative;
 top:-3px;
}

/* Checkbox groupes - Tous les éléments */
.checkbox-group .checkbox-item input[type=checkbox]{
 position:relative;
 top:-4px !important;
}