/* =========================================================================
   ELVA — Feuille de style principale
   Palette de marque : bleu profond #13396b, bleu accent #6494cc
   ========================================================================= */

:root {
    /* Palette dérivée du bleu réel du logo (#184884), rendue plus vive et moderne */
    --blue-950: #06224a;   /* navy profond — fonds / fin de dégradé */
    --blue-900: #0a2c5c;   /* sections sombres */
    --blue-800: #184884;   /* BLEU DE MARQUE = couleur du logo */
    --blue-700: #1e5aa0;
    --blue-600: #2670d6;   /* bleu vif interactif (liens, hover, CTA) */
    --blue-500: #4e90e6;   /* bleu clair d'appoint */
    --blue-300: #9cc0f0;
    --blue-100: #e7f0fb;   /* teinte très claire */
    --blue-50:  #f4f8fd;

    --ink:      #16233a;
    --muted:    #51607a;
    --line:     #e2e8f2;
    --bg:       #ffffff;
    --bg-alt:   #f4f7fb;
    --white:    #ffffff;

    --radius:   14px;
    --radius-sm: 9px;
    --shadow:   0 12px 30px rgba(10, 44, 92, .14);
    --shadow-sm: 0 4px 14px rgba(10, 44, 92, .09);
    --container: 1180px;
    --header-h: 76px;

    --grad: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 60%, var(--blue-600) 100%);

    /* Polices modernes : Sora (titres, géométrique) + Inter (texte, lisible) */
    --font:      'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-head: 'Sora', 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }

