/* ===================================================================
   DESPERTA 21 — App de acompanhamento
   Mesma identidade visual do site e do e-book.
   =================================================================== */
:root {
  --ink:        #2B2420;
  --cream:      #FBF6EE;
  --cream-2:    #F2E9D8;
  --gold:       #D9A441;
  --muted:      #6B6259;

  --saude:            #F79B2F;
  --financas:         #33679F;
  --relacionamentos:  #6EBEB7;
  --proposito:        #9C7CB6;
  --espiritualidade:  #7E74AD;
  --lazer:            #F7CB60;
  --fechamento:       #9C7CB6;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
a { color: inherit; }

.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  background: var(--ink);
  color: #fff;
}
.app-nav__brand { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; color: #fff; text-decoration: none; }
.app-nav__brand span { color: var(--gold); }
.app-nav__logout { color: rgba(255,255,255,.75); text-decoration: none; font-size: .9rem; font-weight: 600; }
.app-nav__logout:hover { color: #fff; }

.app-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.app-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: .8rem;
}

/* ---------- Formulários (login/cadastro) ---------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: 0 2px 14px rgba(43,36,32,.06);
  border: 1px solid rgba(43,36,32,.06);
}

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .4rem; }
.field input, .field textarea {
  width: 100%;
  padding: .75em .9em;
  border-radius: 10px;
  border: 1.5px solid rgba(43,36,32,.15);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--cream);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: .9em 1.4em;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.05); }
.btn--ghost { background: transparent; border: 1.5px solid var(--ink); color: var(--ink); }

.alert {
  padding: .85em 1em;
  border-radius: 10px;
  margin-bottom: 1.2rem;
  font-size: .92rem;
}
.alert--error { background: #FBE3E0; color: #8A2E20; }
.alert--success { background: #E4F3F1; color: #1F5A52; }
.alert--info { background: var(--cream-2); color: var(--ink); }

.muted { color: var(--muted); font-size: .9rem; }
.center { text-align: center; }

/* ---------- Trial banner ---------- */
.trial-banner {
  background: var(--ink);
  color: var(--cream);
  border-radius: var(--radius);
  padding: .9rem 1.2rem;
  margin-bottom: 1.5rem;
  font-size: .88rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.trial-banner strong { color: var(--gold); }

/* ---------- Onboarding (roda de notas) ---------- */
.pilar-step { text-align: center; }
.pilar-step__nome {
  display: inline-block;
  padding: .45em 1.15em;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: 2.15rem;
  letter-spacing: .01em;
  margin-bottom: 1.4rem;
  box-shadow: 0 4px 14px rgba(43,36,32,.12);
}
.nota-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .5rem;
  margin: 1.5rem 0;
}
@media (max-width: 420px) {
  .nota-grid { grid-template-columns: repeat(4, 1fr); }
}
.nota-grid button {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1.5px solid rgba(43,36,32,.15);
  background: var(--cream);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.nota-grid button:hover { background: var(--gold); border-color: var(--gold); }

/* ---------- Tela "Hoje" ---------- */
.dia-header {
  padding: 1.5rem;
  border-radius: var(--radius);
  color: #fff;
  margin-bottom: 1.25rem;
}
.dia-header__label { font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .85; }
.dia-header__pilar { font-family: var(--font-display); font-size: 1.6rem; margin: .2rem 0 0; }

.dia-bloco {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(43,36,32,.07);
}
.dia-bloco__label { font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .4rem; }

.feedback-box {
  background: var(--cream-2);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-top: 1rem;
  font-family: var(--font-display);
  font-style: italic;
}

/* ---------- Tela dedicada de feedback (pós-registro) ---------- */
.feedback-tela {
  max-width: 480px;
  margin: 0 auto;
}
.feedback-tela__topo {
  text-align: center;
  margin-bottom: 1.4rem;
}
.feedback-tela__check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--relacionamentos);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .8rem;
}
.feedback-tela__kicker {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--muted);
}
.feedback-box--tela {
  margin-top: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  padding: 1.3rem 1.4rem;
}

