/* ==========================================================
   2SERH — feuille de style du site public
   Palette tirée du logo : bleu #1574A0, orange #F5843E
   ========================================================== */

:root {
  --blue: #1574A0;
  --blue-d: #0E5677;
  --orange: #F5843E;
  --orange-d: #E3722D;
  --navy: #0B2E42;
  --wa: #25D366;

  --bg: #FFFFFF;
  --bg-soft: #EEF5F9;
  --surface: #FFFFFF;
  --ink: #13232E;
  --heading: #0B2E42;
  --muted: #5B6B76;
  --line: #E3EAEF;
  --accent: var(--blue);
  --ic-bg: #EEF5F9;
  --ic-bg-o: #FEF0E6;
  --header-bg: rgba(255, 255, 255, .92);
  --shadow: 0 20px 40px -15px rgba(21, 116, 160, .25);
  --shadow-lg: 0 30px 60px -20px rgba(11, 46, 66, .35);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #07161F;
  --bg-soft: #0B202D;
  --surface: #0F2836;
  --ink: #DCE8EF;
  --heading: #F2F7FA;
  --muted: #94AAB7;
  --line: #1C3747;
  --accent: #5DB4E0;
  --ic-bg: rgba(93, 180, 224, .12);
  --ic-bg-o: rgba(245, 132, 62, .14);
  --header-bg: rgba(7, 22, 31, .88);
  --shadow: 0 20px 40px -15px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* Sans JavaScript : suit la préférence du système */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #07161F; --bg-soft: #0B202D; --surface: #0F2836; --ink: #DCE8EF; --heading: #F2F7FA;
    --muted: #94AAB7; --line: #1C3747; --accent: #5DB4E0; --ic-bg: rgba(93,180,224,.12);
    --ic-bg-o: rgba(245,132,62,.14); --header-bg: rgba(7,22,31,.88); color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
  transition: background-color .3s, color .3s;
}
h1, h2, h3, h4 { font-family: Montserrat, system-ui, sans-serif; color: var(--heading); line-height: 1.2; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg.lucide { width: 1.15em; height: 1.15em; flex: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--orange); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 10px; font-weight: 600; font-size: 15px;
  transition: background-color .2s, color .2s, transform .2s, box-shadow .2s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-o { background: var(--orange); color: #fff; }
.btn-o:hover { background: var(--orange-d); box-shadow: 0 10px 24px -10px rgba(245, 132, 62, .7); }
.btn-b { border: 1.5px solid var(--accent); color: var(--accent); }
.btn-b:hover { background: var(--accent); color: #fff; }
.btn-wa { background: var(--wa); color: #06361A; }
.btn-wa:hover { background: #1FBE5A; }
.icon-btn { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line); transition: .2s; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Barre supérieure */
.topbar { background: var(--navy); color: #CFE0EA; font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 8px; padding-bottom: 8px; }
.topbar-l, .topbar-r { display: flex; gap: 22px; flex-wrap: wrap; }
.topbar a, .topbar span { display: inline-flex; align-items: center; gap: 6px; }
.topbar a:hover { color: #fff; }
.topbar svg { color: var(--orange); width: 14px; height: 14px; }

/* En-tête */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); transition: box-shadow .3s; }
.site-header.scrolled { box-shadow: 0 8px 30px -12px rgba(0, 0, 0, .18); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 78px; gap: 20px; }
.brand img { height: 50px; width: auto; }
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
.main-nav { display: flex; gap: 28px; font-weight: 500; font-size: 15px; }
.main-nav a { position: relative; padding: 6px 0; }
.main-nav a:not(.btn)::after { content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 2px; background: var(--orange); transition: width .25s; }
.main-nav a:not(.btn):hover, .main-nav a.active { color: var(--accent); }
.main-nav a:not(.btn):hover::after, .main-nav a.active::after { width: 100%; }
.nav-cta-mobile { display: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }
.burger { display: none; }
.burger .i-close { display: none; }
.burger[aria-expanded="true"] .i-open { display: none; }
.burger[aria-expanded="true"] .i-close { display: block; }

/* Hero */
.hero { background: linear-gradient(180deg, var(--bg-soft), var(--bg)); padding: 80px 0 90px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 60px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); padding: 6px 14px 6px 6px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--accent); }
.eyebrow b { background: var(--orange); color: #fff; border-radius: 99px; padding: 2px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.hero h1 { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.12; margin: 22px 0; font-weight: 800; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: var(--orange); }
.lead { font-size: 18px; color: var(--muted); max-width: 540px; }
.ctas { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-img { position: relative; }
.hero-img img { width: 100%; height: 450px; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow-lg); }
.float { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; box-shadow: 0 15px 40px -10px rgba(0, 0, 0, .25); display: flex; gap: 12px; align-items: center; font-size: 14px; color: var(--muted); }
.float .ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--ic-bg); color: var(--accent); }
.float strong { display: block; font-family: Montserrat; font-size: 20px; color: var(--heading); line-height: 1.2; }
.f1 { left: -28px; bottom: 40px; animation: bob 6s ease-in-out infinite; }
.f2 { right: -18px; top: 30px; animation: bob 6s ease-in-out 3s infinite; }
.f2 .ic { background: var(--ic-bg-o); color: var(--orange); }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* Chiffres clés */
.stats { background: var(--blue); color: #fff; }
[data-theme="dark"] .stats { background: linear-gradient(90deg, #0E4C69, #125F84); }
.stats .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); padding-top: 40px; padding-bottom: 40px; }
.stats .wrap > div { text-align: center; padding: 6px 12px; border-right: 1px solid rgba(255, 255, 255, .2); }
.stats .wrap > div:last-child { border-right: 0; }
.stats strong { font-family: Montserrat; font-size: 38px; display: block; line-height: 1.2; }
.stats span { opacity: .85; font-size: 14px; }

/* Sections */
section { padding: 100px 0; }
.kicker { display: inline-block; color: var(--orange); font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: 13px; }
section h2 { font-size: clamp(28px, 3.4vw, 38px); margin: 10px 0 16px; }
.head { text-align: center; max-width: 700px; margin: 0 auto 56px; }
.checks { list-style: none; margin: 24px 0 32px; display: grid; gap: 12px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.checks svg { color: var(--orange); width: 22px; height: 22px; margin-top: 1px; }

/* À propos */
.about .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; }
.about-img img { width: 100%; height: 480px; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow-lg); }
.about p + p { margin-top: 14px; }

/* Expertises */
.services { background: var(--bg-soft); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { border: 1px solid var(--line); border-radius: 16px; padding: 32px; background: var(--surface); transition: transform .25s, box-shadow .25s, border-color .25s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.card .ic, .modal-body .ic { width: 56px; height: 56px; border-radius: 14px; background: var(--ic-bg); color: var(--accent); display: grid; place-items: center; margin-bottom: 22px; transition: .25s; }
.card .ic svg, .modal-body .ic svg { width: 26px; height: 26px; }
.card:hover .ic { background: var(--blue); color: #fff; }
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 15px; flex: 1; }
.card .more { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; color: var(--orange); font-weight: 600; font-size: 14px; align-self: flex-start; }
.card .more svg { width: 16px; transition: transform .2s; }
.card .more:hover svg { transform: translateX(4px); }

/* Kelio */
.kelio .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; }
.kelio-img img { width: 100%; height: 540px; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow-lg); }
.badge { display: inline-flex; align-items: center; gap: 16px; background: #fff; border-radius: 12px; padding: 10px 18px 10px 12px; margin-bottom: 22px; box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .2); }
.badge img { height: 46px; width: auto; }
.badge span { font-size: 13px; color: #5B6B76; line-height: 1.3; border-left: 1px solid #E3EAEF; padding-left: 14px; }

/* Références */
.refs { background: var(--bg-soft); }
.refs-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.ref { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 12px; transition: .2s; }
.ref:hover { border-color: var(--accent); transform: translateY(-3px); }
.ref-name { overflow-wrap: anywhere; font-family: Montserrat; font-weight: 700; font-size: 13px; color: var(--muted); line-height: 1.3; transition: color .2s; }
.ref:hover .ref-name { color: var(--accent); }
.ref-sector { font-size: 11px; color: var(--muted); opacity: .75; margin-top: 4px; }
.ref.has-logo { background: #fff; }
.ref img { max-height: 60px; max-width: 100%; object-fit: contain; filter: grayscale(1); opacity: .75; transition: .25s; }
.ref:hover img { filter: none; opacity: 1; }

/* Bandeau d'appel */
.cta { padding: 100px 0 0; }
.cta .box { background: linear-gradient(120deg, var(--navy), var(--blue)); border-radius: 24px; padding: 56px 60px; color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 30px; position: relative; overflow: hidden; }
.cta .box::after { content: ""; position: absolute; right: -80px; top: -80px; width: 300px; height: 300px; border: 40px solid rgba(245, 132, 62, .25); border-radius: 50%; pointer-events: none; }
.cta h2 { font-size: clamp(24px, 3vw, 32px); max-width: 560px; color: #fff; margin: 0; }
.cta-btns { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }

/* Contact */
.contact .wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: 60px; align-items: start; }
.info-list { list-style: none; margin: 28px 0; display: grid; gap: 16px; }
.info-list li { display: flex; align-items: center; gap: 14px; }
.info-list .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--ic-bg); color: var(--accent); display: grid; place-items: center; flex: none; }
.info-list a:hover { color: var(--accent); }
.contact-form { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 36px; box-shadow: var(--shadow); display: grid; gap: 18px; }
.contact-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--heading); }
.contact-form input, .contact-form select, .contact-form textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%; transition: border-color .2s; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-form textarea { resize: vertical; }
.contact-form button { justify-self: start; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; font-size: 14px; }
.alert.ok { background: rgba(37, 211, 102, .12); color: #128C4B; }
.alert.err { background: rgba(220, 60, 60, .12); color: #C0392B; }
[data-theme="dark"] .alert.ok { color: #5BE39A; }
[data-theme="dark"] .alert.err { color: #FF8A80; }

/* Pied de page */
.site-footer { background: var(--navy); color: #A9BFCC; padding: 70px 0 30px; font-size: 14px; }
[data-theme="dark"] .site-footer { background: #041019; border-top: 1px solid var(--line); }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; }
.site-footer h4 { color: #fff; margin-bottom: 16px; font-size: 16px; }
.site-footer ul { list-style: none; display: grid; gap: 8px; }
.site-footer a:hover { color: #fff; }
.footer-logo { height: 90px; width: auto; margin-bottom: 16px; }
.socials { display: flex; gap: 10px; margin-top: 18px; }
.socials a { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .15); display: grid; place-items: center; }
.socials a:hover { background: var(--orange); border-color: var(--orange); }
.site-footer .bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 50px; padding-top: 24px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Bouton WhatsApp flottant */
.wa-float { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; align-items: center; gap: 0; background: var(--wa); color: #fff; border-radius: 99px; padding: 12px; box-shadow: 0 12px 30px -8px rgba(37, 211, 102, .6); transition: transform .2s, padding .3s; }
.wa-float svg { width: 32px; height: 32px; }
.wa-float .wa-label { max-width: 0; overflow: hidden; white-space: nowrap; font-weight: 600; font-size: 14px; transition: max-width .35s, margin .35s; }
.wa-float:hover { transform: translateY(-2px); padding-right: 20px; }
.wa-float:hover .wa-label { max-width: 220px; margin-left: 10px; }
.wa-float::before { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--wa); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.35); } }
.wa-block { margin-top: 4px; }

/* Lien discret vers le backoffice (pied de page) */
.site-footer .admin-link { color: #6F8796; }
.site-footer .admin-link:hover { color: var(--orange); }

/* Bouton retour en haut : rond marine, anneau orange qui se remplit au fil de la lecture */
.to-top { position: fixed; right: 28px; bottom: 22px; z-index: 55; width: 44px; height: 44px; border-radius: 50%; padding: 0; transition: opacity .2s, transform .2s; box-shadow: 0 8px 20px -6px rgba(11, 46, 66, .5); }
.to-top.above-wa { bottom: 92px; }
.to-top svg { width: 100%; height: 100%; display: block; }
.to-top[hidden] { display: block; opacity: 0; transform: translateY(8px); pointer-events: none; visibility: hidden; }
.to-top:hover { transform: translateY(-2px); }
.to-top:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
[data-theme="dark"] .to-top svg circle:first-child { fill: #15435E; }
@media print { .to-top, .wa-float { display: none !important; } }

/* Fenêtre de détail d'une expertise */
.modal { border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); margin: auto; }
.modal::backdrop { background: rgba(4, 16, 25, .6); backdrop-filter: blur(3px); }
.modal-body { padding: 40px 36px 36px; }
.modal-body h3 { font-size: 24px; margin-bottom: 14px; }
.modal-body p { color: var(--muted); margin-bottom: 14px; }
.modal-body .btn { margin-top: 10px; }
.modal-close { position: absolute; top: 14px; right: 14px; }

/* Page 404 */
.notfound { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 16px; background: linear-gradient(180deg, var(--bg-soft), var(--bg)); }
.notfound .brand img { height: 56px; margin: 0 auto 30px; }
.notfound .code { font-family: Montserrat; font-weight: 800; font-size: clamp(80px, 18vw, 140px); line-height: 1; color: var(--orange); }
.notfound h1 { font-size: clamp(24px, 4vw, 32px); margin: 8px 0 10px; }
.notfound .ctas { justify-content: center; }

/* Apparition au défilement */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .f1, .f2, .wa-float::before { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .refs-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .main-nav { gap: 20px; }
}

@media (max-width: 960px) {
  .burger { display: grid; }
  .header-cta { display: none; }
  .main-nav {
    position: fixed; inset: 78px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 24px 24px;
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .3);
    transform: translateY(-12px); opacity: 0; visibility: hidden; transition: .25s;
    max-height: calc(100vh - 78px); overflow-y: auto;
  }
  .main-nav.open { transform: none; opacity: 1; visibility: visible; }
  .main-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .main-nav a:not(.btn)::after { display: none; }
  .nav-cta-mobile { display: inline-flex; margin-top: 18px; }
  .hero .wrap, .about .wrap, .kelio .wrap, .contact .wrap { grid-template-columns: 1fr; gap: 44px; }
  .hero { padding: 56px 0 70px; }
  .hero-img img { height: 360px; }
  .about-img { order: 2; }
  .about-img img, .kelio-img img { height: 380px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .cta .box { flex-direction: column; align-items: flex-start; padding: 44px 36px; }
  section { padding: 76px 0; }
  .cta { padding-top: 76px; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar .wrap { justify-content: center; }
  .topbar-r { display: none; }
  .topbar-l a[href^="mailto"] { display: none; }
  .site-header .wrap { height: 68px; }
  .main-nav { top: 68px; max-height: calc(100vh - 68px); padding: 6px 16px 20px; }
  .brand img { height: 40px; }
  .hero h1 { margin: 18px 0; }
  .lead { font-size: 16px; }
  .ctas .btn { flex: 1 1 auto; }
  .hero-img img { height: 280px; }
  .float { padding: 10px 14px; font-size: 12px; }
  .float strong { font-size: 16px; }
  .float .ic { width: 34px; height: 34px; }
  .f1 { left: 10px; bottom: -22px; }
  .f2 { right: 10px; top: -18px; }
  .stats .wrap { grid-template-columns: 1fr 1fr; row-gap: 22px; }
  .stats .wrap > div:nth-child(2n) { border-right: 0; }
  .stats strong { font-size: 30px; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 26px; }
  .refs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .about-img img, .kelio-img img { height: 280px; }
  .row2 { grid-template-columns: 1fr; }
  .contact-form { padding: 24px 18px; }
  .contact-form button { justify-self: stretch; }
  .cta .box { padding: 36px 24px; }
  .cta-btns, .cta-btns .btn { width: 100%; }
  .site-footer .cols { grid-template-columns: 1fr; gap: 30px; }
  .wa-float { right: 16px; bottom: 16px; padding: 10px; }
  .wa-float svg { width: 30px; height: 30px; }
  .to-top { right: 19px; bottom: 16px; }
  .to-top.above-wa { bottom: 80px; }
  .modal-body { padding: 36px 22px 26px; }
}
