/* =========================================================================
   SOLUTE RH / Diagnóstico
   Interface de app de mensagem. Mobile-first, 9:16.
   ========================================================================= */

:root {
  --app:      #0B141A;   /* fundo da conversa */
  --cab:      #131E26;   /* barra de cima     */
  --dela:     #1E2C35;   /* balão da Rose     */
  --minha:    #E0A63C;   /* balão do usuário  */
  --minha-tx: #17110A;
  --txt:      #E9EDF2;
  --txt-2:    #8B9AA7;
  --linha:    #22323D;
  --ouro:     #E0A63C;
  --ok:       #53BDEB;
  --raio:     22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: #06090C;
  color: var(--txt);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* brilho de fundo, só aparece no desktop */
.fundo {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(700px 460px at 22% 12%, rgba(224,166,60,.13), transparent 62%),
    radial-gradient(620px 420px at 80% 88%, rgba(242,106,33,.10), transparent 60%);
  pointer-events: none;
}

/* =========================================================================
   O APARELHO / 9:16
   ========================================================================= */

.fone {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--app);
  overflow: hidden;
}

@media (min-width: 560px) and (min-height: 680px) {
  .fone {
    aspect-ratio: 9 / 16;
    height: min(880px, 94vh);
    width: auto;
    max-width: none;
    border-radius: 30px;
    border: 1px solid #223038;
    box-shadow: 0 40px 90px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.03) inset;
  }
}

/* papel de parede discreto */
.fone::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.045) 1px, transparent 0);
  background-size: 22px 22px;
  pointer-events: none;
}

/* =========================================================================
   CABEÇALHO
   ========================================================================= */

.cab {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  padding-top: max(13px, env(safe-area-inset-top));
  background: var(--cab);
  border-bottom: 1px solid var(--linha);
}

.ava {
  width: 42px; height: 42px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(150deg, #E0A63C, #F26A21);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px rgba(224,166,60,.28);
}

.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava .ini { font-weight: 800; color: #17110A; font-size: 1.05rem; }

.quem { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.quem strong { font-size: .97rem; font-weight: 600; letter-spacing: -.01em; }

.quem span {
  font-size: .76rem;
  color: var(--txt-2);
  display: flex;
  align-items: center;
  gap: 5px;
}

.ponto {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ADE80;
  display: inline-block;
}

.selo-cab {
  font-size: .64rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--txt-2);
  border: 1px solid var(--linha);
  padding: 4px 9px;
  border-radius: 999px;
  flex: none;
}

/* barra de progresso fininha */
.progresso {
  position: relative;
  z-index: 2;
  flex: none;
  height: 2px;
  background: rgba(255,255,255,.05);
}

.progresso > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ouro), #F26A21);
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* =========================================================================
   MENSAGENS
   ========================================================================= */

.msgs {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  /* sem isto o flex item nunca encolhe abaixo do conteúdo:
     a lista cresce além da tela e o dock cobre as últimas mensagens */
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 13px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.msgs::-webkit-scrollbar { width: 0; }

.linha-msg {
  display: flex;
  max-width: 100%;
  animation: entra .32s cubic-bezier(.2,.9,.3,1) both;
}

.linha-msg.dela { justify-content: flex-start; }
.linha-msg.minha { justify-content: flex-end; }

/* espaço entre grupos de quem fala */
.linha-msg.primeira { margin-top: 11px; }

@keyframes entra {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.bolha {
  position: relative;
  max-width: 84%;
  padding: 9px 13px 8px;
  border-radius: 16px;
  font-size: .96rem;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
}

.dela .bolha {
  background: var(--dela);
  border-top-left-radius: 6px;
}

.dela.primeira .bolha { border-top-left-radius: 16px; }
.dela .bolha { border-bottom-left-radius: 6px; }

.minha .bolha {
  background: var(--minha);
  color: var(--minha-tx);
  border-bottom-right-radius: 6px;
  font-weight: 500;
}

.hora {
  display: block;
  text-align: right;
  font-size: .64rem;
  margin-top: 2px;
  opacity: .55;
  font-variant-numeric: tabular-nums;
}

.minha .hora { opacity: .75; }

/* dois tiques azuis = lido.
   Azul escuro de propósito: o balão é dourado (luminância alta), então
   azul claro some. Este dá ~4,4:1 de contraste sobre o dourado. */
.tique {
  letter-spacing: -2px;
  margin-left: 5px;
  color: #07406F;
  font-weight: 800;
  font-size: .78rem;
  opacity: 1;
}

/* balão de foto */
.bolha.foto {
  padding: 4px 4px 6px;
  max-width: 78%;
}

.bolha.foto img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 13px;
}

.bolha.foto .hora {
  padding: 3px 6px 0 0;
}

/* digitando */
.digita {
  display: inline-flex;
  gap: 4px;
  padding: 4px 3px 2px;
}

.digita i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--txt-2);
  animation: pisca 1.15s infinite;
}

.digita i:nth-child(2) { animation-delay: .17s; }
.digita i:nth-child(3) { animation-delay: .34s; }

@keyframes pisca {
  0%, 62%, 100% { opacity: .25; transform: translateY(0); }
  32%           { opacity: .95; transform: translateY(-3px); }
}

/* =========================================================================
   DOCK / onde o usuário responde
   ========================================================================= */

