/* ============================================================
   DEFENSA CFE CHATBOT — Design System & Styles
   Premium Dark Theme — Legal + Energy
   ============================================================ */

/* ========== CUSTOM PROPERTIES ========== */
:root {
    /* Colors */
    --color-bg: #0a0a0a;
    --color-bg-elevated: #111111;
    --color-bg-card: rgba(255, 255, 255, 0.04);
    --color-surface: #1a1a1a;
    --color-surface-hover: #222222;
    --color-primary: #00B4D8;
    --color-primary-dim: rgba(0, 180, 216, 0.15);
    --color-primary-glow: rgba(0, 180, 216, 0.3);
    --color-accent: #00E676;
    --color-accent-dim: rgba(0, 230, 118, 0.15);
    --color-danger: #FF5252;
    --color-warning: #FFB300;
    --color-text: #e8e6e3;
    --color-text-muted: #8a8a8a;
    --color-white: #ffffff;
    --color-black: #000000;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-user-bubble: #00B4D8;
    --color-bot-bubble: #1e1e1e;

    /* Typography — Geist 2026 */
    --font-heading: 'Geist', 'Montserrat', sans-serif;
    --font-body: 'Geist', 'Inter', sans-serif;
    --font-mono: 'Geist Mono', monospace;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: 0.4s var(--ease-out-expo);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
}

/* ========== RESET ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 180, 216, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(0, 180, 216, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse 50% 50% at 10% 50%, rgba(168, 85, 247, 0.04) 0%, transparent 50%);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--color-white);
    letter-spacing: -0.03em;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ========== CHAT APP LAYOUT ========== */
.chat-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height — accounts for mobile browser chrome */
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* — Header — */
.chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(
        135deg,
        rgba(0, 180, 216, 0.06) 0%,
        rgba(17, 17, 17, 0.95) 40%,
        rgba(168, 85, 247, 0.04) 100%
    );
    background-size: 300% 300%;
    animation: headerGradientShift 8s ease-in-out infinite;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 180, 216, 0.12);
    position: sticky;
    top: 0;
    z-index: 10;
}

@keyframes headerGradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.chat-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-primary-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    position: relative;
}

.chat-header-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--color-accent);
    border-radius: 50%;
    border: 2px solid var(--color-bg-elevated);
}

.chat-header-info h1 {
    font-size: 1rem;
    font-weight: 700;
}

.chat-header-status {
    font-size: 0.78rem;
    color: var(--color-accent);
    font-weight: 500;
}

.chat-header-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.header-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.header-btn:hover {
    background: var(--color-primary-dim);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* — Messages Area — */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

/* — Message Bubbles — */
.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageIn 0.4s var(--ease-out-expo);
}

@keyframes messageIn {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.95);
        filter: blur(2px);
    }
    60% {
        opacity: 1;
        transform: translateY(-3px) scale(1.005);
        filter: blur(0);
    }
    80% {
        transform: translateY(2px) scale(0.998);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

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

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 4px;
}

.message.user .message-avatar {
    background: rgba(0, 180, 216, 0.3);
}

.message-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    line-height: 1.65;
    position: relative;
}

.message.bot .message-bubble {
    background: rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 180, 216, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
    color: var(--color-text);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.25),
        0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #00B4D8, #0096B7);
    color: var(--color-white);
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 12px rgba(0, 180, 216, 0.2);
}

.message-time {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 6px;
    display: block;
}

.message.user .message-time {
    text-align: right;
    color: rgba(255, 255, 255, 0.6);
}

/* Read receipt checkmarks */
.message-read-receipt {
    display: inline-flex;
    margin-left: 4px;
    color: rgba(255, 255, 255, 0.5);
    vertical-align: middle;
}

.message-read-receipt.read {
    color: #00B4D8;
}

/* — Scroll-to-bottom FAB — */
.scroll-fab {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 180, 216, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 180, 216, 0.3);
    color: #00B4D8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.scroll-fab.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.scroll-fab:hover {
    background: rgba(0, 180, 216, 0.35);
    transform: translateY(-2px) scale(1.05);
}

.scroll-fab:active {
    transform: translateY(0) scale(0.95);
}

/* — Typing Indicator — */
.typing-indicator {
    display: none;
    align-self: flex-start;
    padding: 8px 16px;
    gap: 10px;
    align-items: center;
}