/* ---------- Card "Pra relembrar" (dias que retomam dias anteriores) ---------- */
.card--relembrar {
  background: var(--cream-2);
  border: 1px dashed rgba(43,36,32,.2);
}
.card--relembrar h3 { margin-top: 0; margin-bottom: .8rem; font-size: 1rem; }
.relembrar-item { margin-bottom: .9rem; }
.relembrar-item:last-child { margin-bottom: 0; }
.relembrar-item__dia {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  margin-bottom: .25rem;
}
.relembrar-item__texto {
  background: #fff;
  border-radius: 8px;
  padding: .7em .9em;
  font-size: .92rem;
  margin: 0;
}
.relembrar-item__texto--vazio {
  color: var(--muted);
  font-style: italic;
  background: transparent;
  padding: 0;
}
.relembrar-item__texto--vazio a { color: var(--gold); font-weight: 600; }

.badge-concluido {
  display: inline-block;
  background: var(--relacionamentos);
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  padding: .35em .9em;
  border-radius: 999px;
}

/* ---------- Barra de progresso (Dia X de 21) ---------- */
.progresso {
  margin-bottom: 1.5rem;
}
.progresso__linha {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.progresso__trilha {
  background: var(--cream-2);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.progresso__barra {
  background: linear-gradient(90deg, var(--gold), var(--saude));
  height: 100%;
  border-radius: 999px;
  transition: width .4s ease;
}

/* ---------- Trial banner urgente (últimos 2 dias) ---------- */
.trial-banner--urgente {
  background: #8A2E20;
}
.trial-banner--urgente strong { color: #FBE3E0; }

/* ---------- Toast de confirmação ao registrar ---------- */
.toast-sucesso {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: .8em 1.4em;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: .5em;
}
.toast-sucesso__check {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--relacionamentos);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  flex-shrink: 0;
}

/* ---------- Histórico de registros ---------- */
.historico-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: .9rem;
  border: 1px solid rgba(43,36,32,.07);
}
.historico-item__topo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .5rem;
}
.historico-item__dia {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.historico-item__data { font-size: .78rem; color: var(--muted); }
.historico-item__texto { margin-bottom: 0; }
.historico-item__texto.recolhido {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.historico-vazio { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* ---------- Roda comparativa (radar SVG) ---------- */
.roda-radar { display: block; margin: 1.5rem auto; max-width: 320px; width: 100%; }
.roda-radar__legenda {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: .82rem;
  margin-top: .5rem;
}
.roda-radar__legenda span { display: flex; align-items: center; gap: .4em; }
.roda-radar__ponto { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------- Destaques da tela de resultado do onboarding ---------- */
.resultado-destaques {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  margin: 1rem 0 1.4rem;
}
.resultado-destaque {
  background: #fff;
  border-radius: var(--radius);
  padding: .9rem .6rem;
  text-align: center;
  border: 1px solid rgba(43,36,32,.07);
}
.resultado-destaque__label {
  font-size: .68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .02em;
  margin-bottom: .35rem;
}
.resultado-destaque__valor {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
}
.resultado-destaque__valor--texto {
  font-size: .95rem;
  color: var(--ink);
}

/* ---------- Banner de instalação (PWA) ---------- */
.banner-instalar {
  background: var(--cream-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}
.banner-instalar[hidden] {
  display: none;
}
.banner-instalar__botoes {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}

/* ---------- Tela de espera ("volte amanhã") ---------- */
.espera-card {
  padding: 2.4rem 1.6rem;
}
.espera-card__icone {
  font-size: 2.4rem;
  margin-bottom: .6rem;
}
.espera-card h2 {
  margin-bottom: .5rem;
}
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  margin-top: .6rem;
  font-size: .8rem;
  font-weight: 700;
  color: #B5541C;
}

/* ---------- Celebração do checkpoint ---------- */
.checkpoint-hero {
  text-align: center;
  background: linear-gradient(160deg, var(--ink), #3a2f28);
  border-radius: var(--radius);
  padding: 2rem 1.4rem 1.7rem;
  margin-bottom: 1.2rem;
  color: #fff;
}
.checkpoint-hero__kicker {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--gold);
  margin-bottom: .5rem;
}
.checkpoint-hero__titulo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0;
}

.destaque-evolucao {
  background: linear-gradient(135deg, var(--gold), #E8BE6E);
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  margin-bottom: 1.2rem;
  text-align: center;
}
.destaque-evolucao__label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: rgba(43,36,32,.7);
  margin-bottom: .3rem;
}
.destaque-evolucao__valor {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
}
.destaque-evolucao__delta {
  display: inline-block;
  margin-left: .5em;
  background: var(--ink);
  color: var(--gold);
  font-size: .85rem;
  padding: .15em .55em;
  border-radius: 999px;
  vertical-align: middle;
}

/* ---------- Preview de conteúdo bloqueado (pós-trial) ---------- */
.preview-bloqueado {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin: 1.2rem 0;
  border: 1px dashed rgba(43,36,32,.25);
  overflow: hidden;
}
.preview-bloqueado::after {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(3px);
  background: rgba(251,246,238,.55);
}
.preview-bloqueado__cadeado {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  background: var(--ink);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  padding: .5em 1.1em;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Link discreto (esqueci minha senha etc.) ---------- */
.link-discreto {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: .85rem;
  color: var(--muted);
  text-decoration: underline;
}

/* ---------- Chat livre com o coach ---------- */
.chat-janela {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid rgba(43,36,32,.07);
  padding: 1rem 1rem .5rem;
  max-height: 55vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: .9rem;
}
.chat-bolha {
  max-width: 82%;
  padding: .65em .95em;
  border-radius: 14px;
  font-size: .92rem;
  line-height: 1.45;
}
.chat-bolha--coach {
  align-self: flex-start;
  background: var(--cream-2);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.chat-bolha--usuario {
  align-self: flex-end;
  background: var(--ink);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-form {
  display: flex;
  gap: .6rem;
  align-items: flex-end;
  margin-bottom: .3rem;
}
.chat-form textarea {
  flex: 1;
  resize: none;
  font-family: inherit;
  font-size: .92rem;
  padding: .7em .9em;
  border-radius: 12px;
  border: 1px solid rgba(43,36,32,.15);
}
.chat-form .btn {
  width: auto;
  padding: .75em 1.2em;
  flex-shrink: 0;
}
.chat-form .btn:disabled {
  opacity: .55;
}
.chat-form textarea:disabled {
  opacity: .7;
}

/* ---------- Indicador "digitando..." ---------- */
.chat-digitando {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: .8em 1em;
}
.chat-digitando span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  animation: chat-digitando-pulso 1.1s infinite ease-in-out;
}
.chat-digitando span:nth-child(2) { animation-delay: .15s; }
.chat-digitando span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-digitando-pulso {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- Widget de chat flutuante (balão + painel) ---------- */
.chat-widget-bolha {
  position: fixed;
  bottom: 1.3rem;
  right: 1.3rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  cursor: pointer;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease;
}
.chat-widget-bolha:hover { transform: scale(1.06); }
.chat-widget-bolha--ativa { background: var(--gold); }

.chat-widget-painel {
  position: fixed;
  bottom: 5.6rem;
  right: 1.3rem;
  width: min(360px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - 8rem));
  background: var(--cream);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  z-index: 199;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(43,36,32,.08);
}
.chat-widget-painel[hidden] {
  display: none;
}
.chat-widget-painel__topo {
  background: var(--ink);
  color: #fff;
  padding: .8em 1em;
  font-weight: 700;
  font-size: .92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-widget-painel__fechar {
  background: none;
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  opacity: .8;
  padding: .2em .4em;
}
.chat-widget-painel__fechar:hover { opacity: 1; }

.chat-widget-janela {
  flex: 1;
  border-radius: 0;
  border: none;
  margin-bottom: 0;
  max-height: none;
}
.chat-widget-form {
  padding: .7rem;
  margin-bottom: 0;
  border-top: 1px solid rgba(43,36,32,.08);
  background: #fff;
}

@media (max-width: 480px) {
  .chat-widget-painel {
    right: .6rem;
    bottom: 5.2rem;
  }
  .chat-widget-bolha {
    right: .8rem;
    bottom: 1rem;
  }
}
