﻿/* Chat Widget — Avangard style */
#av-chat-bubble {
  position: fixed; bottom: 24px; right: 24px; z-index: 99999;
  width: 60px; height: 60px; border-radius: 50%;
  background: #B0B02F; color: #080a00; border: 2px solid #85734f;
  cursor: pointer; box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; transition: transform 0.2s, box-shadow 0.2s;
  animation: av-bounce 2s infinite;
}
#av-chat-bubble:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(0,0,0,0.6); }
#av-chat-bubble:active { transform: scale(0.95); }

@keyframes av-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

#av-chat-overlay {
  display: none; position: fixed; inset: 0; z-index: 99998;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  justify-content: center; align-items: center;
}
#av-chat-overlay.open { display: flex; }

#av-chat-frame {
  width: 100%; max-width: 500px; height: 100vh; height: 100dvh;
  max-height: 750px; background: #1a1a1a; border-radius: 12px;
  border: 2px solid #85734f; overflow: hidden;
  display: flex; flex-direction: column; font-family: Roboto, sans-serif;
  animation: av-slidein 0.3s ease;
}
@keyframes av-slidein {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#av-chat-close {
  position: absolute; top: 12px; right: 16px; z-index: 10;
  background: none; border: none; color: #ccc; font-size: 28px;
  cursor: pointer; line-height: 1;
}
#av-chat-close:hover { color: #fff; }

#av-chat-content {
  flex: 1; overflow-y: auto; padding: 20px;
  color: #e8e8e8; background: #111;
}
#av-chat-content::-webkit-scrollbar { width: 4px; }
#av-chat-content::-webkit-scrollbar-thumb { background: #85734f; border-radius: 2px; }

.av-form-card h2 {
  font-size: 22px; color: #B0B02F; margin-bottom: 8px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.av-form-card .av-subtitle {
  color: #999; font-size: 13px; margin-bottom: 20px;
}
.av-form-group { margin-bottom: 14px; }
.av-form-group label {
  display: block; font-size: 12px; color: #888; margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.av-form-group input { font-size: 16px;
  width: 100%; padding: 11px 14px; border-radius: 6px;
  border: 1px solid #333; background: #1a1a1a; color: #fff;
  font-size: 15px; font-family: inherit; transition: border 0.2s;
}
.av-form-group input:focus { outline: none; border-color: #B0B02F; }
.av-form-group input.av-error { border-color: #DC2626; }
.av-form-group .av-err-msg {
  display: none; color: #DC2626; font-size: 11px; margin-top: 4px;
}
.av-form-group .av-err-msg.av-visible { display: block; }

.av-consent-row {
  display: flex; align-items: flex-start; gap: 8px; margin: 18px 0;
  font-size: 12px; color: #888;
}
.av-consent-row input { margin-top: 3px; accent-color: #B0B02F; }
.av-consent-row a { color: #B0B02F; text-decoration: underline; }

.av-btn {
  width: 100%; padding: 14px; border-radius: 8px; border: none;
  font-size: 16px; font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.5px;
  transition: all 0.2s; font-family: inherit;
}
.av-btn-primary { background: linear-gradient(135deg, #B0B02F, #85734f); color: #080a00; }
.av-btn-primary:hover:not(:disabled) { filter: brightness(1.15); }
.av-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.av-btn-success { background: #22c55e; color: #fff; border-radius: 20px; padding: 10px 20px; width: auto; font-size: 14px; }
.av-btn-success:disabled { opacity: 0.5; }

/* THANK YOU STATE — chat */
.av-thankyou-header { text-align: center; padding: 0 0 14px; border-bottom: 1px solid #333; margin-bottom: 10px; }
.av-thankyou-header h2 { font-size: 18px; color: #B0B02F; }
.av-thankyou-header p { font-size: 12px; color: #888; }

.av-chat-messages { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.av-msg { display: flex; gap: 8px; max-width: 88%; animation: av-msgIn 0.25s ease; }
@keyframes av-msgIn { from { opacity:0; transform: translateY(5px); } to { opacity:1; transform: translateY(0); } }
.av-msg-bot { align-self: flex-start; }
.av-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.av-msg .av-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.av-msg-bot .av-avatar { background: #B0B02F; color: #080a00; }
.av-msg-user .av-avatar { background: #333; color: #ccc; }
.av-msg .av-bubble { padding: 8px 12px; border-radius: 10px; font-size: 14px; line-height: 1.4; }
.av-msg-bot .av-bubble { background: #222; border: 1px solid #333; }
.av-msg-user .av-bubble { background: #85734f; color: #fff; }
.av-msg .av-time { font-size: 10px; opacity: 0.5; margin-top: 3px; text-align: right; display: block; }

.av-quick-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; }
.av-quick-row button {
  padding: 8px 14px; border-radius: 16px; border: 1px solid #333;
  background: #1a1a1a; color: #ccc; font-size: 12px; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.av-quick-row button:hover { border-color: #B0B02F; color: #B0B02F; }

.av-callback-row { text-align: center; padding: 8px 0; }

.av-input-row { display: flex; gap: 6px; padding-top: 8px; border-top: 1px solid #333; }
.av-input-row input { flex: 1; padding: 10px 14px; border-radius: 20px; border: 1px solid #333; background: #1a1a1a; color: #fff; font-size: 16px; font-family: inherit; }
.av-input-row input:focus { outline: none; border-color: #B0B02F; }
.av-input-row button { width: 40px; height: 40px; border-radius: 50%; background: #B0B02F; color: #080a00; border: none; font-size: 16px; cursor: pointer; flex-shrink: 0; }
.av-input-row button:disabled { opacity: 0.4; }

.av-typing { display: flex; gap: 3px; padding: 6px 12px; }
.av-typing span { width: 7px; height: 7px; border-radius: 50%; background: #666; animation: av-blink 1.4s infinite ease; }
.av-typing span:nth-child(2) { animation-delay: 0.2s; }
.av-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes av-blink { 0%,60%,100%{opacity:0.3} 30%{opacity:1} }

@media (max-width: 520px) {
  #av-chat-bubble { bottom: 16px; right: 16px; width: 54px; height: 54px; }
  #av-chat-frame { max-height: 100vh; border-radius: 0; }
}
