:root {
  --bg: #050b14;
  --card: #0a1422;
  --card-2: #0d1a2b;
  --line: rgba(255,255,255,.09);
  --text: #f7f9fc;
  --muted: #9fb0c5;
  --blue: #1e9be0;
  --blue-2: #43b7f2;
  --success: #25d366;
  --danger: #ff7676;
  --shadow: 0 28px 80px rgba(0,0,0,.42);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Montserrat", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(30,155,224,.20), transparent 32rem),
    radial-gradient(circle at 90% 80%, rgba(30,155,224,.10), transparent 28rem),
    var(--bg);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.chat-card {
  width: min(100%, 760px);
  min-height: min(820px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(10,20,34,.95);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.chat-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark,
.assistant-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(145deg, var(--blue-2), var(--blue));
  box-shadow: 0 10px 28px rgba(30,155,224,.24);
}

.assistant-avatar.small {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 13px;
}

.brand-name {
  font-weight: 800;
  letter-spacing: .08em;
  font-size: 15px;
}

.online-status {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

.online-status span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
  background: #42d392;
  box-shadow: 0 0 0 4px rgba(66,211,146,.1);
}

.step-badge {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.progress-track { height: 4px; background: rgba(255,255,255,.05); }
.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
  transition: width .35s ease;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  scroll-behavior: smooth;
}

.welcome-block,
.typing-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.message {
  max-width: 580px;
  padding: 17px 19px;
  border-radius: 5px 20px 20px 20px;
  line-height: 1.55;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: #dce5f0;
}

.message p { margin: 0 0 8px; }
.message p:last-child { margin-bottom: 0; }

.typing-row { margin: 16px 0 0; }

.typing {
  display: flex;
  gap: 5px;
  padding: 14px 16px;
  border-radius: 5px 18px 18px 18px;
  border: 1px solid var(--line);
  background: var(--card-2);
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: bounce 1s infinite ease-in-out;
}

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

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

.question-panel,
.final-panel {
  margin-top: 28px;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
}

.back-button,
.restart-button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: none;
  cursor: pointer;
}

.back-button { margin-bottom: 18px; font-size: 13px; }

.question-kicker,
.final-kicker {
  margin: 0 0 8px;
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.question-title,
.final-panel h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.16;
  letter-spacing: -.035em;
}

.question-help {
  min-height: 22px;
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.text-input {
  width: 100%;
  min-height: 58px;
  padding: 0 17px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 15px;
  outline: none;
  color: var(--text);
  background: rgba(3,9,17,.55);
}

.text-input::placeholder { color: #708096; }
.text-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(30,155,224,.12);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

.option-button {
  position: relative;
  min-height: 58px;
  padding: 13px 38px 13px 16px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
  color: #dce5f0;
  text-align: left;
  line-height: 1.35;
  background: rgba(3,9,17,.42);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.option-button:hover {
  transform: translateY(-1px);
  border-color: rgba(30,155,224,.55);
}

.option-button.selected {
  border-color: var(--blue);
  background: rgba(30,155,224,.14);
}

.option-button.selected::after {
  content: "✓";
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blue-2);
  font-weight: 800;
}

.primary-button,
.whatsapp-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, var(--blue), #1178b4);
  box-shadow: 0 14px 30px rgba(30,155,224,.20);
}

.primary-button:disabled {
  cursor: wait;
  opacity: .7;
}

.whatsapp-button {
  background: var(--success);
  box-shadow: 0 14px 30px rgba(37,211,102,.18);
}

.error-message,
.save-status {
  min-height: 18px;
  margin: 10px 0 -6px;
  font-size: 12px;
}

.error-message { color: var(--danger); }
.save-status { color: var(--muted); }

.success-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 16px;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  background: var(--success);
}

.final-panel > p:not(.final-kicker) {
  margin: 12px 0 20px;
  color: var(--muted);
  line-height: 1.55;
}

.summary-card {
  display: grid;
  gap: 11px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(3,9,17,.38);
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(115px, .8fr) 1.4fr;
  gap: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.summary-label { color: var(--muted); }
.summary-value { color: var(--text); font-weight: 600; }

.restart-button {
  display: block;
  margin: 18px auto 0;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-note {
  padding: 15px 24px 18px;
  border-top: 1px solid var(--line);
  color: #718096;
  text-align: center;
  font-size: 11px;
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .page-shell { padding: 0; }
  .chat-card { min-height: 100vh; border-radius: 0; border: 0; }
  .chat-header { padding: 16px 18px; min-height: 80px; }
  .chat-body { padding: 20px 16px; }
  .question-panel, .final-panel { padding: 20px 16px; border-radius: 18px; }
  .options-grid { grid-template-columns: 1fr; }
  .summary-row { grid-template-columns: 1fr; gap: 3px; }
  .message { font-size: 14px; }
}
