/* ==========================================================================
   ZeroData — Demo do chat (minimalista, identidade visual do site)
   ========================================================================== */
:root {
  --bg: #0A0A0B; --bg-2: #111113; --surface: #16161A; --surface-2: #1D1D22;
  --border: rgba(255, 255, 255, .07);
  --text: #F4F4F5; --text-muted: #9A9AA3;
  --accent: #ED3D06; --accent-hover: #FF5A2A; --accent-glow: rgba(237, 61, 6, .35);
  --font: "Plus Jakarta Sans", "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sidebar-w: 248px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; border-radius: 8px; }
[data-lucide] { width: 1.15em; height: 1.15em; stroke-width: 1.75; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app { display: grid; grid-template-columns: 1fr; height: 100dvh; position: relative; }
@media (min-width: 900px) { .app { grid-template-columns: var(--sidebar-w) 1fr; } }

.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #3DD68C; box-shadow: 0 0 8px rgba(61, 214, 140, .7); display: inline-block; flex-shrink: 0; }

.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #B4B4BC; transition: background-color .2s, color .2s; }
.icon-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(84vw, var(--sidebar-w));
  display: flex; flex-direction: column; gap: 22px; padding: 14px 12px;
  background: #0C0C0E; border-right: 1px solid var(--border);
  transform: translateX(-102%); visibility: hidden; transition: transform .35s var(--ease), visibility 0s linear .35s;
}
.sidebar.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 30; }
.scrim[hidden] { display: none; }
@media (min-width: 900px) {
  .sidebar { position: static; transform: none; visibility: visible; width: auto; }
  .scrim, .sidebar__close, .menu-btn { display: none !important; }
}
.sidebar__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.new-chat {
  display: flex; align-items: center; gap: 10px; flex: 1; padding: 9px 12px; border-radius: 10px;
  color: #E4E4E7; font-weight: 500; font-size: .86rem; transition: background-color .2s, color .2s;
}
.new-chat [data-lucide] { width: 16px; height: 16px; color: var(--accent-hover); }
.new-chat:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.history { flex: 1; overflow-y: auto; min-height: 0; }
.history__label { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #6f6f78; padding: 0 12px 8px; font-weight: 600; }
.history button { display: block; width: 100%; padding: 8px 12px; border-radius: 10px; text-align: left; color: #A5A5AD; font-size: .84rem; transition: background-color .2s, color .2s; }
.history button span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history button:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.history button.is-active { background: rgba(255, 255, 255, .07); color: #fff; }

.sidebar__bottom { display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.private { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-size: .75rem; color: var(--text-muted); }
.back-link { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; color: var(--text-muted); font-size: .8rem; transition: color .2s, background-color .2s; }
.back-link [data-lucide] { width: 14px; height: 14px; }
.back-link:hover { color: #fff; background: rgba(255, 255, 255, .05); }

/* ---------- Main ---------- */
.main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; isolation: isolate; }
.main::before { /* brilho laranja sutil no canto superior direito */
  content: ""; position: absolute; z-index: -1; top: -300px; right: -220px; width: 620px; height: 620px; pointer-events: none;
  background: radial-gradient(circle at 30% 70%, rgba(255, 179, 64, .38) 0%, rgba(255, 106, 31, .28) 28%, rgba(237, 61, 6, .16) 50%, transparent 72%);
  filter: blur(70px);
}

.topbar { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; }
.mini-logo { display: none; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .14em; font-size: .78rem; color: #D8D8DC; }
.mini-logo svg { width: 22px; height: 22px; }
.has-chat .mini-logo { display: inline-flex; }
@media (min-width: 900px) { .topbar { min-height: 44px; } }

.scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; padding: 8px 16px; scrollbar-width: thin; scrollbar-color: #2a2a30 transparent; }
.thread { width: min(720px, 100%); margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

/* Estado vazio: logo + chamada */
.empty { margin: auto; padding: 0 0 12vh; text-align: center; display: flex; flex-direction: column; align-items: center; animation: rise .7s var(--ease) both; }
.empty[hidden] { display: none; }
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--text); }
.brand__mark { width: 46px; height: 46px; filter: drop-shadow(0 0 22px rgba(237, 61, 6, .45)); }
.brand__text { font-weight: 700; letter-spacing: .16em; font-size: 1.6rem; }
.empty h1 { margin-top: 14px; font-size: 1rem; font-weight: 400; letter-spacing: 0; color: var(--text-muted); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* Mensagens */
.messages { display: flex; flex-direction: column; gap: 22px; padding: 8px 0 20px; }
.msg { display: flex; gap: 12px; animation: rise .45s var(--ease) both; }
.msg--user { justify-content: flex-end; }
.msg--user .bubble { max-width: 80%; padding: 9px 15px; border-radius: 18px 18px 5px 18px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; }
.avatar { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); margin-top: 2px; }
.avatar svg { width: 17px; height: 17px; }
.ai-body { min-width: 0; flex: 1; }
.ai-name { display: none; }
.ai-content { color: #DEDEE2; font-size: .93rem; line-height: 1.7; overflow-wrap: anywhere; }
.ai-content p + p, .ai-content p + ul, .ai-content ul + p { margin-top: 10px; }
.ai-content ul { display: grid; gap: 6px; }
.ai-content li { position: relative; padding-left: 16px; }
.ai-content li::before { content: ""; position: absolute; left: 2px; top: .75em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.ai-content strong { color: #fff; font-weight: 600; }
.ai-content.is-streaming::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 3px; vertical-align: text-bottom; background: var(--accent-hover); border-radius: 2px; animation: caret 1s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.typing { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--text-muted); font-size: .8rem; }
.typing i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-hover); animation: bounce 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

.sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.sources__label { font-size: .7rem; color: #6f6f78; margin-right: 2px; }
.source { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .72rem; color: #B4B4BC; transition: border-color .2s, color .2s; }
.source [data-lucide] { width: 12px; height: 12px; color: var(--accent-hover); }
.source:hover { border-color: rgba(237, 61, 6, .4); color: #fff; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin-top: 8px; }
.meta__btn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: #6f6f78; transition: background-color .2s, color .2s; }
.meta__btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.meta__btn.is-on { color: var(--accent-hover); }
.meta__btn [data-lucide] { width: 15px; height: 15px; }
.meta__info { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; font-size: .7rem; color: #6f6f78; }
.meta__info [data-lucide] { width: 12px; height: 12px; color: var(--accent-hover); }
.msg .ai-extra { opacity: 0; transform: translateY(5px); transition: opacity .5s, transform .5s var(--ease); }
.msg .ai-extra.is-in { opacity: 1; transform: none; }

/* Composer */
.composer-wrap { padding: 6px 16px 12px; }
.composer {
  width: min(720px, 100%); margin: 0 auto; display: flex; align-items: flex-end; gap: 4px; padding: 6px 6px 6px 8px; border-radius: 24px;
  background: rgba(22, 22, 26, .92); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 14px 40px rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: border-color .25s, box-shadow .25s;
}
.composer:focus-within { border-color: rgba(237, 61, 6, .55); box-shadow: 0 14px 40px rgba(0,0,0,.45), 0 0 0 3px rgba(237, 61, 6, .12); }
.composer textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: none; color: var(--text); font: inherit; font-size: .93rem; line-height: 1.5; padding: 7px 4px; max-height: 160px; }
.composer textarea::placeholder { color: #6f6f78; }
.send { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; transition: transform .25s var(--ease), box-shadow .25s, background-color .25s; }
.send [data-lucide] { width: 18px; height: 18px; }
.send:not(:disabled):hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.send:disabled { background: #26262b; color: #62626b; cursor: not-allowed; }
.disclaimer { width: min(720px, 100%); margin: 8px auto 0; font-size: .68rem; color: #62626b; text-align: center; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 16px); padding: 9px 16px; border-radius: 999px; background: var(--surface-2); border: 1px solid rgba(237, 61, 6, .4); font-size: .8rem; max-width: calc(100% - 32px); text-align: center; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease); z-index: 60; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.history { scrollbar-width: thin; scrollbar-color: #2a2a30 transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .scroll { scroll-behavior: auto; }
}