.typing-indicator.active {
    display: flex;
}

.typing-indicator .message-avatar {
    width: 32px;
    height: 32px;
}

.typing-dots {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    border-bottom-left-radius: 4px;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: typingSpring 1.6s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.18s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes typingSpring {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.35;
        background: var(--color-primary);
    }
    30% {
        transform: translateY(-10px) scale(1.25);
        opacity: 1;
        background: #00d4f7;
    }
    50% {
        transform: translateY(-6px) scale(1.1);
        opacity: 0.85;
    }
    65% {
        transform: translateY(-9px) scale(1.2);
        opacity: 0.95;
    }
    80% {
        transform: translateY(-2px) scale(1.05);
        opacity: 0.7;
    }
}

/* — Input Area — Floating Pill */
.chat-input-area {
    padding: 12px 16px 16px;
    background: transparent;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
    background: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.chat-input-wrapper:focus-within {
    border-color: rgba(0, 180, 216, 0.4);
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.1);
}

.chat-input {
    width: 100%;
    padding: 14px 18px;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.92rem;
    outline: none;
    resize: none;
    max-height: 120px;
}

.chat-input::placeholder {
    color: var(--color-text-muted);
}

.send-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--color-primary), #0096B7);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.25);
}

.send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 180, 216, 0.35);
}

.send-btn:active:not(:disabled) {
    transform: scale(0.92) rotate(15deg);
    transition: transform 0.1s ease;
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* — WhatsApp CTA Bar — */
.whatsapp-bar {
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.15), rgba(0, 180, 216, 0.1));
    border-top: 1px solid rgba(37, 211, 102, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.whatsapp-bar:hover {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.25), rgba(0, 180, 216, 0.15));
}

.whatsapp-bar-icon {
    width: 36px;
    height: 36px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.whatsapp-bar-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-white);
}

.whatsapp-bar-text span {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

.whatsapp-bar-arrow {
    margin-left: auto;
    color: #25D366;
    font-size: 1.2rem;
}

/* ========== WELCOME SCREEN / INTAKE FORM ========== */
.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 30px 30px 20px;
    text-align: center;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    animation: welcomeFadeIn 0.8s ease-out;
}

/* Hero wrapper divs — transparent on mobile, flex columns on desktop */
.welcome-hero-left,
.welcome-hero-right {
    display: contents;
}

/* Animated mesh gradient background */
.welcome-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 80%, rgba(0, 180, 216, 0.20) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 20%, rgba(0, 230, 118, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 50% at 50% 50%, rgba(0, 180, 216, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 70% 70%, rgba(168, 85, 247, 0.08) 0%, transparent 60%);
    animation: meshFloat 12s ease-in-out infinite alternate;
    z-index: 0;
    pointer-events: none;
}

@keyframes meshFloat {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }

    33% {
        transform: translate(10px, -15px) scale(1.05);
        opacity: 1;
    }

    66% {
        transform: translate(-8px, 10px) scale(0.98);
        opacity: 0.9;
    }

    100% {
        transform: translate(5px, -5px) scale(1.02);
        opacity: 1;
    }
}

@keyframes welcomeFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-screen.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    display: none !important;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Chat entrance after welcome fades */
#chatHeader,
#chatMessages,
#chatInputArea {
    animation: chatEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.3s;
}

@keyframes chatEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--color-primary-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: var(--spacing-lg);
    animation: pulse 2s ease-in-out infinite;
    position: relative;
    z-index: 1;
    border: 2px solid rgba(0, 180, 216, 0.3);
    box-shadow:
        0 0 30px rgba(0, 180, 216, 0.2),
        0 0 60px rgba(0, 180, 216, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 180, 216, 0.3), 0 0 30px rgba(0, 180, 216, 0.2), 0 0 60px rgba(0, 180, 216, 0.08);
    }

    50% {
        box-shadow: 0 0 0 18px rgba(0, 180, 216, 0), 0 0 50px rgba(0, 180, 216, 0.25), 0 0 80px rgba(0, 180, 216, 0.1);
    }
}

.welcome-screen h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #ffffff 30%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-screen .subtitle {
    color: var(--color-text-muted);
    font-size: 0.92rem;
    margin-bottom: var(--spacing-lg);
    max-width: 350px;
    position: relative;
    z-index: 1;
    line-height: 1.5;
}

