/* ===== DevLm — widget do assistente de IA ===== */
.ai-spark { color: var(--primary-2); }
.wa-float { bottom: 98px; width: 52px; height: 52px; }
.wa-float svg { width: 26px; height: 26px; }

.aichat { position: fixed; right: 22px; bottom: 22px; z-index: 70; font-family: var(--font); }

.aichat__launcher {
  position: relative; width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 12px 32px rgba(99, 102, 241, .5); transition: transform .2s;
}
.aichat__launcher:hover { transform: scale(1.06); }
.aichat__launcher svg { width: 28px; height: 28px; position: absolute; transition: opacity .2s, transform .2s; }
.aichat__launcher .i-close { opacity: 0; transform: rotate(-90deg); }
.aichat.is-open .aichat__launcher .i-open { opacity: 0; transform: rotate(90deg); }
.aichat.is-open .aichat__launcher .i-close { opacity: 1; transform: none; }
.aichat__ping {
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--primary-2);
  animation: aiPing 2.4s ease-out infinite;
}
.aichat.is-open .aichat__ping { display: none; }
@keyframes aiPing { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.55); opacity: 0; } }

.aichat__teaser {
  position: absolute; right: 0; bottom: 76px; width: 250px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px 16px 4px 16px;
  padding: 14px 32px 14px 16px; box-shadow: var(--shadow); cursor: pointer;
  font-size: 14px; color: var(--text); animation: aiIn .35s ease;
}
.aichat__teaser[hidden] { display: none; }
.aichat__teaser-close {
  position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--muted);
  font-size: 18px; cursor: pointer; line-height: 1;
}
@keyframes aiIn { from { opacity: 0; transform: translateY(10px); } }

