/* ==========================================
   ASSISTENTE VIRTUAL — RICARDO ROMIN
========================================== */

.rr-assistant {
  --av-navy: #07111c;
  --av-beige: #f5f1e8;
  --av-gold: #9a7a47;
  --av-gold-light: #c6a66b;

  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 12000;

  font-family: var(--font-ui, Inter, sans-serif);
}

.rr-assistant * {
  box-sizing: border-box;
}

/* BOTÃO */

.rr-assistant__launcher {
  position: relative;

  width: 58px;
  height: 58px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(245, 241, 232, 0.35);
  border-radius: 50%;

  background: #9A7A47;
  color: #F5F1E8;

  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.28);

  cursor: pointer;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.rr-assistant__launcher:hover {
  transform: translateY(-2px);
  border-color: #C6A66B;
  background: #C6A66B;
}

.rr-assistant__launcher-mark {
  font-family: var(--font-title, Cinzel, serif);
  font-size: 23px;
  color: #F5F1E8;
}

.rr-assistant__launcher-dot {
  position: absolute;
  right: 4px;
  bottom: 4px;

  width: 11px;
  height: 11px;

  border: 2px solid var(--av-navy);
  border-radius: 50%;

  background: #7fa57f;
}

/* PAINEL */

.rr-assistant__panel {
  position: absolute;
  right: 0;
  bottom: 72px;

  width: min(390px, calc(100vw - 28px));
  height: min(640px, calc(100svh - 120px));

  display: flex;
  flex-direction: column;

  overflow: hidden;

  border: 1px solid rgba(198, 166, 107, 0.34);
  border-radius: 16px;

  background:
    linear-gradient(
      180deg,
      rgba(13, 29, 46, 0.99),
      rgba(7, 17, 28, 0.995)
    );

  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.36);

  opacity: 0;
  visibility: hidden;

  transform: translateY(10px) scale(0.985);
  transform-origin: bottom right;

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease,
    transform 0.2s ease;
}

.rr-assistant.is-open .rr-assistant__panel {
  opacity: 1;
  visibility: visible;

  transform: translateY(0) scale(1);
}

/* CABEÇALHO */

.rr-assistant__header {
  min-height: 72px;

  padding: 15px 16px 14px 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid rgba(198, 166, 107, 0.15);
}

.rr-assistant__title {
  margin: 0;

  font-family: var(--font-title, Cinzel, serif);
  font-size: 16px;
  font-weight: 500;

  color: var(--av-beige);
}

.rr-assistant__subtitle {
  margin: 4px 0 0;

  font-size: 11px;
  letter-spacing: 0.05em;

  color: rgba(245, 241, 232, 0.5);
}

.rr-assistant__close {
  width: 36px;
  height: 36px;

  border: 1px solid rgba(198, 166, 107, 0.2);
  border-radius: 50%;

  background: transparent;
  color: rgba(245, 241, 232, 0.75);

  font-size: 20px;

  cursor: pointer;
}

/* MENSAGENS */

