/* ---------- Núcleo IA (agente ambiental, no es un chat clásico) ---------- */
.agent {
  position: fixed;
  right: clamp(16px, 4vw, 28px);
  bottom: clamp(16px, 4vw, 28px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.agent-hint {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(10, 14, 21, 0.85);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--ink);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  pointer-events: none;
  white-space: nowrap;
}

.agent-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.agent-orb {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.agent-orb-ring {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent-blue), var(--accent-cyan), var(--accent-green), var(--accent-blue));
  opacity: 0.5;
  filter: blur(7px);
  animation: agent-spin 7s linear infinite;
  transition: opacity 0.3s var(--ease);
}

.agent-orb-core {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 62% 38% 55% 45% / 45% 55% 45% 55%;
  background: var(--gradient);
  box-shadow: 0 0 26px rgba(34, 199, 232, 0.4), 0 10px 26px rgba(0, 0, 0, 0.4);
  animation: agent-breathe 3.6s var(--ease) infinite;
  transition: transform 0.3s var(--ease);
}

.agent-orb:hover .agent-orb-core {
  transform: scale(1.05);
}

@keyframes agent-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes agent-breathe {
  0%,
  100% {
    transform: scale(1);
    border-radius: 62% 38% 55% 45% / 45% 55% 45% 55%;
  }
  50% {
    transform: scale(1.07);
    border-radius: 48% 52% 40% 60% / 55% 45% 58% 42%;
  }
}

.agent.is-busy .agent-orb-ring {
  animation-duration: 1.4s;
  opacity: 0.85;
}

.agent.is-busy .agent-orb-core {
  animation-duration: 0.9s;
}

.agent-panel {
  width: min(360px, calc(100vw - 40px));
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(10, 14, 21, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}

.agent-panel[hidden] {
  display: none;
}

.agent-reply {
  min-height: 44px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.agent-reply.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.agent-form {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.agent-form input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}

.agent-form input::placeholder {
  color: var(--muted-2);
}

.agent-form button {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 62% 38% 55% 45% / 45% 55% 45% 55%;
  background: var(--gradient);
  color: #05070a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.agent-form button svg {
  width: 13px;
  height: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .agent-orb-ring,
  .agent-orb-core {
    animation: none;
  }
}
