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

:root {
  --bg: #0a0e14;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.10);
  --text: #eef2f7;
  --text-dim: #9aa7b8;
  --accent-1: #ff6b35;
  --accent-2: #ff2d78;
  --ok: #3ddc97;
}

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 300px at 15% -5%, rgba(255, 107, 53, 0.16), transparent 60%),
    radial-gradient(700px 350px at 90% 10%, rgba(255, 45, 120, 0.14), transparent 60%),
    radial-gradient(500px 300px at 20% 45%, rgba(255, 107, 53, 0.08), transparent 65%),
    radial-gradient(500px 300px at 85% 55%, rgba(255, 45, 120, 0.08), transparent 65%),
    radial-gradient(800px 500px at 50% 110%, rgba(61, 220, 151, 0.06), transparent 60%);
}

.hero { position: relative; z-index: 1; padding: 48px 24px 28px; text-align: center; }

.logo {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  font-size: 30px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 8px 30px rgba(255, 45, 120, 0.35);
}

h1 {
  font-size: 34px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tagline {
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
}

.passos {
  position: relative; z-index: 1;
  display: flex;
  gap: 10px;
  padding: 8px 16px 26px;
  max-width: 640px;
  margin: 0 auto;
}

.passo {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.passo-num {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 13px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  margin-bottom: 8px;
}

.passo-txt { font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.passo-txt strong { color: var(--text); display: block; font-size: 13.5px; }

.chat-shell {
  position: relative; z-index: 1;
  max-width: 640px;
  margin: 0 auto 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: min(72vh, 640px);
}

.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.chat-head-info { display: flex; align-items: center; gap: 10px; }

.avatar {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 17px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 4px 14px rgba(255, 45, 120, 0.3);
}

.chat-title { font-size: 14px; font-weight: 700; }
.chat-status { font-size: 11.5px; color: var(--text-dim); }

.progress-wrap {
  width: 70px; height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%; width: 4%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transition: width 0.6s ease;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
}

.msg {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: pop 0.22s ease;
}

@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.msg.agente {
  align-self: flex-start;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}

.msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  border-bottom-right-radius: 6px;
}

.msg.sistema {
  align-self: center;
  background: rgba(61, 220, 151, 0.12);
  border: 1px solid rgba(61, 220, 151, 0.25);
  color: var(--ok);
  font-size: 13px;
  text-align: center;
  max-width: 92%;
}

.msg.erro {
  align-self: center;
  background: rgba(255, 60, 60, 0.12);
  border: 1px solid rgba(255, 60, 60, 0.3);
  color: #ff8f8f;
  font-size: 13px;
  text-align: center;
  max-width: 92%;
}

.msg .meta {
  display: block;
  font-size: 11px;
  opacity: 0.65;
  margin-top: 4px;
}

.typing {
  align-self: flex-start;
  display: inline-flex; gap: 5px;
  padding: 13px 16px;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink { 0%, 70%, 100% { opacity: 0.25; } 35% { opacity: 1; } }

.completo-banner {
  margin: 0 16px 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(61, 220, 151, 0.14);
  border: 1px solid rgba(61, 220, 151, 0.35);
  color: var(--ok);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
}

.chat-input-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--border);
}

.btn-icon {
  width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease;
}

.btn-icon:active { transform: scale(0.92); }
.btn-icon.rec { background: rgba(255, 45, 120, 0.25); border-color: var(--accent-2); }

#input-msg {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 14.5px;
  outline: none;
}

#input-msg::placeholder { color: var(--text-dim); }
#input-msg:focus { border-color: rgba(255, 107, 53, 0.5); }

.btn-send {
  width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 45, 120, 0.3);
  transition: transform 0.12s ease;
}

.btn-send:active { transform: scale(0.92); }

.gravando {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 14px;
  font-size: 13.5px;
  color: var(--text);
  border-top: 1px solid var(--border);
}

.pulse {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: pulse 1s infinite;
}

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 45, 120, 0.5); } 100% { box-shadow: 0 0 0 12px rgba(255, 45, 120, 0); } }

.btn-stop {
  margin-left: auto;
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid var(--accent-2);
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.foot {
  position: relative; z-index: 1;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  padding-bottom: 28px;
}

/* scrollbar */
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 99px; }


/* ---------- porta de entrada (código do grupo + consentimento) ---------- */
.porta-shell{max-width:520px;margin:0 auto 48px;padding:0 20px}
.porta-card{background:rgba(255,255,255,.06);backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);border:1px solid rgba(255,255,255,.12);
  border-radius:20px;padding:28px 24px;box-shadow:0 8px 40px rgba(0,0,0,.35)}
.porta-titulo{margin:0 0 4px;font-size:1.35rem;letter-spacing:-.01em}
.porta-sub{margin:0 0 18px;opacity:.65;font-size:.92rem}
.porta-input{width:100%;box-sizing:border-box;margin-bottom:12px;padding:13px 15px;
  background:rgba(0,0,0,.28);border:1px solid rgba(255,255,255,.14);border-radius:12px;
  color:inherit;font:inherit;outline:none;transition:border-color .18s}
.porta-input:focus{border-color:rgba(255,255,255,.42)}
.porta-info{min-height:20px;margin:-6px 0 10px;font-size:.86rem;opacity:.8}
.porta-consent{display:flex;gap:10px;align-items:flex-start;margin:6px 0 18px;
  font-size:.82rem;line-height:1.45;opacity:.78;cursor:pointer}
.porta-consent input{margin-top:3px;flex:0 0 auto}
.porta-btn{width:100%;padding:14px;border:0;border-radius:12px;cursor:pointer;
  font:inherit;font-weight:600;background:linear-gradient(135deg,#7c5cff,#4bc9ff);color:#0b0d12}
.porta-btn:disabled{opacity:.45;cursor:not-allowed}
.porta-erro{min-height:20px;margin-top:10px;font-size:.86rem;color:#ff8a8a}