.rr-assistant__messages {
  flex: 1;
  min-height: 0;

  overflow-y: auto;

  padding: 18px 16px;

  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rr-assistant__message {
  max-width: 88%;

  padding: 11px 13px;

  border-radius: 12px;

  font-family: var(--font-body, "Cormorant Garamond", serif);
  font-size: 17px;
  line-height: 1.42;

  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.rr-assistant__message--assistant {
  align-self: flex-start;

  border: 1px solid rgba(198, 166, 107, 0.14);
  border-bottom-left-radius: 4px;

  background: rgba(245, 241, 232, 0.065);

  color: rgba(245, 241, 232, 0.94);
}

.rr-assistant__message--user {
  align-self: flex-end;

  border-bottom-right-radius: 4px;

  background: rgba(154, 122, 71, 0.3);

  color: var(--av-beige);
}

/* DIGITANDO */

.rr-assistant__typing {
  display: flex;
  gap: 5px;

  width: auto;
}

.rr-assistant__typing span {
  width: 5px;
  height: 5px;

  border-radius: 50%;

  background: var(--av-gold-light);

  animation: rrTyping 1.1s infinite ease-in-out;
}

.rr-assistant__typing span:nth-child(2) {
  animation-delay: 0.14s;
}

.rr-assistant__typing span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes rrTyping {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* BOTÕES RÁPIDOS */

.rr-assistant__quick-actions {
  display: flex;
  flex-wrap: wrap;

  gap: 7px;
}

.rr-assistant__quick-action {
  padding: 7px 10px;

  border: 1px solid rgba(198, 166, 107, 0.25);
  border-radius: 999px;

  background: transparent;

  color: rgba(245, 241, 232, 0.76);

  font-family: var(--font-ui, Inter, sans-serif);
  font-size: 10.5px;

  cursor: pointer;
}

.rr-assistant__quick-action:hover {
  color: var(--av-gold-light);
  border-color: rgba(198, 166, 107, 0.6);
}

/* FORM DE LEAD */

.rr-assistant__lead-card {
  padding: 15px;

  border: 1px solid rgba(198, 166, 107, 0.25);
  border-radius: 12px;

  background: rgba(245, 241, 232, 0.05);
}

.rr-assistant__lead-title {
  margin: 0 0 7px;

  font-family: var(--font-title, Cinzel, serif);
  font-size: 15px;

  color: var(--av-gold-light);
}

.rr-assistant__lead-copy {
  margin: 0 0 14px;

  font-family: var(--font-body, "Cormorant Garamond", serif);
  font-size: 16px;
  line-height: 1.4;

  color: rgba(245, 241, 232, 0.85);
}

.rr-assistant__field {
  margin-top: 9px;
}

.rr-assistant__field label {
  display: block;

  margin-bottom: 5px;

  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;

  color: rgba(245, 241, 232, 0.58);
}

.rr-assistant__field input {
  width: 100%;
  min-height: 42px;

  padding: 9px 11px;

  border: 1px solid rgba(198, 166, 107, 0.24);
  border-radius: 8px;

  outline: none;

  background: rgba(3, 9, 15, 0.5);

  color: var(--av-beige);

  font-family: var(--font-ui, Inter, sans-serif);
  font-size: 13px;
}

.rr-assistant__field input:focus {
  border-color: var(--av-gold-light);
}

.rr-assistant__consent {
  margin-top: 12px;

  display: grid;
  grid-template-columns: 18px 1fr;

  gap: 8px;

  font-size: 10.5px;
  line-height: 1.4;

  color: rgba(245, 241, 232, 0.53);
}

.rr-assistant__consent a {
  color: var(--av-gold-light);
}

.rr-assistant__lead-submit {
  width: 100%;
  min-height: 42px;

  margin-top: 14px;

  border: 1px solid var(--av-gold);
  border-radius: 8px;

  background: var(--av-gold);

  color: #07111c;

  font-family: var(--font-ui, Inter, sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;

  cursor: pointer;
}

/* COMPOSITOR */

.rr-assistant__composer {
  padding: 12px;

  border-top: 1px solid rgba(198, 166, 107, 0.14);

  background: rgba(3, 9, 15, 0.22);
}

.rr-assistant__form {
  display: grid;
  grid-template-columns: 1fr 42px;

  gap: 8px;

  align-items: end;
}

.rr-assistant__input {
  width: 100%;

  min-height: 44px;
  max-height: 112px;

  resize: none;

  padding: 11px 12px;

  border: 1px solid rgba(198, 166, 107, 0.2);
  border-radius: 10px;

  outline: none;

  background: rgba(245, 241, 232, 0.055);

  color: var(--av-beige);

  font-family: var(--font-body, "Cormorant Garamond", serif);
  font-size: 16px;
}

.rr-assistant__input::placeholder {
  color: rgba(245, 241, 232, 0.35);
}

.rr-assistant__input:focus {
  border-color: rgba(198, 166, 107, 0.65);
}

.rr-assistant__send {
  width: 42px;
  height: 42px;

  border: 1px solid var(--av-gold);
  border-radius: 10px;

  background: var(--av-gold);

  color: #07111c;

  font-size: 18px;

  cursor: pointer;
}

.rr-assistant__microcopy {
  margin: 8px 3px 0;

  font-size: 9.5px;
  line-height: 1.35;

  color: rgba(245, 241, 232, 0.34);
}

.rr-assistant__microcopy a {
  color: rgba(198, 166, 107, 0.78);
}

.rr-assistant__error {
  padding: 9px 11px;

  border: 1px solid rgba(210, 120, 120, 0.25);
  border-radius: 8px;

  background: rgba(120, 30, 30, 0.14);

  font-size: 11px;

  color: var(--av-beige);
}

/* MOBILE */

@media (max-width: 760px) {
  .rr-assistant {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .rr-assistant__panel {
    position: fixed;

    left: 10px;
    right: 10px;

    bottom: calc(80px + env(safe-area-inset-bottom, 0px));

    width: auto;
    height: min(72svh, 660px);

    transform-origin: bottom center;
  }
}