/* Glassmorphism form card */
.intake-form {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 28px 24px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    position: relative;
    z-index: 1;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

.form-group {
    text-align: left;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
    display: block;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: var(--color-primary);
    background: rgba(0, 180, 216, 0.06);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Name row — side by side */
.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* Phone input with +52 prefix */
.phone-input-group {
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.phone-input-group:focus-within {
    border-color: var(--color-primary);
    background: rgba(0, 180, 216, 0.06);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px 0 16px;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font-body);
    user-select: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.phone-input {
    border: none !important;
    background: transparent !important;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
    box-shadow: none !important;
}

.phone-input:focus {
    box-shadow: none !important;
    border-color: transparent !important;
    background: transparent !important;
}

/* CTA button with shimmer */
.start-btn {
    padding: 16px 24px;
    background: linear-gradient(135deg, #00B4D8 0%, #0096B7 50%, #00B4D8 100%);
    background-size: 200% 100%;
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    animation: shimmerBg 3s ease-in-out infinite;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 180, 216, 0.4), 0 4px 12px rgba(0, 180, 216, 0.2);
}

.start-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 180, 216, 0.3);
}

.start-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 50%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-20deg);
    animation: shimmerSweep 4s ease-in-out infinite;
}

@keyframes shimmerBg {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes shimmerSweep {
    0% {
        left: -75%;
    }

    30% {
        left: 125%;
    }

    100% {
        left: 125%;
    }
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 180, 216, 0.35);
}

.start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

.start-btn:disabled::after {
    animation: none;
}

