/* =========================================================
   CBY CLOUD ASSISTANT — premium SaaS styling
   Palette: navy, white, soft gray, cyan glow, red accent
   ========================================================= */

/* * { box-sizing: border-box; margin: 0; padding: 0; }*/

:root {
  --navy-900: #060b1e;
  --navy-800: #0a1130;
  --navy-700: #0f1a44;
  --navy-600: #16224f;
  --white:    #ffffff;
  --gray-100: #eef2f8;
  --gray-300: #c8d0e0;
  --gray-500: #7a839b;
  --cyan:     #2bd4ff;
  --cyan-2:   #5b8cff;
  --red:      #ff5168;
  --glass:    rgba(255,255,255,0.08);
  --glass-2:  rgba(255,255,255,0.14);
  --stroke:   rgba(255,255,255,0.12);
  --shadow-lg: 0 30px 80px -20px rgba(3,8,30,0.6);
}

/*html, body {
  height: 100%;
  background: #000000;
  color: var(--gray-100);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}*/

/* ---------- Plain page background ---------- */
/*.bg-grid,
.bg-glow,
.particles {
  display: none;
}*/

/* ---------- Demo page chrome ---------- */
/*.site-header {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 48px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .2px; }
.brand-logo {
  display: block;
  width: min(170px, 42vw);
  height: auto;
}
.brand strong { color: var(--cyan); font-weight: 700; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  box-shadow: 0 0 18px rgba(43,212,255,.5);
}
.site-header nav { display: flex; gap: 26px; }
.site-header nav a { color: var(--gray-300); text-decoration: none; font-size: 14px; transition: color .2s; }
.site-header nav a:hover { color: #fff; } */

.btn-ghost {
  background: transparent; color: var(--gray-100);
  border: 1px solid var(--stroke); padding: 10px 16px; border-radius: 10px;
  font-size: 14px; cursor: pointer; transition: all .2s;
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: var(--glass); border-color: rgba(255,255,255,0.25); }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  color: #001022; border: 0; padding: 12px 20px; border-radius: 12px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  box-shadow: 0 10px 30px -8px rgba(43,212,255,.55), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .15s, box-shadow .2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -10px rgba(43,212,255,.7); }

/* Hero */
.hero {
  position: relative; z-index: 2;
  max-width: 100%; padding: 120px 48px;
  display: flex; justify-content: center; align-items: center;
}
.hero-center {
  display: flex; justify-content: center; align-items: center;
}
.chat-launcher-btn {
  position: fixed;
  right: 36px; bottom: 36px;
  z-index: 100;
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #6e2cfc 0%, #d442f5 100%);
  color: #fff; border: 0; padding: 16px 36px; border-radius: 999px;
  font-size: 20px; font-weight: 600; cursor: pointer;
  box-shadow: 0 15px 40px -10px rgba(110, 44, 252, 0.5);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s;
}
.chat-launcher-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 20px 50px -12px rgba(110, 44, 252, 0.7);
}
.chat-launcher-btn.hidden {
  opacity: 0; pointer-events: none;
}
.chat-launcher-btn .btn-icon { display: flex; align-items: center; }

/* =========================================================
   Assistant widget
   ========================================================= */
.assistant-widget {
  position: fixed;
  right: 36px; bottom: 36px;
  width: 200px; height: 300px;
  z-index: 50;
  user-select: none;
  touch-action: none;
  opacity: 1; pointer-events: none;
  transform: scale(1) translateY(0);
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.assistant-widget .phone {
  opacity: 0;
  pointer-events: none;
  transform: translateX(100px) scale(0.9); /* Slide from right */
  transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.assistant-widget.visible .phone {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}
.assistant-widget .floor-shadow {
  opacity: 0;
  transform: translateX(100px);
  transition: all 0.6s ease;
}
.assistant-widget.visible .floor-shadow {
  opacity: 1;
  transform: translateX(0);
}

.floor-shadow {
  position: absolute; bottom: 8px; left: 50%;
  transform: translateX(-50%);
  width: 360px; height: 28px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0,0,0,0.55), transparent 70%);
  filter: blur(6px);
  z-index: 1;
}

