/* ==========================================================================
   Table des matières
   ==========================================================================
   1. Variables et Palette de couleurs
   2. Styles de base et Utilitaires
   3. Header (Refactorisé et Unifié)
   4. Sections de la page
      - Hero
      - Sections de contenu (Why, Advantages, How-it-works)
      - Formulaire de contact
      - Section "À propos"
   5. Composants
      - Boutons
      - Badges
      - CTA Sticky Mobile & Flottant
   6. Footer
   7. Animations & Keyframes
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/* 1. Variables et Palette de couleurs                                        */
/* -------------------------------------------------------------------------- */
:root {
    /* Palette */
    --primary-color: #2c3e50;
    --secondary-color: #4a4a4a;
    --accent-color: #336699; /* Accent bleu */
    --accent-color-alt: #7ab430; /* Accent vert */
    --text-color: #222;
    --text-light: #555;
    --bg-light: #f9f9f9;
    --bg-white: #fff;
    --border-color: #e0e0e0;
    --warning-color: #ffb300;

    /* Typographie */
    --font-family: 'Montserrat', sans-serif;
    --font-family-header: 'Inter', 'Montserrat', Arial, sans-serif;

    /* Ombres */
    --box-shadow-sm: 0 2px 8px rgba(44, 62, 80, 0.04);
    --box-shadow-md: 0 6px 24px rgba(44, 62, 80, 0.13);

    /* Header */
    --header-height: 72px;
    --header-bg: rgba(255, 255, 255, 0.92);
    --header-text: #333;
    --header-max-width: 1280px;
    --nav-link-size: 15px;
    --nav-link-weight: 600;
    --nav-link-hover: #111;

    /* CTA */
    --cta-bg: #111;
    --cta-color: #fff;
    --cta-hover-bg: #222;

    /* Z-Index */
    --z-header: 1000;
    --z-overlay: 1100;
    --z-cta-floating: 1200;
}

/* -------------------------------------------------------------------------- */
/* 2. Styles de base et Utilitaires                                           */
/* -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
}

.container {
    max-width: 1100px;
    margin-inline: auto;
    padding-inline: 24px;
}

h1, h2, h3 {
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

h2 {
    font-size: clamp(2.1rem, 5vw, 2.4rem);
    text-align: center;
    margin-bottom: 2.2rem;
    letter-spacing: -0.5px;
}

section {
    padding-block: 72px 64px;
    background: var(--bg-white);
}

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

.hidden {
    display: none;
}

/* -------------------------------------------------------------------------- */
/* 3. Header (Refactorisé et Unifié)                                          */
/* -------------------------------------------------------------------------- */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: var(--header-bg);
    min-height: var(--header-height);
    box-shadow: 0 2px 12px rgba(44, 62, 80, 0.07);
    border-bottom: 1.5px solid var(--border-color);
    transition: box-shadow 0.2s, background 0.2s;
}

/* Effet de flou sur les navigateurs compatibles */
@supports (backdrop-filter: blur(4px)) {
    .header {
        backdrop-filter: blur(4px);
    }
}

.header.scrolled {
    box-shadow: var(--box-shadow-md);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: var(--header-max-width);
    min-height: var(--header-height);
    margin-inline: auto;
    /* --- MODIFICATION DEMANDÉE : Espacement réduit pour rapprocher des bords --- */
    padding-inline: 24px;
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
}

.header-logo-text {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.header-nav {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.header-nav a {
    color: var(--header-text);
    text-decoration: none;
    font-family: var(--font-family-header);
    font-size: var(--nav-link-size);
    font-weight: var(--nav-link-weight);
    letter-spacing: 0.01em;
    padding: 4px 0;
    position: relative;
    transition: color 0.18s;
}

.header-nav a.active,
.header-nav a:hover {
    color: var(--nav-link-hover);
}

.header-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--nav-link-hover);
    transition: width 0.22s cubic-bezier(.4, 1.6, .6, 1);
}

.header-nav a:hover::after,
.header-nav a.active::after {
    width: 100%;
}

.header-cta-btn {
    flex-shrink: 0;
    display: inline-block;
    background: var(--cta-bg);
    color: var(--cta-color);
    border-radius: 4px;
    padding: 12px 22px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    border: none;
    box-shadow: var(--box-shadow-sm);
    cursor: pointer;
    transition: background 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s;
    position: relative;
    overflow: hidden;
}

/* Effet de brillance au survol */
.header-cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.18) 100%);
    transform: skewX(-18deg);
    transition: left 0.35s cubic-bezier(.4, 1.6, .6, 1);
    opacity: 0.7;
}

.header-cta-btn:hover,
.header-cta-btn:focus-visible {
    background: var(--accent-color-alt);
    color: #fff;
    transform: translateY(-2px) scale(1.03);
    box-shadow: var(--box-shadow-md);
}

.header-cta-btn:hover::before {
    left: 110%;
}

/* Menu Hamburger (mobile) */
.header-hamburger {
    display: none; /* Caché par défaut */
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: var(--z-overlay);
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
}

