/* =========================================================================
   SAV AGENT — reprend l'identite "Atelier" partagee avec SAV Autonome,
   le portfolio et le prospecteur. Meme palette, meme typo, meme grammaire
   visuelle : plusieurs produits, une seule marque.
   ========================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Work+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap");

:root {
  --sable: #fbf2e7;
  --sable-2: #ffffff;
  --encre: #33302c;
  --encre-soft: #6b6259;
  --line: rgba(51, 48, 44, 0.14);
  --line-soft: rgba(51, 48, 44, 0.07);

  --miel: #e8a33d;
  --miel-dim: #885c19;
  --miel-glow: rgba(232, 163, 61, 0.22);

  --sauge: #6e8f7c;
  --sauge-dim: #4d6857;
  --sauge-glow: rgba(110, 143, 124, 0.18);

  --rose: #f4dcd2;
  --coral: #a24b3b;
  --coral-glow: rgba(162, 75, 59, 0.13);

  --font-display: "Fredoka", sans-serif;
  --font-body: "Work Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 14px;
  --radius-lg: 22px;
  --max-width: 1160px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0; background: var(--sable); color: var(--encre);
  font-family: var(--font-body); font-size: 16px; line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0 0 .5em; letter-spacing: -0.01em; line-height: 1.12; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 3.1vw, 2.1rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; color: var(--encre-soft); }
a { color: var(--sauge-dim); }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-family: var(--font-body); font-weight: 600; font-size: .82rem;
  color: var(--sauge-dim); display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.eyebrow::before { content: "●"; color: var(--miel); font-size: .6rem; }

/* ===== Boutons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  padding: 13px 24px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--encre); color: var(--sable-2); }
.btn-signal { background: var(--miel); color: #3a2405; font-weight: 700; }
.btn-signal:hover { box-shadow: 0 10px 26px var(--miel-glow); }
.btn-outline { background: transparent; color: var(--encre); border-color: var(--line); }
.btn-outline:hover { border-color: var(--encre); background: var(--sable-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

/* ===== Nav ===== */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(251,242,231,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; }
.nav-logo { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--encre); display: flex; align-items: center; gap: 8px; }
.nav-logo .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--miel); }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--encre-soft); text-decoration: none; font-size: .92rem; font-weight: 500; white-space: nowrap; }
.nav-links a:hover { color: var(--encre); }
.nav-links a.btn { color: var(--sable-2); }
@media (max-width: 640px) { .nav-links a:not(.btn) { display: none; } .nav-links .btn { padding: 10px 16px; font-size: .85rem; } }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; padding: 90px 0 64px; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -10%;
  background:
    radial-gradient(36% 30% at 18% 22%, rgba(232,163,61,.35), transparent 70%),
    radial-gradient(32% 28% at 82% 18%, rgba(110,143,124,.28), transparent 70%),
    radial-gradient(38% 32% at 70% 82%, rgba(244,220,210,.55), transparent 70%);
  filter: blur(50px); animation: drift 18s ease-in-out infinite alternate; z-index: 0;
}
@keyframes drift { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(2%,-3%) scale(1.06); } 100% { transform: translate(-2%,2%) scale(1.03); } }
@media (prefers-reduced-motion: reduce) { .hero::before { animation: none; } }
.hero .wrap, .hero-grid { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero-lede { font-size: 1.1rem; max-width: 46ch; }
.hero-ctas { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-note { font-family: var(--font-mono); font-size: .78rem; color: var(--encre-soft); margin-top: 16px; }

.tilt-wrap { perspective: 1300px; }
.ticket-strip {
  background: var(--sable-2); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: 0 26px 60px rgba(51,48,44,.14);
}
.browser-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: var(--sable); border-bottom: 1px solid var(--line); }
.browser-dot { width: 9px; height: 9px; border-radius: 50%; }
.browser-dot.red { background: var(--coral); } .browser-dot.amber { background: var(--miel); } .browser-dot.green { background: var(--sauge); }
.browser-url { margin-left: 8px; font-family: var(--font-mono); font-size: .68rem; color: var(--encre-soft); background: var(--sable-2); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; }
.ticket-body { padding: 22px 24px; }
.msg { font-family: var(--font-mono); font-size: .82rem; color: var(--encre); background: var(--sable); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; margin-bottom: 12px; }
.stamp { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: .72rem; font-weight: 600; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; }
.stamp-resolu { background: var(--sauge-glow); color: var(--sauge-dim); }
.stamp-escalade { background: var(--coral-glow); color: var(--coral); }

/* ===== Sections ===== */
section { padding: 68px 0; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: var(--sable-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px rgba(51,48,44,.1); }
.card .card-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; margin-bottom: 14px; }
.card:nth-child(1) .card-icon { background: var(--miel-glow); }
.card:nth-child(2) .card-icon { background: var(--sauge-glow); }
.card:nth-child(3) .card-icon { background: var(--rose); }
.card p { margin-bottom: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { border-left: 2px solid var(--line); padding-left: 20px; }
.step .num { font-family: var(--font-mono); font-size: .78rem; color: var(--miel-dim); font-weight: 600; display: block; margin-bottom: 10px; }

/* ===== Tarifs ===== */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { background: var(--sable-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; display: flex; flex-direction: column; }
.plan.featured { border-color: var(--miel); background: linear-gradient(180deg, #fff 0%, #fffaf0 100%); box-shadow: 0 16px 38px var(--miel-glow); }
.plan .price { font-family: var(--font-display); font-size: 2.2rem; margin: 10px 0 4px; }
.plan .price span { font-family: var(--font-body); font-size: .92rem; color: var(--encre-soft); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 20px 0; flex: 1; }
.plan li { padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.plan li:first-child { border-top: none; }
.badge-featured { font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; color: var(--miel-dim); margin-bottom: 6px; display: inline-flex; gap: 6px; }
.badge-featured::before { content: "\2605"; }

/* ===== Footer ===== */
footer { border-top: 1px solid var(--line); padding: 44px 0; background: var(--sable-2); }
footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
footer p { margin: 0; font-size: .85rem; color: var(--encre-soft); }

/* ===== Demo chat ===== */
.demo-shell { max-width: 720px; margin: 0 auto; }
.chat-panel { background: var(--sable-2); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 24px 54px rgba(51,48,44,.1); }
.chat-log { padding: 20px; min-height: 320px; max-height: 480px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.chat-empty { margin: auto; text-align: center; color: var(--encre-soft); font-size: .9rem; }
.bubble-row { display: flex; flex-direction: column; max-width: 82%; }
.bubble-row.user { align-self: flex-end; align-items: flex-end; }
.bubble-row.agent { align-self: flex-start; align-items: flex-start; }
.bubble { padding: 12px 15px; border-radius: 16px; font-size: .92rem; line-height: 1.5; }
.bubble-row.user .bubble { background: var(--miel); color: #3a2405; border-bottom-right-radius: 4px; }
.bubble-row.agent .bubble { background: var(--sable); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble-row.agent .bubble.typing { color: var(--encre-soft); font-style: italic; }
.bubble-meta { font-family: var(--font-mono); font-size: .68rem; color: var(--encre-soft); margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.provider-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sauge); }
.provider-dot.groq { background: var(--miel); }
.escalate-flag { color: var(--coral); border: 1px solid var(--coral-glow); padding: 1px 7px; border-radius: 999px; }
.chat-form { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); background: var(--sable); }
.chat-form textarea { flex: 1; resize: none; height: 46px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-family: var(--font-body); font-size: .92rem; background: var(--sable-2); }
.chat-form textarea:focus { outline: none; border-color: var(--sauge); box-shadow: 0 0 0 3px var(--sauge-glow); }
.chat-form button:disabled { opacity: .5; }

@media (max-width: 860px) {
  .hero-grid, .grid-3, .steps, .pricing-grid { grid-template-columns: 1fr; }
}
:focus-visible { outline: 2px solid var(--miel); outline-offset: 2px; }
