/* ═══════════════════════════════════════════
   Lead Capture Popup + Chatbot Widget Styles
   Uses CSS variables from index.html
   ═══════════════════════════════════════════ */

/* ── Popup Overlay ── */
.popup-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(8,8,12,0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.popup-overlay.active {
  opacity: 1; visibility: visible;
}

/* ── Popup Card ── */
.popup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: 48px 36px;
  max-width: 460px; width: 90vw;
  position: relative;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.35s ease;
}
.popup-overlay.active .popup-card {
  transform: translateY(0);
}

/* ── Popup Badge ── */
.popup-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 100px;
  background: var(--accent-subtle);
  border: 1px solid rgba(201,150,60,0.15);
  font-size: 0.72rem; font-weight: 500;
  color: var(--accent);
  margin-bottom: 20px;
}
.popup-badge-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ── Popup Title ── */
.popup-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem; font-weight: 400; line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.popup-subtitle {
  font-size: 0.88rem; color: var(--text-secondary);
  margin-bottom: 28px; line-height: 1.5;
}

/* ── Form Inputs ── */
.popup-input {
  width: 100%;
  padding: 13px 18px; border-radius: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.25s, background 0.25s;
  margin-bottom: 12px;
}
.popup-input:focus {
  border-color: rgba(201,150,60,0.4);
  background: rgba(255,255,255,0.06);
}
.popup-input::placeholder {
  color: var(--text-tertiary);
}

/* ── Dropdown ── */
.popup-select {
  width: 100%;
  padding: 13px 18px; border-radius: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  margin-bottom: 12px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.popup-select option {
  background: #1a1a1a; color: var(--text);
}

/* ── Popup CTA ── */
.popup-cta {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem; font-weight: 500;
  padding: 14px 28px; border-radius: 100px; border: none;
  background: linear-gradient(135deg, #c9963c 0%, #b88632 100%);
  color: #0a0a0a; cursor: pointer;
  box-shadow: 0 4px 24px rgba(201,150,60,0.3);
  transition: all 0.3s ease;
  margin-bottom: 12px;
}
.popup-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(201,150,60,0.45);
}

/* ── Skip Link ── */
.popup-skip {
  font-size: 0.78rem; color: var(--text-tertiary);
  background: none; border: none; cursor: pointer;
  transition: color 0.2s;
}
.popup-skip:hover { color: var(--accent); }

/* ── Dismiss Button ── */
.popup-dismiss {
  position: absolute; top: 16px; right: 16px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 1rem; line-height: 1;
  transition: background 0.2s;
}
.popup-dismiss:hover { background: rgba(255,255,255,0.1); }

/* ── Toast ── */
.popup-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: 100px;
  background: rgba(220,60,60,0.15);
  border: 1px solid rgba(220,60,60,0.3);
  color: #f5a5a5; font-size: 0.82rem;
  z-index: 10001; opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.popup-toast.active {
  opacity: 1; visibility: visible;
}

/* ── Step Transitions ── */
.popup-step { display: none; }
.popup-step.active { display: block; }

/* ═══════════════════════════════════════════
   Chatbot Widget
   ═══════════════════════════════════════════ */

/* ── Launcher Container ── */
.chat-widget {
  position: fixed; bottom: 24px; right: 24px; z-index: 9998;
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 12px;
}

/* ── Nudge Pill ── */
.chat-nudge {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 100px;
  background: var(--accent-subtle);
  border: 1px solid rgba(201,150,60,0.15);
  font-size: 0.78rem; font-weight: 500;
  color: var(--accent);
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
}
.chat-nudge.visible {
  opacity: 1; visibility: visible;
  transform: translateY(0);
}
.chat-nudge-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ── Launcher Button ── */
.chat-launcher {
  position: relative;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #c9963c 0%, #b88632 100%);
  border: none; cursor: pointer;
  box-shadow: 0 6px 28px rgba(201,150,60,0.42);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 1;
}
.chat-launcher:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 38px rgba(201,150,60,0.55);
}
.launcher-ring {
  position: absolute; inset: -2px; border-radius: 50%;
  border: 1px solid rgba(201,150,60,0.25);
  animation: ring-spin 12s linear infinite;
}
@keyframes ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.chat-launcher svg {
  width: 28px; height: 28px;
}

