/* Sessão — chat conversacional */

.page-session {
  background: linear-gradient(180deg, #e8dff8 0%, #f3eef9 35%, #ebe4f7 100%);
  min-height: 100vh;
}

.page-session .app-main {
  max-width: 28rem;
  padding: 0;
  min-height: calc(100vh - 3.25rem);
  display: flex;
  flex-direction: column;
}

.page-session .site-header {
  position: sticky;
  top: 0;
  z-index: 20;
}

/* --- Shell do chat --- */

.chat-session {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: calc(100vh - 3.25rem);
  max-width: 28rem;
  margin: 0 auto;
  width: 100%;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.chat-header-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-card);
}

.chat-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-header-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--color-brand-dark);
  line-height: 1.2;
}

.chat-header-status {
  font-size: 0.75rem;
  color: var(--color-brand);
  font-weight: 500;
}

.chat-turn--back {
  align-self: center;
  margin: 0.15rem 0 0.35rem;
}

.chat-back-link {
  border: none;
  background: transparent;
  color: var(--color-brand-muted);
  font: inherit;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-back-link:hover {
  color: var(--color-brand-dark);
}

.chat-bubble--orientacao-complementar {
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--color-border);
  font-size: 0.88rem;
  color: var(--color-brand-muted);
}

.complementar-toggle {
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--color-brand-muted);
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.65rem 0.5rem;
  scroll-behavior: smooth;
  background-color: #ebe4f7;
  background-image: radial-gradient(circle at 20% 30%, rgba(125, 107, 168, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(125, 107, 168, 0.05) 0%, transparent 40%);
}

.chat-day-marker {
  align-self: center;
  margin: 0.15rem 0 0.65rem;
  padding: 0.18rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-brand-muted);
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-pill);
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* --- Bolhas --- */

.chat-turn {
  display: flex;
  gap: 0.4rem;
  max-width: 100%;
  animation: chat-in 0.28s ease-out both;
}

.chat-turn--in {
  align-self: flex-start;
  max-width: 92%;
}

.chat-turn--out {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 88%;
}

.chat-avatar-col {
  flex-shrink: 0;
  width: 1.65rem;
  padding-top: 0.15rem;
}

.chat-avatar-sm {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.chat-bubble-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.chat-bubble {
  position: relative;
  padding: 0.62rem 0.85rem;
  line-height: 1.45;
  font-size: 0.94rem;
}

.chat-bubble--in {
  background: #fff;
  color: var(--color-brand-dark);
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 1px 4px rgba(61, 47, 92, 0.07);
  border: 1px solid rgba(212, 196, 239, 0.65);
}

.chat-bubble--in.chat-bubble--question {
  background: linear-gradient(135deg, #fff 0%, #f8f4ff 100%);
  border-color: var(--color-border);
  padding: 0.72rem 0.9rem;
}

.chat-bubble--out {
  background: var(--color-brand);
  color: #fff;
  border-radius: 16px 4px 16px 16px;
  box-shadow: var(--shadow-brand);
}

.chat-bubble--past {
  opacity: 0.72;
}

.chat-bubble--past.chat-bubble--out {
  background: #9a8abf;
  box-shadow: none;
}

.guide-question,
.chat-question {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.28;
  color: inherit;
}

.chat-bubble--out .chat-msg-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
}

.chat-bubble-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-brand);
  background: var(--color-brand-icon-bg);
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.35rem;
}

.chat-bubble--orientacao {
  background: #f7faf5;
  border-left: 3px solid var(--color-brand);
}

.chat-bubble--orientacao .chat-bubble-tag {
  background: rgba(125, 107, 168, 0.12);
}

.chat-bubble--orientacao-tarefa .chat-bubble-tag {
  background: var(--color-brand);
  color: #fff;
}

.chat-bubble--explicacao {
  background: #fff;
}

.chat-bubble--exemplo-contextual {
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px dashed var(--color-border);
}

