/* ═══ NOUVEAUTÉS — Histoire · Témoignages · FAQ · Chat · Code postal · CO₂ ═══ */

/* ══ 1. HISTOIRE (timeline au scroll) ═══════════════════ */
.histoire { padding: 110px 0; }
.hist-rail { position: relative; max-width: 940px; margin: 26px auto 0; }
.hist-line,
.hist-line-fill {
  position: absolute; left: 50%; top: 0; width: 1px;
  transform: translateX(-50%);
}
.hist-line { bottom: 0; background: var(--line); }
.hist-line-fill { height: 0; background: var(--accent); }
.hist-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 72px 1fr;
  align-items: center;
  padding: 40px 0;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.hist-item.on { opacity: 1; transform: none; }
.hist-dot {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line);
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.hist-item.on .hist-dot {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 7px var(--accent-soft);
}
.hist-body { grid-column: 3; padding-left: 6px; }
.hist-item:nth-of-type(even) .hist-body {
  grid-column: 1; grid-row: 1; text-align: right; padding-left: 0; padding-right: 6px;
}
.hist-year {
  display: block;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(30px, 3.4vw, 44px);
  color: var(--accent); line-height: 1;
}
.hist-body h4 {
  font-family: var(--serif); font-weight: 500;
  font-size: 22px; margin: 12px 0 8px;
}
.hist-body p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--sub); max-width: 380px; }
.hist-item:nth-of-type(even) .hist-body p { margin-left: auto; }
@media (max-width: 900px) {
  .hist-line, .hist-line-fill { left: 6px; transform: none; }
  .hist-item { grid-template-columns: 1fr; padding: 30px 0 30px 36px; }
  .hist-dot { left: 6px; }
  .hist-body,
  .hist-item:nth-of-type(even) .hist-body {
    grid-column: 1; grid-row: auto; text-align: left; padding: 0;
  }
  .hist-item:nth-of-type(even) .hist-body p { margin-left: 0; }
}