.header-hamburger span,
.header-hamburger span::before,
.header-hamburger span::after {
    display: block;
    background: var(--header-text);
    height: 3px;
    width: 28px;
    position: relative;
    transition: all 0.25s;
}

.header-hamburger span::before,
.header-hamburger span::after {
    content: '';
    position: absolute;
    left: 0;
}

.header-hamburger span::before { top: -9px; }
.header-hamburger span::after { top: 9px; }

/* Animation du hamburger en croix */
.header-hamburger.open span { background: transparent; }
.header-hamburger.open span::before { transform: rotate(45deg); top: 0; }
.header-hamburger.open span::after { transform: rotate(-45deg); top: 0; }

/* Overlay de navigation mobile */
.header-overlay {
    display: none;
    position: fixed;
    z-index: var(--z-header); /* Inférieur au hamburger */
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.92); /* Légère transparence */
    overflow-y: auto;                   /* Permet le scroll */
    max-height: 100vh;                  /* Ne déborde jamais de l'écran */
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.header-overlay.open {
    display: flex;
    animation: fadeIn 0.2s;
}

.header-overlay .header-nav {
    flex-direction: column;
    gap: 36px;
}

.header-overlay .header-nav a {
    font-size: 1.25rem;
}

.header-overlay .header-cta-btn {
    margin-top: 36px;
    width: 90vw;
    max-width: 340px;
    text-align: center;
    font-size: 1.08rem;
    padding-block: 15px;
}

.header-overlay .close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: none;
    font-size: 2.2rem;
    color: var(--header-text);
    cursor: pointer;
    z-index: 2;
    padding: 4px 10px;
    line-height: 1;
    transition: color 0.18s;
}
.header-overlay .close-btn:hover,
.header-overlay .close-btn:focus {
    color: var(--accent-color);
    outline: none;
}

/* Responsive du Header */
@media (max-width: 900px) {
    .header-nav { display: none; }
    .header-hamburger { display: flex; }
    .header-container .header-cta-btn { display: none; }
    .header-overlay .header-nav { display: flex; }
    .header-container { padding-inline: 16px; }
}

@media (max-width: 500px) {
    .header-logo { height: 36px; }
    .header-container { padding-inline: 8px; }
    .header-logo-text {
        height: 24px;
    }
}


/* -------------------------------------------------------------------------- */
/* 4. Sections de la page                                                     */
/* -------------------------------------------------------------------------- */

/* --- Hero Section --- */
.hero {
    position: relative;
    color: var(--bg-white);
    padding-block: 80px;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin-inline: auto;
}

.hero-title {
    font-size: clamp(2.3rem, 7vw, 3.1rem);
    margin-bottom: 1.1rem;
    color: var(--bg-white);
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.15rem;
    margin-bottom: 2.2rem;
    color: #eaeaea;
    opacity: 0.92;
}

/* --- Section Contenu Générique --- */
.why-protect {
    text-align: center;
    border-block: 1px solid var(--border-color);
}

.why-protect p {
    max-width: 700px;
    margin: 0 auto 2.2rem auto;
    color: var(--text-light);
}

/* --- Section Avantages --- */
.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.advantage-card {
    padding: 32px 28px;
    background: var(--bg-light);
    border-radius: 4px;
    box-shadow: var(--box-shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.advantage-card:hover {
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.08);
    border-color: var(--accent-color);
}

.advantage-card .icon-container {
    font-size: 2.1rem;
    color: var(--accent-color);
    margin-bottom: 0.7rem;
    filter: grayscale(1) opacity(0.7);
}

.advantage-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.18rem;
}

.advantage-card p {
    color: var(--text-light);
    font-size: 1.01rem;
}

/* --- Section "Comment ça marche" --- */
.how-it-works {
    background: var(--bg-light);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    text-align: center;
    margin-bottom: 3rem;
}

.step {
    position: relative;
    background: var(--bg-white);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-sm);
    padding: 24px 18px 18px 18px;
}

.step-number {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.08);
}

.step img {
    border-radius: 4px;
    margin-bottom: 1rem;
    filter: grayscale(0.3) contrast(1.05);
    width: 300px;
    height: 200px;
    object-fit: cover;
    margin-inline: auto;
}

/* --- Section Formulaire --- */
.form-container {
    background: #fafafa;
    border: 1.5px solid var(--border-color);
    box-shadow: 0 4px 24px rgba(44, 62, 80, 0.07), 0 1.5px 6px rgba(44, 62, 80, 0.04);
    border-radius: 4px;
    max-width: 800px;
    margin: 48px auto 0;
    padding: 40px 24px;
}

.form-subtitle {
    color: #333;
    font-size: 1.13rem;
    margin-bottom: 28px;
    text-align: center;
    font-weight: 500;
}

#contact-form {
    max-width: 700px;
    margin-inline: auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px 32px;
    }
}

.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 1.01rem;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 15px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 1rem;
    background: var(--bg-white);
    transition: border-color 0.2s, background 0.2s;
    outline: none;
}

.form-field input:focus,
.form-field textarea:focus {
    border-color: var(--primary-color);
}

