:root {
    --aa-widget-accent: #06b6d4;
    --aa-widget-accent-2: #3b82f6;
}
.demo-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--aa-widget-accent, #06b6d4);
    background: linear-gradient(135deg, var(--aa-widget-accent, #06b6d4), var(--aa-widget-accent-2, #3b82f6));
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.demo-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}
.demo-fab.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}

.demo-widget {
    position: fixed;
    bottom: 104px;
    right: 32px;
    width: 380px;
    max-height: 560px;
    background: #111827;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}
.demo-widget.open {
    display: flex;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.demo-widget-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(6,182,212,0.15), rgba(59,130,246,0.15));
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}
.demo-widget-header .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}
.demo-widget-header .info h4 {
    margin: 0;
    color: white;
    font-size: 14px;
    font-weight: 600;
}
.demo-widget-header .info p {
    margin: 0;
    color: rgba(255,255,255,0.5);
    font-size: 11px;
}

.demo-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.demo-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    border-bottom: 2px solid transparent;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.demo-tab:hover {
    color: rgba(255,255,255,0.7);
}
.demo-tab.active {
    color: #06b6d4;
    border-bottom-color: #06b6d4;
}
.demo-tab i {
    font-size: 13px;
}

.demo-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.demo-panel.active {
    display: flex;
}

/* Chat panel */
.demo-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 320px;
    min-height: 200px;
}
.demo-chat-messages::-webkit-scrollbar {
    width: 4px;
}
.demo-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.demo-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: white;
    word-wrap: break-word;
}
.demo-msg.ai {
    align-self: flex-start;
    background: rgba(6,182,212,0.12);
    border: 1px solid rgba(6,182,212,0.2);
    border-bottom-left-radius: 4px;
}
.demo-msg.user {
    align-self: flex-end;
    background: rgba(59,130,246,0.2);
    border: 1px solid rgba(59,130,246,0.3);
    border-bottom-right-radius: 4px;
}
.demo-msg.system {
    align-self: center;
    background: rgba(255,255,255,0.05);
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 11px;
    text-align: center;
}