/* Trust badges row */
.welcome-trust {
    margin-top: var(--spacing-lg);
    font-size: 0.78rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.trust-badges {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.73rem;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.3px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
}

.trust-badge:hover {
    background: rgba(0, 180, 216, 0.08);
    border-color: rgba(0, 180, 216, 0.15);
    color: rgba(255, 255, 255, 0.85);
}

.trust-badge svg {
    opacity: 0.7;
    flex-shrink: 0;
}

/* Testimonials */
.testimonials {
    width: 100%;
    max-width: 360px;
    position: relative;
    z-index: 1;
    min-height: 90px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.testimonial {
    display: none;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    animation: testimonialFade 0.5s ease-out;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.testimonial.active {
    display: block;
}

@keyframes testimonialFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.testimonial-stars {
    color: #FFB300;
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.testimonial p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    font-style: italic;
    margin-bottom: 6px;
}

.testimonial-author {
    font-size: 0.72rem;
    color: var(--color-primary);
    font-weight: 600;
}

/* CTA Reassurance */
.cta-reassurance {
    text-align: center;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin-top: 8px;
    letter-spacing: 0.5px;
}

/* Urgency Badge */
.urgency-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 16px;
    background: rgba(0, 230, 118, 0.08);
    border: 1px solid rgba(0, 230, 118, 0.15);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    position: relative;
    z-index: 1;
    animation: urgencyPulse 3s ease-in-out infinite;
}

.urgency-dot {
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

@keyframes urgencyPulse {

    0%,
    100% {
        border-color: rgba(0, 230, 118, 0.15);
    }

    50% {
        border-color: rgba(0, 230, 118, 0.3);
    }
}

/* ========== ADMIN DASHBOARD ========== */
.admin-app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 28px;
    min-height: 100vh;
    background: linear-gradient(180deg, #0a0a0a 0%, #0d0f14 100%);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    margin-bottom: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.admin-header h1 {
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #00B4D8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-header h1 span {
    color: var(--color-primary);
}

.admin-stats {
    display: flex;
    gap: 10px;
}

.stat-chip {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-chip:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.stat-chip.hot {
    color: #FF5252;
    border-color: rgba(255, 82, 82, 0.3);
    background: rgba(255, 82, 82, 0.1);
}

.stat-chip.warm {
    color: var(--color-warning);
    border-color: rgba(255, 179, 0, 0.2);
    background: rgba(255, 179, 0, 0.06);
}

.stat-chip.cold {
    color: #42A5F5;
    border-color: rgba(66, 165, 245, 0.2);
    background: rgba(66, 165, 245, 0.06);
}

.stat-chip.contacted {
    color: var(--color-accent);
    border-color: rgba(0, 230, 118, 0.2);
    background: rgba(0, 230, 118, 0.06);
}

/* — New/Seen Divider — */
.conv-divider {
    padding: 10px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.new-divider {
    color: #FF5252;
    border-bottom: 1px solid rgba(255, 82, 82, 0.2);
    background: rgba(255, 82, 82, 0.04);
}

.seen-divider {
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    opacity: 0.5;
    font-size: 0.7rem;
}

/* — New Badge — */
.new-badge {
    display: inline-block;
    background: #FF5252;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-left: 6px;
    vertical-align: middle;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* — Unread Card Glow — */
.conversation-card.is-new {
    border-left: 3px solid #FF5252;
    background: rgba(255, 82, 82, 0.04);
}

/* — Status Badge Colors on Cards — */
.conv-status.hot {
    color: #FF5252;
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

.conv-status.warm {
    color: var(--color-warning);
    background: rgba(255, 179, 0, 0.1);
    border: 1px solid rgba(255, 179, 0, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

.conv-status.cold {
    color: #42A5F5;
    background: rgba(66, 165, 245, 0.1);
    border: 1px solid rgba(66, 165, 245, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

.conv-status.contacted {
    color: var(--color-accent);
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* — Status Selector — */
.status-select {
    padding: 10px 36px 10px 16px;
    background-color: #1a1a1f;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    color: #e8e6e3;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300B4D8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.status-select:hover {
    border-color: rgba(0, 180, 216, 0.4);
    box-shadow: 0 4px 20px rgba(0, 180, 216, 0.1);
}

.status-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.15);
}

.status-select option {
    background: #1a1a1f;
    color: #e8e6e3;
    padding: 10px;
}

/* — Conversation List — */
.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conversation-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.35s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.conversation-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.06) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.conversation-card:hover {
    border-color: rgba(0, 180, 216, 0.2);
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.conversation-card:hover::before {
    opacity: 1;
}

.conversation-card.selected {
    border-color: rgba(0, 180, 216, 0.4);
    background: rgba(0, 180, 216, 0.08);
    box-shadow: 0 0 0 1px rgba(0, 180, 216, 0.15), 0 4px 20px rgba(0, 180, 216, 0.08);
}

.conversation-card.selected::before {
    opacity: 1;
}

.conv-avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.15) 0%, rgba(0, 180, 216, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--color-primary);
    flex-shrink: 0;
    border: 1px solid rgba(0, 180, 216, 0.12);
}

.conv-info {
    flex: 1;
    min-width: 0;
}

.conv-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--color-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

.conv-preview {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
    opacity: 0.7;
}

.conv-meta {
    text-align: right;
    flex-shrink: 0;
}

.conv-time {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    opacity: 0.6;
}

.conv-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 6px;
}

.conv-status.active {
    background: rgba(0, 230, 118, 0.1);
    color: var(--color-accent);
    border: 1px solid rgba(0, 230, 118, 0.15);
}

.conv-status.stuck {
    background: rgba(255, 179, 0, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(255, 179, 0, 0.15);
}

.conv-status.contacted {
    background: rgba(0, 180, 216, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(0, 180, 216, 0.15);
}

.conv-status.closed {
    background: rgba(255, 82, 82, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(255, 82, 82, 0.15);
}

/* — Admin Chat Detail Panel — */
.admin-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: var(--spacing-lg);
    height: calc(100vh - 160px);
}

.admin-sidebar {
    overflow-y: auto;
    padding-right: 4px;
}

.admin-sidebar::-webkit-scrollbar {
    width: 3px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 180, 216, 0.2);
    border-radius: 4px;
}

.admin-detail {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.admin-detail-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-detail-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-white);
    letter-spacing: -0.3px;
}

.admin-detail-phone {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.admin-detail-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* action-btn styles moved to admin-panel.css */

.admin-detail-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-detail-messages::-webkit-scrollbar {
    width: 3px;
}

.admin-detail-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 180, 216, 0.2);
    border-radius: 4px;
}

.admin-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.admin-empty-icon {
    font-size: 3.5rem;
    opacity: 0.2;
    filter: grayscale(0.5);
}

/* — Filter Bar — */
.admin-filters {
    display: flex;
    gap: 8px;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    padding: 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    width: fit-content;
}

.filter-btn {
    padding: 9px 18px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.filter-btn.active {
    background: rgba(0, 180, 216, 0.15);
    color: var(--color-primary);
    box-shadow: 0 2px 12px rgba(0, 180, 216, 0.1);
}

.filter-btn:not(.active):hover {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.04);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .chat-app {
        max-width: 100%;
    }

    /* ——— MOBILE WELCOME SCREEN OPTIMIZATION ———
       Reorder elements so the FORM appears above the fold.
       DOM order: icon → h2 → subtitle → testimonials → credentials → form
       Mobile order: icon → h2 → subtitle → credentials → form → testimonials
       85% of traffic is mobile, 56% is Android WebView (Messenger/FB links)
    */
    .welcome-screen {
        padding: 16px 20px 20px;
        gap: 0;
    }

    /* Smaller avatar on mobile — save vertical space */
    .welcome-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 12px;
        order: 1;
    }

    .welcome-screen h2 {
        font-size: 1.35rem;
        margin-bottom: 6px;
        order: 2;
    }

    .welcome-screen .subtitle {
        font-size: 0.85rem;
        margin-bottom: 12px;
        order: 3;
    }

    /* Credentials bar — compact, right after subtitle */
    .credentials-section {
        margin-bottom: 14px;
        order: 4;
    }

    /* FORM — priority position, above the fold */
    .intake-form {
        padding: 20px 18px;
        gap: 12px;
        margin-bottom: 14px;
        order: 5;
    }

    /* Urgency badge right after form */
    .urgency-badge {
        margin-top: 0;
        margin-bottom: 10px;
        order: 6;
    }

    /* Trust/privacy push down */
    .welcome-trust {
        margin-top: 8px;
        order: 7;
    }

    .privacy-notice {
        order: 8;
    }

    .trust-badges {
        margin-top: 10px;
        order: 9;
    }

    /* Testimonials BELOW the fold — still valuable but not blocking the CTA */
    .testimonials {
        margin-top: 16px;
        margin-bottom: 8px;
        order: 10;
    }

    /* Bigger touch targets for WebView users */
    .form-input {
        padding: 16px 18px;
        font-size: 1rem;
        -webkit-appearance: none;
        appearance: none;
    }

    .phone-prefix {
        padding: 0 14px 0 16px;
        font-size: 1rem;
    }

    .start-btn {
        padding: 18px 24px;
        font-size: 0.95rem;
        -webkit-tap-highlight-color: transparent;
    }

    /* Hook question for social traffic — mobile only */
    .mobile-hook {
        display: block !important;
        order: 3;
        margin-bottom: 12px;
    }

    .admin-app {
        padding: 16px;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-detail {
        display: none;
    }

    .admin-detail.mobile-active {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 100;
        border-radius: 0;
        background: var(--color-bg);
    }

    .admin-stats {
        display: none;
    }

    .admin-header h1 {
        font-size: 1.1rem;
    }

    .admin-filters {
        width: 100%;
    }
}

/* Hook question — hidden by default, shown on mobile via media query above */
.mobile-hook {
    display: none;
    text-align: center;
    font-size: 0.82rem;
    color: var(--color-warning);
    font-weight: 600;
    padding: 8px 16px;
    background: rgba(255, 179, 0, 0.08);
    border: 1px solid rgba(255, 179, 0, 0.15);
    border-radius: var(--radius-full);
    position: relative;
    z-index: 1;
    animation: hookPulse 3s ease-in-out infinite;
}

@keyframes hookPulse {
    0%, 100% { border-color: rgba(255, 179, 0, 0.15); }
    50% { border-color: rgba(255, 179, 0, 0.35); }
}

/* ========== LOGIN GATE ========== */
.login-gate {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    z-index: 9999;
}

.login-gate.hidden {
    display: none;
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 48px 36px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    text-align: center;
    animation: cardIn 0.6s var(--ease-out-expo);
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--color-primary-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 1px solid rgba(0, 180, 216, 0.15);
}

.login-card h2 {
    font-size: 1.4rem;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #ffffff 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--color-text-muted);
    font-size: 0.88rem;
    margin-bottom: 28px;
}

.login-input-wrap {
    position: relative;
    margin-bottom: 8px;
}

.login-input {
    width: 100%;
    padding: 16px 50px 16px 18px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.login-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.1);
}

.login-input::placeholder {
    color: var(--color-text-muted);
}

.login-toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.login-toggle-pw:hover {
    opacity: 1;
}

.login-error {
    color: var(--color-danger);
    font-size: 0.82rem;
    font-weight: 600;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-btn {
    width: 100%;
    padding: 16px;
    background: var(--color-primary);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 4px;
}

.login-btn:hover {
    background: #0096B7;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--color-primary-glow);
}

.login-footer {
    margin-top: 24px;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    opacity: 0.5;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-8px);
    }

    40%,
    80% {
        transform: translateX(8px);
    }
}

.login-card.shake {
    animation: shake 0.4s ease;
}

/* — Logout Button — */
.logout-btn {
    padding: 8px 16px;
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.2);
    border-radius: var(--radius-full);
    color: var(--color-danger);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 82, 82, 0.2);
    border-color: rgba(255, 82, 82, 0.4);
    transform: translateY(-1px);
}

/* ========== CHAR COUNTER ========== */
.char-counter {
    position: absolute;
    right: 8px;
    bottom: -18px;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
    transition: color 0.2s ease;
}

.char-counter.warning {
    color: var(--color-warning);
}

.char-counter.over {
    color: var(--color-danger);
    font-weight: 600;
}

/* ========== USER SVG AVATAR ========== */
.message.user .message-avatar {
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.message.user .message-avatar svg {
    width: 20px;
    height: 20px;
}

/* ========== VERIFIED BADGE ========== */
.verified-badge {
    vertical-align: middle;
    margin-left: 4px;
}

/* ========== PRIVACY NOTICE ========== */
.privacy-notice {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 8px;
    text-align: center;
}

.privacy-notice a {
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
}

/* ========== CONNECTING SCREEN ========== */
.connecting-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 60px 30px;
    animation: fadeIn 0.4s ease;
}

.connecting-avatar {
    position: relative;
    width: 80px;
    height: 80px;
}

.connecting-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: 1;
}

.connecting-pulse {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    animation: connectPulse 1.5s ease-in-out infinite;
}

@keyframes connectPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.15);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}

