/* ==========================================
   STYLE GÉNÉRAL & TYPOGRAPHIE
   ========================================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
    color: #333333;
    line-height: 1.4;
    margin: 0;
    padding: 0;
}

/* Bandeau Logo */
.bandeaublanc {
    background-color: #ffffff;
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}
.bandeaublanc img {
    max-height: 65px;
    width: auto;
    max-width: 90%; /* Évite que le logo dépasse sur petit écran */
}

/* Conteneur principal */
#detailajout {
    max-width: 900px;
    margin: 0 auto 30px auto;
    padding: 0 15px; /* Légèrement réduit pour mobile */
}

/* Textes d'introduction */
.spandetail {
    font-size: 1.05rem;
    color: #1a202c;
    font-weight: 600;
    margin-bottom: 5px;
}
.notedetail {
    font-size: 0.85rem;
    color: #4a5568;
    background-color: #f3e6dd;
    border-left: 4px solid #610916;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* ==========================================
   FORMULAIRE & STRUCTURE (FIELDSET)
   ========================================== */
fieldset {
    border: none;
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
    margin: 0;
}

fieldset h2 {
    font-size: 1.4rem;
    color: #2d3748;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

/* Bandeaux de sections (les onglets/titres) */
.bandeau {
    background: #610916;
    color: #ffffff;
    padding: 6px 12px;
    font-weight: bold;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    border-radius: 4px;
    margin-top: 15px;
    margin-bottom: 10px;
}

/* ==========================================
   CHAMPS DE SAISIE & FORMULAIRES (COMPACT PC)
   ========================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2px;
}

td {
    padding: 4px 6px;
    vertical-align: middle;
    font-size: 0.85rem;
    color: #4a5568;
    font-weight: 500;
}

/* Inputs, Selects et Textareas serrés */
input[type="text"],
input[type="email"],
input[type="date"],
select {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    margin: 2px 0;
    border: 1px solid #f3e6dd;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #2d3748;
    background-color: #fff;
    transition: all 0.15s ease-in-out;
    /* Évite le zoom automatique désagréable sur iOS (iPhone) */
    -webkit-appearance: none; 
}

/* Annuler les largeurs inline strictes du HTML */
input[type="text"]#nomperso,
input[type="text"]#adresse1,
input[type="text"]#adresse2,
input[type="email"]#email,
input[type="text"]#connaissance {
    width: 100% !important; 
    max-width: 100%;
}

input:focus, select:focus {
    border-color: #610916;
    outline: none;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.15);
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    vertical-align: middle;
    margin-right: 4px;
}

#veste, #chemise {
    width: 60px !important;
}

/* Requis */
span[style*="color:red"], span[style*="color:red;font-size:150%"] {
    color: #e53e3e !important;
    font-weight: bold;
    margin-left: 3px;
    font-size: 1.1rem !important;
    vertical-align: middle;
}
span[style*="color:green"] {
    color: #38a169 !important;
    font-weight: bold;
    margin-left: 3px;
}

/* ==========================================
   ZONE TELECHARGEMENT (DOCUMENTS)
   ========================================== */
#tab7 form {
    background: #f7fafc;
    border: 1px dashed #f3e6dd;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}
#tab7 label {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    color: #2d3748;
    font-size: 0.9rem;
}
#uploadSubmit, #uploadSubmitci, #uploadSubmitrib, #uploadSubmitcv, #uploadSubmitvital {
    background-color: #4a5568;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.8rem;
}
#uploadSubmit:hover, #uploadSubmitci:hover, #uploadSubmitrib:hover, #uploadSubmitcv:hover, #uploadSubmitvital:hover {
    background-color: #2d3748;
}
#photoperso {
    max-width: 70px;
    border-radius: 4px;
    border: 2px solid #e2e8f0;
}
img[src*="suppr.png"] {
    cursor: pointer;
    vertical-align: middle;
    margin-left: 5px;
    max-height: 18px;
}

/* Validation principale */
#ajoutperso.classname {
    display: block;
    width: 100%;
    background: #610916;
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 25px;
    transition: all 0.15s ease-in-out;
}
#ajoutperso.classname:hover {
    background: #2f855a;
}

/* ==========================================
   PIED DE PAGE / COMMENTAIRE DE FIN
   ========================================== */
.footer-note {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0; /* Ligne de séparation subtile */
    text-align: center;
}

.footer-note p {
    font-size: 0.75rem; /* Écrit en petit pour rester discret */
    color: #718096; /* Gris doux (style mentions légales) */
    line-height: 1.5;
    margin: 0;
}

/* ==========================================
   MODIFICATIONS RESPONSIVE (MOBILE)
   ========================================== */
@media screen and (max-width: 768px) {
    .footer-note {
        margin-top: 15px;
        padding-top: 10px;
        text-align: justify; /* Plus propre à lire sur un petit écran */
    }
    .footer-note p {
        font-size: 0.8rem; /* Un poil plus grand sur mobile pour le confort visuel */
    }
    
    fieldset {
        padding: 12px; /* Moins de perte d'espace sur les côtés */
    }

    /* Force les tableaux rigides à se comporter comme des blocs empilés */
    table, tbody, tr, td {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    tr {
        margin-bottom: 10px; /* Sépare proprement les lignes une fois empilées */
    }

    td {
        padding: 2px 0; /* Aligne le texte à gauche du champ */
        text-align: left;
    }

    /* Donne un peu plus de hauteur aux inputs sur mobile pour faciliter le clic tactile */
    input[type="text"],
    input[type="email"],
    input[type="date"],
    select {
        padding: 8px 10px;
        font-size: 16px !important; /* Astuce cruciale : Forcer à 16px minimum empêche iOS de zoomer automatiquement dans le champ */
    }

    /* Les petits champs comme les tailles reprennent leur largeur totale sur mobile */
    #veste, #chemise {
        width: 100% !important;
    }

    /* Aligne les formulaires d'upload et les aperçus de documents proprement */
    #tab7 table tr {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 10px;
        margin-bottom: 15px;
    }
}