.demo-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    align-self: flex-start;
}
.demo-typing span {
    width: 6px;
    height: 6px;
    background: #06b6d4;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}
.demo-typing span:nth-child(2) { animation-delay: 0.2s; }
.demo-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

.demo-chat-input {
    display: flex;
    /* Vertically centre the input and the send button so they line up
       regardless of their intrinsic heights. */
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    gap: 8px;
}
.demo-chat-input input {
    flex: 1 1 auto;
    /* Without min-width:0 a flex item refuses to shrink below its content
       width, so a long message overflowed the panel and rode over the send
       button. box-sizing keeps padding inside the measured width. */
    min-width: 0;
    box-sizing: border-box;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s;
}
.demo-chat-input input:focus {
    border-color: rgba(6,182,212,0.5);
}
.demo-chat-input input::placeholder {
    color: rgba(255,255,255,0.3);
}
.demo-chat-input button {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.demo-chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Voice panel */
.demo-voice-panel {
    padding: 24px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.demo-voice-status {
    color: rgba(255,255,255,0.5);
    font-size: 13px;
}
.demo-voice-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(6,182,212,0.3);
    background: rgba(6,182,212,0.1);
    color: #06b6d4;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.demo-voice-btn:hover {
    background: rgba(6,182,212,0.2);
    border-color: rgba(6,182,212,0.5);
}
.demo-voice-btn.recording {
    border-color: #ef4444;
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
    50% { box-shadow: 0 0 0 12px rgba(239,68,68,0); }
}

.demo-voice-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 40px;
}
.demo-voice-wave span {
    width: 3px;
    background: #06b6d4;
    border-radius: 2px;
    height: 8px;
    transition: height 0.1s;
}
.demo-voice-wave.active span {
    animation: waveBar 0.6s infinite;
}
.demo-voice-wave.active span:nth-child(1) { animation-delay: 0s; }
.demo-voice-wave.active span:nth-child(2) { animation-delay: 0.1s; }
.demo-voice-wave.active span:nth-child(3) { animation-delay: 0.2s; }
.demo-voice-wave.active span:nth-child(4) { animation-delay: 0.1s; }
.demo-voice-wave.active span:nth-child(5) { animation-delay: 0s; }
@keyframes waveBar {
    0%, 100% { height: 8px; }
    50% { height: 28px; }
}

.demo-voice-transcript {
    width: 100%;
    max-height: 140px;
    overflow-y: auto;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.demo-voice-transcript .vt-line {
    font-size: 12px;
    line-height: 1.4;
    padding: 4px 8px;
    border-radius: 6px;
}
.demo-voice-transcript .vt-line.ai {
    color: #06b6d4;
    background: rgba(6,182,212,0.08);
}
.demo-voice-transcript .vt-line.user {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.05);
}

/* Callback panel */
.demo-callback-panel {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.demo-callback-panel p {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}
.demo-callback-panel .cb-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.demo-callback-panel input {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 14px;
    color: white;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}
.demo-callback-panel input:focus {
    border-color: rgba(6,182,212,0.5);
}
.demo-callback-panel input::placeholder {
    color: rgba(255,255,255,0.3);
}
.demo-callback-panel .cb-btn {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border: none;
    border-radius: 8px;
    padding: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.demo-callback-panel .cb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.demo-callback-panel .cb-status {
    text-align: center;
    padding: 16px;
    border-radius: 8px;
    font-size: 13px;
}
.demo-callback-panel .cb-status.calling {
    background: rgba(6,182,212,0.1);
    border: 1px solid rgba(6,182,212,0.2);
    color: #06b6d4;
}
.demo-callback-panel .cb-status.success {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.2);
    color: #22c55e;
}
.demo-callback-panel .cb-status.error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: #ef4444;
}

/* Verified-lead summary card shown above the Call button. Replaces the
   old name + phone inputs once the visitor has completed OTP. */
.demo-callback-panel .cb-summary {
    background: rgba(0,217,255,0.06);
    border: 1px solid rgba(0,217,255,0.18);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.demo-callback-panel .cb-summary-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}
.demo-callback-panel .cb-summary-row i {
    color: #00d9ff;
    font-size: 12px;
    width: 14px;
    text-align: center;
}
.demo-callback-panel .cb-edit-link {
    text-align: center;
    margin: -4px 0 0;
    font-size: 12px;
}
.demo-callback-panel .cb-edit-link a {
    color: #38bdf8;
    text-decoration: none;
    transition: color 0.2s;
}
.demo-callback-panel .cb-edit-link a:hover { color: #00d9ff; }

/* Inline phone override that replaces the summary when the visitor
   clicks "Use a different number". */
.demo-callback-panel .cb-override {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.demo-callback-panel .cb-override-label {
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.demo-callback-panel .cb-override-input {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(120,200,255,0.18);
    border-radius: 8px;
    padding: 10px 13px;
    color: #e6eef9;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.demo-callback-panel .cb-override-input:focus {
    border-color: rgba(0,217,255,0.55);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 3px rgba(0,217,255,0.12);
}

/* Mobile responsive */
@media (max-width: 480px) {
    .demo-widget {
        right: 12px;
        left: 12px;
        bottom: 84px;
        width: auto;
        max-height: 70vh;
    }
    .demo-fab {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
}

/* ============================================================================
   Email-OTP verification gate
   Shared between the chatbot widget overlay and the contact-page modal.
   Matches the redesign palette: deep navy + electric cyan, glass inputs,
   cyan→blue gradient buttons. Two positioning modifiers (`-inline` for the
   in-widget overlay, `-modal` for the full-screen contact-page version).
   ============================================================================ */

.aa-vg {
    font-family: 'Inter', sans-serif;
    color: #e6eef9;
}

/* Inline variant: covers the chatbot widget's body. */
.aa-vg-inline {
    position: absolute;
    inset: 0;
    z-index: 10;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(0,217,255,0.10), transparent 60%),
        #0a1428;
    border-radius: inherit;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 18px 18px 22px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Modal variant: full-screen blurred backdrop for the contact page. */
.aa-vg-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(6, 11, 28, 0.72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: aaVgFade 0.25s ease;
}
@keyframes aaVgFade { from { opacity: 0; } to { opacity: 1; } }

.aa-vg-card {
    width: 100%;
    max-width: 380px;
    background:
        linear-gradient(180deg, rgba(15,26,51,0.95), rgba(10,20,40,0.95));
    border: 1px solid rgba(120, 200, 255, 0.18);
    border-radius: 16px;
    box-shadow:
        0 0 60px rgba(0, 217, 255, 0.12),
        0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 28px 24px 24px;
    text-align: left;
    animation: aaVgRise 0.3s ease;
}
.aa-vg-inline .aa-vg-card {
    /* Inside the 380px widget the card is the widget. Drop the
       inner shadow and let the overlay paint the background. */
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 8px 4px;
    max-width: none;
}
@keyframes aaVgRise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.aa-vg-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin: 0 auto 10px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0,217,255,0.18), rgba(59,130,246,0.18));
    border: 1px solid rgba(0, 217, 255, 0.30);
    color: #00d9ff;
    font-size: 22px;
    box-shadow: 0 0 24px rgba(0,217,255,0.20);
}

.aa-vg-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: #e6eef9;
    letter-spacing: -0.01em;
    text-align: center;
}
.aa-vg-subtitle {
    margin: 0 0 14px;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    text-align: center;
}
.aa-vg-subtitle b {
    color: #e6eef9;
    font-weight: 600;
}
.aa-vg-consent {
    margin: 4px 0 14px;
    font-size: 11px;
    line-height: 1.5;
    color: #8a98ad;
    text-align: center;
}
.aa-vg-consent a {
    color: #cbd5e1;
    text-decoration: underline;
}
.aa-vg-consent a:hover { color: #ffffff; }

.aa-vg-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 9px;
}
.aa-vg-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.aa-vg-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(120, 200, 255, 0.15);
    border-radius: 10px;
    padding: 11px 13px;
    color: #e6eef9;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.aa-vg-input::placeholder { color: rgba(148, 163, 184, 0.55); }
.aa-vg-input:focus {
    border-color: rgba(0, 217, 255, 0.55);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.12);
}
.aa-vg-input--code {
    text-align: center;
    font-size: 22px;
    letter-spacing: 10px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.aa-vg-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.aa-vg-btn {
    flex: 1;
    border: 0;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.aa-vg-btn--primary {
    background: linear-gradient(135deg, #00d9ff 0%, #38bdf8 50%, #3b82f6 100%);
    color: #051121;
    box-shadow: 0 6px 24px rgba(0, 217, 255, 0.25);
}
.aa-vg-btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.35);
}
.aa-vg-btn--ghost {
    flex: 0 0 auto;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(120,200,255,0.18);
    color: #94a3b8;
}
.aa-vg-btn--ghost:hover:not(:disabled) {
    background: rgba(255,255,255,0.08);
    color: #e6eef9;
}
.aa-vg-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.aa-vg-error {
    margin: 12px 0 0;
    font-size: 12.5px;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    padding: 9px 11px;
    text-align: center;
    display: none;
    line-height: 1.4;
}
.aa-vg-error.is-visible { display: block; }

.aa-vg-footer {
    margin: 14px 0 0;
    font-size: 12px;
    color: #64748b;
    text-align: center;
}
.aa-vg-footer a {
    color: #38bdf8;
    text-decoration: none;
    transition: color 0.2s;
}
.aa-vg-footer a:hover { color: #00d9ff; }
.aa-vg-footer .aa-vg-sep { margin: 0 6px; color: rgba(148,163,184,0.4); }

/* Trust-signal foot: a row of three muted chips reassuring the visitor.
   Only shown on step 1 — once we've sent the code the affordance changes. */
.aa-vg-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(120,200,255,0.08);
}
.aa-vg-trust span {
    font-size: 10.5px;
    color: #94a3b8;
    letter-spacing: 0.04em;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(120,200,255,0.10);
    border-radius: 999px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.aa-vg-trust i { color: #00d9ff; font-size: 10px; }

@media (max-width: 480px) {
    .aa-vg-modal { padding: 8px; }
    .aa-vg-card { padding: 22px 18px 18px; }
    .aa-vg-input--code { font-size: 20px; letter-spacing: 8px; }
}

/* Contact-page callback summary card — shown above the Call button
   when a verified lead is in sessionStorage. Mirrors the widget's
   cb-summary style but tuned for the larger page surface. */
.aa-cb-summary {
    background:
        linear-gradient(180deg, rgba(0,217,255,0.07), rgba(0,217,255,0.03));
    border: 1px solid rgba(0,217,255,0.22);
    border-radius: 12px;
    padding: 16px 18px;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.aa-cb-summary-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #e6eef9;
}
.aa-cb-summary-row i {
    color: #00d9ff;
    font-size: 13px;
    width: 16px;
    text-align: center;
}
.aa-cb-summary-row .aa-cb-summary-label {
    color: #94a3b8;
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    min-width: 56px;
}
.aa-cb-summary-row .aa-cb-summary-value {
    flex: 1;
    color: #e6eef9;
    font-weight: 500;
}
.aa-cb-helper {
    color: #94a3b8;
    font-size: 13px;
    margin: 0 0 14px;
}
.aa-cb-edit-link {
    text-align: center;
    margin: 10px 0 0;
    font-size: 13px;
}
.aa-cb-edit-link a {
    color: #38bdf8;
    text-decoration: none;
}
.aa-cb-edit-link a:hover { color: #00d9ff; }
.aa-cb-override {
    margin: 0 0 14px;
}
.aa-cb-override-label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.aa-cb-override-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(120,200,255,0.18);
    border-radius: 10px;
    padding: 11px 13px;
    color: #e6eef9;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.aa-cb-override-input:focus {
    border-color: rgba(0,217,255,0.55);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 0 3px rgba(0,217,255,0.12);
}