.connecting-text {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    text-align: center;
}

.connecting-dots {
    display: flex;
    gap: 6px;
}

.connecting-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: connectDots 1.4s infinite ease-in-out both;
}

.connecting-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.connecting-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes connectDots {

    0%,
    80%,
    100% {
        transform: scale(0.4);
        opacity: 0.3;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ——— WhatsApp Fallback Bar (appears on API error) ——— */
.whatsapp-fallback-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    position: relative;
    z-index: 10;
}

.whatsapp-fallback-bar.visible {
    transform: translateY(0);
    opacity: 1;
}

.whatsapp-fallback-bar:hover {
    background: linear-gradient(135deg, #20c05c, #0f7a6c);
}

.whatsapp-fallback-bar svg {
    flex-shrink: 0;
    animation: whatsappPulse 2s ease-in-out infinite;
}

@keyframes whatsappPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* ========== VOICE INPUT BUTTON ========== */
.voice-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.voice-btn:hover {
    background: var(--color-primary-dim);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: scale(1.05);
}

.voice-btn.recording {
    background: rgba(255, 82, 82, 0.2);
    border-color: var(--color-danger);
    color: var(--color-danger);
    animation: voicePulse 1.2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 82, 82, 0.25);
}

@keyframes voicePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.4);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 10px rgba(255, 82, 82, 0);
    }
}

