:root {
  --bg: #030815;
  --bg-2: #071a2d;
  --panel: rgba(7, 20, 38, 0.78);
  --panel-strong: rgba(9, 24, 44, 0.94);
  --card: rgba(255, 255, 255, 0.08);
  --card-soft: rgba(255, 255, 255, 0.055);
  --text: #eaf7ff;
  --muted: #8fb1c8;
  --line: rgba(134, 239, 255, 0.16);
  --line-strong: rgba(125, 211, 252, 0.34);
  --primary: #38bdf8;
  --primary-2: #22d3ee;
  --green: #22c55e;
  --bubble-admin: rgba(11, 31, 55, 0.90);
  --bubble-user: rgba(12, 91, 75, 0.90);
  --shadow: 0 34px 100px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 19% 40%, rgba(34, 211, 238, 0.22), transparent 22rem),
    radial-gradient(circle at 75% 18%, rgba(56, 189, 248, 0.17), transparent 26rem),
    radial-gradient(circle at 83% 86%, rgba(34, 197, 94, 0.12), transparent 28rem),
    linear-gradient(135deg, var(--bg), var(--bg-2) 58%, #02101d);
  overflow-x: hidden;
}

body.chat-open { overflow: hidden; }
button, input { font: inherit; }
button { cursor: pointer; border: 0; }
a { color: inherit; text-decoration: none; }

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background: linear-gradient(rgba(255,255,255,0.036) 1px, transparent 1px);
  background-size: 100% 3px;
  mix-blend-mode: screen;
  z-index: 1;
}

.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.halo {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  box-shadow: inset 0 0 60px rgba(34, 211, 238, 0.08), 0 0 70px rgba(14, 165, 233, 0.12);
  animation: floatHalo 9s ease-in-out infinite alternate;
}
.halo-one { width: 520px; height: 520px; left: -190px; top: -120px; }
.halo-two { width: 680px; height: 680px; right: -270px; top: 2%; animation-delay: -2.5s; }
.halo-three { width: 360px; height: 360px; left: 22%; bottom: -170px; animation-delay: -5s; }
.grid-light {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(56,189,248,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,0.08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 42% 48%, black, transparent 75%);
}
.scan-line {
  position: absolute;
  inset: -20% 0 auto;
  height: 260px;
  background: linear-gradient(180deg, transparent, rgba(125, 211, 252, 0.08), transparent);
  animation: scan 7s ease-in-out infinite;
}
@keyframes scan {
  0%, 15% { transform: translateY(-100%); opacity: 0; }
  40% { opacity: 1; }
  72%, 100% { transform: translateY(130vh); opacity: 0; }
}
@keyframes floatHalo { to { transform: translate3d(20px, 28px, 0) scale(1.06); } }

.hero-shell {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.assistant-stage {
  width: min(1120px, 100%);
  min-height: min(760px, calc(100dvh - 56px));
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(320px, 0.85fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(18px, 4vw, 48px);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 42px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.09), rgba(255,255,255,0.035)),
    rgba(5, 16, 31, 0.62);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,0.04) inset;
  backdrop-filter: blur(22px);
  position: relative;
  overflow: hidden;
}
.assistant-stage::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 0 20%, rgba(125,211,252,0.25), transparent 46% 100%);
  transform: translateX(-70%);
  animation: borderSweep 8s ease-in-out infinite;
}
@keyframes borderSweep {
  0%, 42% { transform: translateX(-75%); opacity: 0; }
  55% { opacity: 1; }
  82%, 100% { transform: translateX(75%); opacity: 0; }
}

