:root {
  --nuit: #0c2422;
  --nuit-2: #102b28;
  --doubs: #1e4d48;
  --laiton: #c9a24b;
  --laiton-2: #e3c57e;
  --pierre: #eae3d4;
  --craie: #f6f3ec;
  --ink: #081311;
  --muted: #9db3ac;
  --line: rgba(201, 162, 75, 0.18); /* Transition vers un trait plus "doré" */
  --radius: 16px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", monospace;
  --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--pierre);
  background: var(--nuit);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { 
  font-family: var(--display); 
  font-weight: 800; 
  line-height: 1.1; 
  letter-spacing: -0.03em; 
  margin: 0; 
}

a { color: inherit; text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.8; }

em { font-style: normal; color: var(--laiton-2); font-weight: 600; }

.eyebrow {
  font-family: var(--mono); 
  font-size: 0.7rem; 
  text-transform: uppercase;
  letter-spacing: 0.25em; 
  color: var(--laiton); 
  margin: 0 0 1.2rem;
}

.dot { color: var(--laiton); }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 2rem;
  padding: 1rem 1.5rem;
  background: rgba(12, 36, 34, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 0.75rem; font-family: var(--display); font-weight: 700; font-size: 1.25rem; }

.brand-mark {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--laiton);
  background: radial-gradient(circle at 30% 30%, var(--laiton-2) 0%, var(--laiton) 80%);
  box-shadow: 0 0 10px rgba(201, 162, 75, 0.3);
}

.nav { display: flex; gap: 2rem; margin-left: auto; font-size: 0.9rem; }
.nav a { color: var(--muted); transition: color 0.3s ease; }
.nav a:hover { color: var(--laiton-2); }

.head-cta { position: relative; }

/* ---------- Buttons ---------- */
.btn { 
  font-family: var(--body); 
  font-weight: 600; 
  font-size: 0.9rem; 
  border-radius: 12px; 
  padding: 0.8rem 1.8rem; 
  cursor: pointer; 
  border: 1px solid transparent; 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.6, 1); 
  display: inline-block;
}

.btn:active { transform: scale(0.97); }

.btn-solid { 
  background: linear-gradient(135deg, var(--laiton) 0%, var(--laiton-2) 100%);
  color: var(--ink); 
  box-shadow: 0 4px 15px rgba(201, 162, 75, 0.3);
}

.btn-solid:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201, 162, 75, 0.4); }

.btn-ghost { border: 1px solid var(--line); color: var(--pierre); background: rgba(255,255,255,0.03); }
.btn-ghost:hover { border-color: var(--laiton); color: var(--laiton-2); background: rgba(201, 162, 75, 0.05); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(3rem, 8vw, 6rem);
  align-items: center;
  padding: 8rem 2rem;
  max-width: 1400px; margin: 0 auto;
}

.hero-copy h1 { font-size: clamp(3.5rem, 8vw, 6rem); line-height: 1; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 45ch; margin: 1.5rem 0 2.5rem; }

.assur { list-style: none; display: flex; flex-wrap: wrap; gap: 0.8rem; padding: 0; margin: 3rem 0 0; }
.assur li { 
  font-family: var(--mono); font-size: 0.75rem; padding: 0.6rem 1.2rem; 
  border: 1px solid var(--line); border-radius: 100px; color: var(--muted);
}
.assur strong { color: var(--laiton-2); }

/* ---------- Le compteur (signature) ---------- */
.meter {
  background: linear-gradient(145deg, var(--craie), var(--pierre));
  color: var(--ink); border-radius: 24px;
  padding: clamp(2rem, 4vw, 3rem);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.8);
  border: 1px solid var(--laiton);
}

.meter-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.2em; color: #8a7e65; }
.meter-live { color: var(--doubs); display: flex; align-items: center; gap: 0.5rem; font-weight: bold; }
.meter-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b9ab86; }

