/* ═══════════════════════════════════════════════════════════════════════════════
   AI LEAD QUALIFIER KIT — Real Estate Skin
   Color System: Deep navy + warm gold accents
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(212, 175, 55, 0.3);
    --text-primary: #f0f0f5;
    --text-secondary: #8892a8;
    --text-muted: #5a6478;
    --accent: #d4af37;
    --accent-glow: rgba(212, 175, 55, 0.15);
    --accent-secondary: #f0c75e;
    --success: #4ade80;
    --error: #ef4444;
    --chat-user: linear-gradient(135deg, #d4af37, #b8941e);
    --chat-ai: rgba(255, 255, 255, 0.05);
    --radius: 16px;
    --radius-sm: 10px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Background Mesh ─────────────────────────────────────────────────────── */
.bg-mesh {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(212, 175, 55, 0.06), transparent),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(212, 175, 55, 0.04), transparent);
}

/* ─── Layout ──────────────────────────────────────────────────────────────── */
.container {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
    gap: 48px;
    align-items: center;
}

/* ─── Hero ─────────────────────────────────────────────────────────────────── */
.hero-content { max-width: 560px; }

.badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent-glow);
    border: 1px solid var(--border-accent);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 24px;
}

h1 {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #ffffff 30%, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
}

.features {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.feature-icon { font-size: 18px; }

/* ─── Lead Card ───────────────────────────────────────────────────────────── */
.lead-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    backdrop-filter: blur(20px);
    transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.lead-card.qualified-pulse {
    border-color: var(--success);
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.1);
    animation: successPulse 2s ease-in-out;
}

.lead-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.lead-card-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.lead-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.4s ease;
}

.lead-badge.partial {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
}

.lead-badge.qualified {
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
    animation: qualifiedGlow 1s ease-in-out;
}

.lead-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.lead-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lead-progress-fill.complete {
    background: linear-gradient(90deg, var(--success), #22c55e);
}

.lead-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.lead-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.lead-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lead-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.lead-value.filled {
    color: var(--text-primary);
}

/* ─── Chat Interface ──────────────────────────────────────────────────────── */
.chat-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    height: 600px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.avatar {
    position: relative;
    width: 42px;
    height: 42px;
}

.avatar-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: var(--accent-glow);
    border-radius: 12px;
    border: 1px solid var(--border-accent);
}

.status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    animation: statusPulse 3s ease-in-out infinite;
}

.header-info h2 {
    font-size: 15px;
    font-weight: 600;
}

.status-text {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.message { display: flex; animation: messageSlideIn 0.3s ease-out; }

.user-message { justify-content: flex-end; }

.user-message .message-content {
    background: var(--chat-user);
    color: #0a0e1a;
    border-radius: var(--radius) var(--radius) 4px var(--radius);
    font-weight: 500;
}

.ai-message .message-content {
    background: var(--chat-ai);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) var(--radius) 4px;
}

.message-content {
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.6;
    max-width: 85%;
    word-wrap: break-word;
}

.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

#chat-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

#user-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease;
}

#user-input:focus { border-color: var(--accent); }
#user-input::placeholder { color: var(--text-muted); }

#send-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--chat-user);
    color: #0a0e1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, opacity 0.2s ease;
    flex-shrink: 0;
}

#send-btn:hover { transform: scale(1.05); }
#send-btn:active { transform: scale(0.95); }

/* ─── Typing Indicator ────────────────────────────────────────────────────── */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
    background: var(--chat-ai);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) var(--radius) 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ─── Animations ──────────────────────────────────────────────────────────── */
@keyframes messageSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes successPulse {
    0% { box-shadow: 0 0 0 rgba(74, 222, 128, 0); }
    50% { box-shadow: 0 0 40px rgba(74, 222, 128, 0.15); }
    100% { box-shadow: 0 0 30px rgba(74, 222, 128, 0.1); }
}

@keyframes qualifiedGlow {
    from { transform: scale(1); }
    50% { transform: scale(1.05); }
    to { transform: scale(1); }
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 24px;
    }
    .chat-container { height: 500px; }
    .features { flex-wrap: wrap; }
    .lead-fields { grid-template-columns: 1fr; }
}
