/*! Nexx Livechat — chat.css (estilos do iframe embed) */
:root {
  --nx-lc-primary: #16a34a;
  --nx-lc-secondary: #0ea5e9;
  --nx-lc-bg: #ffffff;
  --nx-lc-bg-chat: #f8fafc;
  --nx-lc-text: #0f172a;
  --nx-lc-text-muted: #64748b;
  --nx-lc-border: #e2e8f0;
  --nx-lc-bubble-in: #ffffff;
  --nx-lc-bubble-out: var(--nx-lc-primary);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--nx-lc-bg);
  color: var(--nx-lc-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

.hidden { display: none !important; }
.muted { color: var(--nx-lc-text-muted); font-size: 11px; }

#nx-lc-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--nx-lc-bg);
}

/* ───────── Header ───────── */
#nx-lc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--nx-lc-primary), var(--nx-lc-secondary));
  color: #fff;
}
#nx-lc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.4);
}
#nx-lc-title { font-weight: 600; font-size: 15px; line-height: 1.2; }
#nx-lc-subtitle { font-size: 11px; opacity: 0.88; }
#nx-lc-close {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0 6px;
  opacity: 0.85;
}
#nx-lc-close:hover { opacity: 1; }

/* ───────── Pré-cadastro ───────── */
#nx-lc-precadastro {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
#nx-lc-precadastro h2 { margin: 0; font-size: 17px; }
#nx-lc-precadastro p { margin: 0 0 6px; color: var(--nx-lc-text-muted); }
#nx-lc-precadastro input {
  padding: 10px 12px;
  border: 1px solid var(--nx-lc-border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
#nx-lc-precadastro input:focus { border-color: var(--nx-lc-primary); }
#nx-lc-pc-submit {
  padding: 11px 14px;
  background: var(--nx-lc-primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
}
#nx-lc-pc-submit:hover { filter: brightness(1.05); }
#nx-lc-pc-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.error { color: #ef4444; font-size: 12px; min-height: 14px; }

/* ───────── Chat ───────── */
#nx-lc-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#nx-lc-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  background: var(--nx-lc-bg-chat);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nx-lc-msg {
  display: flex;
  max-width: 100%;
}
.nx-lc-msg .bubble {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.4;
  max-width: 78%;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.nx-lc-msg.agent .bubble {
  background: var(--nx-lc-bubble-in);
  color: var(--nx-lc-text);
  border: 1px solid var(--nx-lc-border);
  border-bottom-left-radius: 4px;
}
.nx-lc-msg.visitor {
  justify-content: flex-end;
}
.nx-lc-msg.visitor .bubble {
  background: var(--nx-lc-bubble-out);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* ───────── Input ───────── */
#nx-lc-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 12px;
  background: var(--nx-lc-bg);
  border-top: 1px solid var(--nx-lc-border);
}
#nx-lc-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--nx-lc-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  max-height: 120px;
}
#nx-lc-input:focus { border-color: var(--nx-lc-primary); }
#nx-lc-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--nx-lc-primary);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}
#nx-lc-send:hover { filter: brightness(1.08); }

#nx-lc-powered {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: var(--nx-lc-bg);
  border-top: 1px solid var(--nx-lc-border);
  text-decoration: none;
  opacity: 0.72;
  transition: opacity 0.15s ease;
}
#nx-lc-powered:hover { opacity: 1; }
#nx-lc-powered img {
  height: 14px;
  width: auto;
  display: block;
}

/* ───────── Erro ───────── */
#nx-lc-error {
  padding: 40px 20px;
  text-align: center;
  color: var(--nx-lc-text-muted);
}
