/* ===== Design tokens ===== */
:root {
  --bg: #0a0a0f;
  --bg-alt: #0e0e16;
  --surface: #14141f;
  --surface-2: #181826;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef0f6;
  --muted: #9aa0b4;
  --brand: #7c8cff;
  --brand-2: #33e0d0;
  --grad: linear-gradient(120deg, #7c8cff 0%, #33e0d0 100%);
  --radius: 16px;
  --maxw: 1140px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Focus visibile per navigazione da tastiera (accessibilità) */
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 3px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: "Sora", "Inter", sans-serif; line-height: 1.15; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted { color: var(--muted); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px; font-weight: 600; font-size: 15px;
  background: var(--grad); color: #07070c; border: none; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease; box-shadow: 0 10px 30px -10px rgba(124, 140, 255, .6);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(51, 224, 208, .55); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn--ghost:hover { background: rgba(255,255,255,.04); }
.btn--sm { padding: 10px 18px; font-size: 14px; }
.btn--full { width: 100%; }

/* ===== Navbar ===== */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(10, 10, 15, .75); backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__name { font-family: "Sora", sans-serif; font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.nav__links { display: flex; gap: 28px; }
.nav__links a { color: var(--muted); font-size: 15px; font-weight: 500; transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__cta { display: inline-flex; }

.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav__burger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero { position: relative; padding: 168px 0 110px; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.orb--1 { width: 520px; height: 520px; background: #4a55c9; top: -160px; left: -120px; }
.orb--2 { width: 460px; height: 460px; background: #178c83; top: 40px; right: -140px; opacity: .4; }
.grid-lines {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 70%);
  opacity: .5;
}
.hero__inner { position: relative; z-index: 1; text-align: center; max-width: 880px; margin: 0 auto; }
.pill {
  display: inline-block; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--brand-2); border: 1px solid var(--border); background: rgba(255,255,255,.03); margin-bottom: 26px;
}
.hero__title { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 800; margin-bottom: 22px; }
.hero__sub { font-size: clamp(1rem, 2.2vw, 1.2rem); color: var(--muted); max-width: 640px; margin: 0 auto 36px; }
.hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.stats { display: flex; gap: 52px; justify-content: center; align-items: flex-start; flex-wrap: wrap; margin-top: 64px; }
.stat { text-align: center; }
.stat strong {
  display: flex; align-items: flex-end; justify-content: center; min-height: 3.4rem;
  font-family: "Sora", sans-serif; font-size: 2.6rem; line-height: 1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat__unit { font-size: .65em; margin-left: 2px; }
.stat__label { font-size: 14px; color: var(--muted); max-width: 170px; display: inline-block; margin-top: 8px; }

/* Statistica centrale in evidenza */
.stat--feature strong { font-size: 3.4rem; }
.stat--feature .stat__label { color: var(--text); font-weight: 600; }

/* Statistica testuale (no counter) */
.stat--text strong { font-size: 2rem; white-space: nowrap; }

/* ===== Sections ===== */
.section { padding: 100px 0; }
.section--alt { background: var(--bg-alt); }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-2); margin-bottom: 14px; }
.section__title { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 700; }
.section__head { max-width: 640px; margin: 0 auto 56px; text-align: center; }
.section__head .muted { margin-top: 14px; }
.lead { font-size: 1.18rem; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }

/* ===== Cards (servizi) ===== */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px 28px; transition: transform .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-6px); border-color: rgba(124,140,255,.4); }
.card__icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(124,140,255,.12); color: var(--brand); margin-bottom: 20px;
}
.card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.card p { color: var(--muted); margin-bottom: 18px; }
.ticks { list-style: none; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; font-size: 14.5px; color: #c7cbdb; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--brand-2); font-weight: 700; }

/* ===== Flow (metodo) ===== */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.flow__step { position: relative; padding: 0 14px; text-align: center; list-style: none; }
.flow__step::before {
  content: ""; position: absolute; top: 30px; left: 50%; width: 100%; height: 2px; z-index: 0;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 50%, var(--brand) 100%);
  background-size: 200% 100%; opacity: .5; animation: flow-line 3.5s linear infinite;
}
.flow__step:last-child::before { display: none; }
@keyframes flow-line { to { background-position: -200% 0; } }
@keyframes flow-line-v { to { background-position: 0 -200%; } }

.flow__node {
  position: relative; z-index: 1; width: 60px; height: 60px; margin: 0 auto 24px;
  border-radius: 50%; display: grid; place-items: center; background: var(--bg-alt);
  transition: transform .25s ease, box-shadow .25s ease;
}
/* Anello gradient via mask */
.flow__node::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; padding: 1.5px; background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.flow__step:hover .flow__node { transform: translateY(-3px); box-shadow: 0 16px 34px -14px rgba(124,140,255,.65); }
.flow__num { font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.15rem; letter-spacing: .03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.flow__body h3 { font-size: 1.18rem; margin-bottom: 8px; }
.flow__body p { color: var(--muted); font-size: 14.5px; }

/* ===== Projects ===== */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.proj {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px;
  display: flex; flex-direction: column; gap: 16px; transition: transform .25s, border-color .25s;
}
.proj:hover { transform: translateY(-5px); border-color: rgba(51,224,208,.35); }
.proj__top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.proj__logo {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em;
  color: #07070c; background: var(--grad);
}
.proj__link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600;
  color: var(--brand-2); border: 1px solid var(--border); border-radius: 999px; padding: 7px 13px;
  transition: border-color .2s, background .2s;
}
.proj__link:hover { border-color: rgba(51,224,208,.5); background: rgba(51,224,208,.07); }
.proj__link--private { color: var(--muted); cursor: default; }
.proj__link--private:hover { border-color: var(--border); background: none; }
.proj__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.proj__tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--brand-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; }
.proj h3 { font-size: 1.35rem; }
.proj p { color: var(--muted); font-size: 15px; }
.proj__deliver { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.proj__deliver li { font-size: 12.5px; color: #c7cbdb; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 11px; }
.proj--cta { background: linear-gradient(135deg, rgba(124,140,255,.14), rgba(51,224,208,.1)); align-items: flex-start; justify-content: center; gap: 12px; }
.proj--cta .btn { margin-top: 6px; }

/* ===== Team ===== */
.team { display: grid; gap: 24px; }
.team__row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

.member {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.member:hover { transform: translateY(-4px); border-color: rgba(124, 140, 255, .35); box-shadow: var(--shadow); }

.member__avatar {
  width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center;
  font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.2rem; color: #07070c; background: var(--grad);
  box-shadow: 0 10px 28px -10px rgba(124, 140, 255, .6);
}
.member h3 { font-size: 1.15rem; margin-top: 16px; }
.member__role { display: block; color: var(--brand-2); font-size: 13.5px; font-weight: 600; margin: 6px 0 12px; }
.member p { color: var(--muted); font-size: 14.5px; }

.member__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.member__tags li {
  font-size: 12px; font-weight: 600; color: var(--text);
  padding: 5px 11px; border-radius: 999px;
  background: rgba(124, 140, 255, .10); border: 1px solid rgba(124, 140, 255, .22);
}

/* Founder in evidenza */
.member--lead {
  display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; padding: 36px;
  background:
    radial-gradient(130% 150% at 0% 0%, rgba(124, 140, 255, .14), transparent 55%),
    var(--surface);
  border-color: rgba(124, 140, 255, .24);
}
.member--lead .member__avatar { width: 92px; height: 92px; border-radius: 24px; font-size: 1.8rem; }
.member--lead h3 { font-size: 1.65rem; margin-top: 0; }
.member--lead .member__role { font-size: 15px; }
.member--lead p { max-width: 62ch; }

/* ===== Contact ===== */
.contact .section__title { text-align: left; }
.contact__info { list-style: none; margin: 28px 0 18px; display: grid; gap: 14px; }
.contact__info li { display: flex; gap: 16px; align-items: baseline; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.contact__info span { color: var(--muted); min-width: 70px; font-size: 14px; }
.note { font-size: 13.5px; color: var(--muted); font-style: italic; }

.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; display: grid; gap: 18px; box-shadow: var(--shadow); }
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field textarea {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 13px 15px;
  color: var(--text); font: inherit; font-size: 15px; transition: border-color .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.field textarea { resize: vertical; }
.form__hint { font-size: 12.5px; color: var(--muted); text-align: center; }
.form__status { font-size: 14px; text-align: center; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); }
.form__status--success { color: var(--brand-2); border-color: rgba(51,224,208,.4); background: rgba(51,224,208,.08); }
.form__status--error { color: #ff9b9b; border-color: rgba(255,107,107,.4); background: rgba(255,107,107,.08); }

/* ===== Footer ===== */
.footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 56px 0 28px; }
.footer__inner { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.footer__links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer__links a { color: var(--muted); font-size: 15px; transition: color .2s; }
.footer__links a:hover { color: var(--text); }
.footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; font-size: 14px; color: var(--muted); }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .cards, .projects { grid-template-columns: 1fr 1fr; }
  .team__row { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; gap: 32px; }
}

/* Flow diventa verticale con connettore a sinistra */
@media (max-width: 760px) {
  .flow { grid-template-columns: 1fr; gap: 0; }
  .flow__step { display: grid; grid-template-columns: 60px 1fr; gap: 20px; text-align: left; padding: 0 0 34px 0; }
  .flow__step::before {
    top: 60px; left: 29px; width: 2px; height: 100%;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 50%, var(--brand) 100%);
    background-size: 100% 200%; animation: flow-line-v 3.5s linear infinite;
  }
  .flow__step:last-child { padding-bottom: 0; }
  .flow__node { margin: 0; }
  .flow__body { padding-top: 8px; }
}

@media (max-width: 720px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: flex; }
  .nav__links.show {
    display: flex; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0;
    background: rgba(10,10,15,.97); backdrop-filter: blur(14px); padding: 24px; gap: 20px; border-bottom: 1px solid var(--border);
  }
  .cards, .projects { grid-template-columns: 1fr; }
  .team__row { grid-template-columns: 1fr; }
  .member--lead { grid-template-columns: 1fr; gap: 20px; padding: 28px 24px; text-align: left; }
  .stats { gap: 28px; }
  .section { padding: 72px 0; }
  .hero { padding: 130px 0 80px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== Chatbot ===== */

/* --- Pulsante flottante --- */
.lx-chat-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--grad);
  color: #07070c;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 32px -8px rgba(124, 140, 255, 0.7);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  /* Anello pulsante: trattato come firma estetica del widget */
  outline: none;
}
.lx-chat-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 14px 40px -10px rgba(51, 224, 208, 0.65);
}
.lx-chat-btn:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 4px;
}

