:root{
  --bg:#0c0d10;
  --panel:#16181d;
  --muted:#9aa4b2;
  --text:#e7ecf3;
  --accent:#6ea8fe;
  --accent-2:#9a6efe;
  --border:#262934;
  --ok:#40c463;
  --danger:#ff6b6b;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 800px at 20% -10%, #1d2230 0%, transparent 60%),
              radial-gradient(900px 600px at 120% 30%, #191f2b 0%, transparent 40%),
              var(--bg);
  color:var(--text);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

#app{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

/* HERO */
.hero{
  position:relative;
  width:100%;
  max-width:880px;
  text-align:center;
  padding:96px 24px 72px;
  background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.00));
  border:1px solid var(--border);
  border-radius:16px;
  backdrop-filter: blur(4px);
}

.hero.hidden{ display:none; }

.title{
  font-weight:700;
  font-size: clamp(24px, 4vw, 40px);
  letter-spacing:.2px;
  margin:0 0 16px;
}

.hero-form{
  display:flex;
  gap:12px;
  justify-content:center;
  margin:16px auto 8px;
  width:min(720px, 100%);
}

.hero-input{
  flex:1;
  padding:16px 18px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--text);
  outline:none;
  font-size:16px;
}
.hero-input::placeholder{ color:#6a7280; }

.btn{
  padding:14px 18px;
  border-radius:12px;
  border:1px solid transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color:white;
  font-weight:600;
  cursor:pointer;
}
.btn:active{ transform:translateY(1px) }

.btn-secondary{
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background:transparent;
  color:var(--text);
  cursor:pointer;
}

.disclaimer{
  color:var(--muted);
  font-size:13px;
  margin-top:8px;
}

/* ORB (esfera IA) */
.orb{
  --size: 140px;
  position:absolute;
  top:-70px; left:50%;
  transform:translateX(-50%);
  width:var(--size);
  height:var(--size);
  border-radius:50%;
  background:
    radial-gradient(60% 60% at 30% 30%, rgba(255,255,255,.25), rgba(255,255,255,0) 60%),
    radial-gradient(120% 120% at 110% 110%, rgba(110,168,254,.7), rgba(154,110,254,.65) 50%, rgba(0,0,0,0) 70%);
  filter: drop-shadow(0 20px 40px rgba(110,168,254,.25));
  animation: float 6s ease-in-out infinite;
  border: 1px solid rgba(255,255,255,.06);
}
.orb::after{
  content:'';
  position:absolute; inset:-14px;
  border-radius:50%;
  background:
    conic-gradient(from 0deg, rgba(110,168,254,.35), rgba(154,110,254,.35), rgba(110,168,254,.35));
  filter: blur(30px);
  opacity:.5;
  animation: spin 12s linear infinite;
  mask: radial-gradient(circle at center, rgba(0,0,0,0) 60%, black 62%);
}
.orb--small{
  position:static;
  width:18px; height:18px;
  transform:none;
  background:
    radial-gradient(60% 60% at 30% 30%, rgba(255,255,255,.45), rgba(255,255,255,0) 60%),
    radial-gradient(120% 120% at 110% 110%, rgba(110,168,254,.95), rgba(154,110,254,.9) 50%, rgba(0,0,0,0) 70%);
  border:1px solid rgba(255,255,255,.18);
  filter:none;
}
@keyframes float{
  0%,100%{ transform:translate(-50%, 0) }
  50%{ transform:translate(-50%, -8px) }
}
@keyframes spin{
  to{ transform:rotate(360deg) }
}

/* CHAT */
.chat{
  width:min(980px, 100%);
  height:min(80vh, 720px);
  /* REMOVA o display daqui */
  flex-direction:column;
  border:1px solid var(--border);
  border-radius:16px;
  background: rgba(22,24,29,.6);
  backdrop-filter: blur(4px);
}

/* Controle explícito de visibilidade */
.chat.hidden{ display:none; }
.chat:not(.hidden){ display:flex; }

.chat-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
}
.chat-id{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:600;
}

.messages{
  flex:1;
  overflow:auto;
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.msg{
  max-width:min(80ch, 85%);
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:14px;
  white-space:pre-wrap;
  word-break:break-word;
}
.msg.user{
  align-self:flex-end;
  background:#0f1320;
}
.msg.assistant{
  align-self:flex-start;
  background:#11161f;
}
.msg.system{
  align-self:center;
  color:var(--muted);
  font-size:13px;
  border-style:dashed;
}

.composer{
  display:flex;
  gap:10px;
  padding:12px;
  border-top:1px solid var(--border);
}
.composer-input{
  flex:1;
  padding:14px 16px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--panel);
  color:var(--text);
  outline:none;
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce){
  .orb, .orb::after { animation:none }
}
