.goals {
  padding-block: var(--section);
  border-top: 1px solid var(--edge);
  background: var(--ivory);
}

.goals-layout {
  display: grid;
  width: min(100% - 2 * var(--gutter), 720px);
  gap: 28px;
}

.goals-intro { text-align: center; }
.goals-intro .eyebrow { justify-content: center; }
.goals-intro h2 { max-width: 18ch; margin-inline: auto; }

.goals-chat {
  min-width: 0;
  --chat-wall: #0b151a;
  --chat-bar: #1e2c33;
  --chat-incoming: #24343c;
  --chat-outgoing: #064d42;
  --chat-accent: #75d5a6;
  --chat-text: #eef6f4;
  --chat-height: min(66svh, 660px);
  overflow: hidden;
  border: 1px solid #263a3e;
  border-radius: 14px;
  color: var(--chat-text);
  background: var(--chat-wall) url("assets/conversa-fundo.svg") repeat;
  box-shadow: 0 16px 45px #0b233115;
}

.goals-chat-bar:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 67px;
  padding: 9px clamp(12px, 3vw, 23px);
  background: var(--chat-bar);
  border-bottom: 1px solid #31464e;
  scroll-margin-top: 12px;
}

.goals-avatar {
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  height: 42px;
  border-radius: 50%;
  background: var(--paper);
}
.goals-avatar img { width: 35px; height: auto; }