/* ========== VOICE NOTE PLAYER (in chat bubbles) ========== */
.voice-note-player {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    padding: 4px 0;
}

.vnp-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 180, 216, 0.2);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.vnp-play-btn:hover {
    background: rgba(0, 180, 216, 0.35);
    transform: scale(1.08);
}

.message.user .vnp-play-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.message.user .vnp-play-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.vnp-waveform-track {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 28px;
    position: relative;
    overflow: hidden;
}

.vnp-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(0, 180, 216, 0.15);
    border-radius: 4px;
    transition: width 0.1s linear;
    z-index: 0;
}

.message.user .vnp-progress {
    background: rgba(255, 255, 255, 0.15);
}

.vnp-bar {
    display: block;
    width: 3px;
    min-height: 3px;
    background: rgba(0, 180, 216, 0.5);
    border-radius: 2px;
    position: relative;
    z-index: 1;
}

.message.user .vnp-bar {
    background: rgba(255, 255, 255, 0.5);
}

.vnp-duration {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    min-width: 30px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.message.user .vnp-duration {
    color: rgba(255, 255, 255, 0.7);
}

/* ========== MARKDOWN IN CHAT BUBBLES ========== */
.message-bubble ul {
    list-style: disc;
    padding-left: 1.2em;
    margin: 6px 0;
}

.message-bubble ul li {
    margin-bottom: 2px;
    line-height: 1.5;
}

.message-bubble strong {
    font-weight: 600;
    color: var(--color-white);
}

.message.user .message-bubble strong {
    color: inherit;
}

.message-bubble em {
    font-style: italic;
    opacity: 0.9;
}

/* ========== STAGGERED ENTRANCE ANIMATIONS ========== */
.welcome-screen .welcome-icon {
    animation: staggerFadeIn 0.6s ease-out 0.1s both, pulse 2s ease-in-out 0.7s infinite;
}

.welcome-screen h2 {
    animation: staggerFadeIn 0.6s ease-out 0.25s both;
}

.welcome-screen .subtitle {
    animation: staggerFadeIn 0.6s ease-out 0.4s both;
}

.welcome-screen .testimonials {
    animation: staggerFadeIn 0.6s ease-out 0.55s both;
}

.welcome-screen .intake-form {
    animation: staggerFadeIn 0.7s ease-out 0.7s both;
}

.welcome-screen .urgency-badge {
    animation: staggerFadeIn 0.5s ease-out 0.9s both, urgencyPulse 3s ease-in-out 1.4s infinite;
}

.welcome-screen .welcome-trust,
.welcome-screen .privacy-notice,
.welcome-screen .trust-badges,
.welcome-screen .credentials-section {
    animation: staggerFadeIn 0.5s ease-out 1.0s both;
}

@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== CREDENTIALS / TRUST SECTION ========== */
.credentials-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 18px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 360px;
}

