:root {
  --bg-top: #d5efe4;
  --bg-bottom: #f5eee6;
  --ink: #17322d;
  --muted: #5d6f6b;
  --muted-strong: #3f5752;
  --brand: #11a173;
  --brand-strong: #0b7258;
  --brand-soft: rgba(17, 161, 115, 0.12);
  --bubble-bot: #ffffff;
  --bubble-user: #dcf8c8;
  --line: rgba(15, 49, 40, 0.12);
  --danger: #b04343;
  --shadow-xl: 0 32px 80px rgba(16, 50, 41, 0.18);
  --shadow-lg: 0 20px 40px rgba(16, 50, 41, 0.14);
  --shadow-md: 0 12px 26px rgba(16, 50, 41, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: "Trebuchet MS", "Candara", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 9% 14%, rgba(17, 161, 115, 0.3), transparent 23%),
    radial-gradient(circle at 88% 8%, rgba(255, 192, 128, 0.26), transparent 20%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  gap: 24px;
  align-items: center;
}

.hero {
  position: relative;
  min-height: 270px;
  display: flex;
  align-items: center;
  padding: 28px;
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.36)),
    linear-gradient(130deg, rgba(17, 161, 115, 0.08), rgba(255, 214, 161, 0.2));
  animation: hero-rise 0.75s ease both;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(4px);
  opacity: 0.82;
  pointer-events: none;
  animation: float 10s ease-in-out infinite;
}

.orb-one {
  width: 190px;
  height: 190px;
  right: -48px;
  top: -48px;
  background: radial-gradient(circle, rgba(17, 161, 115, 0.42), rgba(17, 161, 115, 0));
}

.orb-two {
  width: 240px;
  height: 240px;
  left: -82px;
  bottom: -128px;
  background: radial-gradient(circle, rgba(255, 189, 116, 0.4), rgba(255, 189, 116, 0));
  animation-duration: 13s;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 630px;
}

.eyebrow {
  display: inline-flex;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand-strong);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