.chat-bubble--resumo-necessidades {
  background: linear-gradient(135deg, #f8f4ff 0%, #fff 100%);
  border: 1px solid var(--color-border);
  padding: 0.75rem 0.85rem;
}

.chat-bubble--orientacao-fecho {
  background: linear-gradient(135deg, #fff 0%, #f8f4ff 100%);
  border: 1px solid var(--color-border);
}

.chat-bubble--orientacao-fecho .chat-bubble-tag {
  display: none;
}

.chat-bubble--orientacao-tarefa {
  background: linear-gradient(135deg, #fff 0%, #f5f0fc 100%);
  border-left: 3px solid var(--color-brand);
}

.needs-reminder-lead {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  color: var(--color-brand-dark);
  font-weight: 600;
}

.needs-axis-cards {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.needs-axis-card {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.5rem 0.6rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--color-border-soft);
  border-radius: 10px;
}

.needs-axis-num {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.needs-axis-intro {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  color: var(--color-brand-muted);
  line-height: 1.3;
}

.needs-axis-title {
  margin: 0 0 0.12rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-brand-dark);
  line-height: 1.25;
}

.needs-axis-syn {
  margin: 0;
  font-size: 0.72rem;
  color: var(--color-brand-muted);
  line-height: 1.35;
}

.needs-reflection {
  margin: 0.5rem 0 0.55rem;
  padding: 0.45rem 0.55rem;
  background: var(--color-brand-icon-bg);
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--color-brand-dark);
}

.needs-inline-open,
.composer-needs-btn {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.48rem 0.75rem;
  border: 1.5px solid var(--color-brand);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--color-brand-dark);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}

.needs-inline-open:hover,
.composer-needs-btn:hover {
  background: var(--color-brand-icon-bg);
}

.composer-needs-btn {
  margin-top: 0.45rem;
}

.chat-bubble--explicacao-gate {
  background: var(--surface-notice);
  border: 1px solid #e6d9a8;
  padding: 0.55rem 0.8rem;
  line-height: 1.42;
}

.chat-bubble--explicacao-gate > p {
  margin: 0;
}

.text-explicacao-gate {
  padding: 0;
}

.chat-bubble p:last-child,
.chat-bubble ul:last-child {
  margin-bottom: 0;
}

.chat-bubble .text-block {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
}

.guide-bubble {
  /* alias p/ testes */
}

.guide-turn {
  display: contents;
}

.node-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.node-content .chat-turn--in {
  max-width: 100%;
}

/* Respostas rápidas (escolhas) */

.chat-replies {
  padding: 0.5rem 0 0.25rem;
  margin-top: 0.15rem;
}

.chat-replies-label {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-brand-muted);
  text-align: right;
}

.chat-reply-options {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.32rem;
}

.chat-reply-btn {
  display: inline-block;
  max-width: 95%;
  padding: 0.62rem 1rem;
  border: 2px solid var(--color-brand);
  border-radius: 18px 18px 4px 18px;
  background: #fff;
  color: var(--color-brand-dark);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  box-shadow: 0 2px 8px rgba(61, 47, 92, 0.08);
}

.chat-reply-btn:hover {
  background: var(--color-brand-icon-bg);
}

.chat-reply-btn:active {
  transform: scale(0.98);
}

.chat-reply-btn--primary {
  background: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
}

.chat-reply-btn--primary:hover {
  background: #6e5c98;
}

.chat-reply-skip {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 0.25rem;
  font-size: 0.82rem;
}

/* Compositor (campo de texto) */

.chat-composer {
  flex-shrink: 0;
  padding: 0.5rem 0.65rem 0.65rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-border);
}

.composer-inner {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  background: #fff;
  border: 1.5px solid var(--color-border);
  border-radius: 22px;
  padding: 0.35rem 0.35rem 0.35rem 0.85rem;
  box-shadow: 0 2px 10px rgba(61, 47, 92, 0.06);
}

.composer-input {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  min-height: 2.5rem;
  max-height: 9rem;
  padding: 0.45rem 0;
  font: inherit;
  font-size: 0.94rem;
  line-height: 1.4;
  outline: none;
}

.composer-send {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-brand);
  transition: transform 0.12s;
}

.composer-send:active {
  transform: scale(0.94);
}

.composer-hint {
  margin: 0.35rem 0.5rem 0;
  font-size: 0.72rem;
  color: var(--color-brand-muted);
  text-align: center;
}

.composer-actions-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.composer-actions-row .btn-secondary {
  font-size: 0.82rem;
  padding: 0.4rem 0.65rem;
}

