/* ===========================================
   DEPOSE, RECHERCHE, ADDVIGNETTE & ADDVOISIN
   Master-Village - Style "maisonnette"
   ===========================================
   Palette :
   - Crème murs   : #FBF3D8 → #F2E2B0
   - Brun trait   : #5C3A1E   Brun toit : #6B4226
   - Bleu fenêtre : #1E4A63
   - Jaune soleil : #F4D03F
   - Vert prés    : #4C8C2B
   - Texte        : #3E2A14
   =========================================== */

/* RESET BODY */
body {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    overflow-x: hidden;
}
.form-text {
    color: #3E2A14;
}

/* BODY - DEPOSE */
.depose-fond {
    background-image: url(rechordipost.png);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: 'Arial', sans-serif;
    color: #3E2A14;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    overflow-x: hidden;
}

/* BODY - RECHERCHE */
.bodyrecherche {
    background-image: url(rechordi.png);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: 'Arial', sans-serif;
    color: #3E2A14;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    overflow-x: hidden;
}

/* BODY - ADDVIGNETTE */
.addvignette-fond {
    background-image: url(rechordipost.png);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: 'Arial', sans-serif;
    color: #3E2A14;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    overflow-x: hidden;
}

/* BODY - ADDVOISIN */
.addvoisin-fond {
    background-image: url(village10.jpg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: 'Arial', sans-serif;
    color: #3E2A14;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    overflow-x: hidden;
}

/* TOP BANNER : poutre de bois sombre, liseré soleil */
.top-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(62, 42, 20, 0.95);
    border-bottom: 3px solid #F4D03F;
    color: #FBF3D8;
    padding: 10px 0;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.h1inscri {
    font-size: 24px;
    margin: 0;
    color: #F4D03F;
    letter-spacing: 0.5px;
}

/* FOOTER NAV : même poutre en bas */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(62, 42, 20, 0.95);
    border-top: 3px solid #F4D03F;
    padding: 10px 0;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.35);
}

.footer-nav .lignecobis {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-nav .lignecobis li {
    margin: 0;
}

.footer-nav .lignecobis a {
    color: #F4D03F;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    padding: 10px 25px;
    border-radius: 25px;
    background: rgba(244, 208, 63, 0.12);
    transition: all 0.25s ease;
    border: 2px solid rgba(244, 208, 63, 0.4);
    display: inline-block;
}

.footer-nav .lignecobis a:hover {
    background: #F4D03F;
    color: #3E2A14;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 208, 63, 0.4);
}

/* FORM SECTION - DEPOSE
   (vignettage : détache la carte crème des fonds illustrés) */
.depose-form-section {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 80px 20px 60px;
    box-sizing: border-box;
    overflow-x: hidden;
    background: radial-gradient(
        ellipse 70% 60% at center,
        rgba(20, 25, 35, 0.40) 0%,
        rgba(20, 25, 35, 0.18) 55%,
        rgba(20, 25, 35, 0) 100%
    );
}

.depose-form-section.visible {
    display: flex;
    opacity: 1;
    transform: scale(1);
    animation: slideUp 0.5s ease forwards;
}

/* FORM SECTION - RECHERCHE */
.containerrecherche {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 80px 20px 60px;
    box-sizing: border-box;
    overflow-x: hidden;
    background: radial-gradient(
        ellipse 70% 60% at center,
        rgba(20, 25, 35, 0.40) 0%,
        rgba(20, 25, 35, 0.18) 55%,
        rgba(20, 25, 35, 0) 100%
    );
}

.containerrecherche[style*="block"] {
    display: flex !important;
    opacity: 1;
    transform: scale(1);
    animation: slideUp 0.5s ease forwards;
}

/* FORM SECTION - ADDVIGNETTE */
.addvignette-form-section {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 80px 20px 60px;
    box-sizing: border-box;
    overflow-x: hidden;
    background: radial-gradient(
        ellipse 70% 60% at center,
        rgba(20, 25, 35, 0.40) 0%,
        rgba(20, 25, 35, 0.18) 55%,
        rgba(20, 25, 35, 0) 100%
    );
}

.addvignette-form-section.visible {
    display: flex;
    opacity: 1;
    transform: scale(1);
    animation: slideUp 0.5s ease forwards;
}

/* FORM SECTION - ADDVOISIN */
.addvoisin-form-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    padding: 80px 20px 60px;
    box-sizing: border-box;
    overflow-x: hidden;
    background: radial-gradient(
        ellipse 70% 60% at center,
        rgba(20, 25, 35, 0.40) 0%,
        rgba(20, 25, 35, 0.18) 55%,
        rgba(20, 25, 35, 0) 100%
    );
}

