/* ============================================================
   Botler360 Chatwindow — base styles + 11 themes
   Inspiration Claude (Anthropic): serif titles, cream parchment,
   thin borders, colored dots, pill send button.
   ============================================================ */

.bc,
.bc * {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bc {
  /* --- base tokens (shared across all themes) --- */
  --cream:       #faf8f3;
  --parchment:   #f3efe3;
  --ink:         #161a2b;
  --ink-soft:    #3b4050;
  --muted:       #8a8a94;
  --gold:        #F5B800;
  --gold-deep:   #E29A00;
  --border:      rgba(22, 26, 43, 0.08);
  --border-strong: rgba(22, 26, 43, 0.14);

  --serif: 'Fraunces', 'Tiempos', 'Source Serif Pro', Georgia, serif;
  --sans:  'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* themed tokens (overridden per data-theme) */
  --accent:       var(--gold);
  --accent-deep:  var(--gold-deep);
  --accent-ink:   #161a2b;   /* text color on accent bubble */
  --bg:           var(--cream);
  --bg-messages:  var(--parchment);
  --bg-bubble-bot: #ffffff;
  --text:         var(--ink);
  --text-soft:    var(--ink-soft);
  --name-color:   var(--ink);
  --header-rule:  var(--accent);
  --header-bg:    var(--cream);

  /* shell */
  width: 400px;
  height: 620px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px -24px rgba(22, 26, 43, 0.22),
              0 2px 6px rgba(22, 26, 43, 0.04);
  overflow: hidden;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  isolation: isolate;
}

/* ---------- header ---------- */
.bc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 14px;
  background: var(--header-bg);
  position: relative;
  flex: none;
}
.bc-header::after {
  content: '';
  position: absolute;
  left: 18px; right: 18px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0,
    var(--header-rule) 8%,
    var(--header-rule) 92%,
    transparent 100%);
  opacity: 0.55;
}

.bc-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  flex: none;
  position: relative;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
  overflow: hidden;
}
.bc-avatar svg { width: 100%; height: 100%; display: block; }

.bc-info { flex: 1; min-width: 0; line-height: 1.25; }
.bc-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--name-color);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.bc-name sup { font-size: 9px; opacity: 0.55; top: -0.6em; }
.bc-sector {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
  line-height: 1.4;
}
.bc-status {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.bc-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3fb27f;
  box-shadow: 0 0 0 2px color-mix(in srgb, #3fb27f 20%, transparent);
}
.bc-close {
  background: transparent;
  border: none;
  color: var(--text-soft);
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: background .22s cubic-bezier(.2,.8,.2,1), color .22s;
}
.bc-close:hover {
  background: var(--border);
  color: var(--text);
}

/* ---------- intro block ---------- */
.bc-intro {
  padding: 18px 20px 8px;
  flex: none;
}
.bc-intro h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.2;
}
.bc-intro p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ---------- messages ---------- */
.bc-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-messages);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 8px 0 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.bc-messages::-webkit-scrollbar { width: 4px; }
.bc-messages::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 2px;
}

.bc-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: bc-msg-in .26s cubic-bezier(.2,.8,.2,1);
}
@keyframes bc-msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bc-msg--bot {
  background: var(--bg-bubble-bot);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.bc-msg--user {
  background: var(--accent);
  color: var(--accent-ink);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.bc-msg-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
  align-self: flex-start;
}
.bc-msg-meta--user { align-self: flex-end; }

/* typing indicator */
.bc-typing {
  display: inline-flex;
  gap: 4px;
  padding: 12px 14px;
}
.bc-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: bc-bounce 1.2s infinite ease-in-out;
}
.bc-typing span:nth-child(2) { animation-delay: .15s; }
.bc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bc-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .35; }
  30%           { transform: translateY(-3px); opacity: 1; }
}