/* ── Chat Window ── */
.chat-window {
  width: 380px; max-width: calc(100vw - 48px);
  height: 520px; max-height: calc(100vh - 120px);
  background: #0d0d12;
  border-radius: 20px;
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0; visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transition: all 0.3s ease;
  border: 1px solid transparent;
  background-clip: padding-box;
  position: relative;
}
.chat-window.open {
  opacity: 1; visibility: visible;
  transform: translateY(0) scale(1);
}

/* Gold gradient border via wrapper */
.chat-window-border {
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(201,150,60,0.35) 0%, rgba(201,150,60,0.08) 60%, rgba(255,255,255,0.07) 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

/* Inner top shimmer */
.chat-window::before {
  content: ''; position: absolute; inset: 0; border-radius: 20px;
  background: radial-gradient(ellipse at 50% 0%, rgba(201,150,60,0.05) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ── Chat Header ── */
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative; z-index: 1;
}
.chat-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #c9963c 0%, #b88632 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(201,150,60,0.25);
}
.chat-avatar svg { width: 20px; height: 20px; }
.chat-header-info { flex: 1; }
.chat-header-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem; font-style: italic; font-weight: 400;
  color: var(--text);
}
.chat-header-status {
  font-size: 0.7rem; color: var(--accent);
  display: flex; align-items: center; gap: 5px;
}
.chat-header-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.chat-close {
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; font-size: 1.2rem; padding: 4px;
  transition: color 0.2s;
}
.chat-close:hover { color: var(--text); }

/* ── Chat Body ── */
.chat-body {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative; z-index: 1;
}

/* ── Chat Bubbles ── */
.chat-bubble {
  max-width: 82%; padding: 10px 14px; border-radius: 16px;
  font-size: 0.84rem; line-height: 1.45;
  animation: bubble-in 0.25s ease-out;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-bubble.agent {
  align-self: flex-start;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.075);
  color: var(--text);
}
.chat-bubble.agent.demo {
  font-style: italic; color: var(--accent);
}
.chat-bubble.user {
  align-self: flex-end;
  background: rgba(201,150,60,0.12);
  border: 1px solid rgba(201,150,60,0.18);
  color: var(--text);
}

/* ── Qualifier Buttons ── */
.chat-qualifiers {
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px 0;
}
.chat-qualifier-btn {
  width: 100%; padding: 11px 18px; border-radius: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-strong);
  color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 0.84rem; cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
  backdrop-filter: blur(10px);
}
.chat-qualifier-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  transform: translateX(2px);
}

/* ── Book CTA ── */
.chat-book-cta {
  display: block; width: 100%; padding: 13px 20px; border-radius: 100px;
  background: linear-gradient(135deg, #c9963c 0%, #b88632 100%);
  color: #0a0a0a; font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; font-weight: 600; text-align: center;
  cursor: pointer; border: none;
  box-shadow: 0 4px 20px rgba(201,150,60,0.35);
  transition: all 0.3s ease;
  margin-top: 4px;
}
.chat-book-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,150,60,0.5);
}

/* ── Chat Input ── */
.chat-input-bar {
  display: flex; gap: 10px; padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  position: relative; z-index: 1;
}
.chat-input {
  flex: 1; padding: 11px 18px; border-radius: 100px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-strong);
  color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; outline: none;
  transition: border-color 0.25s;
}
.chat-input:focus {
  border-color: rgba(201,150,60,0.4);
}
.chat-input::placeholder {
  color: var(--text-tertiary);
}
.chat-send {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #c9963c 0%, #b88632 100%);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
.chat-send:hover {
  transform: scale(1.06);
}
.chat-send svg { width: 18px; height: 18px; }

/* ── Chat Countdown ── */
.chat-countdown {
  text-align: center; font-size: 0.72rem; color: var(--text-tertiary);
  padding: 4px 0;
}
