/* Avantia — custom CSS */

/* Base */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #EEF2FF;
  color: #0C0C0A;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

::selection { background: #0A5CFF; color: #fff; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #EEF2FF; }
::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 99px; }

/* ============================================================
   Scroll-reveal
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   Hero floating cards
   ============================================================ */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.float-0 { animation: floatY 5.5s ease-in-out infinite 0.0s; }
.float-1 { animation: floatY 6.2s ease-in-out infinite 0.8s; }
.float-2 { animation: floatY 5.8s ease-in-out infinite 1.6s; }
.float-3 { animation: floatY 6.8s ease-in-out infinite 2.4s; }

/* ============================================================
   Pulse ring
   ============================================================ */
@keyframes pulseRing {
  0%   { transform: translate(-50%,-50%) scale(1);   opacity: 0.25; }
  100% { transform: translate(-50%,-50%) scale(2.8); opacity: 0; }
}
.pulse-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: rgba(10,92,255,0.25);
  animation: pulseRing 3.5s ease-out 1.2s infinite;
  pointer-events: none;
}

/* ============================================================
   Marquee
   ============================================================ */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-track {
  display: flex;
  gap: 48px;
  width: max-content;
  animation: marquee 28s linear infinite;
  white-space: nowrap;
}

/* ============================================================
   Nav
   ============================================================ */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
#nav.scrolled {
  background: rgba(238,242,255,0.95);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(191,219,254,0.8);
}

/* ============================================================
   Mobile menu
   ============================================================ */
#mobile-menu {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  z-index: 40;
  background: #EEF2FF;
  border-bottom: 1px solid #dbeafe;
}
#mobile-menu.open {
  display: block;
  animation: menuIn 0.18s ease;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Service / result cards
   ============================================================ */
.service-card {
  background: #F5F8FF;
  border: 1px solid rgba(191,219,254,0.8);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.service-card:hover {
  box-shadow: 0 12px 40px -8px rgba(10,92,255,0.12);
  transform: translateY(-2px);
}

.result-card {
  background: #F5F8FF;
}

/* ============================================================
   Blog cards
   ============================================================ */
.blog-card-small {
  background: #F5F8FF;
  border: 1px solid rgba(191,219,254,0.8);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  min-height: 90px;
}
.blog-card-small:hover {
  box-shadow: 0 8px 24px -6px rgba(10,92,255,0.1);
  transform: translateY(-2px);
}
.blog-card-small:hover img { transform: scale(1.05); }

/* ============================================================
   FAQ
   ============================================================ */
.faq-item {
  background: #F5F8FF;
  border: 1px solid rgba(191,219,254,0.8);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.faq-item:hover { box-shadow: 0 4px 16px -4px rgba(10,92,255,0.08); }

/* faq icons: initial visibility handled by inline HTML style, toggled via JS */

.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}
.faq-answer.open {
  max-height: 300px;
  opacity: 1;
}

/* ============================================================
   Contact form
   ============================================================ */
.form-input {
  width: 100%;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  color: #0C0C0A;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
}
.form-input::placeholder { color: #a1a1aa; }
.form-input:focus {
  border-color: #0A5CFF;
  box-shadow: 0 0 0 3px rgba(10,92,255,0.1);
}
.form-input.error {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.1);
}

.form-error {
  font-size: 12px;
  color: #ef4444;
  min-height: 16px;
  display: block;
}

/* ============================================================
   Chat widget
   ============================================================ */
#chat-widget {
  position: fixed;
  bottom: 20px; right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
@media (min-width: 640px) {
  #chat-widget { bottom: 24px; right: 24px; }
}

#chat-toggle {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #0A5CFF;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px -4px rgba(10,92,255,0.55);
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
  order: 2;
}
#chat-toggle:hover { background: #3b82f6; transform: scale(1.08); }
#chat-toggle:active { transform: scale(0.95); }

#chat-box {
  display: none;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 64px -12px rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.06);
  background: #0F172A;
  width: min(360px, calc(100vw - 32px));
  height: min(520px, calc(100dvh - 120px));
  order: 1;
}
#chat-box.open {
  display: flex;
  animation: chatOpen 0.22s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes chatOpen {
  from { opacity: 0; transform: scale(0.9) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  scrollbar-width: none;
}
#chat-messages::-webkit-scrollbar { display: none; }

.msg-bot, .msg-user {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
  word-break: break-word;
}
.msg-bot {
  background: rgba(255,255,255,0.07);
  color: #e4e4e7;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.msg-user {
  background: #0A5CFF;
  color: white;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.typing-dots {
  background: rgba(255,255,255,0.07);
  padding: 12px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
}
@keyframes dotBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}
.typing-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #71717a;
  display: inline-block;
}
.typing-dots span:nth-child(1) { animation: dotBounce 0.6s infinite 0.00s; }
.typing-dots span:nth-child(2) { animation: dotBounce 0.6s infinite 0.15s; }
.typing-dots span:nth-child(3) { animation: dotBounce 0.6s infinite 0.30s; }

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  align-self: flex-start;
}
.quick-reply-btn {
  font-size: 12px;
  color: #d4d4d8;
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  padding: 6px 12px;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: 'Inter', sans-serif;
}
.quick-reply-btn:hover {
  border-color: rgba(10,92,255,0.6);
  color: white;
  background: rgba(10,92,255,0.1);
}

/* ============================================================
   Spinner
   ============================================================ */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