.aichat__panel {
  position: absolute; right: 0; bottom: 78px; width: 380px; height: min(580px, calc(100vh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(3, 6, 20, .7); animation: aiIn .25s ease;
}
.aichat__panel[hidden] { display: none; }

.aichat__head {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(34,211,238,.12));
  border-bottom: 1px solid var(--border);
}
.aichat__head strong { display: block; font-family: var(--font-display); font-size: 16px; }
.aichat__head small { font-size: 12px; color: var(--muted); }
.aichat__avatar {
  position: relative; width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff;
}
.aichat__avatar span {
  position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--success); border: 2px solid var(--surface);
}
.aichat__close { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
.aichat__close:hover { color: var(--text); }

.aichat__msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.aimsg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; word-wrap: break-word; }
.aimsg--bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.aimsg--user { align-self: flex-end; background: linear-gradient(135deg, var(--primary), #7c5cf6); color: #fff; border-bottom-right-radius: 4px; }
.aimsg a { color: var(--primary-2); font-weight: 600; text-decoration: underline; }
.aimsg--user a { color: #fff; }
.aimsg--typing { display: flex; gap: 5px; padding: 14px 16px; }
.aimsg--typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.aimsg--typing i:nth-child(2) { animation-delay: .2s; }
.aimsg--typing i:nth-child(3) { animation-delay: .4s; }

.aichat__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 12px; }
.aichat__chips:empty { display: none; }
.aichat__chips button {
  font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
  background: rgba(99,102,241,.12); border: 1px solid rgba(99,102,241,.35); border-radius: 999px; padding: 7px 12px;
  transition: background .2s;
}
.aichat__chips button:hover { background: rgba(99,102,241,.25); }

.aichat__form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.aichat__form textarea {
  flex: 1; resize: none; font: inherit; font-size: 15px; color: var(--text); max-height: 120px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px;
}
.aichat__form textarea:focus { outline: none; border-color: var(--primary); }
.aichat__form button {
  width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 12px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); display: grid; place-items: center;
}
.aichat__form button svg { width: 20px; height: 20px; }
.aichat__legal { font-size: 11px; color: var(--muted); padding: 0 16px 12px; text-align: center; }
.aichat__legal a { color: var(--primary-2); }

@media (max-width: 520px) {
  .aichat { right: 16px; bottom: 16px; }
  .wa-float { right: 21px; bottom: 90px; }
  .aichat.is-open { inset: 0; right: 0; bottom: 0; }
  .aichat.is-open .aichat__launcher { display: none; }
  .aichat__panel { position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; bottom: 0; }
  .aichat__teaser { width: 220px; }
}

/* ===== Modal de experiência ===== */
.xmodal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; pointer-events: none; }
.xmodal.is-open { pointer-events: auto; }
.xmodal__backdrop {
  position: absolute; inset: 0; background: rgba(5, 8, 20, .62);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .45s ease;
}
.xmodal.is-open .xmodal__backdrop { opacity: 1; }
.xmodal__card {
  position: relative; width: min(500px, 100%); overflow: hidden;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid rgba(148,163,255,.25); border-radius: 22px;
  padding: 34px 30px 24px; box-shadow: 0 40px 100px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(24px) scale(.96);
  transition: opacity .45s ease, transform .55s cubic-bezier(.2,.8,.2,1);
}
.xmodal.is-open .xmodal__card { opacity: 1; transform: none; }
.xmodal__glow {
  position: absolute; inset: -40% -20% auto; height: 260px; pointer-events: none;
  background: radial-gradient(260px 160px at 30% 50%, rgba(99,102,241,.35), transparent 70%),
              radial-gradient(220px 140px at 80% 40%, rgba(34,211,238,.22), transparent 70%);
}
.xmodal__x {
  position: absolute; top: 12px; right: 14px; z-index: 2; width: 34px; height: 34px; border-radius: 10px;
  border: 0; background: rgba(255,255,255,.05); color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.xmodal__x:hover { color: var(--text); background: rgba(255,255,255,.1); }
.xmodal__step { position: relative; display: none; }
.xmodal__step.is-active { display: block; animation: xIn .45s ease; }
@keyframes xIn { from { opacity: 0; transform: translateX(14px); } }
.xmodal__badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; color: var(--primary-2);
  background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.28); margin-bottom: 16px;
}
.xmodal h2 { font-size: 26px; margin-bottom: 10px; }
.xmodal p { color: var(--muted); font-size: 15px; margin-bottom: 22px; }
.xmodal__rate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.xmodal__rate button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer;
  padding: 16px 8px; border-radius: 14px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text);
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  transition: transform .2s, border-color .2s, background .2s;
}
.xmodal__rate button span { font-size: 30px; line-height: 1; transition: transform .25s; }
.xmodal__rate button:hover, .xmodal__rate button:focus-visible { border-color: var(--primary); background: rgba(99,102,241,.14); transform: translateY(-3px); outline: none; }
.xmodal__rate button:hover span { transform: scale(1.15); }
.xmodal__list { display: grid; gap: 10px; margin: -6px 0 22px; }
.xmodal__list li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.xmodal__list svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--success); }
.xmodal__fb { display: grid; gap: 6px; margin: -6px 0 18px; font-size: 13.5px; color: var(--muted); }
.xmodal__fb[hidden] { display: none; }
.xmodal__fb em { font-style: normal; opacity: .7; }
.xmodal__fb textarea {
  font: inherit; font-size: 14px; color: var(--text); resize: none;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.xmodal__fb textarea:focus { outline: none; border-color: var(--primary); }
.xmodal__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xmodal__actions .btn { padding: 13px 14px; font-size: 14.5px; }
.xmodal__later { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.xmodal__later:hover { color: var(--text); }

@media (max-width: 520px) {
  .xmodal { align-items: end; padding: 0; }
  .xmodal__card { border-radius: 22px 22px 0 0; padding: 28px 20px 22px; transform: translateY(100%); }
  .xmodal h2 { font-size: 22px; }
  .xmodal__actions { grid-template-columns: 1fr; }
  .xmodal__rate button { padding: 14px 6px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .xmodal__card, .xmodal__backdrop { transition: none; } }