/* Animation d'entrée */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* CONTAINER - DEPOSE : maisonnette avec toit */
.depose-container {
    position: relative;
    background-color: #F7ECC6;
    background-image: linear-gradient(180deg, #FBF3D8 0%, #F2E2B0 100%);
    border: 3px solid #5C3A1E;
    border-radius: 0 0 16px 16px;
    padding: 40px;
    box-shadow:
        0 8px 0 rgba(20, 25, 35, 0.32),
        0 22px 45px rgba(20, 25, 35, 0.40);
    width: 90%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* CONTAINER - RECHERCHE : les pseudo-éléments sont capricieux
   sur <table>, donc toit plat en bandeau brun */
.containerrecherche table {
    background-color: #F7ECC6;
    background-image: linear-gradient(180deg, #FBF3D8 0%, #F2E2B0 100%);
    border: 3px solid #5C3A1E;
    border-top: 14px solid #6B4226;
    border-radius: 12px 12px 16px 16px;
    padding: 30px 25px;
    box-shadow:
        0 8px 0 rgba(20, 25, 35, 0.32),
        0 22px 45px rgba(20, 25, 35, 0.40);
    width: 90%;
    max-width: 450px;
    border-collapse: separate;
}

.containerrecherche table td {
    padding: 8px 6px;
}

/* CONTAINER - ADDVIGNETTE */
.addvignette-container {
    position: relative;
    background-color: #F7ECC6;
    background-image: linear-gradient(180deg, #FBF3D8 0%, #F2E2B0 100%);
    border: 3px solid #5C3A1E;
    border-radius: 0 0 16px 16px;
    padding: 40px;
    box-shadow:
        0 8px 0 rgba(20, 25, 35, 0.32),
        0 22px 45px rgba(20, 25, 35, 0.40);
    width: 90%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* CONTAINER - ADDVOISIN */
.addvoisin-container {
    position: relative;
    background-color: #F7ECC6;
    background-image: linear-gradient(180deg, #FBF3D8 0%, #F2E2B0 100%);
    border: 3px solid #5C3A1E;
    border-radius: 0 0 16px 16px;
    padding: 40px;
    box-shadow:
        0 8px 0 rgba(20, 25, 35, 0.32),
        0 22px 45px rgba(20, 25, 35, 0.40);
    width: 90%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Le toit brun + la lucarne (containers en div uniquement) */
.depose-container::before,
.addvignette-container::before,
.addvoisin-container::before {
    content: "";
    position: absolute;
    top: -26px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 30px);
    height: 0;
    border-bottom: 26px solid #6B4226;
    border-left: 24px solid transparent;
    border-right: 24px solid transparent;
    pointer-events: none;
}

.depose-container::after,
.addvignette-container::after,
.addvoisin-container::after {
    content: "";
    position: absolute;
    top: -19px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 10px;
    background: #F1DFAE;
    border: 2px solid #1E4A63;
    border-radius: 2px;
    pointer-events: none;
}

/* TITRES */
.depose-container h1, .containerrecherche h2, .addvignette-container h1, .addvoisin-container h1 {
    color: #3E2A14;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
}

.depose-container h1::after, .addvignette-container h1::after, .addvoisin-container h1::after {
    content: "";
    display: block;
    width: 64px;
    height: 5px;
    margin: 12px auto 0;
    background: #F4D03F;
    border-radius: 3px;
    box-shadow: 0 1px 0 #C79A1B;
}

/* FORM GROUP - DEPOSE, ADDVIGNETTE, ADDVOISIN */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    width: 100%;
}

/* CHECKBOX ROW - DEPOSE */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

/* LABELS - DEPOSE, ADDVIGNETTE, ADDVOISIN */
.form-group label.td1,
.checkbox-row label.td1 {
    color: #5C3A1E;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    text-align: left;
    width: 30%;
}

/* CHECKBOX LABEL - DEPOSE */
.checkbox-row label.td1 {
    margin-bottom: 0;
    width: auto;
}

/* LABELS - RECHERCHE */
.containerrecherche .td1 {
    color: #5C3A1E;
    font-weight: bold;
    font-size: 14px;
    padding-right: 20px;
    text-align: left;
}

/* INPUTS - DEPOSE, ADDVIGNETTE, ADDVOISIN : fenêtres de la maison */
.depose-container input[type="text"],
.depose-container input[type="date"],
.depose-container textarea,
.addvignette-container input[type="text"],
.addvignette-container input[type="file"],
.addvoisin-container input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    background: #FFFDF5;
    border: 2px solid #1E4A63;
    border-radius: 8px;
    font-size: 16px;
    color: #14324A;
    font-family: inherit;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
    box-shadow: inset 0 2px 3px rgba(30, 74, 99, 0.12);
}

.depose-container textarea {
    min-height: 110px;
    resize: vertical;
}

/* CHECKBOX - DEPOSE */
.depose-container input[type="checkbox"] {
    margin: 0;
    width: auto;
    cursor: pointer;
    transform: scale(1.2);
    accent-color: #4C8C2B;
}

/* INPUTS - RECHERCHE */
.containerrecherche input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    background: #FFFDF5;
    border: 2px solid #1E4A63;
    border-radius: 8px;
    font-size: 16px;
    color: #14324A;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-sizing: border-box;
    box-shadow: inset 0 2px 3px rgba(30, 74, 99, 0.12);
}

/* FORM-TEXT - DEPOSE */
.form-group .form-text {
    color: #3E2A14;
    font-weight: bold;
    font-size: 16px;
    padding: 12px 15px;
}

/* Focus : le soleil éclaire la fenêtre */
.depose-container input[type="text"]:focus,
.depose-container input[type="date"]:focus,
.depose-container textarea:focus,
.addvignette-container input[type="text"]:focus,
.addvignette-container input[type="file"]:focus,
.addvoisin-container input[type="text"]:focus,
.containerrecherche input[type="text"]:focus {
    outline: none;
    border-color: #E0A800;
    box-shadow:
        0 0 0 4px rgba(244, 208, 63, 0.35),
        inset 0 2px 3px rgba(30, 74, 99, 0.08);
    background: #FFFFFF;
}

/* Autofill Chrome/Safari : rester dans le thème */
.depose-container input:-webkit-autofill,
.addvignette-container input:-webkit-autofill,
.addvoisin-container input:-webkit-autofill,
.containerrecherche input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #FFFDF5 inset;
    -webkit-text-fill-color: #14324A;
    transition: background-color 5000s ease-in-out 0s;
}

/* Placeholders */
.depose-container input::placeholder,
.depose-container textarea::placeholder,
.addvignette-container input::placeholder,
.addvoisin-container input::placeholder,
.containerrecherche input::placeholder {
    color: rgba(20, 50, 74, 0.45);
}

.depose-container input:focus::placeholder,
.depose-container textarea:focus::placeholder,
.addvignette-container input:focus::placeholder,
.addvoisin-container input:focus::placeholder,
.containerrecherche input:focus::placeholder {
    color: rgba(20, 50, 74, 0.3);
}

/* Bouton Submit : le soleil du village */
.depose-container input[type="submit"],
.addvignette-container input[type="submit"],
.addvoisin-container input[type="submit"],
.containerrecherche input[type="submit"] {
    background: linear-gradient(180deg, #FFE066 0%, #F4C531 100%);
    color: #3E2A14;
    font-weight: bold;
    font-size: 17px;
    border: 2px solid #5C3A1E;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 10px;
    padding: 12px 20px;
    box-shadow: 0 4px 0 #B98A1F;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.depose-container input[type="submit"]:hover,
.addvignette-container input[type="submit"]:hover,
.addvoisin-container input[type="submit"]:hover,
.containerrecherche input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #B98A1F, 0 10px 18px rgba(244, 208, 63, 0.45);
}

.depose-container input[type="submit"]:active,
.addvignette-container input[type="submit"]:active,
.addvoisin-container input[type="submit"]:active,
.containerrecherche input[type="submit"]:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #B98A1F;
}

/* SUGGESTIONS VILLE ET VOISIN */
.ville-group, .activite-group {
    position: relative;
    width: 100%;
}

#Ville, #Activite, #Voisin {
    cursor: pointer;
}

#suggestions, #suggestionsa, .suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #FFFDF5;
    border: 2px solid #1E4A63;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin: 0;
    padding: 0;
    box-shadow: 0 8px 16px rgba(20, 25, 35, 0.25);
}