/* ---------- quick replies ---------- */
.bc-quick {
  flex: none;
  padding: 10px 16px 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bc-chip {
  appearance: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px 7px 10px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .22s cubic-bezier(.2,.8,.2,1);
  line-height: 1.3;
}
.bc-chip:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}
.bc-chip-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* ---------- input ---------- */
.bc-input {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 10px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.bc-field {
  flex: 1;
  background: color-mix(in srgb, var(--text) 3%, var(--bg));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color .22s cubic-bezier(.2,.8,.2,1),
              box-shadow .22s cubic-bezier(.2,.8,.2,1);
}
.bc-field::placeholder { color: var(--muted); }
.bc-field:focus {
  border-color: var(--accent);
  border-width: 1.5px;
  padding: 9.5px 13.5px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.bc-send {
  appearance: none;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .22s cubic-bezier(.2,.8,.2,1),
              transform .15s cubic-bezier(.2,.8,.2,1);
  white-space: nowrap;
}
.bc-send:hover {
  background: var(--accent-deep);
  transform: translateX(1px);
}
.bc-send-arrow { transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.bc-send:hover .bc-send-arrow { transform: translateX(2px); }

/* ---------- footer ---------- */
.bc-footer {
  flex: none;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 6px 16px 10px;
  background: var(--bg);
}
.bc-footer b {
  font-weight: 500;
  color: var(--text-soft);
  font-family: var(--serif);
  font-style: normal;
}

/* ---------- in-chat pricing card (variant B) ---------- */
.bc-pricecard {
  align-self: flex-start;
  max-width: 88%;
  background: var(--bg-bubble-bot);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  animation: bc-msg-in .26s cubic-bezier(.2,.8,.2,1);
}
.bc-pricecard-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.bc-pricecard-title {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.bc-pricecard-badge {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2C5F4F;
  border: 1px solid #2C5F4F;
  padding: 2px 7px;
  border-radius: 999px;
}
.bc-pricecard-price {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--accent-deep);
}
.bc-pricecard-price small {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0;
  font-weight: 400;
  margin-left: 4px;
}
.bc-pricecard-list {
  list-style: none;
  margin: 0; padding: 0;
  font-size: 12.5px;
  color: var(--text-soft);
  display: grid;
  gap: 4px;
}
.bc-pricecard-list li {
  display: flex; gap: 7px; align-items: baseline;
}
.bc-pricecard-list li::before {
  content: '';
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  transform: translateY(-2px);
  flex: none;
}
.bc-pricecard-cta {
  appearance: none;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent-deep);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  justify-self: flex-start;
  transition: background .22s cubic-bezier(.2,.8,.2,1);
}
.bc-pricecard-cta:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---------- form-chat (variant K) ---------- */
.bc-formstep {
  align-self: flex-start;
  max-width: 88%;
  background: var(--bg-bubble-bot);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  animation: bc-msg-in .26s cubic-bezier(.2,.8,.2,1);
}
.bc-formstep-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.bc-formstep-q {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.bc-formstep-progress {
  display: flex; gap: 4px;
  margin-top: 2px;
}
.bc-formstep-progress span {
  height: 3px; width: 22px;
  border-radius: 2px;
  background: var(--border);
}
.bc-formstep-progress span.is-done { background: var(--accent); }

/* ==============================================================
   THEME A — Signature (accueil)    data-theme="signature"
   ============================================================== */
.bc[data-theme="signature"] {
  --accent:      #F5B800;
  --accent-deep: #E29A00;
  --accent-ink:  #161a2b;
}

/* ==============================================================
   THEME B — Pricing Concierge      data-theme="pricing"
   ============================================================== */
.bc[data-theme="pricing"] {
  --accent:      #F5B800;
  --accent-deep: #E29A00;
  --accent-ink:  #161a2b;
  --bg-messages: #f5f1e5;
}

/* ==============================================================
   THEME C — Showcase Navigator     data-theme="showcase"
   ============================================================== */
.bc[data-theme="showcase"] {
  --accent:      #E29A00;
  --accent-deep: #B87A00;
  --accent-ink:  #ffffff;
  --bg:          rgba(255, 255, 255, 0.78);
  --bg-messages: rgba(243, 239, 227, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 24px 60px -20px rgba(22, 26, 43, 0.22),
              inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.bc[data-theme="showcase"] .bc-avatar {
  background: linear-gradient(135deg, #F5B800, #E29A00);
}

/* ==============================================================
   THEME D — Tourisme               data-theme="tourisme"
   ============================================================== */
.bc[data-theme="tourisme"] {
  --accent:      #2D6B9F;
  --accent-deep: #1E4F78;
  --accent-ink:  #ffffff;
  --bg:          #faf5ea;
  --bg-messages: #f4ede0;
}
.bc[data-theme="tourisme"] .bc-header::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, #2D6B9F 0%, transparent 70%);
}

/* ==============================================================
   THEME E — Viticulture (nocturne) data-theme="viticulture"
   ============================================================== */
.bc[data-theme="viticulture"] {
  --accent:      #8B1F3D;
  --accent-deep: #6E1830;
  --accent-ink:  #f0e6d2;
  --bg:          #1a0e14;
  --bg-messages: #140a10;
  --bg-bubble-bot: #2a1a20;
  --text:        #f0e6d2;
  --text-soft:   #c8b89a;
  --muted:       #8a7866;
  --border:      rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --name-color:  #D4A84F;
  --header-rule: #D4A84F;
  --header-bg:   #1a0e14;
}
.bc[data-theme="viticulture"] .bc-name {
  color: #D4A84F;
  letter-spacing: 0.01em;
}
.bc[data-theme="viticulture"] .bc-sector {
  color: #D4A84F;
  border-color: rgba(212, 168, 79, 0.4);
}
.bc[data-theme="viticulture"] .bc-footer b { color: #D4A84F; }
.bc[data-theme="viticulture"] .bc-field {
  background: rgba(255, 255, 255, 0.04);
}

/* ==============================================================
   THEME F — Restaurants            data-theme="restaurants"
   ============================================================== */
.bc[data-theme="restaurants"] {
  --accent:      #C15F3C;
  --accent-deep: #9E4A2C;
  --accent-ink:  #ffffff;
  --bg:          #faf3e8;
  --bg-messages: #f7efe4;
}

/* ==============================================================
   THEME G — Boulangerie            data-theme="boulangerie"
   ============================================================== */
.bc[data-theme="boulangerie"] {
  --accent:      #B8722C;
  --accent-deep: #8E5620;
  --accent-ink:  #fff7e8;
  --bg:          #fdf8ea;
  --bg-messages: #fbf3de;
}

/* ==============================================================
   THEME H — Immobilier             data-theme="immobilier"
   ============================================================== */
.bc[data-theme="immobilier"] {
  --accent:      #34557A;
  --accent-deep: #24405E;
  --accent-ink:  #ffffff;
  --bg:          #faf8f3;
  --bg-messages: #f1ede3;
}

/* ==============================================================
   THEME I — Hébergements           data-theme="hebergements"
   ============================================================== */
.bc[data-theme="hebergements"] {
  --accent:      #3F6B4D;
  --accent-deep: #2E523A;
  --accent-ink:  #ffffff;
  --bg:          #f6f4ec;
  --bg-messages: #f1efe8;
}

/* ==============================================================
   THEME J — Sites Web Pro          data-theme="sites-web-pro"
   ============================================================== */
.bc[data-theme="sites-web-pro"] {
  --accent:      #3D3B6E;
  --accent-deep: #2B2A50;
  --accent-ink:  #ffffff;
  --bg:          #faf8f3;
  --bg-messages: #efece3;
}

/* ==============================================================
   THEME K — Contact (form-chat)    data-theme="contact"
   ============================================================== */
.bc[data-theme="contact"] {
  --accent:      #F5B800;
  --accent-deep: #E29A00;
  --accent-ink:  #161a2b;
  --bg:          #faf8f3;
  --bg-messages: #f5f1e5;
}