.form-submit-btn {
    width: 100%;
    padding: 18px 0;
    font-size: 1.13rem;
    background: #1a2a3a;
    font-weight: 700;
    letter-spacing: 0.2px;
    margin-top: 24px;
}

.confidentialite {
    font-size: 0.99rem;
    color: #888;
    margin-top: 18px;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-feedback {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    font-weight: 600;
    display: none;
}

.form-feedback.success { display: block; background: #eaf6ef; color: #1a4d2e; border: 1.5px solid #b7e0c2; }
.form-feedback.error { display: block; background: #f8eaea; color: #a94442; border: 1.5px solid #e0b7b7; }


/* -------------------------------------------------------------------------- */
/* 5. Composants                                                              */
/* -------------------------------------------------------------------------- */

/* --- Boutons --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: var(--accent-color-alt);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(140, 198, 63, 0.4);
}

/* --- Badges --- */
.badge-reparation-wrapper {
    display: flex;
    justify-content: center;
    margin: 24px 0 18px;
}
.badge-reparation {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(90deg, #ffe082 0%, var(--warning-color) 100%);
    color: var(--primary-color);
    font-size: 1.18rem;
    font-weight: 700;
    border-radius: 8px;
    padding: 14px 32px 14px 22px;
    box-shadow: 0 4px 24px rgba(255, 179, 0, 0.13), 0 1.5px 6px rgba(44, 62, 80, 0.04);
    border: 1.5px solid #ffd54f;
    transition: box-shadow 0.18s, transform 0.18s;
    text-decoration: none;
}
.badge-reparation .badge-icon {
    font-size: 1.5em;
    filter: drop-shadow(0 2px 4px rgba(255, 179, 0, 0.18));
}
.badge-reparation:hover, .badge-reparation:focus-visible {
    box-shadow: 0 8px 32px rgba(255, 179, 0, 0.22), 0 2px 8px rgba(44, 62, 80, 0.08);
    transform: translateY(-2px) scale(1.04);
    outline: none;
}

/* --- CTA Sticky Mobile --- */
.cta-mobile-sticky {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-header);
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.10);
    border-radius: 4px;
    background: var(--primary-color);
    color: var(--bg-white);
    font-weight: 700;
    font-size: 1.08rem;
    padding-block: 14px;
    width: 90vw;
    max-width: 400px;
    text-align: center;
    border: none;
    transition: background 0.18s;
    -webkit-tap-highlight-color: transparent; /* Empêche le flash sur mobile */
}

.cta-mobile-sticky:hover {
    background: #22313a;
}

@media (min-width: 768px) {
    .cta-mobile-sticky {
        display: none;
    }
}

/* --- CTA Flottant Desktop --- */
.cta-floating {
    display: none; /* Désactivé par défaut, activé sur grand écran */
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: var(--z-cta-floating);
    background: var(--accent-color-alt);
    color: #fff;
    font-weight: 700;
    font-size: 1.13rem;
    padding: 18px 32px;
    border-radius: 50px;
    box-shadow: 0 4px 24px rgba(44, 62, 80, 0.18);
    transition: background 0.18s, transform 0.18s;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.cta-floating:hover {
    background: #22313a;
    transform: translateY(-2px) scale(1.04);
}
@media (min-width: 768px) {
    .cta-floating {
        display: flex;
    }
}
@media (max-width: 767px) {
    .cta-floating {
        display: none !important;
    }
}


/* -------------------------------------------------------------------------- */
/* 6. Footer                                                                  */
/* -------------------------------------------------------------------------- */
footer {
    background: var(--primary-color);
    color: #eaeaea;
    padding: 48px 0 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    text-align: center;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .footer-content {
        text-align: left;
    }
}

.footer-logo {
    filter: grayscale(1) brightness(0.7) contrast(1.1);
    margin: 0 auto 10px;
    height: 38px;
    max-width: 100px;
}

@media (min-width: 768px) {
    .footer-logo {
        margin-inline-start: 0;
    }
}

footer a {
    color: #eaeaea;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--accent-color-alt);
}

.footer-social a {
    margin-inline: 10px;
    font-size: 1.05rem;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 18px;
    text-align: center;
    font-size: 0.97rem;
    color: #bfc9d1;
}

.footer-bottom a {
    margin-left: 15px;
}

/* -------------------------------------------------------------------------- */
/* 7. Animations & Keyframes                                                  */
/* -------------------------------------------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- À propos : Alternance texte/image --- */
.about-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  margin: 0 auto;
  max-width: 1100px;
}
.about-row.reverse {
  flex-direction: row-reverse;
}
.about-col {
  flex: 1 1 0;
  min-width: 0;
}
.about-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 1.08rem;
  padding: 0 10px;
}
.about-img {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}
.about-img img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(44,62,80,0.10);
}
@media (max-width: 900px) {
  .about-row {
    flex-direction: column;
    gap: 28px;
    text-align: center;
  }
  .about-row.reverse {
    flex-direction: column;
  }
  .about-content, .about-img {
    padding: 0;
  }
}