* { box-sizing: border-box; }

:root {
  --wa-header: #075E54;
  --wa-header-dark: #054c44;
  --wa-bg: #E5DDD5;
  --wa-in: #FFFFFF;
  --wa-out: #DCF8C6;
  --wa-accent: #25D366;
  --wa-blue-tick: #34B7F1;
  --text: #111B21;
  --text-muted: #667781;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #0b141a;
}

.phone {
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--wa-bg);
  background-image: radial-gradient(rgba(0,0,0,0.02) 1px, transparent 1px);
  background-size: 18px 18px;
  overflow: hidden;
  position: relative;
}

.header {
  background: var(--wa-header);
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  z-index: 2;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #128C7E;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}

.header-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.header-status {
  font-size: 12.5px;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4FE05E;
  display: inline-block;
}

.progress-track {
  height: 3px;
  background: rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--wa-header);
  transition: width 0.4s ease;
}

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

.bubble-row {
  display: flex;
  width: 100%;
  animation: rise 0.25s ease;
}

.bubble-row.in { justify-content: flex-start; }
.bubble-row.out { justify-content: flex-end; }

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

.bubble {
  max-width: 78%;
  padding: 7px 9px 6px 10px;
  border-radius: 8px;
  font-size: 14.7px;
  line-height: 1.4;
  color: var(--text);
  position: relative;
  box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.bubble.in {
  background: var(--wa-in);
  border-top-left-radius: 2px;
}

.bubble.out {
  background: var(--wa-out);
  border-top-right-radius: 2px;
}

.bubble.strong {
  font-weight: 700;
}

.meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.ticks { color: var(--wa-blue-tick); font-size: 13px; letter-spacing: -2px; }

.typing-row { display: flex; justify-content: flex-start; }

.typing-bubble {
  background: var(--wa-in);
  border-radius: 8px;
  border-top-left-radius: 2px;
  padding: 10px 14px;
  display: flex;
  gap: 4px;
  box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
}

.typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9aa5aa;
  display: inline-block;
  animation: bounce 1.2s infinite;
}

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

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

.composer {
  flex-shrink: 0;
  background: #F0F0F0;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.option-btn {
  background: white;
  border: 1.5px solid var(--wa-accent);
  color: #075E54;
  font-size: 14.5px;
  font-weight: 600;
  padding: 11px 14px;
  border-radius: 20px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.option-btn:active {
  transform: scale(0.98);
  background: #eafaf0;
}

.cta-btn {
  background: var(--wa-accent);
  color: white;
  border: none;
  font-size: 15.5px;
  font-weight: 700;
  padding: 13px 16px;
  border-radius: 24px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
}

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

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row input {
  border: 1.5px solid #cfd8dc;
  border-radius: 20px;
  padding: 11px 15px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
}

.form-row input:focus {
  border-color: var(--wa-accent);
}

.hint {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  padding: 2px 6px 0;
}

.result-badge {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.badge-alto { background: #FDE2E1; color: #C0392B; }
.badge-medio { background: #FFF3CD; color: #8A6100; }
.badge-baixo { background: #DCF8C6; color: #1B5E20; }

@media (min-width: 481px) {
  body { display: flex; align-items: center; justify-content: center; }
  .phone {
    height: 92vh;
    max-height: 850px;
    border-radius: 18px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    margin-top: 4vh;
  }
}
