/* Contact dock (WhatsApp, live AI chat, book a meeting) and the chat panel it opens. */

.cv-dock {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem;
}
.cv-dock__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; min-width: 3rem; padding: 0 1rem; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16); background: #140d0d; color: #fff;
  font: inherit; font-size: 0.9rem; font-weight: 700; line-height: 1; text-decoration: none; cursor: pointer;
  box-shadow: 0 16px 32px -18px rgba(0, 0, 0, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cv-dock__btn .ico { width: 1.2rem; height: 1.2rem; flex: none; }
.cv-dock__btn:hover, .cv-dock__btn:focus-visible { transform: translateY(-2px); box-shadow: 0 20px 36px -18px rgba(0, 0, 0, 0.8); }
.cv-dock__btn:focus-visible { outline: 3px solid #ff9b6b; outline-offset: 3px; }
.cv-dock__btn--wa { background: #25d366; border-color: transparent; color: #04200d; }
.cv-dock__btn--ai { background: linear-gradient(135deg, #ff4b00, #ff7a3d); border-color: transparent; }
.cv-dock__btn--cal { background: #fff; border-color: transparent; color: #140d0d; }
.cv-dock__btn[aria-expanded="true"] { outline: 2px solid #ff9b6b; outline-offset: 3px; }

.cv-chat {
  position: fixed; right: 13.2rem; bottom: 1rem; z-index: 70;
  width: min(380px, calc(100vw - 14.5rem)); height: min(540px, calc(100vh - 2rem));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 1.2rem; border: 1px solid rgba(255, 255, 255, 0.12);
  background: #140d0d; color: #fff; box-shadow: 0 30px 70px -28px rgba(0, 0, 0, 0.85);
}
.cv-chat[hidden] { display: none; }
.cv-chat__head {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(255, 75, 0, 0.22), rgba(255, 75, 0, 0));
}
.cv-chat__head > div { flex: 1; min-width: 0; display: grid; gap: 0.15rem; }
.cv-chat__head strong { font-size: 0.98rem; }
.cv-chat__head small { color: rgba(255, 255, 255, 0.62); font-size: 0.78rem; }
.cv-chat__avatar { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: #ff4b00; }
.cv-chat__avatar .ico { width: 1.2rem; height: 1.2rem; }
.cv-chat__close {
  display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer;
}
.cv-chat__close .ico { width: 1rem; height: 1rem; }
.cv-chat__log {
  flex: 1; min-height: 0; overflow-y: auto; padding: 1rem;
  display: flex; flex-direction: column; gap: 0.6rem;
}
.cv-chat__msg {
  max-width: 85%; padding: 0.65rem 0.85rem; border-radius: 1rem;
  font-size: 0.92rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
  animation: cv-msg-in 0.35s ease both;
}
.cv-chat__msg a { color: #ffb08a; font-weight: 700; }
.cv-chat__msg--bot { align-self: flex-start; background: rgba(255, 255, 255, 0.08); border-bottom-left-radius: 0.3rem; }
.cv-chat__msg--user { align-self: flex-end; background: #ff4b00; color: #fff; border-bottom-right-radius: 0.3rem; }
.cv-chat__msg--typing { align-self: flex-start; color: rgba(255, 255, 255, 0.7); font-style: italic; }
.cv-chat__form { display: flex; gap: 0.5rem; padding: 0.8rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.cv-chat__input {
  flex: 1; min-width: 0; height: 2.8rem; padding: 0 0.9rem; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.06);
  color: #fff; font: inherit; font-size: 0.95rem;
}
.cv-chat__input::placeholder { color: rgba(255, 255, 255, 0.5); }
.cv-chat__input:focus { outline: 2px solid #ff9b6b; outline-offset: 1px; }
.cv-chat__send {
  width: 2.8rem; height: 2.8rem; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: #ff4b00; color: #fff; cursor: pointer;
}
.cv-chat__send:disabled { opacity: 0.5; cursor: wait; }
.cv-chat__send .ico { width: 1.1rem; height: 1.1rem; }
.cv-chat__note { margin: 0; padding: 0 1rem 0.9rem; font-size: 0.78rem; color: rgba(255, 255, 255, 0.62); }
.cv-chat__note a { color: #ffb08a; }

@keyframes cv-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
  .cv-dock { right: 0.8rem; bottom: 0.8rem; }
  .cv-dock__btn { width: 3.1rem; height: 3.1rem; min-width: 0; padding: 0; }
  .cv-dock__btn span { display: none; }
  .cv-chat { left: 0.8rem; right: 0.8rem; bottom: 0.8rem; width: auto; height: min(540px, 78vh); }
}

@media (prefers-reduced-motion: reduce) {
  .cv-chat__msg { animation: none; }
  .cv-dock__btn { transition: none; }
}
