 :root {
            --bg: #f8f9fc;
            --fg: #1a1a2e;
            --muted: #6b7280;
            --accent: #2563eb;
            --accent-hover: #1d4ed8;
            --accent-soft: rgba(37, 99, 235, 0.08);
            --card: #ffffff;
            --border: rgba(0, 0, 0, 0.08);
            --input-bg: #f1f5f9;
            --success: #10b981;
            --success-soft: rgba(16, 185, 129, 0.1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', sans-serif;
            background: var(--bg);
            color: var(--fg);
            min-height: 100vh;
            overflow-x: hidden;
        }

        h1,
        h2,
        h3,
        h4,
        h5,
        h6 {
            font-family: 'Plus Jakarta Sans', sans-serif;
        }

        /* Background pattern */
        .bg-pattern {
            position: fixed;
            inset: 0;
            z-index: 0;
            background-color: var(--bg);
            background-image:
                radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.04) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
        }

        /* Chat Trigger */
        .chat-trigger {
            position: fixed;
            bottom: 24px;
            right: 24px;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: var(--accent);
            border: none;
            cursor: pointer;
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .chat-trigger:hover {
            transform: scale(1.06);
            background: var(--accent-hover);
        }

        .chat-trigger svg {
            width: 26px;
            height: 26px;
            color: white;
            transition: all 0.3s ease;
        }

        .chat-trigger.open svg {
            transform: rotate(180deg);
        }



        /* Chat Widget */
        .chat-widget {
            position: fixed;
            bottom: 96px;
            right: 24px;
            width: 24vw;
            max-height: 70vh;
            height: 65vh;
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 20px;
            z-index: 999;
            opacity: 0;
            visibility: hidden;
            transform: translateY(16px) scale(0.96);
            transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
            display: flex;
            flex-direction: column;
        }

        .chat-widget.open {
            opacity: 1;
            visibility: visible;
            transform: translateY(0) scale(1);
        }

        /* Chat Header */
        .chat-header {
            padding: 10px 20px;
            background: linear-gradient(180deg, var(--card) 0%, #fafbfc 100%);
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 14px;
            flex-shrink: 0;
        }

        .chat-avatar {
            width: 42px;
            height: 42px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            flex-shrink: 0;
        }

        .chat-avatar svg {
            width: 22px;
            height: 22px;
            color: white;
        }

        .form-header{
           display: flex;
           width: fit-content;
           padding: 8px 8px;
           background: var(--card);
           border: 1px solid var(--border);
           border-radius: 14px;
           transition: all 0.2s ease;
           align-items: center;
           gap: 14px;
           text-align: left;
           margin-bottom: 10px;
        }

        .status-dot {
            position: absolute;
            bottom: -2px;
            right: -2px;
            width: 12px;
            height: 12px;
            background: var(--success);
            border-radius: 50%;
            border: 2px solid var(--card);
        }

        .chat-header-info h4 {
            font-size: 15px;
            font-weight: 700;
            color: var(--fg);
        }

        .chat-header-info p {
            font-size: 12px;
            color: var(--muted);
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 2px;
        }

  /*      .chat-header-info p::before {
            content: '';
            width: 6px;
            height: 6px;
            background: var(--success);
            border-radius: 50%;
        }*/



        /* Welcome Section */
        .welcome-section {
            text-align: center;
            padding: 10px 0 20px;
        }

        .welcome-section h3 {
            font-size: 20px;
            font-weight: 700;
            margin-bottom: 6px;
            color: var(--fg);
        }

        .welcome-section p {
            font-size: 14px;
            color: var(--muted);
        }

        /* Option Buttons */
        .option-buttons {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .intro-label{
           width: 100%;
           padding: 16px 18px;
           background: var(--card);
           border: 1px solid var(--border);
           border-radius: 14px;
           transition: all 0.2s ease;
           display: flex;
           align-items: center;
           gap: 14px;
           text-align: left;
        }

        .option-btn {
            width: 100%;
            padding: 16px 18px;
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 14px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 14px;
            text-align: left;
        }

        .option-btn:hover {
            border-color: var(--accent);
            background: var(--accent-soft);
            transform: translateX(4px);
        }

        .option-icon {
            width: 42px;
            height: 42px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: transform 0.2s ease;
        }

        .option-btn:hover .option-icon {
            transform: scale(1.08);
        }

        .option-icon svg {
            width: 20px;
            height: 20px;
        }

        .option-icon.renewal {
            background: rgba(245, 158, 11, 0.1);
            color: #f59e0b;
        }

        .option-icon.buy {
            background: rgba(139, 92, 246, 0.1);
            color: #10b981;
        }

        .option-icon.faq {
            background: rgba(16, 185, 129, 0.1);
            color: #8b5cf6;
        }

        .option-icon.agent {
            background: rgba(37, 99, 235, 0.1);
            color: #2563eb;
        }

        .option-text h5 {
            font-size: 14px;
            font-weight: 600;
            color: var(--fg);
            margin-bottom: 2px;
        }

        .option-text p {
            font-size: 12px;
            color: var(--muted);
        }

        .option-arrow {
            margin-left: auto;
            opacity: 0;
            transform: translateX(-8px);
            transition: all 0.2s ease;
            color: var(--accent);
        }

        .option-btn:hover .option-arrow {
            opacity: 1;
            transform: translateX(0);
        }

        /* Form Section */
        .form-section {
            display: block;
        }

        .form-section.visible {
            display: block;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .form-subtitle {
            font-size: 14px;
            color: var(--muted);
            margin-bottom: 20px;
            padding: 12px 14px;
            background: #f8fafc;
            border-radius: 10px;
            border-left: 3px solid var(--accent);
        }

        .chat-form {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .form-group label {
            font-size: 12px;
            font-weight: 600;
            color: var(--fg);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .form-input {
            width: 100%;
            padding: 12px 14px;
            background: var(--input-bg);
            border: 1.5px solid transparent;
            border-radius: 10px;
            color: var(--fg);
            font-size: 14px;
            font-family: inherit;
            transition: all 0.2s ease;
            outline: none;
        }

        .form-input::placeholder {
            color: #94a3b8;
        }

        .form-input:focus {
            border-color: var(--accent);
            background: var(--card);
            box-shadow: 0 0 0 3px var(--accent-soft);
        }

        .phone-input-group {
            display: flex;
            gap: 10px;
        }

        .country-select {
            width: 95px;
            padding: 12px 10px;
            background: var(--input-bg);
            border: 1.5px solid transparent;
            border-radius: 10px;
            color: var(--fg);
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s ease;
            outline: none;
        }

        .country-select:focus {
            border-color: var(--accent);
            background-color: var(--card);
        }

        .submit-btn {
            width: 100%;
            padding: 14px 20px;
            background: var(--accent);
            border: none;
            border-radius: 12px;
            color: white;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.25s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-top: 4px;
            font-family: inherit;
        }

        .submit-btn:hover {
            background: var(--accent-hover);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
        }

        .submit-btn svg {
            transition: transform 0.2s ease;
        }

        .submit-btn:hover svg {
            transform: translateX(3px);
        }

        .privacy-note {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 12px;
            background: #f8fafc;
            border-radius: 10px;
            margin-top: 4px;
        }

        .privacy-note svg {
            width: 14px;
            height: 14px;
            color: var(--muted);
            flex-shrink: 0;
            margin-top: 2px;
        }

        .privacy-note p {
            font-size: 11px;
            color: var(--muted);
            line-height: 1.5;
        }

        /* Chat Body */
        .chat-body {
            padding: 20px;
            flex: 1;
            display: flex;
            flex-direction: column;
            background: var(--bg);
            overflow-y: auto;
            height: auto;
        }

        /* Chat Messages */
        .chat-messages {
            display: none;
            flex-direction: column;
            gap: 12px;
            height: auto;
            overflow-y: auto;
        }

        .chat-messages.visible {
            display: flex;
        }

        .chat-messages::-webkit-scrollbar {
        	width: 3px;
        	height: 8px;
        }


        .message {
            max-width: 85%;
            padding: 8px 10px;
            border-radius: 16px;
            font-size: 12px;
            line-height: 1.5;
            animation: messageIn 0.3s ease;
            position: relative;
        }

        @keyframes messageIn {
            from {
                opacity: 0;
                transform: translateY(8px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .message.bot {
            background: #f1f5f9;
            color: var(--fg);
            border-bottom-left-radius: 4px;
            align-self: flex-start;
        }

        .message.user {
            background: var(--accent);
            color: white;
            border-bottom-right-radius: 4px;
            align-self: flex-end;
        }

        /* Styles for Agent Messages (Integrated from legacy) */
        .message.operator-message {
            background: #E8EDF2;
            color: var(--fg);
            border-bottom-left-radius: 4px;
            align-self: flex-start;
            margin-top: 24px;
            /* Space for avatar */
        }

        .message.client-message {
            color: black;
            border-bottom-right-radius: 4px;
            align-self: flex-end;
            background: #e3f2fd;
        }

        .system-message {
            width: 100%;
            text-align: center;
            font-size: 12px;
            color: var(--muted);
            font-style: inherit;
        }

        .message-header {
            font-size: 11px;
            color: var(--muted);
            margin-bottom: 4px;
            display: block;
        }

        .avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 2px solid white;
            position: absolute;
            top: -14px;
            left: -4px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        /* Spinner */
        .client-spinner {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 2px solid rgba(0, 0, 0, 0.1);
            border-left-color: var(--accent);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 10px auto;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        /* Error Message */
        .error-message {
            background: #fee2e2;
            color: #dc2626;
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 12px;
            margin-bottom: 12px;
            display: none;
            animation: fadeIn 0.2s ease;
        }

        .error-message.show {
            display: block;
        }

        /* Chat Input */
        .chat-input-area {
            display: none;
            padding: 14px 18px 18px;
            border-top: 1px solid var(--border);
            background: #fafbfc;
            flex-shrink: 0;
        }

        .chat-input-area.visible {
            display: flex;
            gap: 10px;
            align-items: flex-end;
            padding : 8px 8px 8px 8px;
        }

        .input-wrapper {
            flex: 1;
            background: var(--input-bg);
            border: 1.5px solid transparent;
            border-radius: 14px;
            padding: 10px 14px;
            display: flex;
            align-items: center;
            transition: all 0.2s ease;
        }

        .input-wrapper textarea {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            color: var(--fg);
            font-size: 14px;
            font-family: inherit;
            resize: none;
            max-height: 80px;
            line-height: 1.4;
        }

        .input-wrapper textarea::placeholder {
            color: #94a3b8;
        }

        .send-btn {
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            flex-shrink: 0;
            background: none;
        }



        .send-btn svg {
            width: 18px;
            height: 18px;
            color: white;
        }

        /* Back Button */
        .back-btn {
            display: none;
            align-items: center;
            gap: 6px;
            background: transparent;
            border: none;
            color: var(--muted);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            padding: 4px 0;
            margin-bottom: 12px;
            transition: color 0.2s ease;
            font-family: inherit;
        }

        .back-btn.visible {
            display: inline-flex;
        }

        .back-btn:hover {
            color: var(--accent);
        }

        .header1-info {
           display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 14px;
            background: #d4dff9;
            border-radius: 8px;
            margin-bottom: 16px;
            font-size: 13px;
            color: #2563eb;
            font-weight: 500;
        }

        .header2-info {
                   /* display: none;*/
                   display: flex;
                    align-items: center;
                    gap: 8px;
                    padding: 10px 14px;
                    background: var(--success-soft);
                    border-radius: 8px;
                    margin-bottom: 16px;
                    font-size: 13px;
                    color: #047857;
                    font-weight: 500;
                }

        .selection-info.visible {
            display: flex;
        }

        /* Demo Landing Content */
        .demo-content {
            position: relative;
            z-index: 1;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 40px 24px;
            text-align: center;
        }

        .demo-content h1 {
            font-size: clamp(28px, 5vw, 48px);
            font-weight: 800;
            line-height: 1.1;
            margin-bottom: 14px;
            max-width: 560px;
        }

        .demo-content h1 span {
            color: var(--accent);
        }

        /* Quick Actions in Chat */
        .quick-options {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
        }

        .quick-btn {
            padding: 8px 14px;
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 100px;
            font-size: 12px;
            font-weight: 500;
            color: var(--fg);
            cursor: pointer;
            transition: all 0.2s ease;
            font-family: inherit;
        }

        .quick-btn:hover {
            border-color: var(--accent);
            background: var(--accent-soft);
            color: var(--accent);
        }

        @media (max-width: 480px) {
            .chat-widget {
                width: calc(100vw - 32px);
                right: 16px;
                bottom: 84px;
                max-height: calc(100vh - 110px);
                border-radius: 18px;
            }

            .chat-trigger {
                bottom: 16px;
                right: 16px;
                width: 54px;
                height: 54px;
            }

            .phone-input-group {
                flex-direction: column;
            }

            .country-select {
                width: 100%;
            }
        }