:root {
  --navy: #0f2540;
  --navy-2: #1b3e63;
  --green: #3fa13b;
  --green-soft: #e8f5e7;
  --orange: #e08a2e;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #14233a;
  --muted: #5b6b80;
  --line: #dde5ee;
  --danger: #c0392b;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
}

body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  background: var(--navy);
}

.topbar-in {
  max-width: 880px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  height: 38px;
  width: auto;
  display: block;
}

.ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 7px 14px;
  font: 500 13px Inter, sans-serif;
  cursor: pointer;
}

.ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 8px;
}

.intro h1 {
  font: 800 28px/1.15 Nunito, sans-serif;
  color: var(--navy);
  margin: 0 0 6px;
}

.intro p {
  margin: 0 0 18px;
  color: var(--muted);
  max-width: 60ch;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.burbuja {
  max-width: 88%;
  padding: 11px 15px;
  border-radius: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.burbuja.user {
  align-self: flex-end;
  background: var(--navy-2);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.burbuja.bot {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.burbuja.error {
  align-self: flex-start;
  background: #fdecea;
  border: 1px solid #f5c6c0;
  color: var(--danger);
}

.burbuja.pensando {
  color: var(--muted);
  font-style: italic;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--navy-2);
  border-radius: 999px;
  padding: 8px 14px;
  font: 500 13.5px Inter, sans-serif;
  cursor: pointer;
  text-align: left;
}

.chip:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.composer {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 18px;
  box-shadow: 0 4px 18px rgba(15, 37, 64, 0.08);
}

.composer input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 400 15.5px Inter, sans-serif;
  color: var(--text);
  padding: 8px 4px;
}

.hero-voz {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin: 10px 0 26px;
}

.orbe {
  --d: 150px;
  position: relative;
  width: var(--d);
  height: var(--d);
  display: grid;
  place-items: center;
  margin: 36px 0 12px;
}

.mic {
  position: relative;
  z-index: 2;
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  color: #fff;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 25%, #74d66f, var(--green) 55%, #2a7d27);
  box-shadow: 0 12px 32px rgba(63, 161, 59, 0.45), inset 0 -8px 16px rgba(0, 0, 0, 0.18);
  animation: respira 3.2s ease-in-out infinite;
  transition: background 0.3s, box-shadow 0.3s, transform 0.3s;
}

.mic:hover {
  filter: brightness(1.07);
}

.mic:focus-visible {
  outline: 3px solid var(--navy-2);
  outline-offset: 5px;
}

.mic:disabled {
  cursor: progress;
}

.mic[hidden] {
  display: none;
}

.ico-mic {
  width: 58px;
  height: 58px;
}

.barras {
  display: none;
  align-items: center;
  gap: 6px;
  height: 56px;
}

.barras i {
  display: block;
  width: 8px;
  height: 14px;
  border-radius: 5px;
  background: #fff;
  animation: barra 1s ease-in-out infinite;
}

.barras i:nth-child(2) {
  animation-delay: 0.12s;
}
.barras i:nth-child(3) {
  animation-delay: 0.24s;
}
.barras i:nth-child(4) {
  animation-delay: 0.36s;
}
.barras i:nth-child(5) {
  animation-delay: 0.48s;
}

.onda {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  border: 2px solid var(--green);
  opacity: 0;
  animation: onda 3.6s ease-out infinite;
  pointer-events: none;
}

.onda:nth-child(2) {
  animation-delay: 1.2s;
}
.onda:nth-child(3) {
  animation-delay: 2.4s;
}

.etiqueta {
  margin: 0;
  min-height: 24px;
  font: 600 15px Inter, sans-serif;
  color: var(--navy-2);
  text-align: center;
}

.orbe[data-estado='escuchando'] .mic {
  background: radial-gradient(circle at 30% 25%, #ff8f80, var(--danger) 60%, #8e271c);
  box-shadow: 0 12px 36px rgba(192, 57, 43, 0.5), inset 0 -8px 16px rgba(0, 0, 0, 0.2);
  animation: none;
  transform: scale(1.06);
}
.orbe[data-estado='escuchando'] .onda {
  border-color: var(--danger);
  animation-duration: 1.6s;
}
.orbe[data-estado='escuchando'] .onda:nth-child(2) {
  animation-delay: 0.53s;
}
.orbe[data-estado='escuchando'] .onda:nth-child(3) {
  animation-delay: 1.06s;
}
.orbe[data-estado='escuchando'] .ico-mic,
.orbe[data-estado='hablando'] .ico-mic {
  display: none;
}
.orbe[data-estado='escuchando'] .barras,
.orbe[data-estado='hablando'] .barras {
  display: flex;
}

.orbe[data-estado='pensando'] .mic {
  background: radial-gradient(circle at 30% 25%, #4a79ad, var(--navy-2) 60%, var(--navy));
  box-shadow: 0 12px 32px rgba(27, 62, 99, 0.45), inset 0 -8px 16px rgba(0, 0, 0, 0.2);
  animation: respira 1.4s ease-in-out infinite;
}
.orbe[data-estado='pensando'] .onda {
  display: none;
}
.orbe[data-estado='pensando']::after {
  content: '';
  position: absolute;
  inset: -12px;
  z-index: 3;
  border-radius: 50%;
  border: 5px solid transparent;
  border-top-color: var(--green);
  border-right-color: var(--green);
  animation: gira 0.9s linear infinite;
  pointer-events: none;
}

.orbe[data-estado='hablando'] .mic {
  background: radial-gradient(circle at 30% 25%, #4a79ad, var(--navy-2) 60%, var(--navy));
  box-shadow: 0 12px 32px rgba(27, 62, 99, 0.5), inset 0 -8px 16px rgba(0, 0, 0, 0.2);
  animation: none;
}
.orbe[data-estado='hablando'] .onda {
  border-color: var(--navy-2);
  animation-duration: 2s;
}
.orbe[data-estado='hablando'] .onda:nth-child(2) {
  animation-delay: 0.66s;
}
.orbe[data-estado='hablando'] .onda:nth-child(3) {
  animation-delay: 1.32s;
}
.orbe[data-estado='hablando'] .barras i {
  animation-duration: 0.7s;
}

@keyframes respira {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes onda {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

@keyframes barra {
  0%,
  100% {
    height: 12px;
  }
  50% {
    height: 48px;
  }
}

@keyframes gira {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mic,
  .onda,
  .barras i,
  .orbe::after {
    animation: none !important;
  }
  .onda {
    display: none;
  }
}

.send {
  flex: none;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font: 600 14px Inter, sans-serif;
  padding: 12px 20px;
  cursor: pointer;
}

.send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.estado {
  min-height: 22px;
  margin: 8px 6px 0;
  font-size: 13px;
  color: var(--muted);
}

.resultados {
  margin-top: 18px;
}

.resultados h2 {
  font: 800 20px Nunito, sans-serif;
  color: var(--navy);
  margin: 0 0 12px;
}

.lista {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.tarjeta {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.foto {
  height: 150px;
  background: linear-gradient(135deg, var(--navy-2), var(--navy));
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
  font: 700 14px Nunito, sans-serif;
  position: relative;
}

.foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.num {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--navy);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 13px Inter, sans-serif;
}

.cuerpo {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.cuerpo h3 {
  margin: 0;
  font: 700 16px/1.25 Nunito, sans-serif;
  color: var(--navy);
}

.sub {
  color: var(--muted);
  font-size: 13px;
}

.precio {
  font: 800 20px Nunito, sans-serif;
  color: var(--navy);
}

.datos {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.datos b {
  color: var(--text);
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font: 600 11.5px Inter, sans-serif;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eef2f7;
  color: var(--navy-2);
}

.tag.ok {
  background: var(--green-soft);
  color: #25761f;
}

.tag.warn {
  background: #fdf0e0;
  color: #a3600f;
}

.mapa {
  margin-top: auto;
  font: 600 13px Inter, sans-serif;
  color: var(--navy-2);
  text-decoration: none;
}

.mapa:hover {
  text-decoration: underline;
}

.ampliar {
  margin-top: 6px;
}

.pie {
  max-width: 880px;
  margin: 28px auto 0;
  padding: 18px 16px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

.pie p {
  margin: 0 0 6px;
}

.pie a {
  color: var(--navy-2);
  font-weight: 600;
}

@media (max-width: 520px) {
  .orbe {
    --d: 128px;
  }
  .intro h1 {
    font-size: 24px;
  }
  .send {
    padding: 12px 14px;
  }
}