/* Anello gradient animato attorno al pulsante — firma estetica */
.lx-chat-btn__ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--grad);
  opacity: 0.35;
  animation: lx-ring-pulse 2.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes lx-ring-pulse {
  0%, 100% { transform: scale(1);   opacity: 0.35; }
  50%       { transform: scale(1.18); opacity: 0; }
}

/* Icone apertura / chiusura */
.lx-chat-btn__icon { position: absolute; transition: opacity 0.2s ease, transform 0.2s ease; }
.lx-chat-btn__icon--open  { opacity: 1; transform: scale(1) rotate(0deg); }
.lx-chat-btn__icon--close { opacity: 0; transform: scale(0.7) rotate(-90deg); }
.lx-chat-btn--open .lx-chat-btn__icon--open  { opacity: 0; transform: scale(0.7) rotate(90deg); }
.lx-chat-btn--open .lx-chat-btn__icon--close { opacity: 1; transform: scale(1) rotate(0deg); }

/* --- Pannello chat --- */
.lx-chat-panel {
  position: fixed;
  bottom: 102px;
  right: 28px;
  z-index: 9998;
  width: 360px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(124, 140, 255, 0.08);
  overflow: hidden;
  /* Nascosto e fuori dal flusso accessibilità di default */
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform-origin: bottom right;
}
.lx-chat-panel--open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* --- Header pannello --- */
.lx-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}
.lx-chat-header__info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lx-chat-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad);
  color: #07070c;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.lx-chat-header__title {
  font-family: "Sora", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.lx-chat-header__sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
}
.lx-chat-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.lx-chat-close:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.lx-chat-close:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 8px; }

