/* ==========================================================================
   JlP Elec - Feuille de style
   Projet de formation Développeur Web Front-End
   --------------------------------------------------------------------------
   Sommaire :
     1. Variables (couleurs, polices)
     2. Réinitialisation (reset) et styles de base
     3. Barre de défilement (scrollbar) personnalisée
     4. En-tête (header) et navigation + menu burger
     5. Bandeau cookies
     6. Sections communes (titres, boutons, cartes)
     7. Section "héros" avec effet parallaxe
     8. Pages Travaux / Dépannage (grilles de services)
     9. Page Rendez-vous (formulaire)
     10. Modale (mot de passe oublié)
     11. Pied de page (footer)
     12. Animations
     13. Responsive (point de rupture mobile / desktop)
   ========================================================================== */


/* ==========================================================================
   1. VARIABLES
   ========================================================================== */
:root {
     /* Polices : Couleurs */
    --noir:        #0d0d0d;   /* fond principal */
    --noir-clair:  #1a1a1a;   /* fond des cartes */
    --or:          #c9a24b;   /* couleur dorée principale */
    --or-clair:    #e6c878;   /* or plus clair pour les survols (hover) */
    --blanc:       #f5f5f5;   /* texte clair */
    --gris:        #9a9a9a;   /* texte secondaire */

    /* Polices : une pour les titres et une pour le texte */
    --police-titre: 'Playfair Display', Georgia, serif;
    --police-texte: 'Poppins', Arial, sans-serif;
}


/* ==========================================================================
   2. RÉINITIALISATION ET STYLES DE BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; 
}

html {
    scroll-behavior: smooth; /* JC */ /*défilement doux quand on clique sur une ancre */
}

body {
    font-family: var(--police-texte);
    background-color: var(--noir);
    color: var(--blanc);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none; /* on enlève les puces des listes */
}

img {
    max-width: 100%;
    display: block;
}


/* ==========================================================================
   3. BARRE DE DÉFILEMENT 
   ========================================================================== */
::-webkit-scrollbar {  /* JC */
    width: 12px;
}

::-webkit-scrollbar-track { /* JC */
    background: var(--noir-clair); /* le "rail" de la scrollbar */
}

::-webkit-scrollbar-thumb { /* JC */
    background: var(--or);          /* la partie que l'on déplace */
    border-radius: 10px;
    border: 3px solid var(--noir-clair);
}

::-webkit-scrollbar-thumb:hover { /* JC */
    background: var(--or-clair);
}


/* ==========================================================================
   4. EN-TÊTE (HEADER) ET NAVIGATION
   ========================================================================== */
.header {
    position: sticky; /* JC */
    top: 0;
    z-index: 1000; /* passe au-dessus du reste du contenu */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: rgba(13, 13, 13, 0.95); 
    border-bottom: 1px solid var(--or);
}

/* Le logo */
.logo {
    font-family: var(--police-titre);
    font-size: 1.8rem;
    color: var(--or);
    letter-spacing: 2px;
}

.logo span {
    color: var(--blanc);
}

/* La liste des liens de navigation */
.nav-liens {
    display: flex;
    gap: 30px;
}

.nav-liens a {
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s;
}

.nav-liens a:hover {
    color: var(--or); /* Variable par JC */
}

/* Petit trait doré qui apparaît sous le lien au survol */
.nav-liens a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0;
    height: 2px;
    background-color: var(--or);
    transition: width 0.3s;
}

.nav-liens a:hover::after,
.nav-liens a.actif::after {
    width: 100%; /* le trait se déploie sur toute la largeur */
}

.nav-liens a.actif {
    color: var(--or); /* lien de la page en cours mis en avant */
}

/* Le bouton burger : caché sur desktop, affiché sur mobile */
.burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

/* Les 3 barres du burger */
.burger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--or);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Animation du burger en croix (X) quand le menu est ouvert */
.burger.ouvert span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.burger.ouvert span:nth-child(2) {
    opacity: 0; /* la barre du milieu disparaît */
}
.burger.ouvert span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}


/* ==========================================================================
   5. BANDEAU COOKIES
   ========================================================================== */
