/* W2Docs Lead-Closing Assistant Widget */
:root {
  --w2-primary: #0a4d68;
  --w2-primary-hover: #083b50;
  --w2-accent: #0582ca;
  --w2-gold: #d4a373;
  --w2-bg: #f8fafc;
  --w2-text: #1e293b;
  --w2-text-light: #64748b;
  --w2-border: #e2e8f0;
  --w2-shadow: 0 12px 35px -4px rgba(0, 0, 0, 0.18), 0 6px 15px -2px rgba(0, 0, 0, 0.1);
  --w2-radius: 16px;
}

#w2-chatbot-container * {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Floating Launcher Button */
.w2-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a4d68 0%, #0582ca 100%);
  box-shadow: 0 8px 24px rgba(10, 77, 104, 0.4);
  border: 2px solid #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.w2-chat-launcher:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 28px rgba(10, 77, 104, 0.55);
}

.w2-chat-launcher svg {
  width: 30px;
  height: 30px;
  fill: #ffffff;
  transition: transform 0.3s ease;
}

.w2-chat-launcher .w2-icon-close {
  display: none;
}

.w2-chat-launcher.active .w2-icon-chat {
  display: none;
}

.w2-chat-launcher.active .w2-icon-close {
  display: block;
}

.w2-launcher-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

/* Chat Widget Window */
.w2-chat-widget {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 410px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: var(--w2-radius);
  box-shadow: var(--w2-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(10, 77, 104, 0.08);
}

.w2-chat-widget.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.w2-chat-header {
  background: linear-gradient(135deg, #0a4d68 0%, #083b50 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.w2-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.w2-header-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-weight: 800;
  color: #0a4d68;
  font-size: 16px;
  border: 2px solid #00d26a;
  position: relative;
}

.w2-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #00d26a;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.w2-header-text h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.w2-header-text p {
  margin: 2px 0 0 0;
  font-size: 12px;
  opacity: 0.85;
}

.w2-header-actions {
  display: flex;
  gap: 8px;
}

.w2-btn-icon {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.w2-btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Chat Messages Area */
.w2-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--w2-bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.w2-message {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.w2-message.bot {
  align-self: flex-start;
}

.w2-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.w2-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0a4d68;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.w2-msg-bubble {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.w2-message.bot .w2-msg-bubble {
  background: #ffffff;
  color: var(--w2-text);
  border: 1px solid var(--w2-border);
  border-top-left-radius: 4px;
}

.w2-message.user .w2-msg-bubble {
  background: linear-gradient(135deg, #0a4d68 0%, #0582ca 100%);
  color: #ffffff;
  border-top-right-radius: 4px;
}

/* Tab & Quick Action Options */
.w2-quick-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.w2-tab-btn {
  background: #ffffff;
  border: 1.5px solid #0a4d68;
  color: #0a4d68;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.w2-tab-btn:hover {
  background: #0a4d68;
  color: #ffffff;
  transform: translateX(3px);
}

.w2-tab-btn span.badge {
  font-size: 10px;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 6px;
  border-radius: 12px;
  font-weight: 700;
}

.w2-tab-btn:hover span.badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Category Selection (Individual vs Businessman) */
.w2-category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.w2-cat-card {
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.w2-cat-card:hover {
  border-color: #0582ca;
  background: #f0f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(5, 130, 202, 0.15);
}

.w2-cat-card .icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.w2-cat-card .title {
  font-size: 13px;
  font-weight: 700;
  color: #0a4d68;
}

.w2-cat-card .sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

/* Document Limited Preview Card */
.w2-docs-box {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 12px;
  margin-top: 8px;
}

.w2-docs-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.w2-doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.w2-doc-list li {
  font-size: 12.5px;
  color: #334155;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.w2-doc-list li svg {
  width: 14px;
  height: 14px;
  fill: #00d26a;
  flex-shrink: 0;
}

.w2-limited-notice {
  margin-top: 8px;
  font-size: 11px;
  background: #fffbeb;
  color: #92400e;
  padding: 6px 8px;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
  line-height: 1.35;
}

/* CTA Lead Closing Box */
.w2-lead-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
  border: 1.5px solid #00d26a;
  border-radius: 12px;
  padding: 14px;
  margin-top: 10px;
  box-shadow: 0 4px 14px rgba(0, 210, 106, 0.12);
}

.w2-lead-box h4 {
  margin: 0 0 6px 0;
  color: #065f46;
  font-size: 14px;
  font-weight: 700;
}

.w2-lead-box p {
  margin: 0 0 10px 0;
  font-size: 12px;
  color: #334155;
}

.w2-lead-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.w2-btn-cta {
  background: #00d26a;
  color: #ffffff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 3px 8px rgba(0, 210, 106, 0.3);
  transition: all 0.2s ease;
}

.w2-btn-cta:hover {
  background: #05b35c;
  transform: translateY(-1px);
}

.w2-btn-whatsapp {
  background: #25d366;
  color: #ffffff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 3px 8px rgba(37, 211, 102, 0.3);
  transition: all 0.2s ease;
}

.w2-btn-whatsapp:hover {
  background: #1eb956;
}

/* Appointment Form Modal Inside Chat */
.w2-form-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
}

.w2-form-group {
  margin-bottom: 8px;
}

.w2-form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 3px;
}

.w2-form-group input, .w2-form-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12.5px;
  outline: none;
}

.w2-form-group input:focus, .w2-form-group select:focus {
  border-color: #0582ca;
}

.w2-btn-submit {
  width: 100%;
  background: #0a4d68;
  color: #fff;
  border: none;
  padding: 9px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.w2-btn-submit:hover {
  background: #083b50;
}

/* Typing Indicator */
.w2-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--w2-border);
  border-radius: 14px;
  width: fit-content;
}

.w2-typing-dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.w2-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.w2-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Footer Input Area */
.w2-chat-footer {
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid var(--w2-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.w2-chat-input {
  flex: 1;
  border: 1px solid var(--w2-border);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.w2-chat-input:focus {
  border-color: #0a4d68;
}

.w2-send-btn {
  background: #0a4d68;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.w2-send-btn:hover {
  background: #0582ca;
  transform: scale(1.05);
}

.w2-send-btn svg {
  width: 18px;
  height: 18px;
  fill: #ffffff;
}

.w2-powered-by {
  font-size: 10px;
  text-align: center;
  color: #94a3b8;
  padding-bottom: 4px;
  background: #ffffff;
}