.goals-contact { min-width: 0; flex: 1 1 auto; }
.goals-contact h3 { font-size: .97rem; line-height: 1.25; }
.goals-status { margin-top: 3px; color: #b3c6c8; font-size: .76rem; }
.goals-chat-bar:has(+ .goals-composer[hidden]) .goals-status { color: var(--chat-accent); }

.goals-answer { padding: clamp(14px, 3vw, 24px); }
.goals-chat-prompt { font-size: .96rem; font-weight: 700; }
.goals-hint { margin-top: 3px; color: #d2dfdf; font-size: .86rem; line-height: 1.45; }

.goals-composer:not([hidden]) {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-block-size: var(--chat-height);
  padding: clamp(14px, 3vw, 24px);
}

.goals-message.goals-poll {
  width: min(100%, 460px);
  max-width: 100%;
  padding: 14px 15px 5px;
}

.goals-options {
  display: grid;
  min-inline-size: 0;
  margin: 10px 0 0;
  padding: 0;
  border: 0;
}

.goals-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  padding: 7px 4px;
  border-top: 1px solid #3b5056;
  border-radius: 3px;
  cursor: pointer;
}

.goals-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.goals-option-label { font-size: .9rem; line-height: 1.35; }

.goals-option--featured {
  margin-bottom: 5px;
  padding: 10px 8px;
  border: 1px solid #548875;
  border-radius: 7px;
  background: #174237;
}
.goals-option--featured + .goals-option { border-top: 0; }
.goals-option--featured .goals-option-label { font-weight: 720; }
.goals-option--featured .goals-option-check { border-color: var(--chat-accent); }

.goals-option-check {
  display: grid;
  order: -1;
  flex: 0 0 22px;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid #95adaf;
  border-radius: 50%;
  color: var(--chat-wall);
}
.goals-option-check svg { width: 15px; height: 15px; visibility: hidden; }
.goals-option:has(input:checked) .goals-option-label { color: #b6efce; }
.goals-option input:checked ~ .goals-option-check { background: var(--chat-accent); border-color: var(--chat-accent); }
.goals-option input:checked ~ .goals-option-check svg { visibility: visible; }
.goals-option:has(input:focus-visible) { outline: 2px solid var(--chat-accent); outline-offset: -2px; }
.goals-chat :focus-visible { outline-color: var(--chat-accent); }

.goals-send-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
}
.goals-count { color: #c3d3d4; font-size: .79rem; }

.goals-send, .goals-booking, .goals-edit:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 22px;
  color: var(--chat-wall);
  background: var(--chat-accent);
  font: 720 .86rem/1.2 Inter, sans-serif;
  cursor: pointer;
}
.goals-send:disabled {
  color: #c3d3d4;
  background: transparent;
  border-color: #68838a;
  cursor: default;
}
.goals-edit:not([hidden]) {
  padding-inline: 10px;
  color: var(--chat-text);
  background: transparent;
  border-color: #537078;
  font-size: .75rem;
}

.goals-answer {
  block-size: var(--chat-height);
  overflow-y: auto;
  overflow-anchor: none;
  scrollbar-color: #58736f var(--chat-wall);
  scrollbar-width: thin;
}
.goals-answer:focus-visible { outline-offset: -3px; }
.goals-dialogue { display: grid; gap: 12px; }
.goals-dialogue:not(:empty) { margin-top: 15px; }

.goals-message {
  position: relative;
  width: fit-content;
  max-width: 90%;
  border-radius: 2px 10px 10px 10px;
  background: var(--chat-incoming);
  animation: goals-message-in .22s ease-out both;
}
.goals-message::before {
  position: absolute;
  top: 0;
  left: -6px;
  width: 9px;
  height: 9px;
  background: inherit;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
  content: "";
}
.goals-message--choice {
  display: flex;
  align-items: end;
  gap: 9px;
  margin-left: auto;
  padding: 9px 10px 9px 12px;
  border-radius: 10px 2px 10px 10px;
  background: var(--chat-outgoing);
  font-size: .88rem;
  line-height: 1.5;
}
.goals-message--choice::before { right: -6px; left: auto; transform: scaleX(-1); }
.goals-message--choice svg { width: 16px; height: 16px; color: #8fd5ff; }

.goals-message--reply {
  display: grid;
  gap: 6px;
  width: min(90%, 440px);
  padding: 5px;
}
.goals-message--album { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.goals-scene { min-width: 0; }
.goals-scene img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 29%; border-radius: 6px; }
.goals-scene figcaption { margin: 0; padding: 8px 5px 5px; color: var(--chat-text); font-size: .87rem; line-height: 1.48; }
.goals-message--featured { width: min(100%, 570px); max-width: 100%; }
.goals-message--featured .goals-scene img {
  aspect-ratio: 3 / 2;
  object-position: center;
}

.goals-typing:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 13px;
  padding: 12px 14px;
}
.goals-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chat-accent);
  animation: goals-typing-dot 1s ease-in-out infinite;
}
.goals-typing span:nth-child(2) { animation-delay: .14s; }
.goals-typing span:nth-child(3) { animation-delay: .28s; }

.goals-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px clamp(12px, 3vw, 23px);
  border-top: 1px solid #31464e;
  background: var(--chat-bar);
}
.goals-invitation { color: #d7e5e3; font-size: .82rem; line-height: 1.45; }
.goals-booking { flex: none; }
.goals-send svg, .goals-booking svg { width: 16px; height: 16px; }

@media (hover: hover) and (pointer: fine) {
  .goals-option:hover { background: #ffffff0c; }
  .goals-option--featured:hover { background: #205345; }
  .goals-send:enabled:hover, .goals-edit:not([hidden]):hover, .goals-booking:hover { background: var(--ivory); color: var(--ink-deep); }
}

@keyframes goals-message-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes goals-typing-dot {
  0%, 60%, 100% { opacity: .45; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 560px) {
  .goals-chat { --chat-height: 62svh; }
  .goals-message { max-width: 95%; }
  .goals-message--reply:not(.goals-message--featured) { width: min(95%, 440px); }
  .goals-message--featured { max-width: 100%; }
  .goals-message--album .goals-scene img { aspect-ratio: 1; }
  .goals-next { flex-wrap: wrap; }
  .goals-invitation { flex: 1 1 140px; }
}

@media (prefers-reduced-motion: reduce) {
  .goals-message, .goals-typing span { animation: none; }
}
