/* EVA assistant: one persistent widget for every page (launcher + dialogue). */
.eva-dock {
  --eva-bg: #0a0f14;
  --eva-panel: #101922;
  --eva-panel-2: #142231;
  --eva-line: #1f3140;
  --eva-line-strong: #2e4a5e;
  --eva-ink: #e4eef2;
  --eva-ink-2: #b8cad2;
  --eva-mute: #8aa2ad;
  --eva-glass: #9fe3ef;
  --eva-blue: #1677ff;
  --eva-ok: #7fe0a8;
  position: fixed;
  z-index: 9000;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  font-family: inherit;
  color: var(--eva-ink);
  -webkit-font-smoothing: antialiased;
}
.eva-dock *, .eva-dock *::before, .eva-dock *::after { box-sizing: border-box; }
.eva-dock[hidden] { display: none; }

/* Launcher */
.eva-launcher {
  position: relative;
  display: block;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 1px solid rgba(159, 227, 239, .7);
  border-radius: 50%;
  overflow: visible;
  background: radial-gradient(circle at 50% 30%, #1d3f5c, #07121d 70%);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, .12), 0 10px 30px rgba(0, 0, 0, .45), 0 0 26px rgba(95, 200, 255, .35);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, opacity .25s ease;
}
.eva-launcher:hover { transform: translateY(-3px); box-shadow: 0 0 0 4px rgba(22, 119, 255, .2), 0 14px 34px rgba(0, 0, 0, .5), 0 0 34px rgba(95, 200, 255, .5); }
.eva-launcher:focus-visible { outline: 2px solid var(--eva-glass); outline-offset: 4px; }
.eva-launcher-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
}
.eva-launcher-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transform: scale(2.3);
  transform-origin: 50% 18%;
}
.eva-launcher::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(159, 227, 239, .55);
  border-radius: 50%;
  animation: eva-ring 2.8s ease-out infinite;
  pointer-events: none;
}
.eva-launcher-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  border: 2px solid #07121d;
  border-radius: 50%;
  background: var(--eva-ok);
}
.eva-launcher-dot[hidden] { display: none; }
.eva-dock.is-open .eva-launcher { opacity: 0; pointer-events: none; transform: scale(.8); }

/* Greeting bubble near the launcher */
.eva-bubble {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: min(280px, calc(100vw - 32px));
  padding: 12px 34px 12px 14px;
  border: 1px solid var(--eva-line-strong);
  border-radius: 14px 14px 4px 14px;
  background: rgba(16, 25, 34, .97);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
  font-size: 14px;
  line-height: 1.4;
  color: var(--eva-ink);
  cursor: pointer;
  animation: eva-pop .3s ease both;
}
.eva-bubble[hidden] { display: none; }
.eva-bubble b { display: block; margin-bottom: 2px; color: var(--eva-glass); font-size: 12px; letter-spacing: .06em; }
.eva-bubble-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  color: var(--eva-mute);
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.eva-bubble-close:hover { color: var(--eva-ink); background: rgba(255, 255, 255, .06); }

/* Dialogue panel */
.eva-chat {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: 390px;
  height: min(640px, calc(100vh - 40px));
  height: min(640px, calc(100dvh - 40px));
  overflow: hidden;
  border: 1px solid var(--eva-line-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 34, 49, .98), rgba(10, 15, 20, .98));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(159, 227, 239, .08), 0 0 40px rgba(95, 200, 255, .12);
  transform-origin: 100% 100%;
  animation: eva-pop .25s ease both;
}
.eva-chat[hidden] { display: none; }
.eva-chat-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 12px 12px 14px;
  border-bottom: 1px solid var(--eva-line);
  background: rgba(10, 15, 20, .5);
}
.eva-chat-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid rgba(159, 227, 239, .6);
  border-radius: 50%;
}
.eva-chat-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; transform: scale(2.3); transform-origin: 50% 18%; }
.eva-chat-title { flex: 1; min-width: 0; }
.eva-chat-title strong { display: block; color: var(--eva-glass); font-size: 16px; letter-spacing: .08em; }
.eva-chat-title span { display: block; overflow: hidden; color: var(--eva-mute); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.eva-icon-btn {
  flex: 0 0 auto;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--eva-line);
  border-radius: 10px;
  color: var(--eva-ink-2);
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.eva-icon-btn:hover, .eva-icon-btn:focus-visible { color: var(--eva-ink); border-color: var(--eva-line-strong); background: rgba(255, 255, 255, .05); outline: none; }

.eva-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}
.eva-msg { display: flex; margin: 0 0 10px; }
.eva-msg-body {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.eva-msg.is-eva .eva-msg-body { border: 1px solid var(--eva-line); border-bottom-left-radius: 4px; background: var(--eva-panel-2); color: var(--eva-ink); }
.eva-msg.is-user { justify-content: flex-end; }
.eva-msg.is-user .eva-msg-body { border-bottom-right-radius: 4px; background: var(--eva-blue); color: #fff; }
.eva-msg-body p { margin: 0 0 6px; }
.eva-msg-body p:last-child { margin-bottom: 0; }
.eva-context-note {
  margin: 4px 0 10px;
  color: var(--eva-mute);
  font-size: 11px;
  letter-spacing: .04em;
  text-align: center;
}
.eva-typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.eva-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--eva-glass); opacity: .4; animation: eva-blink 1s infinite; }
.eva-typing i:nth-child(2) { animation-delay: .15s; }
.eva-typing i:nth-child(3) { animation-delay: .3s; }