.meter.is-running .meter-live { color: #146b3a; }
.meter.is-running .meter-live::before { background: #2ecc71; box-shadow: 0 0 10px rgba(46, 204, 113, 0.5); animation: ping 1.5s infinite; }

@keyframes ping { 
  0% { transform: scale(1); opacity: 1; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

.meter-readout { display: flex; align-items: baseline; gap: 0.6rem; margin: 1.2rem 0; border-bottom: 2px solid rgba(8, 19, 17, 0.1); padding-bottom: 1rem; }
.meter-price { font-family: var(--mono); font-weight: 800; font-size: clamp(3.5rem, 9vw, 5rem); line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.meter-price[data-empty="true"] { color: #c3b89c; }
.meter-cur { font-family: var(--mono); font-size: 1.8rem; color: var(--laiton); font-weight: 700; }

.meter-sub { font-size: 0.9rem; color: #6c6250; margin-top: 0.8rem; min-height: 1.4em; letter-spacing: 0.05em; }

.meter-form { margin-top: 2rem; display: grid; gap: 1rem; }
.fld { display: grid; gap: 0.4rem; }
.fld > span { font-family: var(--mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.2em; color: #8a7e65; }

.fld input, .fld select {
  font-family: var(--body); font-size: 1rem; padding: 0.9rem 1.2rem;
  border: 1px solid rgba(12, 36, 34, 0.2); border-radius: 12px;
  background: #fff; color: var(--ink); width: 100%; transition: all 0.2s;
}

.fld input:focus, .fld select:focus { outline: none; border-color: var(--laiton); box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.15); }

.meter-form .btn-solid { margin-top: 0.5rem; width: 100%; padding: 1rem; font-size: 1.1rem; border-radius: 12px; }
.meter-err { color: #bc3c3c; font-size: 0.8rem; margin: 0.4rem 0 0; }

/* ---------- Sections ---------- */
section { scroll-margin-top: 100px; }
.sec-head { max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; }
.sec-head h2 { font-size: clamp(2rem, 5vw, 3.5rem); max-width: 24ch; border-left: 4px solid var(--laiton); padding-left: 1.5rem; }

.services, .steps, .pro { padding: 80px 0; border-top: 1px solid var(--line); }

.svc-grid { max-width: 1240px; margin: 4rem auto 0; padding: 0 1.5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.svc-card { background: var(--nuit-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 2.5rem; transition: all 0.4s ease; position: relative; overflow: hidden; }
.svc-card::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--laiton); opacity: 0.3; }
.svc-card:hover { border-color: var(--laiton); transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.4); }

.svc-ico { font-size: 2rem; margin-bottom: 1rem; color: var(--laiton); }
.svc-card h3 { font-size: 1.5rem; margin: 0; }
.svc-card p { color: var(--muted); font-size: 1rem; line-height: 1.6; margin: 1rem 0 2rem; }

.svc-tarif { font-family: var(--mono); font-size: 0.85rem; color: var(--laiton-2); border-top: 1px solid var(--line); padding-top: 1rem; display: flex; justify-content: space-between; }

.loading { color: var(--muted); padding: 4rem 0; text-align: center; font-style: italic; }

.step-list { max-width: 1240px; margin: 4rem auto 0; padding: 0 1.5rem; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 3rem; }
.step-list li { position: relative; padding-top: 3rem; }
.step-list li::before { content: counter(s, decimal-leading-zero); position: absolute; top: 0; left: 0; font-family: var(--mono); font-size: 1rem; color: var(--laiton); border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.8rem; background: var(--nuit); }

.step-k { font-family: var(--display); font-weight: 700; font-size: 1.3rem; margin-bottom: 0.5rem; color: var(--pierre); }
.step-list p { color: var(--muted); font-size: 1rem; line-height: 1.6; }

.pro-inner { max-width: 1240px; margin: 0 auto; padding: 80px 1.5rem; display: flex; gap: 4rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pro-inner h2 { font-size: clamp(2rem, 6vw, 3.5rem); margin: 0; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 4rem 1.5rem; text-align: center; color: var(--muted); font-size: 0.9rem; background: rgba(12, 36, 34, 0.5); }
.foot-brand { font-family: var(--display); font-weight: 700; font-size: 1.4rem; color: var(--pierre); margin-bottom: 0.5rem; }
.foot-mini { font-size: 0.8rem; opacity: 0.6; letter-spacing: 0.05em; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 4rem 1.5rem; text-align: center; }
  .lede { margin: 1.5rem auto 3rem; }
  .assur { justify-content: center; }
  .nav { display: none; }
}

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

:focus-visible { outline: 2px solid var(--laiton); outline-offset: 4px; }

/* ---------- Écran de connexion (accueil) ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; background: radial-gradient(circle at 50% 50%, var(--doubs), var(--nuit)); }
.auth-brand { font-size: 1.6rem; margin-bottom: 3rem; }
.auth-card { background: rgba(12, 36, 34, 0.9); border: 1px solid var(--line); border-radius: 28px; padding: clamp(2rem, 5vw, 3.5rem); width: min(450px, 100%); box-shadow: 0 40px 80px rgba(0,0,0,0.8); border: 1px solid var(--laiton); }
.auth-card h1 { font-size: 2rem; color: var(--pierre); }
.auth-form { display: grid; gap: 1.2rem; margin-top: 2rem; }
.auth-form label { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.auth-form input, .auth-form textarea, .auth-form select { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,0.03); color: var(--pierre); }
.auth-form input:focus { outline: none; border-color: var(--laiton); box-shadow: 0 0 10px rgba(201, 162, 75, 0.2); }
.auth-form .btn-solid { width: 100%; padding: 1rem; border-radius: 12px; font-size: 1.1rem; }

.auth-switch { margin: 1.5rem 0; text-align: center; }
.linklike { color: var(--laiton-2); text-decoration: underline; text-underline-offset: 4px; }

.auth-banner { padding: 1rem; border-radius: 12px; font-size: 0.9rem; margin-bottom: 1.5rem; border: 1px solid transparent; }
.auth-banner.ok { background: rgba(34, 168, 116, 0.15); border-color: #22a874; color: #b7e8cd; }
.auth-banner.bad { background: rgba(192, 85, 77, 0.15); border-color: #c0554d; color: #ffc3c3; }

.head-user { display: flex; align-items: center; gap: 1rem; }
.nav { margin-left: auto; }

/* ---------- Carte ---------- */
.mapwrap { padding: 2rem; max-width: 1400px; margin: 0 auto; }
.map { width: 100%; height: 450px; border-radius: 24px; border: 1px solid var(--line); filter: grayscale(0.3) contrast(1.1); }

/* ---------- Modale ---------- */
.modal { position: fixed; inset: 0; z-index: 1000; background: rgba(5, 15, 14, 0.9); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-card { background: var(--nuit-2); border: 1px solid var(--laiton); border-radius: 24px; padding: 3rem; width: min(450px, 100%); box-shadow: 0 40px 100px rgba(0,0,0,0.8); }

/* ---------- Assistant IA ---------- */
.chat-toggle { position: fixed; bottom: 2rem; right: 2rem; z-index: 90; width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--laiton); background: linear-gradient(135deg, var(--laiton), var(--laiton-2)); color: var(--ink); font-size: 1.8rem; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
.chat-panel { position: fixed; bottom: 90px; right: 2rem; z-index: 90; width: min(380px, calc(100vw - 4rem)); height: 550px; max-height: calc(100vh - 120px); border-radius: 24px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,0.9); border: 1px solid var(--line); }
.chat-head { background: linear-gradient(90deg, var(--doubs), var(--nuit)); padding: 1.2rem; border-bottom: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: 1.5rem; background: rgba(16, 43, 40, 0.3); }
.chat-msg { max-width: 85%; padding: 0.8rem 1.2rem; border-radius: 16px; margin-bottom: 0.8rem; font-size: 0.95rem; line-height: 1.4; }
.chat-msg.bot { background: var(--nuit-2); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg.me { background: var(--laiton); color: var(--ink); align-self: flex-end; border-bottom-right-radius: 4px; font-weight: 500; }
.chat-form { padding: 1rem; border-top: 1px solid var(--line); display: flex; gap: 0.8rem; background: var(--nuit); }
.chat-form input { flex: 1; padding: 0.8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--nuit-2); color: var(--pierre); }
.chat-form button { width: 45px; height: 45px; border-radius: 12px; border: none; background: var(--laiton); cursor: pointer; }