body {
    margin: 0;
    font-family: var(--font);
    font-weight: 400;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 800; line-height: 1.12; letter-spacing: -.015em; color: var(--blue-900); margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
p  { margin: 0 0 1rem; }
img { max-width: 100%; display: block; height: auto; }
a  { color: var(--blue-800); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 1000;
    background: var(--blue-800); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ----------------------------------------------------------- Boutons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: var(--font); font-weight: 700; font-size: 1rem;
    padding: .9rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
    cursor: pointer; text-decoration: none; transition: .2s ease; white-space: nowrap;
}
.btn-primary { background: var(--blue-800); color: #fff; }
.btn-primary:hover { background: var(--blue-600); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(38,112,214,.35); }
.btn-outline { background: transparent; color: var(--blue-800); border-color: var(--blue-800); }
.btn-outline:hover { background: var(--blue-800); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: #fff; color: var(--blue-800); }
.btn-block { width: 100%; }

/* ----------------------------------------------------------- Header ----- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,.95);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 1rem; }
.brand { display: inline-flex; align-items: center; }
.brand img { width: 170px; height: auto; }

.primary-nav ul { list-style: none; display: flex; align-items: center; gap: .3rem; margin: 0; padding: 0; }
.primary-nav a {
    display: inline-block; padding: .6rem .9rem; text-decoration: none; color: var(--ink);
    font-weight: 600; font-size: .95rem; border-radius: 8px; text-transform: uppercase; letter-spacing: .02em;
}
.primary-nav a:hover { color: var(--blue-600); }
.nav-cta { background: var(--blue-800); color: #fff !important; border-radius: 999px; padding: .6rem 1.2rem !important; }
.nav-cta:hover { background: var(--blue-600); }
.nav-cta.is-active { background: var(--blue-600); }

.nav-toggle {
    display: none; width: 46px; height: 46px; background: transparent; border: 0; cursor: pointer;
    position: relative; border-radius: 8px;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    content: ""; position: absolute; left: 11px; width: 24px; height: 3px; border-radius: 3px;
    background: var(--blue-800); transition: .25s ease;
}
.nav-toggle-bar { top: 50%; transform: translateY(-50%); }
.nav-toggle-bar::before { top: -8px; }
.nav-toggle-bar::after  { top: 8px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after  { top: 0; transform: rotate(-45deg); }

/* ----------------------------------------------------------- Héro ------- */
.hero { position: relative; color: #fff; isolation: isolate; }
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: -2;
    background: url("../../media/autorf.jpeg") center/cover no-repeat;      /* repli */
    background-image: image-set(
        url("../../media/autorf.webp") type("image/webp"),
        url("../../media/autorf.jpeg") type("image/jpeg")
    );
    background-position: center; background-size: cover; background-repeat: no-repeat;
}
.hero-overlay {
    position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(120deg, rgba(6,34,74,.90) 0%, rgba(10,44,92,.62) 52%, rgba(38,112,214,.28) 100%);
}
.hero-content { padding: clamp(3rem, 8vw, 6rem) 1.25rem clamp(3rem, 6vw, 5rem); max-width: 960px; }
.hero-eyebrow {
    display: inline-block; text-transform: uppercase; letter-spacing: .12em; font-weight: 700;
    font-size: .8rem; background: rgba(255,255,255,.15); padding: .35rem .9rem; border-radius: 999px; margin-bottom: 1rem;
}
.hero h1 { color: #fff; text-shadow: 0 2px 16px rgba(0,0,0,.35); }
.hero-lead { font-size: 1.15rem; max-width: 42ch; margin-bottom: 1.5rem; color: rgba(255,255,255,.95); }

/* Carte mini-formulaire */
.quote-card {
    display: grid; gap: 1rem; background: rgba(255,255,255,.97); color: var(--ink);
    padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow);
    grid-template-columns: repeat(3, minmax(185px, 1fr)) auto; align-items: end;
}
.quote-card .field input { padding: .95rem 1rem; font-size: 1.02rem; }
.quote-card .btn { height: 54px; padding-inline: 1.7rem; }

.field { display: flex; flex-direction: column; gap: .35rem; text-align: left; }
.field label { font-size: .82rem; font-weight: 700; color: var(--blue-800); text-transform: uppercase; letter-spacing: .03em; }
.field input, .field select, .devis-form input, .devis-form select {
    font-family: var(--font); font-size: 1rem; padding: .8rem .9rem; border: 1px solid var(--line);
    border-radius: var(--radius-sm); background: #fff; color: var(--ink); width: 100%;
}
.field input:focus, .field select:focus, .devis-form input:focus, .devis-form select:focus {
    outline: 3px solid rgba(38,112,214,.35); border-color: var(--blue-600);
}

/* --- Autocomplétion de villes -------------------------------------------- */
.ac-field { position: relative; }
.ac-panel {
    position: absolute; top: calc(100% + 8px); left: 0; right: auto; z-index: 60;
    /* Indépendant de la largeur (étroite) du champ : au moins 300px, jusqu'à 430px */
    min-width: max(100%, 300px); width: max-content; max-width: min(430px, calc(100vw - 2rem));
    background: #fff; color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
    animation: ac-in .16s ease;
}
@keyframes ac-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.ac-list { list-style: none; margin: 0; padding: .35rem; max-height: 300px; overflow-y: auto; }
.ac-item {
    display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem;
    border-radius: 10px; cursor: pointer; line-height: 1.25;
    border-left: 3px solid transparent; transition: background .12s ease;
}
.ac-item:hover, .ac-item.is-active { background: var(--blue-50); border-left-color: var(--blue-600); }

.ac-icon {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 9px; background: var(--blue-100); color: var(--blue-600);
}
.ac-icon svg { width: 17px; height: 17px; fill: currentColor; }
.ac-icon--air { background: #eaf1fc; color: var(--blue-700); }

.ac-text { display: flex; flex-direction: column; min-width: 0; }
.ac-main { font-weight: 600; color: var(--ink); font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-text small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-mark { background: transparent; color: var(--blue-600); font-weight: 800; }

.ac-tag {
    flex: 0 0 auto; margin-left: auto; font-size: .68rem; font-weight: 700; letter-spacing: .03em;
    text-transform: uppercase; color: var(--blue-700); background: var(--blue-100);
    padding: .2rem .5rem; border-radius: 999px;
}

.ac-foot {
    display: flex; align-items: center; gap: .45rem; padding: .5rem .8rem;
    font-size: .72rem; color: var(--muted); border-top: 1px solid var(--line); background: var(--bg-alt);
}
.ac-foot-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-500); }

/* ----------------------------------------------------------- Stats ------ */
.stats { background: var(--blue-800); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 2.2rem 1.25rem; text-align: center; }
.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat-num { font-family: var(--font-head); font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 800; color: #fff; letter-spacing: -.01em; }
.stat-label { font-size: .9rem; color: rgba(255,255,255,.85); text-transform: uppercase; letter-spacing: .04em; }

/* ------------------------------------------------------ Présentation ---- */
.presentation { padding: clamp(3rem, 6vw, 5rem) 0; background: var(--bg); }
.presentation p { font-size: 1.08rem; color: var(--muted); max-width: 72ch; }

/* ----------------------------------------------------------- Services --- */
.services { padding: clamp(3rem, 6vw, 5rem) 0; background: var(--bg-alt); }
.services-intro { color: var(--muted); max-width: 60ch; margin-bottom: 2rem; }
.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.8rem; }
.service-card {
    background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
    display: flex; flex-direction: column; transition: .25s ease; border: 1px solid var(--line);
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.service-media-wrap { display: block; line-height: 0; }
.service-media { width: 100%; height: 215px; object-fit: cover; }
.service-body { padding: 1.4rem; display: flex; flex-direction: column; gap: .8rem; flex: 1; }
.service-body h3 { margin: 0; }
.service-body p { color: var(--muted); font-size: .97rem; margin: 0; flex: 1; }
.service-body .btn { align-self: flex-start; }

/* ----------------------------------------------------------- CTA band --- */
.cta-band { background: var(--grad); color: #fff; padding: clamp(2.5rem, 5vw, 4rem) 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: .4rem; }
.cta-band p { color: rgba(255,255,255,.9); margin: 0; }
.cta-actions { display: flex; gap: .8rem; flex-wrap: wrap; }

/* ----------------------------------------------------------- Devis ------ */
.devis-section { padding: clamp(2.5rem, 5vw, 4rem) 0; background: var(--bg-alt); }
.devis-layout { display: grid; grid-template-columns: 0.9fr 1.3fr; gap: 2.5rem; align-items: start; }
.devis-intro h1 { margin-bottom: 1rem; }
.devis-intro p { color: var(--muted); }
.devis-points { list-style: none; padding: 0; margin: 1.3rem 0; display: grid; gap: .6rem; }
.devis-points li { position: relative; padding-left: 1.8rem; font-weight: 600; color: var(--ink); }
.devis-points li::before {
    content: "✓"; position: absolute; left: 0; top: 0; width: 1.3rem; height: 1.3rem; line-height: 1.3rem;
    text-align: center; background: var(--blue-100); color: var(--blue-800); border-radius: 50%; font-size: .8rem; font-weight: 800;
}
.devis-call { font-weight: 600; }

.devis-form-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.4rem, 3vw, 2.2rem); }
.devis-form fieldset { border: 0; padding: 0; margin: 0 0 1.6rem; }
.devis-form legend { font-family: var(--font-head); font-weight: 800; color: var(--blue-800); font-size: 1.1rem; margin-bottom: 1rem; padding: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.devis-form .field { margin: 0; }

.checkbox { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-weight: 600; margin-top: .3rem; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--blue-800); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin: .2rem 0 1.2rem; min-height: 65px; }

.form-note { font-size: .82rem; color: var(--muted); margin-top: 1rem; }
.form-feedback { padding: 1rem 1.2rem; border-radius: var(--radius-sm); margin-bottom: 1.4rem; font-weight: 600; }
.form-feedback--success { background: #e6f6ec; color: #1c7a43; border: 1px solid #b7e4c7; }
.form-feedback--error   { background: #fdecec; color: #b42318; border: 1px solid #f6c7c3; }

/* ----------------------------------------------------------- Footer ----- */
.site-footer { background: var(--blue-900); color: rgba(255,255,255,.85); padding: 3rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer h2 { color: #fff; font-size: 1.05rem; margin-bottom: .9rem; }
.footer-brand img { background: #fff; padding: .5rem .7rem; border-radius: 8px; margin-bottom: 1rem; }
.footer-brand p { color: rgba(255,255,255,.7); font-size: .95rem; }
.site-footer address { font-style: normal; line-height: 1.8; color: rgba(255,255,255,.8); }
.footer-contact, .footer-legal { list-style: none; padding: 0; margin: 0; line-height: 2; }
.site-footer a { color: var(--blue-500); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
    border-top: 1px solid rgba(255,255,255,.15); margin-top: 2.5rem; padding-top: 1.3rem;
    font-size: .85rem; color: rgba(255,255,255,.6);
}
.footer-bottom p { margin: 0; }

/* ------------------------------------------------------- Back to top ---- */
.back-to-top {
    position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 90;
    width: 46px; height: 46px; border-radius: 50%; background: var(--blue-800); color: #fff;
    display: none; align-items: center; justify-content: center; text-decoration: none;
    font-size: 1.4rem; box-shadow: var(--shadow); transition: .2s ease;
}
.back-to-top:hover { background: var(--blue-600); }
.back-to-top.is-visible { display: inline-flex; }

/* ========================================================= Responsive === */
@media (max-width: 960px) {
    .devis-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .quote-card { grid-template-columns: 1fr 1fr; }
    .quote-card .btn { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .nav-toggle { display: inline-block; }
    .primary-nav {
        position: absolute; top: var(--header-h); left: 0; right: 0;
        background: #fff; border-bottom: 1px solid var(--line);
        max-height: 0; overflow: hidden; transition: max-height .3s ease; box-shadow: var(--shadow-sm);
    }
    .primary-nav.is-open { max-height: 70vh; }
    .primary-nav ul { flex-direction: column; align-items: stretch; padding: .6rem 1.25rem 1.2rem; gap: .2rem; }
    .primary-nav a { padding: .9rem .6rem; border-radius: 8px; }
    .nav-cta { text-align: center; margin-top: .4rem; }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 1.4rem; }
    .cta-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
    .quote-card { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .service-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; animation: none !important; }
}
