:root {
  --primary: #c94c83;
  --primary-dark: #8c2f57;
  --primary-soft: #fdf2f7;
  --primary-softer: #fffafd;
  --accent: #d4a373;
  --bg: #fafafa;
  --card: #ffffff;
  --border: #f2e1e9;
  --text: #3d2a35;
  --muted: #7d6e77;
  --shadow: 0 20px 40px rgba(61, 42, 53, 0.08);
  --glass: rgba(255, 255, 255, 0.88);
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  background-color: #fdf8f9;
  background-image: radial-gradient(#f2e1e9 0.5px, transparent 0.5px);
  background-size: 20px 20px;
  font-family: 'Montserrat', sans-serif;
  color: var(--text);
  min-height: 100vh;
}

.app {
  width: 100%;
  max-width: 600px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--card);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow);
}

/* ===== TOPBAR ===== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

/* ===== AVATAR GRANDE ===== */

.avatar-wrap {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, #fdf2f7);
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(201, 76, 131, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  transition: opacity .25s ease, transform .25s ease;
}

/* leve animação "vida" */
.avatar-wrap.is-animating .avatar-img {
  transform: scale(1.03);
}

/* ===== TEXTO TOPO ===== */

.topbar-text {
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--primary-dark);
  line-height: 1.2;
}

.topbar p {
  margin: 4px 0 0;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* ===== MAIN ===== */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 18px;
}

.screen {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.35s ease;
}

.screen.active {
  display: flex;
}

/* ===== CHAT ===== */

.message {
  display: flex;
}

.message.ai {
  justify-content: flex-start;
}

.bubble {
  max-width: 100%;
  border-radius: 20px;
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.6;
}

.bubble.default {
  background: var(--primary-soft);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.bubble.question {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  box-shadow: 0 8px 20px rgba(0,0,0,0.03);
  border-bottom-left-radius: 4px;
}

/* ===== PERGUNTA ===== */

.question-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
  display: block;
  letter-spacing: 1px;
}

.question-text {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--primary-dark);
  line-height: 1.4;
}

/* ===== TYPING ===== */

.typing {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
}

.typing-dots {
  display: inline-flex;
  gap: 5px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #caa2b5;
  animation: blink 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }

/* ===== OPTIONS ===== */

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

.option-btn {
  background: #fff;
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
  color: var(--text);
}

.option-btn:hover {
  border-color: var(--primary);
  background: var(--primary-softer);
  transform: translateX(4px);
}

.option-btn.selected {
  background: var(--primary-dark);
  color: white;
  border-color: var(--primary-dark);
  box-shadow: 0 8px 18px rgba(140, 47, 87, 0.14);
}

/* ===== NAV ===== */

.nav {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
}

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

.btn-primary {
  background: var(--primary-dark);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--primary-dark);
}

/* ===== PROGRESS ===== */

.progress-wrap {
  padding: 15px 25px 30px;
  background: #fff;
  border-top: 1px solid var(--border);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.progress {
  height: 4px;
  background: var(--primary-soft);
  border-radius: 10px;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 10px;
  transition: width 0.5s ease;
}

/* ===== RESULT ===== */

.result-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 25px;
  box-shadow: 0 15px 45px rgba(201, 76, 131, 0.1);
}

.result-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--primary-dark);
}

.note-chip {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 11px;
  border: 1px solid var(--border);
  font-weight: 600;
  text-transform: uppercase;
}

.offer-box {
  margin-top: 16px;
  background: var(--primary-softer);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}

.cta-btn {
  width: 100%;
  background: var(--primary-dark);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 12px;
  margin-top: 12px;
  cursor: pointer;
}

.ghost-btn,
.restart-btn {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 12px;
  margin-top: 10px;
  cursor: pointer;
}

.brand {
  font-weight: 600;
  color: var(--primary-dark);
}

.cursor {
  color: var(--primary);
  font-weight: bold;
}

/* ===== ANIMAÇÕES ===== */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 80%, 100% { opacity: .35; }
  40% { opacity: 1; }
}

/* ===== MOBILE ===== */

@media (max-width: 640px) {
  .avatar-wrap {
    width: 90px;
    height: 90px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .topbar p {
    font-size: 10px;
  }

  .main {
    padding: 20px 16px 16px;
  }
}


/* ==== LOADER ==== */

.loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  text-align: center;
}

.loader-text {
  font-size: 18px;
  margin-bottom: 20px;
}

.progress-bar-wrap {
  width: 80%;
  max-width: 300px;
  height: 8px;
  background: #eee;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff4db8, #ff8ad6);
  transition: width 0.3s ease;
}

.loader-percent {
  margin-top: 10px;
  font-size: 14px;
  opacity: 0.7;
}

.btn.is-disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn {
  transition: opacity 0.25s ease, transform 0.2s ease;
}