.cookies {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    padding: 18px 40px;
    background-color: var(--noir-clair);
    border-top: 2px solid var(--or);
}

.cookies p {
    color: var(--gris);
    font-size: 0.9rem;
    max-width: 70%;
}

.cookies-boutons {
    display: flex;
    gap: 10px;
}

/* Classe utilitaire pour cacher un élément (cookies, modale...) */
.cache { /* JC */
    display: none !important;
}


/* ==========================================================================
   6. SECTIONS COMMUNES (titres, boutons, cartes)
   ========================================================================== */
.section {
    padding: 80px 40px;
    max-width: 1200px;
    margin: 0 auto; /* centre la section horizontalement */
}

/* Titre de section */
.titre-section {
    font-family: var(--police-titre);
    font-size: 2.4rem;
    text-align: center;
    margin-bottom: 15px;
    /*color: var(--blanc);*/
    color: var(--or);
}

.titre-section span {
    /*color: var(--or);*/
    color: var(--blanc);

}

.sous-titre {
    text-align: center;
    color: var(--gris);
    margin-bottom: 50px;
}

/* Bouton principal */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--or);
    color: var(--noir);
    font-weight: 600;
    border: 2px solid var(--or);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--police-texte);
    font-size: 1rem;
}

.btn:hover {
    background-color: transparent;
    color: var(--or);
}

/* Bouton secondaire */
.btn-secondaire {
    background-color: transparent;
    color: var(--or);
}

.btn-secondaire:hover {
    background-color: var(--or);
    color: var(--noir);
}


/* ==========================================================================
   7. SECTION AVEC EFFET
   ========================================================================== */
.historique {
    /*height: 90vh; /* 90% de la hauteur de l'écran */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    background-image:linear-gradient(rgba(13, 13, 13, 0.6), rgba(13, 13, 13, 0.8)),url('../images/04_travaux-tableau.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; 
}

.historique h1 {
    font-family: var(--or);
    /*font-family: var(--police-titre);*/
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--or);
    /*color: var(--blanc);*/
}

.historique h1 span {
    color: var(--police-titre);
    color: var(--blanc);
    /*color: var(--or);*/
}

.historique p {
    font-size: 1.2rem;
    color: var(--gris);
    max-width: 600px;
    margin-bottom: 30px;
}


/* ==========================================================================
   8. GRILLES DE SERVICES 
   ========================================================================== */
.grille-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* Une carte */
.carte {
    background-color: var(--noir-clair);
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden; 
    transition: transform 0.3s, border-color 0.3s;
}

.carte:hover {
    transform: translateY(-8px); /* JC  la carte se soulève au survol */
    border-color: var(--or);
}

/* Conteneur de l'image */
.carte-image {
    overflow: hidden;
    height: 220px;
}

.carte-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s; /* transition douce pour le zoom */
}

/* Zoom sur l'image quand on survole la carte */
.carte:hover .carte-image img {
    transform: scale(1.1);
}

.carte-contenu {
    padding: 25px;
}

.carte-contenu h3 {
    font-family: var(--police-titre);
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--or);
}

.carte-contenu p {
    color: var(--gris);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

/* Le prix de la prestation */
.prix {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--blanc);
}


/* ==========================================================================
   9. PAGE RENDEZ-VOUS 
   ========================================================================== */
.formulaire-bloc {
    max-width: 550px;
    margin: 0 auto;
    background-color: var(--noir-clair);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
}

/* Un groupe = une étiquette (label) + un champ (input) */
.champ {
    margin-bottom: 22px;
}

.champ label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--blanc);
}

.champ input,
.champ select,
.champ textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--noir);
    border: 1px solid #333;
    border-radius: 4px;
    color: var(--blanc);
    font-family: var(--police-texte);
    font-size: 1rem;
    transition: border-color 0.3s;
}

/* Champ mis en surbrillance quand on clique dedans (focus) */
.champ input:focus,
.champ select:focus,
.champ textarea:focus {
    outline: none;
    border-color: var(--or);
}

/* Message d'erreur affiché sous un champ */
.message-erreur {
    display: block;
    color: #e06666; 
    font-size: 0.85rem;
    margin-top: 6px;
    min-height: 18px; 
}