.orb-zone {
  display: grid;
  place-items: center;
  min-height: 450px;
  position: relative;
  isolation: isolate;
}
.big-orb {
  width: clamp(300px, 41vw, 500px);
  height: clamp(300px, 41vw, 500px);
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 999px;
  filter: drop-shadow(0 0 46px rgba(56, 189, 248, 0.34));
}
.big-orb::before,
.big-orb::after,
.orb-core,
.orb-ring,
.orb-dot {
  content: "";
  position: absolute;
  border-radius: 999px;
}
.big-orb::before {
  inset: 18%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,0.98), transparent 8%),
    radial-gradient(circle at 62% 68%, rgba(34,197,94,0.72), transparent 22%),
    conic-gradient(from 70deg, #38bdf8, #a78bfa, #22d3ee, #22c55e, #38bdf8);
  filter: saturate(1.35) blur(0.2px);
  box-shadow: 0 0 46px rgba(34, 211, 238, 0.40), inset 0 0 40px rgba(255,255,255,0.12);
  animation: spin 5.8s linear infinite;
}
.big-orb::after {
  inset: 14%;
  border: 1px solid rgba(255,255,255,0.22);
  background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 58%);
  mix-blend-mode: screen;
}
.orb-core {
  width: 27%;
  height: 27%;
  background: radial-gradient(circle, #eaffff 0 12%, rgba(125,211,252,0.75) 13% 35%, rgba(8,47,73,0.08) 60%);
  box-shadow: 0 0 60px rgba(255,255,255,0.55);
  z-index: 4;
  animation: breathe 2.5s ease-in-out infinite;
}
.orb-ring {
  border: 1px solid rgba(125, 211, 252, 0.34);
  box-shadow: 0 0 35px rgba(34, 211, 238, 0.18), inset 0 0 35px rgba(34, 211, 238, 0.08);
}
.ring-1 { inset: 7%; animation: morph 5s ease-in-out infinite alternate; }
.ring-2 { inset: 0; border-style: dashed; opacity: 0.58; animation: spin 18s linear infinite reverse; }
.ring-3 { inset: 24%; opacity: 0.80; animation: morph 3.5s ease-in-out infinite alternate-reverse; }
.ring-4 { inset: -6%; opacity: 0.26; animation: pulseRing 3s ease-in-out infinite; }
.orb-dot {
  width: 10px;
  height: 10px;
  background: #a7f3d0;
  box-shadow: 0 0 22px rgba(167, 243, 208, 0.9);
  z-index: 6;
}
.dot-a { left: 18%; top: 28%; animation: orbitA 7s ease-in-out infinite; }
.dot-b { right: 12%; top: 58%; animation: orbitB 8s ease-in-out infinite; }
.dot-c { left: 50%; bottom: 5%; animation: orbitC 6.5s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.12); opacity: 0.78; } }
@keyframes pulseRing { 50% { transform: scale(1.08); opacity: 0.72; } }
@keyframes morph {
  0% { transform: rotate(0deg) scale(0.96); border-radius: 42% 58% 54% 46% / 45% 42% 58% 55%; }
  100% { transform: rotate(160deg) scale(1.06); border-radius: 58% 42% 45% 55% / 44% 61% 39% 56%; }
}
@keyframes orbitA { 50% { transform: translate(30px, -26px) scale(1.5); } }
@keyframes orbitB { 50% { transform: translate(-36px, 22px) scale(0.75); } }
@keyframes orbitC { 50% { transform: translate(28px, -42px) scale(1.2); } }

.voice-wave {
  position: absolute;
  bottom: 34px;
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 12px 18px;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
}
.voice-wave i {
  width: 5px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a7f3d0, #38bdf8);
  box-shadow: 0 0 18px rgba(34,211,238,0.28);
  animation: bars 1.2s ease-in-out infinite;
}
.voice-wave i:nth-child(2) { animation-delay: -0.2s; }
.voice-wave i:nth-child(3) { animation-delay: -0.4s; }
.voice-wave i:nth-child(4) { animation-delay: -0.6s; }
.voice-wave i:nth-child(5) { animation-delay: -0.8s; }
.voice-wave i:nth-child(6) { animation-delay: -0.3s; }
.voice-wave i:nth-child(7) { animation-delay: -0.5s; }
.voice-wave i:nth-child(8) { animation-delay: -0.7s; }
.voice-wave i:nth-child(9) { animation-delay: -0.9s; }
@keyframes bars { 50% { height: 34px; opacity: 0.72; } }

