/* CHAT: moldura de celular e conversa (index.html) */
/* ======================================================================
   1. VARIÁVEIS DE COR, RESET E BASE DA PÁGINA
   ====================================================================== */

:root {
  --roxo: #4B3F7F;
  --roxo2: #3C3266;
  --rosa: #FF1FA9;
  --grafite: #333336;
  --escuro: #242427;
  --texto: #fff;
  --suave: #C9C4DA;
}

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

html {
  height: 100%;
}

body {
  min-height: 100%;   /* cresce (e rola) se o conteúdo for maior que a janela */
  background: #F1EFF6;
  font-family: "Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px;
  color: #2A2540;
}


/* ======================================================================
   2. MOLDURA DO CELULAR
   ====================================================================== */

.celular {
  width: 360px;
  max-width: 100%;
  height: 700px;
  max-height: calc(100vh - 120px);   /* sobra espaço para as abas */
  background: #26262A;
  border-radius: 46px;
  padding: 10px;
  box-shadow: 0 24px 60px rgba(40,30,80,.3);
}

.tela {
  height: 100%;
  background: var(--grafite);
  border-radius: 36px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--texto);
}


/* ======================================================================
   3. BARRA DE STATUS E CABEÇALHO (topo roxo)
   ====================================================================== */

.status {
  background: var(--escuro);
  height: 34px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  flex: none;
}

.status svg {
  display: block;
}

.status .ic {
  display: flex;
  gap: 6px;
  align-items: center;
}

.topo {
  flex: none;
  background: var(--roxo);
  height: 92px;
  margin-top: -1px;
  border-radius: 0 0 50% 50%/0 0 34px 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  padding-bottom: 6px;
}

.topo strong {
  font-weight: 500;
  font-size: 16px;
}

.av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
}

.av svg {
  width: 100%;
  height: 100%;
}

.btn {
  background: none;
  border: 0;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.btn:hover {
  background: rgba(255,255,255,.14);
}

.btn:focus-visible,
#texto:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.reiniciar {
  position: absolute;
  left: 12px;
  top: 14px;
}

.mais {
  position: absolute;
  right: 12px;
  top: 14px;
  opacity: .85;
  cursor: default;
}


/* ======================================================================
   4. LISTA DE MENSAGENS E BALÕES
   ====================================================================== */

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

.chat::-webkit-scrollbar {
  width: 4px;
}

.chat::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.aviso {
  align-self: center;
  color: var(--suave);
  font-size: 12px;
  text-align: center;
  padding: 2px 8px;
}

.linha {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.linha.eu {
  justify-content: flex-end;
}

.msg {
  max-width: 72%;
  padding: 9px 13px;
  font-size: 14px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-wrap: break-word;
  border-radius: 18px;
}

.agente .msg {
  background: var(--rosa);
  border-bottom-left-radius: 4px;
}

.eu .msg {
  background: var(--roxo);
  border-bottom-right-radius: 4px;
}

.hora {
  font-size: 11.5px;
  color: #E6E3EF;
  flex: none;
}

.digitando {
  background: var(--rosa);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  padding: 11px 14px;
  display: flex;
  gap: 4px;
}

.digitando i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: p 1s infinite;
}

.digitando i:nth-child(2) {
  animation-delay: .15s;
}

.digitando i:nth-child(3) {
  animation-delay: .3s;
}

@keyframes p {
  0%,60%,100% {
    opacity: .35;
  }
  30% {
    opacity: 1;
  }
}


/* ======================================================================
   5. BARRA DE DIGITAÇÃO
   ====================================================================== */

.rodape {
  flex: none;
  background: var(--roxo);
  border-radius: 50% 50% 0 0/26px 26px 0 0;
  padding: 20px 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.entrada {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--escuro);
  border-radius: 20px;
  padding: 0 6px 0 14px;
  min-width: 0;
}

#texto {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  color: #fff;
  font: inherit;
  font-size: 14px;
  padding: 10px 0;
}

#texto::placeholder {
  color: #A7A1BD;
}

.ic-rosa {
  color: var(--rosa);
}

.rodape .btn {
  width: 34px;
  height: 34px;
  color: var(--rosa);
}

.rodape .btn:hover {
  background: rgba(255,255,255,.1);
}

.rodape .off {
  opacity: .55;
  cursor: default;
}

.enviar {
  background: var(--rosa)!important;
  color: #fff!important;
}

.enviar:hover {
  background: #E0159A!important;
}


/* ======================================================================
   6. NOTA ABAIXO DO CELULAR
   ====================================================================== */

.nota {
  max-width: 360px;
  text-align: center;
  font-size: 12.5px;
  color: #6A6485;
  line-height: 1.4;
}

/* ======================================================================
   7. RESPONSIVIDADE E ACESSIBILIDADE
   ====================================================================== */

/* Quem pede menos movimento: desliga animações */
@media (prefers-reduced-motion: reduce) {
  .chat {
    scroll-behavior: auto;
  }

  .digitando i {
    animation: none;
    opacity: 0.8;
  }
}

/* Celular de verdade: o chat ocupa a tela inteira (menos a barra de abas) */
@media (max-width: 420px) {
  body {
    padding: 0;
  }

  .celular {
    border-radius: 0;
    height: calc(100vh - 56px);
    max-height: none;
    padding: 0;
  }

  .tela {
    border-radius: 0;
  }

  .nota {
    display: none;
  }
}