.character {
  position: absolute;
  right: -50px; bottom: -10px; /* Pushed further to the right corner */
  width: 270px; height: 92%;
  z-index: 5;
  pointer-events: auto;
  cursor: pointer;
  animation: floatChar 5s ease-in-out infinite;
  transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.assistant-widget.visible .character {
  right: 130px; /* Shifted further left to prevent button overlap */
  pointer-events: none;
}

.character:hover {
  transform: scale(1.02);
}

.speech-bubble {
  position: absolute;
  top: 180px; /* Pulled very close to the head */
  left: 25%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 12px 20px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 10;
}
.speech-bubble::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 75%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid rgba(15, 23, 42, 0.95);
}

.character:hover .speech-bubble {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.assistant-widget.visible .speech-bubble {
  display: none;
}

.assistant-widget.desk-mode .character {
  right: 180px; /* Shifted further left to prevent desk overlap with phone */
  left: auto;
}

.character img {
  width: 85%; height: 100%; object-fit: contain; object-position: bottom;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,.45)) drop-shadow(0 0 30px rgba(43,212,255,.18));
  transition: opacity .35s ease, transform .5s cubic-bezier(.2,.8,.2,1);
}

@keyframes floatChar {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-8px); }
}

/* Phone */
.phone {
  position: absolute;
  right: 0; bottom: 0;
  width: 235px; height: 470px;
  z-index: 4;
  animation: floatPhone 6s ease-in-out infinite;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes floatPhone {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}

.phone-frame {
  --device-bezel: 8px;
  --screen-radius: 30px;
  position: fixed;
  width: 100%; height: 100%;
  border-radius: 44px;
  background:
    rgba(255, 255, 255, 0.02);
  padding: 0;
  box-shadow:
    0 32px 64px -12px rgba(0,0,0,.7),
    inset 0 0 0 1px rgba(255,255,255,.11),
    inset 0 -8px 16px rgba(0,0,0,.28);
}
.phone-frame::before {
  content: "";
  position: absolute;
  inset: var(--device-bezel);
  border-radius: calc(var(--screen-radius) + 4px);
  background: rgba(15, 23, 42, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}
.phone-notch {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 58px; height: 14px; background: #03060f; border-radius: 10px;
  z-index: 6;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.phone-screen {
  position: absolute;
  inset: calc(var(--device-bezel) + 5px);
  z-index: 4;
  border-radius: var(--screen-radius);
  overflow: hidden;
  background: rgba(10, 15, 30, 0.05);
  backdrop-filter: blur(25px) saturate(160%);
  -webkit-backdrop-filter: blur(25px) saturate(160%);
  display: flex; flex-direction: column;
  isolation: isolate;
}
.phone-glow {
  position: absolute; inset: -10px;
  border-radius: 50px;
  background: radial-gradient(closest-side, rgba(43,212,255,.35), transparent 70%);
  filter: blur(20px);
  opacity: .35;
  z-index: -1;
  transition: opacity .3s;
}
.assistant-widget:hover .phone-glow { opacity: .65; }
.assistant-widget:hover .phone { transform: translateY(-4px) scale(1.01); }

/* Idle screen */
.screen-idle {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: var(--gray-300); font-size: 13.5px; letter-spacing: .3px;
  transition: opacity .35s ease;
}
.idle-gif {
  width: min(170px, 80%);
  height: auto;
  max-height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(43,212,255,0.4));
  animation: orbPulse 3s ease-in-out infinite;
}
@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 25px rgba(43,212,255,0.6)); }
}
.screen-idle p { color: rgba(255,255,255,.85); font-weight: 500; }
.pulse-dot {
  position: absolute; top: 50%; left: 50%;
  width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  transform: translate(-50%, -60%);
  box-shadow: 0 0 20px rgba(43,212,255,.8);
}
.pulse-ring {
  position: absolute; top: 50%; left: 50%;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(43,212,255,.6);
  transform: translate(-50%, -60%);
  animation: pulseRing 1.8s ease-out infinite;
}
@keyframes pulseRing {
  0%   { width: 16px; height: 16px; opacity: .9; }
  100% { width: 90px; height: 90px; opacity: 0; margin-left: 0; }
}

