/* Lía – asistente virtual de LEGAMITY */
.lia { position: fixed; right: 18px; bottom: 18px; z-index: 900; font-family: var(--font-body, system-ui, sans-serif); }
body:has(.privacy-notice) .lia { bottom: 128px; }
@media (max-width: 700px) { body:has(.privacy-notice) .lia { bottom: 170px; } }

.lia-launcher { position: relative; width: 66px; height: 66px; padding: 0; border-radius: 50%; border: 3px solid #fff; background: var(--lia-a, #8b5cf6); cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 0 color-mix(in srgb, var(--lia-a, #8b5cf6) 55%, transparent); animation: liaPulse 2.8s ease-in-out infinite; transition: transform .2s; }
.lia-launcher:hover { transform: scale(1.06); }
.lia-launcher img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.lia-online { position: absolute; right: 2px; bottom: 2px; width: 15px; height: 15px; border-radius: 50%; background: #34d399; border: 3px solid #0b0b12; }
.lia-launcher.lia-hide { display: none; }
@keyframes liaPulse { 0%,100% { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 0 color-mix(in srgb, var(--lia-a, #8b5cf6) 50%, transparent); } 50% { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 14px color-mix(in srgb, var(--lia-a, #8b5cf6) 0%, transparent); } }

.lia-teaser { position: absolute; right: 78px; bottom: 14px; background: #fff; color: #1f2937; padding: .55rem .95rem; border-radius: 14px 14px 4px 14px; font-weight: 600; font-size: .95rem; box-shadow: 0 8px 24px rgba(0,0,0,.35); cursor: pointer; white-space: nowrap; animation: liaPop .4s ease both; }
.lia-teaser[hidden] { display: none; }
@keyframes liaPop { from { opacity: 0; transform: translateY(8px) scale(.95); } to { opacity: 1; transform: none; } }

.lia-panel { width: 380px; height: min(620px, calc(100vh - 40px)); display: flex; flex-direction: column; background: #0d0a1c; border: 1px solid color-mix(in srgb, var(--lia-a, #8b5cf6) 45%, transparent); border-radius: 18px; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.65); animation: liaPop .3s ease both; }
.lia-panel[hidden] { display: none; }
.lia-head { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; background: linear-gradient(135deg, var(--lia-a, #8b5cf6), var(--lia-b, #f43f5e)); color: #fff; }
.lia-head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.85); }
.lia-head-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; flex: 1; }
.lia-head-txt strong { font-size: 1.05rem; }
.lia-head-txt span { font-size: .78rem; opacity: .92; }
.lia-status { display: flex; align-items: center; gap: .35rem; font-size: .74rem; background: rgba(0,0,0,.25); padding: .2rem .55rem; border-radius: 999px; }
.lia-status i { width: 8px; height: 8px; border-radius: 50%; background: #34d399; display: inline-block; }
.lia-close { background: transparent; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; padding: .3rem .4rem; border-radius: 8px; }
.lia-close:hover { background: rgba(255,255,255,.18); }
.lia-note { font-size: .74rem; color: #a1a1aa; background: #130f26; padding: .45rem 1rem; border-bottom: 1px solid rgba(255,255,255,.06); }

.lia-msgs { flex: 1; overflow-y: auto; padding: 1rem .9rem .5rem; display: flex; flex-direction: column; gap: .65rem; scroll-behavior: smooth; }
.lia-row { display: flex; align-items: flex-end; gap: .5rem; max-width: 100%; }
.lia-row.lia-user { justify-content: flex-end; }
.lia-ava { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: 0 0 28px; }
.lia-bubble { max-width: 82%; padding: .65rem .9rem; border-radius: 16px; font-size: .94rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; animation: liaPop .25s ease both; }
.lia-assistant .lia-bubble { background: #1a1533; color: #ececf1; border: 1px solid rgba(255,255,255,.08); border-bottom-left-radius: 4px; }
.lia-user .lia-bubble { background: linear-gradient(135deg, var(--lia-a, #8b5cf6), var(--lia-b, #f43f5e)); color: #fff; font-weight: 500; border-bottom-right-radius: 4px; }
.lia-typing .lia-bubble { display: flex; gap: 4px; padding: .8rem 1rem; }
.lia-typing .lia-bubble i { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--lia-a, #8b5cf6) 70%, white); animation: liaDot 1.1s infinite ease-in-out; }
.lia-typing .lia-bubble i:nth-child(2) { animation-delay: .15s; } .lia-typing .lia-bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes liaDot { 0%,80%,100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }

.lia-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: .3rem .9rem .6rem; }
.lia-chips:empty { display: none; }
.lia-chip { background: transparent; color: color-mix(in srgb, var(--lia-a, #8b5cf6) 45%, white); border: 1px solid color-mix(in srgb, var(--lia-a, #8b5cf6) 60%, white); border-radius: 999px; padding: .4rem .8rem; font-size: .84rem; cursor: pointer; font-family: inherit; transition: background .15s, color .15s; }
.lia-chip:hover { background: #8b5cf6; color: #fff; border-color: var(--lia-a, #8b5cf6); }

.lia-input { display: flex; gap: .5rem; padding: .7rem .8rem; border-top: 1px solid rgba(255,255,255,.08); background: #0a0817; }
.lia-input input { flex: 1; background: #17122c; color: #fff; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; padding: .65rem 1rem; font-size: .95rem; font-family: inherit; outline: none; }
.lia-input input:focus { border-color: var(--lia-a, #8b5cf6); }
.lia-input button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--lia-a, #8b5cf6), var(--lia-b, #f43f5e)); color: #fff; font-size: 1.05rem; cursor: pointer; }
.lia-input button:disabled { opacity: .5; cursor: default; }

.lia-leadform { width: 100%; background: #17122c; border: 1px solid color-mix(in srgb, var(--lia-a, #8b5cf6) 50%, transparent); border-radius: 14px; padding: .8rem; display: grid; gap: .5rem; }
.lia-leadform input[type=text], .lia-leadform input[type=email], .lia-leadform input[type=tel] { width: 100%; background: #0d0a1c; color: #fff; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: .6rem .75rem; font-size: .92rem; font-family: inherit; box-sizing: border-box; }
.lia-consent { display: flex; gap: .5rem; font-size: .76rem; color: #b4b4c0; line-height: 1.4; align-items: flex-start; }
.lia-consent input { margin-top: .15rem; width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--lia-a, #8b5cf6); }
.lia-consent a { color: color-mix(in srgb, var(--lia-a, #8b5cf6) 45%, white); text-decoration: underline; }
.lia-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; }
.lia-send { background: linear-gradient(135deg, var(--lia-a, #8b5cf6), var(--lia-b, #f43f5e)); color: #fff; border: 0; border-radius: 10px; padding: .7rem; font-weight: 700; font-size: .95rem; cursor: pointer; font-family: inherit; }
.lia-send:disabled { opacity: .6; }
.lia-err { color: #fda4af; font-size: .8rem; }
.lia-err:empty { display: none; }

@media (max-width: 520px) {
  .lia { right: 10px; bottom: 10px; left: 10px; }
  .lia-launcher { margin-left: auto; display: block; }
  .lia-panel { width: 100%; height: min(86vh, 640px); }
  .lia-teaser { right: 74px; }
  .lia-bubble { max-width: 86%; }
}
@media (prefers-reduced-motion: reduce) { .lia-launcher, .lia-bubble, .lia-panel, .lia-teaser, .lia-typing .lia-bubble i { animation: none; } }