/* ══ 2. RECHERCHE CODE POSTAL (section zones) ═══════════ */
.zone-search { grid-column: 2; margin-top: 34px; }
.zone-search label {
  display: block;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(247, 248, 244, 0.5);
  margin-bottom: 12px;
}
.zs-row { display: flex; gap: 0; }
.zs-row input {
  flex: 1; min-width: 0;
  background: transparent;
  border: 1px solid rgba(247, 248, 244, 0.25);
  border-right: none;
  color: #f7f8f4;
  font-family: var(--mono); font-size: 15px; letter-spacing: 0.14em;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.3s;
}
.zs-row input:focus { border-color: #2dd162; }
.zs-row input::placeholder { color: rgba(247, 248, 244, 0.3); }
.zs-row button {
  background: #2dd162; color: #0a140c;
  border: none; cursor: pointer;
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0 24px;
  transition: filter 0.25s;
}
.zs-row button:hover { filter: brightness(1.12); }
.zs-result {
  min-height: 22px; margin: 12px 0 0;
  font-size: 13.5px; line-height: 1.5;
  color: rgba(247, 248, 244, 0.65);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.zs-result.show { opacity: 1; transform: none; }
.zs-result.ok b { color: #2dd162; }
.zs-result.ko b { color: #e8b34c; }
@media (max-width: 900px) { .zone-search { grid-column: 1; } }

/* ══ 3. TÉMOIGNAGES (carrousel) ═════════════════════════ */
.temoignages { background: var(--paper-dark); color: #f7f8f4; padding: 110px 0; position: relative; }
.temoignages .section-head h2 { color: #f7f8f4; }
.tm-carousel { max-width: 880px; margin: 0 auto; }
.tm-viewport { overflow: hidden; }
.tm-track { display: flex; transition: transform 0.7s var(--ease); }
.tm-slide { flex: 0 0 100%; margin: 0; padding: 26px 4px 8px; }
.tm-slide blockquote {
  margin: 0 0 30px;
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(23px, 2.9vw, 36px);
  line-height: 1.35; letter-spacing: -0.01em;
  color: rgba(247, 248, 244, 0.92);
  text-wrap: pretty;
}
.tm-slide blockquote em { color: #2dd162; font-style: italic; }
.tm-author {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: #2dd162;
}
.tm-role {
  display: block; margin-top: 5px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(247, 248, 244, 0.45);
  text-transform: none;
}
.tm-nav { display: flex; align-items: center; gap: 22px; margin-top: 36px; }
.tm-nav button {
  width: 46px; height: 46px; border-radius: 50%;
  background: transparent; color: #f7f8f4;
  border: 1px solid rgba(247, 248, 244, 0.25);
  font-size: 17px; cursor: pointer;
  transition: border-color 0.3s, background 0.3s, color 0.3s;
}
.tm-nav button:hover { border-color: #2dd162; background: rgba(45, 209, 98, 0.12); color: #2dd162; }
.tm-dots { display: flex; gap: 9px; }
.tm-dots span {
  width: 7px; height: 7px; border-radius: 4px;
  background: rgba(247, 248, 244, 0.25);
  cursor: pointer;
  transition: background 0.35s, width 0.35s;
}
.tm-dots span.on { background: #2dd162; width: 26px; }

/* ══ 4. FAQ (accordéon) ═════════════════════════════════ */
.faq { padding: 110px 0; }
.faq-list { max-width: 860px; margin: 0 auto; border-bottom: 1px solid var(--line); }
.faq-item { border-top: 1px solid var(--line); }
.faq-q {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  background: none; border: none; cursor: pointer;
  padding: 26px 4px;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(18px, 2vw, 23px);
  color: var(--ink); text-align: left;
  transition: color 0.3s;
}
.faq-q:hover { color: var(--accent); }
.faq-q .fx {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  font-family: var(--mono); font-size: 15px; color: var(--sub);
  transition: transform 0.45s var(--ease), background 0.3s, color 0.3s, border-color 0.3s;
}
.faq-item.open .faq-q { color: var(--accent); }
.faq-item.open .faq-q .fx {
  transform: rotate(45deg);
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.faq-a {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--ease);
}
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a > div { overflow: hidden; }
.faq-a p {
  margin: 0; padding: 0 44px 28px 4px;
  font-size: 14.5px; line-height: 1.7; color: var(--sub);
  max-width: 640px;
}

/* ══ 5. CHAT ASSISTANT FLOTTANT ═════════════════════════ */
.chat-fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 9500;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--paper-dark); color: #2dd162;
  border: 1px solid rgba(45, 209, 98, 0.45);
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 12px 32px rgba(10, 20, 12, 0.35);
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
}
.chat-fab:hover { transform: translateY(-3px) scale(1.06); box-shadow: 0 16px 40px rgba(10, 20, 12, 0.45); }
.chat-fab svg { transition: transform 0.35s var(--ease); }
.chat-widget.open .chat-fab svg { transform: rotate(90deg) scale(0.9); }
.chat-panel {
  position: fixed; right: 26px; bottom: 98px; z-index: 9500;
  width: min(360px, calc(100vw - 40px));
  max-height: min(540px, 72vh);
  background: var(--bg);
  border: 1px solid var(--ink);
  box-shadow: 0 26px 64px rgba(10, 20, 12, 0.28);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.chat-widget.open .chat-panel { opacity: 1; transform: none; pointer-events: auto; }
.chat-head {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper-dark); color: #f7f8f4;
  padding: 15px 18px;
}
.chat-avatar {
  flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 19px;
}
.chat-head > div { flex: 1; min-width: 0; }
.chat-head b { display: block; font-size: 14px; font-weight: 600; }
.chat-head span.status {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(247, 248, 244, 0.5);
  margin-top: 2px;
}
.chat-head span.status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #2dd162;
  animation: chat-online 2.2s ease-in-out infinite;
}
@keyframes chat-online { 50% { opacity: 0.35; } }
.chat-close {
  background: none; border: none; cursor: pointer;
  color: rgba(247, 248, 244, 0.6); font-size: 15px;
  padding: 6px; line-height: 1;
  transition: color 0.25s;
}
.chat-close:hover { color: #fff; }
.chat-msgs {
  flex: 1; overflow-y: auto;
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 180px;
}
.chat-msg {
  max-width: 85%;
  padding: 11px 14px;
  font-size: 13.5px; line-height: 1.55;
  opacity: 0; transform: translateY(10px);
  animation: chat-in 0.45s var(--ease) forwards;
}
@keyframes chat-in { to { opacity: 1; transform: none; } }
.chat-msg.bot {
  align-self: flex-start;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: 2px 14px 14px 14px;
}
.chat-msg.bot a { color: var(--accent); font-weight: 600; }
.chat-msg.user {
  align-self: flex-end;
  background: var(--accent); color: #fff;
  border-radius: 14px 2px 14px 14px;
}
.chat-typing {
  align-self: flex-start;
  display: flex; gap: 5px;
  padding: 13px 15px;
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: 2px 14px 14px 14px;
}
.chat-typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sub);
  animation: chat-dot 1.1s ease-in-out infinite;
}
.chat-typing i:nth-child(2) { animation-delay: 0.15s; }
.chat-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-dot { 40% { transform: translateY(-5px); opacity: 0.5; } }
.chat-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 18px 18px;
}
.chat-chips button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink); cursor: pointer;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
.chat-chips button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 640px) {
  .chat-fab { right: 16px; bottom: 16px; width: 52px; height: 52px; }
  .chat-panel { right: 16px; bottom: 80px; }
}

/* ══ 6. COMPTEUR CO₂ FOOTER ═════════════════════════════ */
.footer-co2 {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 10px 32px;
  padding: 36px clamp(24px, 6vw, 64px);
  border-bottom: 1px solid rgba(247, 248, 244, 0.12);
}
.fc-lbl {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: rgba(247, 248, 244, 0.5);
}
.fc-count {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1; color: #2dd162;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.fc-count .fc-unit { font-size: 0.45em; margin-left: 8px; color: rgba(247, 248, 244, 0.7); }
.fc-note {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(247, 248, 244, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .hist-item, .zs-result, .chat-msg { transition: none; animation: none; opacity: 1; transform: none; }
  .chat-typing i { animation: none; }
}