/* Chat (hidden until open) */
.chat {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transform: translateY(8px) scale(.99);
  transition: opacity .35s ease, transform .4s cubic-bezier(.2,.8,.2,1);
  background: 
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0)),
    rgba(10, 15, 30, 0.02);
}
.assistant-widget.open .chat { opacity: 1; pointer-events: auto; transform: none; }
.assistant-widget.open .screen-idle { opacity: 0; pointer-events: none; }

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 10px 6px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(20px);
}
.chat-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.avatar {
  position: relative;
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  display: grid; place-items: center;
  color: #001022; font-weight: 700; font-size: 13px;
  box-shadow: 0 0 14px rgba(43,212,255,.5);
}
.avatar-logo {
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  width: 30px;
  height: 30px;
  border-radius: 7px;
}
.ai-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
  display: block;
}
.online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22d39a;
  box-shadow: 0 0 6px rgba(34,211,154,.5);
}

@keyframes onlinePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 211, 154, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(34, 211, 154, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 211, 154, 0); }
}
.chat-title { display: flex; flex-direction: column; min-width: 0; }
.chat-title strong { font-size: 11px; color: #fff; line-height: 1.05; }
.online-status { 
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px; 
  color: #22d39a; 
  font-weight: 500;
  line-height: 1.05;
}
.chat-back {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 8;
  height: 32px;
  min-width: 92px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #23d3b0 0%, #2bd4ff 100%);
  color: #042338;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px -8px rgba(43,212,255,.85), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .15s, box-shadow .2s;
}
.chat-back:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px -8px rgba(43,212,255,1), inset 0 1px 0 rgba(255,255,255,.45);
}
.chat-back-icon {
  font-size: 22px;
  line-height: 1;
  margin-top: -2px;
}
.chat-back.hidden {
  display: none;
}
.chat-close {
  background: transparent; border: 0; color: var(--gray-300);
  width: 22px; height: 22px; border-radius: 8px; cursor: pointer;
  font-size: 16px; line-height: 1;
  justify-self: end;
}
.chat-close:hover { background: var(--glass); color: #fff; }

.chat-body {
  flex: 1; overflow-y: auto;
  padding: 14px 12px 8px;
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.msg {
  max-width: 82%; padding: 9px 12px;
  font-size: 13.5px; line-height: 1.45;
  border-radius: 14px;
  animation: msgIn .35s cubic-bezier(.2,.8,.2,1) both;
  word-wrap: break-word;
}
.msg.bot {
  align-self: flex-start;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.06);
  color: #eaf2ff;
  border-bottom-left-radius: 4px;
  backdrop-filter: blur(6px);
}
.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  color: #001022;
  border-bottom-right-radius: 4px;
  box-shadow: 0 6px 16px -6px rgba(43,212,255,.6);
  font-weight: 500;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* Typing indicator */
.typing {
  align-self: flex-start;
  display: inline-flex; gap: 4px;
  padding: 10px 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px; border-bottom-left-radius: 4px;
}
.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.6);
  animation: typing 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing {
  0%,100% { transform: translateY(0); opacity: .4; }
  50%     { transform: translateY(-4px); opacity: 1; }
}

/* Lead form */
.lead-form {
  display: none;
  flex-direction: column; gap: 8px;
  padding: 10px 12px 14px;
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(10px);
  animation: msgIn .4s ease both;
}
.lead-form.show { display: flex; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field label { font-size: 10.5px; color: var(--gray-500); letter-spacing: .3px; text-transform: uppercase; }
.field input, .field textarea {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: #fff; font-size: 13px;
  padding: 8px 10px; border-radius: 9px;
  outline: none; font-family: inherit;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus {
  border-color: rgba(43,212,255,.6);
  background: rgba(43,212,255,.08);
  box-shadow: 0 0 0 3px rgba(43,212,255,.15);
}
.field textarea { resize: none; }

.cta-glow {
  margin-top: 4px;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  color: #001022; border: 0; padding: 11px 14px; border-radius: 11px;
  font-weight: 700; font-size: 13px; cursor: pointer; letter-spacing: .2px;
  box-shadow: 0 8px 24px -6px rgba(43,212,255,.6), inset 0 1px 0 rgba(255,255,255,.4);
  position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .2s;
}
.cta-glow:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -8px rgba(43,212,255,.85); }
.cta-glow::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .8s;
}
.cta-glow:hover::after { transform: translateX(100%); }

