/* Website chat robot "Nova" (resources/views/website/partials/chat.blade.php + /site/js/chat.js) */
.nv-chat { --nv-brand: var(--brand, #f0520f); --nv-brand-2: var(--brand-2, #ff7a32); --nv-ink: var(--ink, #15122b); --nv-muted: var(--muted, #66637e);
    --nv-line: var(--line, #eceaf3); --nv-soft: var(--soft, #f7f6fb); --nv-ease: cubic-bezier(.2, .8, .2, 1);
    position: fixed; right: 22px; bottom: 22px; z-index: 9990; font-family: inherit; color: var(--nv-ink); }
.nv-chat[hidden] { display: none; }

/* Launcher */
.nv-chat-fab { position: relative; width: 64px; height: 64px; border: 0; border-radius: 22px; cursor: pointer; display: grid; place-items: center; color: #fff;
    background: linear-gradient(140deg, var(--nv-brand-2), var(--nv-brand) 55%, #c23b03); box-shadow: 0 18px 40px -14px rgb(240 82 15 / .7), 0 4px 12px -4px rgb(21 18 43 / .25);
    transition: transform .35s var(--nv-ease), border-radius .35s var(--nv-ease); animation: nv-pop .6s var(--nv-ease) both; }
.nv-chat-fab::before { content: ""; position: absolute; inset: -6px; border-radius: 26px; border: 2px solid rgb(240 82 15 / .45); animation: nv-ring 2.6s ease-out infinite; pointer-events: none; }
.nv-chat-fab:hover { transform: translateY(-3px) scale(1.04); }
.nv-chat-fab:focus-visible { outline: 3px solid #ffd25e; outline-offset: 3px; }
.nv-chat-fab-bot { width: 44px; height: 44px; display: block; color: #fff; transition: transform .35s var(--nv-ease), opacity .25s; }
.nv-chat-fab-x { position: absolute; opacity: 0; transform: rotate(-90deg) scale(.6); transition: transform .35s var(--nv-ease), opacity .25s; }
.nv-chat.is-open .nv-chat-fab { border-radius: 50%; }
.nv-chat.is-open .nv-chat-fab::before { display: none; }
.nv-chat.is-open .nv-chat-fab-bot { opacity: 0; transform: scale(.4) rotate(40deg); }
.nv-chat.is-open .nv-chat-fab-x { opacity: 1; transform: none; }
.nv-chat-dot { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #16a34a; color: #fff;
    font-size: 12px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; animation: nv-pop .5s var(--nv-ease) both; }
.nv-chat-dot[hidden] { display: none; }

/* Robot */
.nv-bot { width: 100%; height: 100%; display: block; }
.nv-bot-eyes { transform-origin: 24px 23.5px; animation: nv-blink 4.5s infinite; }
.nv-bot-ant { animation: nv-glow 2s ease-in-out infinite; }
.nv-chat-fab-bot .nv-bot { animation: nv-bob 3s ease-in-out infinite; }
.nv-bot-mouth { transform-box: fill-box; transform-origin: center; transition: transform .2s; }
.nv-chat.is-talking .nv-bot-mouth { animation: nv-talk .26s ease-in-out infinite alternate; }
.nv-chat.is-talking .nv-chat-avatar { box-shadow: 0 0 0 3px rgb(255 255 255 / .25), 0 0 18px rgb(255 122 50 / .7); }
@keyframes nv-talk { 0% { transform: scale(.8, 1); } 50% { transform: scale(1, 2.6); } 100% { transform: scale(.7, 1.4); } }
.nv-chat-say { position: absolute; right: 0; bottom: 80px; width: 290px; padding: 15px 34px 15px 17px; background: #fff; border-radius: 20px 20px 6px 20px; display: grid; gap: 5px;
    box-shadow: 0 28px 60px -24px rgb(21 18 43 / .5), 0 0 0 1px var(--nv-line); font-size: 14px; line-height: 1.45; animation: nv-rise .35s var(--nv-ease) both; }
.nv-chat-say[hidden] { display: none; }
.nv-chat-say b { font-size: 15.5px; color: var(--nv-ink); }
.nv-chat-say span { color: var(--nv-muted); }
.nv-chat-say a { justify-self: start; margin-top: 4px; padding: 7px 13px; border-radius: 999px; background: #fff1e8; color: var(--nv-brand); font-weight: 700; font-size: 13px; text-decoration: none; }
.nv-chat-say a:hover { background: #ffe1cc; }
.nv-chat-say a::after { content: " →"; }
.nv-chat-say::after { content: ""; position: absolute; right: 22px; bottom: -7px; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); box-shadow: 3px 3px 4px -2px rgb(21 18 43 / .12); }
.w-app.is-speaking { outline: 3px solid rgb(240 82 15 / .45); outline-offset: 4px; border-radius: 22px; }
.nv-chat-mute { width: 36px; height: 36px; border: 0; border-radius: 12px; background: rgb(255 255 255 / .1); color: #fff; cursor: pointer; display: grid; place-items: center; }
.nv-chat-mute:hover { background: rgb(255 255 255 / .2); }
.nv-chat-mute .nv-off { display: none; }
.nv-chat.is-muted .nv-chat-mute .nv-on { display: none; }
.nv-chat.is-muted .nv-chat-mute .nv-off { display: block; }
.nv-bot-hold { transform-box: view-box; transform-origin: 33.5px 24px; animation: nv-wave 3s ease-in-out infinite; }
@keyframes nv-wave { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-10deg); } 80% { transform: rotate(4deg); } 90% { transform: rotate(-6deg); } }

/* Teaser bubble */
.nv-chat-teaser { position: absolute; right: 0; bottom: 78px; width: 250px; padding: 14px 34px 14px 16px; background: #fff; border-radius: 18px 18px 6px 18px;
    box-shadow: 0 24px 50px -22px rgb(21 18 43 / .45), 0 0 0 1px var(--nv-line); display: grid; gap: 3px; font-size: 14px; cursor: pointer;
    animation: nv-rise .5s var(--nv-ease) both; }
.nv-chat-teaser[hidden] { display: none; }
.nv-chat-teaser span { color: var(--nv-muted); line-height: 1.4; }
.nv-chat-teaser-x { position: absolute; top: 6px; right: 8px; width: 24px; height: 24px; border: 0; background: none; color: var(--nv-muted); font-size: 18px; cursor: pointer; border-radius: 8px; }
.nv-chat-teaser-x:hover { background: var(--nv-soft); }

/* Panel */
.nv-chat-panel { position: absolute; right: 0; bottom: 80px; width: 380px; height: min(600px, calc(100vh - 120px)); background: #fff; border-radius: 24px; overflow: hidden;
    display: flex; flex-direction: column; box-shadow: 0 40px 90px -30px rgb(21 18 43 / .55), 0 0 0 1px rgb(21 18 43 / .06);
    transform-origin: bottom right; animation: nv-open .38s var(--nv-ease) both; }
.nv-chat-panel[hidden] { display: none; }
.nv-chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; color: #fff;
    background: radial-gradient(120% 140% at 100% 0%, #6d4aff 0%, transparent 55%), linear-gradient(135deg, #15122b, #2a2450); }
.nv-chat-avatar { width: 44px; height: 44px; flex: none; border-radius: 15px; padding: 5px; color: #fff; background: linear-gradient(140deg, var(--nv-brand-2), var(--nv-brand)); }
.nv-chat-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.nv-chat-title b { font-size: 15px; }
.nv-chat-title small { font-size: 12.5px; color: rgb(255 255 255 / .72); display: flex; align-items: center; gap: 6px; }
.nv-chat-online { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgb(74 222 128 / .25); animation: nv-glow 2s ease-in-out infinite; }
.nv-chat-close { width: 36px; height: 36px; border: 0; border-radius: 12px; background: rgb(255 255 255 / .1); color: #fff; cursor: pointer; display: grid; place-items: center; }
.nv-chat-close:hover { background: rgb(255 255 255 / .2); }

.nv-chat-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; background: var(--nv-soft); scroll-behavior: smooth; }
.nv-msg { max-width: 86%; padding: 11px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; white-space: pre-line; word-wrap: break-word; animation: nv-rise .32s var(--nv-ease) both; }
.nv-msg-bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgb(21 18 43 / .06); }
.nv-msg-user { align-self: flex-end; color: #fff; background: linear-gradient(135deg, var(--nv-brand-2), var(--nv-brand)); border-bottom-right-radius: 6px; }
.nv-msg-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nv-msg-links a { display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; text-decoration: none;
    color: var(--nv-brand); background: #fff1e8; transition: background .2s, transform .2s; }
.nv-msg-links a:hover { background: #ffe1cc; transform: translateY(-1px); }
.nv-msg-links a::after { content: "→"; }
.nv-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.nv-typing i { width: 7px; height: 7px; border-radius: 50%; background: #b9b6c9; animation: nv-dots 1.1s infinite; }
.nv-typing i:nth-child(2) { animation-delay: .15s; } .nv-typing i:nth-child(3) { animation-delay: .3s; }

.nv-chat-quick { display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; background: var(--nv-soft); scrollbar-width: none; }
.nv-chat-quick:empty { display: none; }
.nv-chat-quick::-webkit-scrollbar { display: none; }
.nv-chat-quick button { flex: none; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line-2, #dedbe8); background: #fff; color: var(--nv-ink);
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .2s, color .2s, transform .2s; }
.nv-chat-quick button:hover { border-color: var(--nv-brand); color: var(--nv-brand); transform: translateY(-1px); }

.nv-chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--nv-line); background: #fff; }
.nv-chat-input input { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-2, #dedbe8); font: inherit; font-size: 15px; color: var(--nv-ink); background: #fff; }
.nv-chat-input input:focus { outline: none; border-color: var(--nv-brand); box-shadow: 0 0 0 4px rgb(240 82 15 / .12); }
.nv-chat-input button { width: 46px; height: 46px; flex: none; border: 0; border-radius: 14px; cursor: pointer; color: #fff; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--nv-brand-2), var(--nv-brand)); transition: transform .2s; }
.nv-chat-input button:hover { transform: scale(1.05); }

/* Lead form inside the chat */
.nv-lead { align-self: stretch; max-width: none; background: #fff; display: grid; gap: 8px; }
.nv-lead b { font-size: 14.5px; }
.nv-lead input, .nv-lead textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2, #dedbe8); font: inherit; font-size: 14px; color: var(--nv-ink); resize: vertical; }
.nv-lead input:focus, .nv-lead textarea:focus { outline: none; border-color: var(--nv-brand); box-shadow: 0 0 0 3px rgb(240 82 15 / .12); }
.nv-lead .nv-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.nv-lead button { height: 44px; border: 0; border-radius: 12px; font: inherit; font-weight: 700; color: #fff; cursor: pointer; background: linear-gradient(135deg, var(--nv-brand-2), var(--nv-brand)); }
.nv-lead button[disabled] { opacity: .6; cursor: wait; }
.nv-lead small { color: var(--nv-muted); font-size: 12.5px; }
.nv-lead .nv-err { color: #c2410c; }

@keyframes nv-pop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
@keyframes nv-ring { 0% { opacity: .9; transform: scale(.92); } 80%, 100% { opacity: 0; transform: scale(1.25); } }
@keyframes nv-open { from { opacity: 0; transform: translateY(16px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes nv-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes nv-dots { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes nv-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes nv-glow { 50% { opacity: .45; } }
@keyframes nv-bob { 50% { transform: translateY(-2px) rotate(-4deg); } }

@media (max-width: 520px) {
    .nv-chat { right: 14px; bottom: 14px; }
    .nv-chat-panel { position: fixed; inset: 10px 10px 90px 10px; width: auto; height: auto; }
    .nv-chat-teaser { width: min(250px, calc(100vw - 40px)); }
}
@media (prefers-reduced-motion: reduce) {
    .nv-chat *, .nv-chat *::before, .nv-chat-fab::before { animation: none !important; transition: none !important; }
}