.assistant-copy { position: relative; z-index: 2; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid rgba(134, 239, 172, 0.22);
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.10);
  color: #a7f3d0;
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 22px;
}
.status-pill i,
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #86efac;
  box-shadow: 0 0 0 5px rgba(134, 239, 172, 0.14), 0 0 16px rgba(134, 239, 172, 0.9);
}
.assistant-copy h1 {
  margin: 0;
  max-width: 620px;
  font-size: clamp(34px, 5.3vw, 68px);
  line-height: 0.96;
  letter-spacing: -0.075em;
}
.assistant-copy p {
  margin: 20px 0 0;
  max-width: 560px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 16px;
}
.cta-panel {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}
.chat-launch {
  min-width: min(100%, 330px);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 24px;
  color: #06121f;
  text-align: left;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.96), transparent 26%),
    linear-gradient(135deg, #a7f3d0, #38bdf8 55%, #22d3ee);
  box-shadow: 0 22px 52px rgba(56, 189, 248, 0.28), inset 0 0 0 1px rgba(255,255,255,0.42);
  transform: translateY(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chat-launch:hover { transform: translateY(-2px); box-shadow: 0 28px 70px rgba(56, 189, 248, 0.35); }
.launch-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,0.34);
  font-size: 24px;
}
.chat-launch strong { display: block; font-size: 18px; font-weight: 950; letter-spacing: -0.02em; }
.chat-launch small { display: block; margin-top: 3px; color: rgba(6, 18, 31, 0.76); line-height: 1.35; }
.wa-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  padding: 16px 20px;
  border-radius: 24px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(125,211,252,0.22);
  color: #dffbff;
  font-weight: 900;
}
.wa-link:hover { background: rgba(34,197,94,0.13); border-color: rgba(34,197,94,0.4); }
.mini-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.mini-info span {
  padding: 8px 11px;
  border-radius: 999px;
  color: #b8d9ea;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(125,211,252,0.12);
}

.chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(1, 8, 18, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(10px);
}
.chat-overlay.open { opacity: 1; pointer-events: auto; }

.chat-card {
  width: min(94vw, 860px);
  height: min(88dvh, 760px);
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  border: 1px solid var(--line-strong);
  border-radius: 30px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.045)),
    var(--panel-strong);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,0.04) inset;
  transform: translateY(34px) scale(0.96);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.chat-overlay.open .chat-card { transform: translateY(0) scale(1); opacity: 1; }

