/* ================= WIDGET SOFIA (demo embarcado) ================= */
#sofia-widget, #sw-panel {
  font-family: inherit; box-sizing: border-box;
  --sw-bg: #0b0f14; --sw-surface: #10151f; --sw-elevated: #151b28;
  --sw-accent: #3b7bf5; --sw-sofia: #06b6d4; --sw-cyan: #22b8d9;
  --sw-text: rgba(255,255,255,.95); --sw-muted: rgba(255,255,255,.55);
  --sw-border: rgba(255,255,255,.1);
}
#sofia-widget *, #sw-panel * { box-sizing: border-box; }
#sofia-widget { position: fixed; right: 20px; bottom: 20px; z-index: 9000; display: flex; align-items: flex-end; gap: 10px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .45s ease, transform .45s ease; }
#sofia-widget.sw-show { opacity: 1; transform: none; pointer-events: auto; }
#sw-teaser { max-width: 232px; color: var(--sw-text); border: 1.5px solid var(--sw-cyan); border-radius: 14px 14px 4px 14px; padding: 12px 28px 12px 14px; font-size: 13.5px; line-height: 1.45; position: relative; cursor: pointer; background: linear-gradient(180deg, rgba(6,182,212,0.10), transparent 60%), var(--sw-card, #10151f); box-shadow: 0 18px 50px rgba(6,182,212,0.22), 0 0 0 1px rgba(6,182,212,0.25); }
#sw-teaser button.sw-x { position: absolute; top: 5px; right: 8px; border: 0; background: none; font-size: 15px; color: var(--sw-muted); cursor: pointer; line-height: 1; }
#sw-teaser strong { color: var(--sw-cyan); }
#sw-launch { width: 64px; height: 64px; border-radius: 999px; border: 1.5px solid var(--sw-cyan); cursor: pointer; padding: 0; background: #0c1729 center/cover url("/assets/integracoes/sofia.png?v=3"); box-shadow: 0 18px 50px rgba(6,182,212,0.28), 0 0 0 1px rgba(6,182,212,0.25); position: relative; flex: 0 0 auto; }
#sw-launch::after { content: ""; position: absolute; inset: -4px; border-radius: 999px; border: 2px solid var(--sw-cyan); animation: swpulse 2s ease-out infinite; }
@keyframes swpulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #sw-launch::after { animation: none; opacity: 0; } }
#sw-panel { position: fixed; right: 20px; bottom: 20px; z-index: 9001; width: 380px; max-width: calc(100vw - 24px); height: 600px; max-height: calc(100vh - 40px); background: var(--sw-bg); border: 1px solid var(--sw-border); border-radius: 18px; box-shadow: 0 24px 64px rgba(0,0,0,.55); display: none; flex-direction: column; overflow: hidden; }
#sw-panel.open { display: flex; }
.sw-head { background: var(--sw-surface); color: var(--sw-text); padding: 14px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--sw-border); }
.sw-head .sw-ava { width: 40px; height: 40px; border-radius: 999px; background: #0c1729 center/cover url("/assets/integracoes/sofia.png?v=3"); border: 1px solid var(--sw-border); flex: 0 0 auto; }
.sw-head .sw-name { font-weight: 700; font-size: 15px; }
.sw-head .sw-stat { font-size: 11.5px; color: var(--sw-sofia); display: flex; align-items: center; gap: 5px; }
.sw-head .sw-stat::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--sw-sofia); display: inline-block; box-shadow: 0 0 6px var(--sw-sofia); }
.sw-head .sw-close { margin-left: auto; background: none; border: 0; color: var(--sw-muted); font-size: 20px; cursor: pointer; }
#sw-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--sw-bg); }
#sw-msgs > * { flex: 0 0 auto; }
.sw-msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.sw-msg.bot { background: var(--sw-elevated); color: var(--sw-text); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--sw-border); }
.sw-msg.me { background: var(--sw-accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.sw-typing { align-self: flex-start; color: var(--sw-muted); font-size: 13px; padding: 6px 4px; }
.sw-card { background: var(--sw-surface); border: 1px solid var(--sw-border); border-radius: 14px; overflow: hidden; align-self: flex-start; max-width: 88%; }
.sw-card-imgs { display: flex; gap: 2px; overflow-x: auto; min-height: 120px; background: var(--sw-bg); }
.sw-card-imgs img { height: 120px; width: auto; object-fit: cover; flex: 0 0 auto; }
.sw-card-body { padding: 10px 12px; font-size: 13px; color: var(--sw-text); }
.sw-card-body .sw-code { display: inline-block; background: rgba(59,123,245,.18); color: var(--sw-accent); font-weight: 700; font-size: 11px; padding: 2px 7px; border-radius: 6px; margin-bottom: 5px; }
.sw-card-body .sw-title { font-weight: 700; margin: 0 0 4px; font-size: 13.5px; }
.sw-card-body .sw-specs { color: var(--sw-muted); font-size: 12px; line-height: 1.5; }
.sw-card-body .sw-price { font-weight: 800; color: var(--sw-text); margin-top: 5px; }
.sw-card-body .sw-poi { color: var(--sw-muted); font-size: 11.5px; margin-top: 4px; }
.sw-rec { background: var(--sw-surface); border: 1px solid var(--sw-accent); border-radius: 14px; padding: 14px; align-self: stretch; }
.sw-rec h4 { margin: 0 0 2px; font-size: 12px; color: var(--sw-accent); text-transform: uppercase; letter-spacing: .04em; }
.sw-rec .sw-rec-plan { font-size: 19px; font-weight: 800; color: var(--sw-text); }
.sw-rec .sw-rec-price { font-size: 14px; color: var(--sw-muted); margin: 2px 0 10px; }
.sw-rec .sw-rec-reason { font-size: 13px; color: var(--sw-text); margin: 0 0 12px; line-height: 1.5; }
.sw-rec a.sw-cta { display: block; text-align: center; background: var(--sw-accent); color: #fff; text-decoration: none; font-weight: 700; padding: 11px; border-radius: 10px; }
.sw-emailform { display: flex; flex-direction: column; gap: 7px; background: var(--sw-surface); border: 1px solid var(--sw-border); border-radius: 14px; padding: 12px; align-self: stretch; }
.sw-emailform p { margin: 0; font-size: 13px; color: var(--sw-text); }
.sw-emailform input { background: var(--sw-bg); color: var(--sw-text); border: 1px solid var(--sw-border); border-radius: 9px; padding: 9px 11px; font-size: 14px; }
.sw-emailform input::placeholder { color: var(--sw-muted); }
.sw-emailform button { background: var(--sw-sofia); color: #051018; border: 0; border-radius: 9px; padding: 10px; font-weight: 700; cursor: pointer; }
.sw-emailform button.sw-skip { background: transparent; color: var(--sw-muted); border: 1px solid var(--sw-border); font-weight: 600; }
.sw-maps { align-self: flex-start; display: inline-block; background: var(--sw-elevated); color: var(--sw-cyan); border: 1px solid var(--sw-cyan); border-radius: 10px; padding: 9px 13px; font-size: 13px; font-weight: 600; text-decoration: none; }
.sw-qr { display: flex; flex-direction: column; gap: 7px; align-self: stretch; }
.sw-qr button { background: var(--sw-elevated); color: var(--sw-text); border: 1px solid var(--sw-cyan); border-radius: 10px; padding: 11px 13px; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; transition: background .15s; }
.sw-qr button:hover:not(:disabled) { background: rgba(34,184,217,.15); }
.sw-qr button:disabled { cursor: default; }
/* Diagnóstico consultivo */
.sw-diag { background: var(--sw-surface); border: 1px solid var(--sw-border); border-radius: 14px; padding: 13px 14px; align-self: stretch; }
.sw-diag + .sw-diag { margin-top: -2px; }
.sw-diag h5 { margin: 0 0 8px; font-size: 13px; font-weight: 800; color: var(--sw-cyan); display: flex; align-items: center; gap: 6px; }
.sw-diag .sw-diag-row { font-size: 13px; color: var(--sw-text); line-height: 1.6; display: flex; gap: 7px; }
.sw-diag .sw-diag-row b { color: var(--sw-muted); font-weight: 600; min-width: 92px; }
.sw-diag p { margin: 0; font-size: 13px; color: var(--sw-text); line-height: 1.55; }
.sw-diag p + p { margin-top: 8px; }
.sw-diag .sw-src { font-size: 11px; color: var(--sw-muted); margin-top: 8px; font-style: italic; }
.sw-diag ul { margin: 0; padding-left: 4px; list-style: none; }
.sw-diag li { font-size: 13px; color: var(--sw-text); line-height: 1.5; margin: 4px 0; display: flex; gap: 8px; }
.sw-diag li::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: #22c55e; margin-top: 5px; flex: 0 0 auto; }
.sw-foot { padding: 10px 12px; background: var(--sw-surface); border-top: 1px solid var(--sw-border); display: flex; align-items: center; gap: 8px; }
.sw-foot input { flex: 1; background: var(--sw-bg); color: var(--sw-text); border: 1px solid var(--sw-border); border-radius: 999px; padding: 10px 14px; font-size: 14px; outline: none; }
.sw-foot input::placeholder { color: var(--sw-muted); }
.sw-foot button { border: 0; border-radius: 999px; width: 42px; height: 42px; flex: 0 0 auto; cursor: pointer; font-size: 17px; display: grid; place-items: center; }
.sw-foot .sw-mic { background: var(--sw-elevated); color: var(--sw-accent); border: 1px solid var(--sw-border); }
.sw-foot .sw-mic.rec { background: rgba(226,59,59,.18); color: #ff6b6b; animation: swpulse2 1s infinite; }
@keyframes swpulse2 { 50% { opacity: .5; } }
.sw-foot .sw-send { background: var(--sw-accent); color: #fff; }
.sw-foot.sw-hidden { display: none; }
@media (max-width: 560px) {
  #sofia-widget { right: 14px; bottom: 78px; }
  #sw-teaser { display: none; }
  #sw-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
}