h1 {
  margin: 14px 0 12px;
  font-size: clamp(2.1rem, 5vw, 4.3rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.hero p {
  margin: 0;
  max-width: 57ch;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.53;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-points span {
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(23, 49, 45, 0.06);
  font-size: 0.9rem;
}

.phone-shell {
  display: flex;
  justify-content: center;
}

.phone-frame {
  width: min(100%, 430px);
  height: min(860px, calc(100dvh - 64px));
  min-height: 640px;
  max-height: 860px;
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid rgba(10, 111, 86, 0.22);
  background: #e7ddd3;
  box-shadow: 0 35px 90px rgba(16, 50, 41, 0.24);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  animation: frame-rise 0.86s ease both;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 18px 14px;
  color: #fff;
  background: linear-gradient(135deg, rgba(9, 110, 85, 0.98), rgba(17, 161, 115, 0.95));
}

.chat-header p {
  margin: 2px 0 0;
  font-size: 0.83rem;
  opacity: 0.85;
}

.avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.progress-panel {
  padding: 11px 16px 13px;
  background: rgba(250, 248, 245, 0.94);
  border-bottom: 1px solid var(--line);
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(10, 111, 86, 0.12);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(9, 110, 85, 1), rgba(34, 196, 139, 1), rgba(9, 110, 85, 1));
  background-size: 200% 100%;
  transition: width 0.3s ease;
  animation: shine 3.2s linear infinite;
}

.chat-body {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 14px 20px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.35)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23bed9c8' fill-opacity='0.43'%3E%3Cpath d='M15 14c0 3.9-3.1 7-7 7v4c6.1 0 11-4.9 11-11h-4Zm42 13c0-3.9 3.1-7 7-7v-4c-6.1 0-11 4.9-11 11h4Zm-8 29c-3.9 0-7-3.1-7-7h-4c0 6.1 4.9 11 11 11v-4ZM22 49c0 3.9-3.1 7-7 7v4c6.1 0 11-4.9 11-11h-4Zm13-22c-1.8 0-3.2 1.4-3.2 3.2S33.2 33.4 35 33.4s3.2-1.4 3.2-3.2S36.8 27 35 27Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.message-row {
  display: flex;
  margin-bottom: 12px;
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  animation: bubble-in 0.34s ease forwards;
}

.message-row.bot {
  justify-content: flex-start;
}

.message-row.user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 84%;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.48;
  font-size: 0.97rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-shadow: var(--shadow-md);
}

.message-row.bot .message-bubble {
  background: var(--bubble-bot);
  border-top-left-radius: 5px;
}

.message-row.user .message-bubble {
  background: var(--bubble-user);
  border-top-right-radius: 5px;
}

.typing-row .message-bubble {
  padding: 11px 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 56px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(23, 50, 45, 0.45);
  animation: typing-bounce 1s ease-in-out infinite;
}

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

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

.chat-input {
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  overflow: visible;
  background: rgba(248, 244, 238, 0.97);
  border-top: 1px solid var(--line);
}

.chat-input label {
  font-size: 0.88rem;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.chat-input input {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(10, 111, 86, 0.2);
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.chat-input input::placeholder {
  color: #7a8d89;
}

.chat-input input:focus {
  border-color: rgba(17, 161, 115, 0.67);
  box-shadow: 0 0 0 4px rgba(17, 161, 115, 0.11);
  transform: translateY(-1px);
}

.submit-button {
  border: 0;
  border-radius: 18px;
  padding: 0 18px;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(17, 161, 115, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(17, 161, 115, 0.28);
  filter: saturate(1.04);
}

.submit-button:focus-visible {
  outline: 3px solid rgba(17, 161, 115, 0.36);
  outline-offset: 2px;
}

.submit-button:active {
  transform: translateY(0);
}

.submit-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.24);
  opacity: 0.72;
  box-shadow: none;
}

.option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: min(26dvh, 180px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.option-list[hidden],
.suggestions[hidden] {
  display: none;
}

.option-chip,
.suggestion-chip {
  width: auto;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(10, 111, 86, 0.16);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-strong);
  text-align: left;
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  box-shadow: 0 4px 10px rgba(11, 114, 88, 0.08);
}

.option-chip:hover,
.suggestion-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(17, 161, 115, 0.5);
  background: rgba(17, 161, 115, 0.055);
}

.option-chip::before {
  content: "+ ";
  opacity: 0.8;
}

.option-chip:focus-visible,
.suggestion-chip:focus-visible,
.chat-input input:focus-visible {
  outline: 3px solid rgba(17, 161, 115, 0.3);
  outline-offset: 1px;
}

.option-chip:disabled,
.suggestion-chip:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.suggestions {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(100% + 8px);
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  max-height: min(35dvh, 230px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(10, 111, 86, 0.12);
  box-shadow: var(--shadow-lg);
  z-index: 5;
}

.suggestions .suggestion-chip {
  width: 100%;
  border-radius: 14px;
  color: var(--ink);
  font-weight: 500;
}

.status,
.hint {
  min-height: 18px;
  font-size: 0.85rem;
  line-height: 1.3;
}

.status {
  color: var(--muted-strong);
}

.hint {
  color: var(--danger);
}

.success-card {
  margin-top: 8px;
  padding: 16px;
  border-radius: 21px;
  background: linear-gradient(135deg, rgba(17, 161, 115, 0.1), rgba(255, 255, 255, 0.74));
  border: 1px solid rgba(17, 161, 115, 0.19);
  box-shadow: var(--shadow-md);
}

.success-card strong {
  display: block;
  margin-bottom: 8px;
}

.success-card p {
  margin: 8px 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.intro-card {
  margin: 4px 0 14px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(17, 161, 115, 0.12), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(10, 111, 86, 0.14);
  box-shadow: var(--shadow-lg);
}

.intro-card p {
  margin: 0;
  white-space: pre-line;
  line-height: 1.6;
  font-size: 0.97rem;
  color: var(--ink);
}

.intro-start-btn {
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: 18px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  color: #fff;
  font-weight: 700;
  font-size: 0.99rem;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(17, 161, 115, 0.24);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.intro-start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(17, 161, 115, 0.28);
  filter: saturate(1.04);
}

.intro-start-btn:focus-visible {
  outline: 3px solid rgba(17, 161, 115, 0.36);
  outline-offset: 2px;
}

.intro-start-btn:active {
  transform: translateY(0);
}

.success-card a {
  color: var(--brand-strong);
  font-weight: 700;
}

.success-card a:focus-visible {
  outline: 3px solid rgba(17, 161, 115, 0.33);
  border-radius: 6px;
  outline-offset: 2px;
}

.cep-skip {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 8px 0;
  color: var(--brand-strong);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cep-skip:hover {
  color: var(--brand);
}

.review-card {
  margin-top: 8px;
  padding: 16px;
  border-radius: 21px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(17, 161, 115, 0.06));
  border: 1px solid rgba(17, 161, 115, 0.19);
  box-shadow: var(--shadow-md);
}

.review-card strong {
  display: block;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.review-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(17, 161, 115, 0.08);
  font-size: 0.88rem;
}

.review-item:last-of-type {
  border-bottom: none;
}

.review-label {
  color: var(--muted);
  min-width: 90px;
  flex-shrink: 0;
  font-size: 0.82rem;
}

.review-value {
  flex: 1;
  font-weight: 600;
  word-break: break-word;
}

.review-edit-btn {
  background: none;
  border: none;
  color: var(--brand-strong);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
  flex-shrink: 0;
}

.review-edit-btn:hover {
  color: var(--brand);
}

.review-confirm-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  color: #fff;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(17, 161, 115, 0.22);
  transition: transform 0.15s, box-shadow 0.15s;
}

.review-confirm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(17, 161, 115, 0.28);
}

.review-confirm-btn:active {
  transform: translateY(0);
}

@keyframes bubble-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

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

@keyframes frame-rise {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shine {
  0% {
    background-position: 0% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -16px, 0);
  }
}

@keyframes typing-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.42;
  }

  40% {
    transform: translateY(-3px);
    opacity: 0.95;
  }
}