/* Floating launcher (mobile / collapsed) */
.launcher {
  position: absolute;
  right: 10px; bottom: 10px;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2));
  color: #001022; border: 0; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 14px 30px -8px rgba(43,212,255,.7);
  z-index: 10;
}
.launcher-pulse {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid rgba(43,212,255,.55);
  animation: pulseRing 1.8s ease-out infinite;
}

/* =========================================================
   Responsive
   ========================================================= */
/* ─── existing: mid tablet / small laptop ─── */
@media (max-width: 900px) {
  .site-header nav { display: none; }
  .hero { padding: 50px 24px 100px; }
}

/* ─── NEW: Surface Pro 7/8, windowed 1024 laptops ─── */
@media (max-width: 1024px) {
  .site-header nav { gap: 16px; }
  .hero { padding: 60px 32px 110px; }
}

/* ─── NEW: Surface Go, tablets in portrait, 768px browsers ─── */
@media (max-width: 768px) {
  .assistant-widget {
    right: 16px; bottom: 16px;
    width: 340px; height: 450px;
  }
  .character {
    width: 190px;
    left: auto;
    right: -20px;
  }
  .assistant-widget.visible .character { right: 155px; }
  .assistant-widget.desk-mode .character {
    left: auto;
    right: 128px;
  }
  .assistant-widget.form-open .character { right: 210px; }
  .phone { width: 224px; height: 460px; }
  .phone-frame { border-radius: 38px; }
  .phone-screen { --screen-radius: 29px; }
  .floor-shadow { width: 250px; }
  .hero-stats { gap: 26px; }
}

/* ─── existing: small phones ─── */
@media (max-width: 640px) {
  .assistant-widget {
    right: 12px; bottom: 12px;
    width: 320px; height: 420px;
  }
  .character {
    width: 180px;
    left: auto;
    right: -22px;
  }
  .assistant-widget.visible .character { right: 145px; }
  .assistant-widget.desk-mode .character {
    left: auto;
    right: 120px;
  }
  .assistant-widget.form-open .character { right: 200px; }
  .phone { width: 214px; height: 440px; }
  .phone-frame { border-radius: 36px; }
  .phone-screen { --screen-radius: 27px; }
  .floor-shadow { width: 240px; }
  .hero-stats { gap: 22px; }
}

/* ─── NEW: snapped windows / narrow phones (Galaxy Fold open, etc.) ─── */
@media (max-width: 480px) {
  .assistant-widget {
    right: 8px; bottom: 8px;
    width: 300px; height: 400px;
  }
  .character {
    width: 165px;
    right: -18px;
  }
  .assistant-widget.visible .character { right: 132px; }
  .assistant-widget.desk-mode .character { right: 110px; }
  .assistant-widget.form-open .character { right: 184px; }
  .phone { width: 198px; height: 415px; }
  .phone-frame { border-radius: 32px; }
  .phone-screen { --screen-radius: 24px; }
  .floor-shadow { width: 220px; }
  .hero-stats { gap: 16px; }
}
/* When dragged */
.assistant-widget.dragging { transition: none; cursor: grabbing; }
.assistant-widget.dragging .phone, .assistant-widget.dragging .character { animation: none; }

/* Integration layer: keep WB visual shell while embedding cbycloudbot widget */
.chat-body--embed {
  position: relative;
  padding: 0 0 48px;
  overflow: hidden;
  min-height: 0;
  margin: 0;
  border: 0;
  background: transparent;
}

.chat .chat-body.chat-body--embed {
  padding: 0 !important;
  gap: 0 !important;
  margin: 0 !important;
}

.chatbot-frame {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 100%;
  max-height: 100%;
  border: 0;
  background: transparent;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
}

.chat .chat-body.chat-body--embed > .chatbot-frame {
  display: block;
  width: 100% !important;
  height: 100% !important;
  flex: none;
  margin: 0 !important;
  padding: 0 !important;
}

/* Allow the phone content area to size fluidly across desktop/tablet/mobile */
.chat {
  min-height: 0;
}