.dock {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--cab);
  border-top: 1px solid var(--linha);
}

.dock:empty { display: none; }

/* respostas rápidas */
.chips {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 46dvh;
  overflow-y: auto;
}

.chips::-webkit-scrollbar { width: 0; }

.chip {
  appearance: none;
  font: inherit;
  font-size: .93rem;
  text-align: left;
  color: var(--txt);
  background: #1B2933;
  border: 1px solid #2B3C48;
  border-radius: 999px;
  padding: 11px 17px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .12s;
  animation: entra .3s both;
}

.chip:active { transform: scale(.975); }

@media (hover: hover) {
  .chip:hover { background: #24343F; border-color: var(--ouro); }
}

.chip:focus-visible { outline: 2px solid var(--ouro); outline-offset: 2px; }

/* campo de texto */
.entrada {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1B2933;
  border: 1px solid #2B3C48;
  border-radius: 999px;
  padding: 5px 5px 5px 17px;
  transition: border-color .15s;
}

.entrada:focus-within { border-color: var(--ouro); }

.entrada input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  color: var(--txt);
  background: none;
  border: 0;
  padding: 10px 0;
}

.entrada input::placeholder { color: #5E6E7B; }
.entrada input:focus { outline: none; }

.enviar {
  appearance: none;
  flex: none;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(150deg, #E0A63C, #F26A21);
  color: #17110A;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .12s, filter .15s;
}

.enviar:active { transform: scale(.92); }
@media (hover: hover) { .enviar:hover { filter: brightness(1.09); } }

/* botão largo (intro / CTA) */
.largo {
  appearance: none;
  width: 100%;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: #17110A;
  background: linear-gradient(100deg, #E0A63C, #F26A21);
  border: 0;
  border-radius: 999px;
  padding: 15px;
  cursor: pointer;
  transition: transform .12s, filter .15s;
}

.largo:active { transform: scale(.98); }
@media (hover: hover) { .largo:hover { filter: brightness(1.08); } }

.largo.calmo {
  background: none;
  border: 1px solid #2B3C48;
  color: var(--txt);
  font-weight: 600;
  margin-top: 8px;
}

.erro {
  color: #FCA5A5;
  font-size: .8rem;
  padding: 7px 17px 0;
}

.aviso {
  color: var(--txt-2);
  font-size: .7rem;
  padding: 8px 6px 0;
  text-align: center;
}

/* =========================================================================
   CARTÃO DE RESULTADO / entra como mensagem
   ========================================================================= */

.cartao {
  max-width: 92%;
  background: linear-gradient(165deg, #22303A, #1A262E);
  border: 1px solid #31434F;
  border-radius: 18px;
  border-top-left-radius: 6px;
  overflow: hidden;
  box-shadow: 0 8px 26px rgba(0,0,0,.45);
}

.cartao .faixa { height: 3px; background: linear-gradient(90deg, var(--ouro), #F26A21); }
.cartao .corpo { padding: 15px 16px 16px; }

.cartao .tag {
  display: inline-block;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ouro);
  margin-bottom: 7px;
}

.cartao h2 {
  margin: 0 0 3px;
  font-size: 1.13rem;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.cartao .preco {
  color: var(--ouro);
  font-weight: 700;
  font-size: .82rem;
  margin-bottom: 9px;
}

.cartao p { margin: 0 0 11px; font-size: .9rem; }

.cartao .porque {
  font-size: .85rem;
  color: var(--txt-2);
  border-left: 2px solid var(--ouro);
  padding-left: 11px;
  margin-bottom: 14px;
}

.cartao .cta {
  display: block;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
  color: #17110A;
  background: linear-gradient(100deg, #E0A63C, #F26A21);
  border-radius: 999px;
  padding: 13px;
}

/* assinatura com a foto: a recomendação ganha rosto */
.assina {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0 0;
  padding-top: 13px;
  border-top: 1px solid #31434F;
}

.assina img {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  box-shadow: 0 0 0 2px rgba(224,166,60,.35);
}

.assina .qm { line-height: 1.3; }
.assina .qm b { display: block; font-size: .84rem; font-weight: 600; }
.assina .qm span { font-size: .73rem; color: var(--txt-2); }

.cartao .cta.calmo {
  margin-top: 8px;
  background: none;
  border: 1px solid #3A4C58;
  color: var(--txt);
  font-weight: 600;
}

/* alternativas */
.alt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  text-decoration: none;
  color: inherit;
  background: var(--dela);
  border: 1px solid #2B3C48;
  border-radius: 14px;
  padding: 11px 14px;
  max-width: 92%;
  transition: border-color .15s;
}

@media (hover: hover) { .alt:hover { border-color: var(--ouro); } }

.alt .t { font-weight: 600; font-size: .89rem; display: block; }
.alt .p { color: var(--txt-2); font-size: .74rem; display: block; margin-top: 1px; }
.alt .s { color: var(--ouro); font-size: 1.05rem; flex: none; }

.rodape-msg {
  text-align: center;
  color: var(--txt-2);
  font-size: .68rem;
  padding: 14px 10px 4px;
  line-height: 1.5;
}

.rodape-msg a { color: var(--txt-2); }

@media (prefers-reduced-motion: reduce) {
  *, .fone * { animation: none !important; transition: none !important; }
  .msgs { scroll-behavior: auto; }
}