/* --- Area messaggi --- */
.lx-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
/* Scrollbar sottile coerente col tema */
.lx-chat-messages::-webkit-scrollbar { width: 4px; }
.lx-chat-messages::-webkit-scrollbar-track { background: transparent; }
.lx-chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* --- Bolle messaggio --- */
.lx-msg {
  display: flex;
  max-width: 88%;
}
.lx-msg--user  { align-self: flex-end; justify-content: flex-end; }
.lx-msg--assistant { align-self: flex-start; }

.lx-msg__bubble {
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.55;
  word-break: break-word;
}
/* Bolla utente: gradiente brand */
.lx-msg--user .lx-msg__bubble {
  background: var(--grad);
  color: #07070c;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}
/* Bolla assistente: surface-2 con bordo laterale brand come "firma AI" */
.lx-msg--assistant .lx-msg__bubble {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 2px solid var(--brand-2);
  border-bottom-left-radius: 4px;
}

/* --- Indicatore di digitazione --- */
.lx-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
}
.lx-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-2);
  opacity: 0.45;
  animation: lx-dot-bounce 1.2s ease-in-out infinite;
}
.lx-typing span:nth-child(1) { animation-delay: 0s; }
.lx-typing span:nth-child(2) { animation-delay: 0.18s; }
.lx-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes lx-dot-bounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.45; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* --- Footer input --- */
.lx-chat-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}
.lx-chat-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.lx-chat-input:focus { border-color: var(--brand); }
.lx-chat-input::placeholder { color: var(--muted); }
.lx-chat-input:disabled { opacity: 0.5; cursor: not-allowed; }

.lx-chat-send {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  border: none;
  background: var(--grad);
  color: #07070c;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, opacity 0.2s;
}
.lx-chat-send:hover:not(:disabled) { transform: scale(1.08); }
.lx-chat-send:disabled { opacity: 0.45; cursor: not-allowed; }
.lx-chat-send:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.lx-chat-send--loading { animation: lx-send-pulse 0.9s ease-in-out infinite; }
@keyframes lx-send-pulse {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 0.75; }
}

/* --- Mobile (< 480px): pannello quasi a tutta larghezza --- */
@media (max-width: 480px) {
  .lx-chat-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 90px;
    max-height: 72vh;
  }
  .lx-chat-btn {
    right: 20px;
    bottom: 20px;
  }
}

/* --- Rispetta prefers-reduced-motion (sovrascrive le animazioni del widget) --- */
@media (prefers-reduced-motion: reduce) {
  .lx-chat-btn__ring,
  .lx-typing span,
  .lx-chat-send--loading { animation: none !important; }
  .lx-chat-panel,
  .lx-chat-btn,
  .lx-chat-btn__icon,
  .lx-chat-close,
  .lx-chat-input,
  .lx-chat-send { transition: none !important; }
  .lx-chat-btn__ring { opacity: 0; }
}