.field-block {
  margin: 0;
}

.field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.empty-field-reminder {
  margin: 0.5rem 0 0;
  border-radius: 14px;
  font-size: 0.88rem;
}

.wizard-nav {
  padding: 0.25rem 0.85rem 0.65rem;
  flex-shrink: 0;
}

.wizard-nav .btn-secondary {
  background: transparent;
  border: none;
  color: var(--color-brand-muted);
  font-size: 0.85rem;
  padding: 0.2rem 0;
  box-shadow: none;
  text-decoration: underline;
}

.user-turn {
  /* alias p/ testes */
}

.end-panel {
  padding: 0.5rem 0;
}

.end-panel .summary-text {
  border-radius: 12px;
  max-height: 12rem;
  overflow-y: auto;
}

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.gate-actions .btn {
  border-radius: 18px;
  font-size: 0.88rem;
}

.gate-exp-options {
  flex-wrap: wrap;
  gap: 0.32rem;
}

.gate-exp-options .chat-reply-btn--primary {
  flex: 1 1 100%;
  max-width: 100%;
}

.chat-reply-btn--secondary {
  background: #fff;
  color: var(--color-brand-dark);
  border: 2px solid var(--color-border);
  box-shadow: none;
}

.chat-reply-btn--secondary:hover {
  background: var(--color-brand-icon-bg);
  border-color: var(--color-brand);
}

.gate-exp-options .chat-reply-btn--secondary {
  flex: 1 1 100%;
  max-width: 100%;
}

.exemplo-toggle {
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
}

@keyframes chat-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble--typing {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.72rem 1rem;
  min-width: 3.5rem;
}

.chat-bubble--typing span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--color-brand-muted);
  animation: typing-dot 1.2s ease-in-out infinite;
}

.chat-bubble--typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-bubble--typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing-dot {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* Player de áudio no chat */
.chat-bubble .audio-player {
  margin: 0.35rem 0 0.5rem;
}

/* Páginas auxiliares (mantido) */
.example-audio-hero {
  margin: 0 0 1.25rem;
}

.example-section-title {
  font-family: var(--font-display);
  color: var(--color-brand-dark);
  font-size: 1.1rem;
  margin: 1.25rem 0 0.35rem;
}

.crescer-page {
  max-width: 26rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.crescer-intro {
  color: var(--color-brand-muted);
  line-height: 1.55;
}

.crescer-intro p {
  margin: 0.75rem 0;
}

.crescer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 1.25rem 0;
}

.crescer-actions .home-btn {
  width: 100%;
  text-align: left;
}

.crescer-pix-feedback {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--color-brand);
}

.page-title {
  font-family: var(--font-display);
  color: var(--color-brand-dark);
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
}

.back-link {
  color: var(--color-brand);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
  padding: 0.45rem 0.65rem;
  background: var(--color-brand-icon-bg);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  color: var(--color-brand-dark);
}

.audio-player-btn {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.audio-player-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}

.audio-player-progress {
  flex: 1;
  height: 4px;
  background: rgba(125, 107, 168, 0.25);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}

.audio-player-progress-fill {
  height: 100%;
  background: var(--color-brand);
  width: 0%;
  transition: width 0.1s linear;
}

.audio-player-label {
  flex-shrink: 0;
  font-weight: 500;
  min-width: 2.5rem;
}

.audio-player-speed {
  flex-shrink: 0;
  min-width: 2.4rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid rgba(125, 107, 168, 0.35);
  border-radius: var(--radius-pill);
  background: transparent;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-brand-dark);
  cursor: pointer;
  line-height: 1.2;
}

.audio-player-speed:hover {
  background: rgba(125, 107, 168, 0.12);
}

.audio-player--hero {
  margin: 0;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
}

.audio-player--hero .audio-player-btn {
  width: 2.35rem;
  height: 2.35rem;
}

.audio-player--hero .audio-player-btn svg {
  width: 1rem;
  height: 1rem;
}

.audio-player--hero .audio-player-progress {
  height: 6px;
}

.audio-player--hero .audio-player-label {
  min-width: 5.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.audio-player--hero .audio-player-speed {
  font-size: 0.78rem;
  min-width: 2.55rem;
}