.chat-header {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background:
    radial-gradient(circle at 12% 18%, rgba(34, 211, 238, 0.22), transparent 22rem),
    linear-gradient(135deg, rgba(10, 38, 67, 0.96), rgba(3, 24, 43, 0.96));
  border-bottom: 1px solid var(--line);
}
.profile { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mini-orb {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.mini-orb::before,
.mini-orb::after,
.mini-orb span {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.mini-orb::before {
  inset: 8px;
  background: conic-gradient(from 90deg, #38bdf8, #a78bfa, #22c55e, #38bdf8);
  animation: spin 5s linear infinite;
  box-shadow: 0 0 28px rgba(34,211,238,0.48);
}
.mini-orb::after { inset: 16px; background: #eaffff; box-shadow: 0 0 18px rgba(255,255,255,0.85); }
.mini-orb span { inset: 0; border: 1px dashed rgba(125,211,252,0.42); animation: spin 8s linear infinite reverse; }
.profile-text { min-width: 0; }
.eyebrow {
  display: inline-flex;
  margin-bottom: 4px;
  color: #7dd3fc;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.profile-text strong { display: block; font-size: 17px; line-height: 1.22; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-line { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; margin-top: 4px; }
.close-chat {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(125,211,252,0.22);
  color: #dffbff;
  font-size: 28px;
  line-height: 1;
}
.close-chat:hover { background: rgba(239, 68, 68, 0.20); border-color: rgba(252, 165, 165, 0.34); }

.notice {
  display: grid;
  place-items: center;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.notice span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
}

.chat-body {
  overflow-y: auto;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 12%, rgba(56,189,248,0.07), transparent 15rem),
    radial-gradient(circle at 100% 80%, rgba(34,197,94,0.07), transparent 16rem);
}
.chat-body::-webkit-scrollbar { width: 10px; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(125,211,252,0.20); border-radius: 999px; border: 3px solid rgba(0,0,0,0); background-clip: padding-box; }
.message-row { display: flex; margin: 0 0 12px; }
.message-row.admin { justify-content: flex-start; }
.message-row.user { justify-content: flex-end; }
.message {
  width: fit-content;
  max-width: 88%;
  padding: 12px 13px 18px;
  border-radius: 20px;
  line-height: 1.48;
  font-size: 14px;
  white-space: pre-line;
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 30px rgba(0,0,0,0.16);
}
.message.admin {
  background: var(--bubble-admin);
  color: #eaf7ff;
  border-bottom-left-radius: 6px;
}
.message.user {
  background: var(--bubble-user);
  color: #ecfff9;
  border-bottom-right-radius: 6px;
}
.message a { color: #a7f3d0; font-weight: 900; text-decoration: underline; }
.time {
  position: absolute;
  right: 12px;
  bottom: 5px;
  color: rgba(234,247,255,0.58);
  font-size: 10px;
}
.quick-replies {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: rgba(4, 14, 27, 0.86);
}
.quick-replies button {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 9px 12px;
  color: #dffbff;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(125,211,252,0.18);
  font-size: 12px;
  font-weight: 800;
}
.quick-replies button:hover { background: rgba(56,189,248,0.14); border-color: rgba(125,211,252,0.44); }
.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: rgba(3, 12, 24, 0.95);
}
.composer input {
  min-width: 0;
  border: 1px solid rgba(125,211,252,0.18);
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border-radius: 18px;
  padding: 13px 14px;
  outline: none;
}
.composer input:focus { border-color: rgba(125,211,252,0.62); box-shadow: 0 0 0 4px rgba(56,189,248,0.10); }
.composer input::placeholder { color: rgba(143,177,200,0.78); }
.composer button {
  border-radius: 18px;
  padding: 0 16px;
  color: #042033;
  font-weight: 950;
  background: linear-gradient(135deg, #a7f3d0, #38bdf8);
}

@media (max-width: 860px) {
  .hero-shell { padding: 14px; }
  .assistant-stage {
    min-height: calc(100dvh - 28px);
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
    border-radius: 30px;
    text-align: center;
  }
  .orb-zone { min-height: 350px; }
  .big-orb { width: min(78vw, 360px); height: min(78vw, 360px); }
  .voice-wave { bottom: 10px; }
  .assistant-copy h1 { font-size: clamp(34px, 12vw, 54px); }
  .assistant-copy p { margin-left: auto; margin-right: auto; }
  .cta-panel { justify-content: center; }
  .mini-info { justify-content: center; }
  .chat-overlay { align-items: stretch; padding: 10px; }
  .chat-card { width: 100%; height: 100%; border-radius: 26px; }
}

@media (max-width: 480px) {
  .cta-panel { display: grid; }
  .chat-launch { width: 100%; }
  .wa-link { min-height: 58px; }
  .message { max-width: 94%; }
  .composer { grid-template-columns: 1fr; }
  .composer button { min-height: 46px; }
}

.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(234, 247, 255, 0.82);
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing-dots i {
  width: 7px;
  height: 7px;
  display: block;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.38;
  animation: typingDot 1s ease-in-out infinite;
}

.typing-dots i:nth-child(2) { animation-delay: 0.14s; }
.typing-dots i:nth-child(3) { animation-delay: 0.28s; }

.typing-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.composer input:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

@keyframes typingDot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-4px); opacity: 1; }
}