#suggestions ul, #suggestionsa ul, .suggestions ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#suggestions li, #suggestionsa li, .suggestions li {
    padding: 12px 15px;
    color: #14324A;
    cursor: pointer;
    border-bottom: 1px solid rgba(30, 74, 99, 0.15);
    transition: all 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#suggestions li:hover, #suggestionsa li:hover, .suggestions li:hover {
    background: rgba(244, 208, 63, 0.3);
    color: #3E2A14;
    padding-left: 20px;
}

#suggestions li:last-child, #suggestionsa li:last-child, .suggestions li:last-child {
    border-bottom: none;
}

/* AVATAR DANS SUGGESTIONS */
.suggestions .avatarr {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1E4A63;
}

/* PLUME - DEPOSE : médaillon crème cerclé de brun */
#introScreen {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90px;
    height: 90px;
    background: #FBF3D8;
    border: 3px solid #5C3A1E;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 6px 0 rgba(20, 25, 35, 0.30), 0 10px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: fadeInIntro 1s ease forwards;
    cursor: pointer;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.2s ease;
}

#introScreen:hover {
    transform: translate(-50%, -50%) scale(1.08) !important;
}

#enterButton {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

/* LOUPE - RECHERCHE */
#loupe-container {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90px;
    height: 90px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeInIntro 1s ease forwards;
    cursor: pointer;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.2s ease;
}

