* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(180deg, #1a0e1f 0%, #120a16 100%);
  color: #f3eaf0;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 70px;
}

.app-header {
  padding: 20px 16px 14px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.logo span {
  color: #e0558f;
}

.tagline {
  margin-top: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #b98aa6;
}

/* ---------- Chat ---------- */

.chat {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 80%;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.45;
  font-size: 15px;
}

.message p {
  white-space: pre-wrap;
}

.message p {
  margin: 0;
}

.message.bot {
  align-self: flex-start;
  background: #2a1730;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom-left-radius: 4px;
}

.message.user {
  align-self: flex-end;
  background: #e0558f;
  color: #1a0e1f;
  border-bottom-right-radius: 4px;
}

.message.typing {
  align-self: flex-start;
  background: #2a1730;
  color: #b98aa6;
  font-style: italic;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 10px;
}

.suggestion-chip {
  background: #241129;
  border: 1px solid rgba(224, 85, 143, 0.35);
  color: #e7d9e2;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.suggestion-chip:active {
  background: #3a1c40;
}

.disclaimer {
  font-size: 11px;
  color: #6e5468;
  text-align: center;
  padding: 8px 20px 4px;
  line-height: 1.4;
  margin: 0;
}

.composer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.composer input {
  flex: 1;
  background: #241129;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 12px 16px;
  color: #f3eaf0;
  font-size: 15px;
  outline: none;
}

.composer input::placeholder {
  color: #7a5d70;
}

.composer button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #e0558f;
  color: #1a0e1f;
  font-size: 18px;
  cursor: pointer;
}

.composer button:active {
  transform: scale(0.96);
}

/* ---------- Layout genérico de telas ---------- */

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  gap: 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen-centered {
  justify-content: center;
  text-align: center;
}

.title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.subtitle {
  font-size: 15px;
  color: #cba6bd;
  line-height: 1.5;
}

.body-text {
  font-size: 15px;
  line-height: 1.6;
  color: #e7d9e2;
}

/* ---------- Botões ---------- */

.btn {
  display: block;
  width: 100%;
  padding: 15px 18px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.btn-primary {
  background: #e0558f;
  color: #1a0e1f;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f3eaf0;
}

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

.btn-ghost {
  background: transparent;
  color: #b98aa6;
  font-size: 14px;
  text-decoration: underline;
}

/* ---------- Quiz ---------- */

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 20px;
}

.progress-fill {
  height: 100%;
  background: #e0558f;
  transition: width 0.3s ease;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  text-align: left;
  padding: 16px;
  border-radius: 14px;
  background: #241129;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f3eaf0;
  font-size: 15px;
  cursor: pointer;
}

.option-btn:active,
.option-btn.selected {
  background: #3a1c40;
  border-color: #e0558f;
}

/* Botões com foto de fundo (dor/pergunta) — overlay desfocado e escurecido,
   cai num fundo sólido normal se a imagem ainda não existir no servidor. */
.option-btn-photo {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 56px;
  display: flex;
  align-items: center;
}

.option-btn-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(3px) brightness(0.45);
  transform: scale(1.1);
  z-index: 0;
}

.option-btn-label {
  position: relative;
  z-index: 1;
}

.slider-wrap {
  padding: 10px 4px;
}

input[type="range"] {
  width: 100%;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #b98aa6;
  margin-top: 6px;
}

.text-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  background: #241129;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f3eaf0;
  font-size: 16px;
}

/* ---------- Reveal / VSL ---------- */

.diagnosis-card {
  background: #241129;
  border: 1px solid rgba(224, 85, 143, 0.3);
  border-radius: 18px;
  padding: 20px;
  font-size: 15px;
  line-height: 1.6;
}

.vsl-beat {
  background: #241129;
  border-radius: 16px;
  padding: 18px;
  font-size: 15px;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 0.5s ease forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #e0558f;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Paywall ---------- */

.badge {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(224, 85, 143, 0.15);
  color: #e0558f;
  border: 1px solid rgba(224, 85, 143, 0.4);
}

.plan-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #241129;
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.plan-card.popular {
  border-color: #e0558f;
  background: #2f1530;
}

.plan-name {
  font-weight: 700;
  font-size: 15px;
}

.plan-sub {
  font-size: 12px;
  color: #b98aa6;
  margin-top: 2px;
}

.plan-price {
  font-weight: 700;
  font-size: 17px;
}

/* ---------- Cards genéricos (ideia, conteúdo) ---------- */

.card {
  background: #241129;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px;
}

.card-locked {
  opacity: 0.55;
}

.card-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}

.card-text {
  font-size: 14px;
  color: #d8c3d1;
  line-height: 1.5;
}

.partner-code {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 4px;
  text-align: center;
  padding: 16px;
  background: #241129;
  border-radius: 14px;
  border: 1px dashed rgba(224, 85, 143, 0.5);
}

/* ---------- Bottom nav ---------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: #1a0e1f;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: #7a5d70;
}

.nav-item.active {
  color: #e0558f;
}

.nav-icon {
  font-size: 18px;
}

/* ---------- Perfil: preferências e submenu avançado ---------- */

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
}

.pref-row:first-of-type {
  border-top: none;
}

.pref-select {
  background: #1a0e1f;
  color: #f3eaf0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #3a1c40;
  border-radius: 999px;
  transition: 0.2s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #f3eaf0;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .switch-slider {
  background: #e0558f;
}

.switch input:checked + .switch-slider::before {
  transform: translateX(18px);
}