@media (min-width: 960px) {
  .page {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 28px;
  }
}

@media (max-width: 959px) {
  .page {
    padding: 20px 0 24px;
    align-items: start;
  }

  .phone-shell {
    order: -1;
    position: sticky;
    top: 6px;
    z-index: 8;
  }

  .hero {
    order: 2;
    min-height: auto;
    padding: 22px;
    border-radius: 28px;
  }

  .hero-copy {
    text-align: center;
    margin: 0 auto;
  }

  .hero-points {
    justify-content: center;
  }

  .phone-frame {
    width: min(100%, 470px);
    height: min(860px, calc(100dvh - 42px));
    min-height: 620px;
  }
}

@media (min-width: 521px) and (max-width: 959px) {
  h1 {
    font-size: clamp(1.95rem, 6vw, 3.2rem);
  }
}

@media (max-width: 520px) {
  .page {
    width: min(100%, calc(100% - 14px));
    gap: 14px;
    padding: 8px 0 12px;
  }

  .hero {
    min-height: auto;
    padding: 16px;
    border-radius: 22px;
  }

  .eyebrow {
    font-size: 0.72rem;
    padding: 7px 11px;
  }

  h1 {
    margin-top: 11px;
    font-size: clamp(1.42rem, 7.8vw, 1.95rem);
    line-height: 1.05;
  }

  .hero p {
    font-size: 0.91rem;
    line-height: 1.4;
  }

  .hero-points {
    display: none;
  }

  .phone-frame {
    width: 100%;
    height: calc(100dvh - 10px);
    min-height: 560px;
    max-height: none;
    border-radius: 22px;
  }

  .chat-header {
    padding: 13px 14px 11px;
  }

  .progress-panel {
    padding: 10px 12px 11px;
  }

  .chat-body {
    padding: 12px 10px 16px;
  }

  .chat-input {
    padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
  }

  .input-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .submit-button {
    min-height: 50px;
  }

  .suggestions {
    left: 10px;
    right: 10px;
    bottom: calc(100% + 6px);
    max-height: min(36dvh, 210px);
  }

  .option-list {
    max-height: min(25dvh, 170px);
  }

  .option-chip,
  .suggestion-chip {
    font-size: 0.91rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