#loupe-container:hover {
    transform: translate(-50%, -50%) scale(1.08) !important;
}

.loupe-circle {
    width: 90px;
    height: 90px;
    background: #FBF3D8;
    border: 3px solid #5C3A1E;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 0 rgba(20, 25, 35, 0.30), 0 10px 20px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

#image-loupe {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

/* PLUME - ADDVIGNETTE */
#introAddVignette {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90px;
    height: 90px;
    background: #FBF3D8;
    border: 3px solid #5C3A1E;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 6px 0 rgba(20, 25, 35, 0.30), 0 10px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: fadeInIntro 1s ease forwards;
    cursor: pointer;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform 0.2s ease;
}

#introAddVignette:hover {
    transform: translate(-50%, -50%) scale(1.08) !important;
}

#enterButtonAdd {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

@keyframes fadeInIntro {
    to { opacity: 1; }
}

/* Messages d'erreur */
.error-message {
    color: #A93226;
    font-weight: bold;
    margin: 20px 0;
    padding: 15px;
    background: rgba(231, 76, 60, 0.12);
    border-radius: 8px;
    border-left: 4px solid #C0392B;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

/* Sur les sections vignettées, l'erreur hors carte doit rester lisible */
.containerrecherche .error-message {
    background: #FBF3D8;
    border: 2px solid #C0392B;
    border-left: 6px solid #C0392B;
    max-width: 450px;
    margin: 20px auto;
    box-shadow: 0 6px 15px rgba(20, 25, 35, 0.3);
}

/* BOUTON MARCHÉ / MES VOISINS */
.btn-marche {
    display: inline-block;
    background: linear-gradient(180deg, #FFE066 0%, #F4C531 100%);
    color: #3E2A14;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 2px solid #5C3A1E;
    box-shadow: 0 4px 0 #B98A1F;
    margin-top: 20px;
}

.btn-marche:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #B98A1F, 0 10px 18px rgba(244, 208, 63, 0.45);
}

/* MOBILE */
@media (max-width: 480px) {
    .depose-fond {
        background-image: url('rech.png');
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 100vh;
        touch-action: auto;
        overflow-x: hidden;
    }

    .bodyrecherche {
        background-image: url('rechpost.png');
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 100vh;
        touch-action: auto;
        overflow-x: hidden;
    }

    .addvignette-fond {
        background-image: url('rech.png');
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 100vh;
        touch-action: auto;
        overflow-x: hidden;
    }

    .addvoisin-fond {
        background-image: url('afficheMV1.png');
        background-size: cover;
        background-position: center;
        background-attachment: fixed;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 100vh;
        touch-action: auto;
        overflow-x: hidden;
    }

    .depose-container, .containerrecherche table, .addvignette-container, .addvoisin-container {
        width: 100%;
        max-width: 350px;
        padding: 25px 20px;
    }

    .depose-container h1, .containerrecherche h2, .addvignette-container h1, .addvoisin-container h1 {
        font-size: 26px;
    }

    .depose-container input[type="text"],
    .depose-container input[type="date"],
    .depose-container textarea,
    .addvignette-container input[type="text"],
    .addvignette-container input[type="file"],
    .addvoisin-container input[type="text"],
    .containerrecherche input[type="text"] {
        padding: 10px 12px;
        font-size: 15px;
    }

    .form-group label.td1, .containerrecherche .td1 {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .checkbox-row label.td1 {
        font-size: 13px;
        margin-bottom: 0;
    }

    .top-banner {
        padding: 15px 0;
    }

    .h1inscri {
        font-size: 20px;
    }
}

/* Accessibilité : moins d'animations si demandé par le système */
@media (prefers-reduced-motion: reduce) {
    .depose-form-section.visible,
    .containerrecherche[style*="block"],
    .addvignette-form-section.visible {
        animation: none;
    }
    #introScreen, #loupe-container, #introAddVignette {
        animation-duration: 0.01s;
        transition: none;
    }
}