.eva-actions { display: grid; gap: 7px; margin: 2px 0 12px; }
.eva-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--eva-glass);
  border-radius: 10px;
  color: var(--eva-bg);
  background: var(--eva-glass);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.eva-action:hover, .eva-action:focus-visible { background: #c4f1f8; outline: none; }
.eva-action.is-secondary { color: var(--eva-glass); background: transparent; border-color: var(--eva-line-strong); }
.eva-action.is-secondary:hover, .eva-action.is-secondary:focus-visible { color: var(--eva-ink); background: rgba(159, 227, 239, .08); border-color: var(--eva-glass); }
.eva-action small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; opacity: .8; }

.eva-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 10px; }
.eva-quick[hidden] { display: none; }
.eva-quick button {
  padding: 8px 11px;
  border: 1px solid var(--eva-line-strong);
  border-radius: 999px;
  color: var(--eva-ink);
  background: rgba(20, 34, 49, .8);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}
.eva-quick button:hover, .eva-quick button:focus-visible { border-color: var(--eva-glass); color: #fff; background: rgba(159, 227, 239, .1); outline: none; }

.eva-input {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--eva-line);
  background: rgba(10, 15, 20, .6);
}
.eva-input textarea {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  max-height: 120px;
  padding: 10px 12px;
  resize: none;
  border: 1px solid var(--eva-line-strong);
  border-radius: 10px;
  color: var(--eva-ink);
  background: var(--eva-panel);
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  overflow-y: auto;
  scrollbar-width: none;
}
.eva-input textarea::-webkit-scrollbar { display: none; }
.eva-input textarea::placeholder { color: var(--eva-mute); }
.eva-input textarea:focus { border-color: var(--eva-glass); outline: none; box-shadow: 0 0 0 3px rgba(159, 227, 239, .12); }
.eva-send {
  flex: 0 0 auto;
  width: 44px;
  border: 0;
  border-radius: 10px;
  color: var(--eva-bg);
  background: var(--eva-glass);
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
}
.eva-send:disabled { opacity: .45; cursor: default; }
.eva-foot { padding: 0 12px 9px; color: var(--eva-mute); font-size: 11px; line-height: 1.35; background: rgba(10, 15, 20, .6); }

/* Lead form inside the dialogue */
.eva-lead {
  margin: 2px 0 12px;
  padding: 12px;
  border: 1px solid var(--eva-line-strong);
  border-radius: 12px;
  background: var(--eva-panel);
}
.eva-lead label { display: block; margin: 0 0 4px; color: var(--eva-ink-2); font-size: 12px; }
.eva-lead input[type="text"], .eva-lead input[type="tel"] {
  display: block;
  width: 100%;
  margin: 0 0 9px;
  padding: 10px 11px;
  border: 1px solid var(--eva-line-strong);
  border-radius: 9px;
  color: var(--eva-ink);
  background: var(--eva-bg);
  font: inherit;
  font-size: 16px;
}
.eva-lead input:focus { border-color: var(--eva-glass); outline: none; }
.eva-lead .eva-consent { display: flex; gap: 8px; align-items: flex-start; margin: 2px 0 10px; color: var(--eva-mute); font-size: 12px; line-height: 1.4; }
.eva-lead .eva-consent input { margin-top: 2px; accent-color: var(--eva-glass); }
.eva-lead .eva-consent a { color: var(--eva-glass); }
.eva-lead-error { margin: 0 0 8px; color: #ffb35c; font-size: 12px; }
.eva-lead-error[hidden] { display: none; }

.eva-backdrop { display: none; }

/* Homepage: the fixed widget replaces the hero-bound reopen button. */
.home-cinematic .eva-reopen { display: none !important; }
body.menu-open .eva-dock { display: none; }
body.eva-hero-active .eva-dock { opacity: 0; pointer-events: none; }

@keyframes eva-ring { 0% { opacity: .8; transform: scale(.92); } 70%, 100% { opacity: 0; transform: scale(1.25); } }
@keyframes eva-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes eva-blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

@media (max-width: 600px) {
  .eva-launcher { width: 58px; height: 58px; }
  .eva-bubble { bottom: 70px; }
  .eva-dock.is-open .eva-backdrop { display: block; position: fixed; inset: 0; background: rgba(3, 8, 14, .6); }
  .eva-chat {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    height: 88vh;
    height: 88dvh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  body.eva-chat-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .eva-launcher::after, .eva-chat, .eva-bubble, .eva-typing i { animation: none; }
}
