/* app.css — isolated stylesheet */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
}

/* ── Header ── */
.hdr-bar {
  background: #fff;
  border-bottom: 3px solid #fbbf24;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.hdr-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hdr-logo { height: 38px; width: auto; }
.hdr-title {
  font-size: 14px;
  font-weight: 700;
  color: #162032;
}

/* ── Timer banner ── */
.top-timer {
  background: #162032;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
}
.timer-val { font-weight: 800; color: #fbbf24; }

/* ── Main layout ── */
.session-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 12px 80px;
}

/* ── Session card ── */
.session-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.10);
  overflow: hidden;
}

/* ── Agent header ── */
.agent-header {
  background: linear-gradient(135deg, #162032 0%, #1e3a5f 100%);
  padding: 20px 20px 16px;
  text-align: center;
  position: relative;
}
.av-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}
.av-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.agent-online {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #fff;
}
.agent-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.agent-role {
  font-size: 12px;
  color: rgba(255,255,255,.7);
}
.online-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(34,197,94,.15);
  border: 1px solid rgba(34,197,94,.3);
  color: #86efac;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 6px;
}
.online-dot {
  width: 6px; height: 6px;
  background: #22c55e;
  border-radius: 50%;
  animation: glow 1.4s ease-in-out infinite;
}
@keyframes glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(1.3); }
}

/* ── Steps bar ── */
.steps-bar {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  gap: 0;
}
.step-node {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  padding: 5px 4px;
  border-radius: 6px;
  transition: color .3s, background .3s;
}
.step-node.active {
  color: #1d4ed8;
  background: #eff6ff;
}
.step-node.done {
  color: #15803d;
  background: #f0fdf4;
}
.step-sep {
  width: 24px;
  height: 1px;
  background: #e2e8f0;
  flex-shrink: 0;
}

/* ── Message feed ── */
.msg-feed {
  padding: 16px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

/* ── Messages ── */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.msg-row-user {
  flex-direction: row-reverse;
}
.av-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.bubble {
  max-width: 78%;
  background: #f1f5f9;
  border-radius: 16px 16px 16px 4px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.55;
  color: #1e293b;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.bubble p { font-size: 14px; line-height: 1.55; }
.bubble-user {
  background: #1d4ed8;
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}
.bubble-user p { color: #fff; }

/* Typing dots */
.dot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #f1f5f9;
  border-radius: 16px 16px 16px 4px;
}
.dot-t {
  width: 7px; height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: bounce 1.2s ease-in-out infinite;
}
.dot-t:nth-child(2) { animation-delay: .2s; }
.dot-t:nth-child(3) { animation-delay: .4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* Data card inside bubble */
.data-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  min-width: 200px;
}
.data-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.data-row:last-child { border-bottom: none; }
.data-row strong { color: #475569; font-weight: 600; }

/* Image inside bubble */
.bubble-img { max-width: 100%; border-radius: 10px; display: block; }
.img-scan { max-width: 220px; border-radius: 8px; }

/* Signature layout */
.sig-wrap { position: relative; display: inline-block; }
.sig-img { max-width: 220px; border-radius: 8px; display: block; }
.sig-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(22,32,50,.75);
  color: #fff;
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 0 0 8px 8px;
}
.sig-line { line-height: 1.5; }

/* Audio player */
.audio-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 200px;
}
.play-btn {
  width: 36px; height: 36px;
  background: #1d4ed8;
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s;
}
.play-btn:hover { background: #1e40af; }
.audio-right { flex: 1; }
.progress-track {
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  margin-bottom: 4px;
}
.progress-fill {
  height: 100%;
  background: #1d4ed8;
  border-radius: 2px;
  width: 0;
  transition: width .1s linear;
}
.audio-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
}
.speed-btn {
  background: none;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 10px;
  padding: 1px 5px;
  cursor: pointer;
  color: #64748b;
}

/* ── Input zone ── */
.input-zone {
  display: none;
  padding: 14px 16px;
  border-top: 1px solid #e2e8f0;
  gap: 8px;
  flex-direction: column;
}
.input-zone.visible { display: flex; }
.cpf-input {
  width: 100%;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 16px;
  color: #1e293b;
  outline: none;
  transition: border-color .2s;
  -webkit-appearance: none;
}
.cpf-input:focus { border-color: #1d4ed8; }
.cpf-send {
  width: 100%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
.cpf-send:hover { opacity: .92; transform: translateY(-1px); }
.cpf-send:active { transform: translateY(0); }

/* ── Action row ── */
.action-row {
  display: flex;
  justify-content: center;
  padding: 4px 16px 8px;
}
.ok-btn {
  width: 100%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
  text-align: center;
}
.ok-btn:hover { opacity: .92; transform: translateY(-1px); }
.ok-btn.clicked {
  background: #22c55e;
  cursor: not-allowed;
  transform: none;
}

/* ── Misc ── */
.hl-name { color: #1d4ed8; font-weight: 700; }
.hl-red { color: #dc2626; font-weight: 700; }
.hl-date { color: #b45309; font-weight: 700; }

/* Responsive */
@media (max-width: 480px) {
  .hdr-logo { height: 30px; }
  .hdr-title { font-size: 12px; }
  .av-img { width: 60px; height: 60px; }
  .agent-name { font-size: 16px; }
  .bubble { max-width: 85%; font-size: 13px; }
}