/* Bordure rouge quand le champ est invalide */
.champ input.invalide,
.champ select.invalide {
    border-color: #e06666;
}

/* Bordure verte quand un champ est valide */
.champ input.valide {
    border-color: #6aa84f;
}

/* Lien "mot de passe oublié" */
.lien-oubli {
    display: inline-block;
    margin-top: 8px;
    color: var(--or);
    font-size: 0.9rem;
    cursor: pointer;
}

.lien-oubli:hover {
    text-decoration: underline;
}

/* Message de confirmation après envoi réussi du formulaire */
.message-succes {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    background-color: rgba(106, 168, 79, 0.15);
    border: 1px solid #6aa84f;
    border-radius: 4px;
    color: #b6d7a8;
}


/* ==========================================================================
   10. MODALE (fenêtre "mot de passe oublié")
   ========================================================================== */
.modale {
    position: fixed;
    inset: 0; 
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.8); /* le voile sombre */
    padding: 20px;
    /* Animation * /* JC */
    animation: fondu 0.3s ease;
}

.modale-boite {
    background-color: var(--noir-clair);
    border: 1px solid var(--or);
    border-radius: 8px;
    padding: 35px;
    max-width: 420px;
    width: 100%;
    position: relative;
    /* Animation */
    animation: monte 0.4s ease; /* JC */
}

.modale-boite h3 {
    font-family: var(--police-titre);
    color: var(--or);
    margin-bottom: 10px;
}

.modale-boite p {
    color: var(--gris);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* La croix pour fermer la modale */
.fermer-modale {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.6rem;
    color: var(--gris);
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s;
}

.fermer-modale:hover {
    color: var(--or);
}


/* ==========================================================================
   11. PIED DE PAGE 
   ========================================================================== */
.footer {
    background-color: var(--noir-clair);
    border-top: 1px solid var(--or);
    padding: 50px 40px 20px;
}

.footer-contenu {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-colonne h4 {
    font-family: var(--police-titre);
    color: var(--or);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-colonne p,
.footer-colonne li {
    color: var(--gris);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.footer-colonne a:hover {
    color: var(--or);
}

/* Les icônes de réseaux sociaux */
.reseaux {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.reseaux a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--or);
    border-radius: 50%;
    color: var(--or);
    font-size: 1.1rem;
    transition: all 0.3s;
}

.reseaux a:hover {
    background-color: var(--or);
    color: var(--noir);
    transform: translateY(-4px);
}

/* Bas du footer : copyright */
.footer-bas {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #2a2a2a;
    color: var(--gris);
    font-size: 0.85rem;
}


/* ==========================================================================
   12. ANIMATIONS 
   ========================================================================== */

/* Fondu simple */
@keyframes fondu {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Élément qui monte en apparaissant */
@keyframes monte {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* On applique une petite animation d'entrée aux sections */
.section,
.hero h1,
.hero p {
    animation: monte 0.8s ease;
}


/* ==========================================================================
   13. RESPONSIVE - POINT DE RUPTURE MOBILE
   ========================================================================== */
@media (max-width: 768px) {

    .header {
        padding: 15px 20px;
    }

    /* On affiche le bouton burger */
    .burger {
        display: flex;
    }

    /* Le menu devient un panneau vertical */
    .nav-liens {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        background-color: var(--noir-clair);
        border-left: 1px solid var(--or);
        transform: translateX(100%);
        transition: transform 0.4s ease;
    }

    .nav-liens.ouvert {
        transform: translateX(0);
    }

    .nav-liens a {
        font-size: 1.3rem;
    }

    .historique h1 {
        font-size: 2.3rem;
    }

    .historique p {
        font-size: 1rem;
    }

    .titre-section {
        font-size: 1.8rem;
    }

    .section {
        padding: 50px 20px;
    }

    .historique {
        background-attachment: scroll;
    }

    .cookies {
        flex-direction: column;
        text-align: center;
        padding: 18px 20px;
    }

    .cookies p {
        max-width: 100%;
    }

    .footer {
        padding: 40px 20px 20px;
    }
}