.credential-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.credential-number {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary), #00e676);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.credential-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.credential-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
}

/* ========== DESKTOP ENHANCEMENTS ========== */
@media (min-width: 768px) {

    /* Wider container on desktop */
    .chat-app {
        max-width: 900px;
        border-left: 1px solid var(--color-border);
        border-right: 1px solid var(--color-border);
        box-shadow:
            -40px 0 80px -20px rgba(0, 180, 216, 0.03),
            40px 0 80px -20px rgba(0, 180, 216, 0.03);
    }

    /* 2-column layout: hero left, form right — tighter padding */
    .welcome-screen {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 40px;
        padding: 24px 36px 20px;
        text-align: left;
    }

    /* Left column — branding & social proof */
    .welcome-hero-left {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        flex: 1;
        max-width: 400px;
    }

    /* Bigger avatar on desktop — more presence */
    .welcome-hero-left .welcome-icon {
        align-self: flex-start;
        width: 120px;
        height: 120px;
        margin-bottom: 20px;
    }

    .welcome-hero-left h2 {
        text-align: left;
        font-size: 1.8rem;
    }

    .welcome-hero-left .subtitle {
        text-align: left;
        max-width: 380px;
    }

    /* Show hook on desktop too — adapted for side layout */
    .mobile-hook {
        display: block !important;
        text-align: left;
        margin-bottom: 16px;
        width: fit-content;
    }

    /* Right column — form card */
    .welcome-hero-right {
        display: flex;
        flex-direction: column;
        align-items: center;
        flex-shrink: 0;
        width: 380px;
    }

    .welcome-hero-right .intake-form {
        max-width: 100%;
        width: 100%;
    }

    /* Richer hero gradient */
    .welcome-screen::before {
        background:
            radial-gradient(ellipse 80% 60% at 20% 80%, rgba(0, 180, 216, 0.22) 0%, transparent 60%),
            radial-gradient(ellipse 60% 80% at 80% 20%, rgba(0, 230, 118, 0.12) 0%, transparent 60%),
            radial-gradient(ellipse 60% 60% at 50% 40%, rgba(0, 180, 216, 0.10) 0%, transparent 70%);
    }

    /* Form card gets subtle glow on desktop */
    .intake-form {
        border: 1px solid rgba(0, 180, 216, 0.15);
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    }

    .intake-form:hover {
        border-color: rgba(0, 180, 216, 0.25);
        box-shadow: 0 8px 40px rgba(0, 180, 216, 0.08);
    }

    /* Credentials wider on desktop */
    .credentials-section {
        max-width: 100%;
    }
}