/* Chat live widget — ton site (brand blue + navy) */

.aa-chat-launcher {
  --aa-chat-gap: 1rem;
  position: fixed;
  right: max(var(--aa-chat-gap), env(safe-area-inset-right, 0px));
  bottom: max(var(--aa-chat-gap), env(safe-area-inset-bottom, 0px));
  z-index: 55;
  width: 3.15rem;
  height: 3.15rem;
  border: 0;
  border-radius: 0.9rem;
  background: var(--brand, #2563eb);
  color: #fff;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s var(--ease, ease), background 0.15s ease, opacity 0.15s ease;
}

.aa-chat-launcher:hover {
  background: var(--brand-hover, #1d4ed8);
  transform: translateY(-1px);
}

.aa-chat-launcher:focus-visible {
  outline: 2px solid var(--brand, #2563eb);
  outline-offset: 3px;
}

.aa-chat-launcher.is-on {
  display: inline-flex;
}

.aa-chat-launcher.is-left {
  right: auto;
  left: max(var(--aa-chat-gap), env(safe-area-inset-left, 0px));
}

.aa-chat-launcher.is-raised {
  /* ridicat peste footer / CTA când e nevoie */
}

body.aa-prefs-open .aa-chat-launcher,
body.aa-prefs-open .aa-chat-panel {
  opacity: 0;
  pointer-events: none;
}

.aa-chat-launcher svg {
  width: 1.3rem;
  height: 1.3rem;
}

.aa-chat-panel {
  --aa-chat-gap: 1rem;
  position: fixed;
  right: max(var(--aa-chat-gap), env(safe-area-inset-right, 0px));
  bottom: calc(3.15rem + 1.35rem + env(safe-area-inset-bottom, 0px));
  z-index: 56;
  width: min(22.5rem, calc(100vw - 1.5rem));
  max-height: min(36rem, calc(100vh - 5.5rem));
  display: none;
  flex-direction: column;
  background: var(--paper, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 1rem;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  font-family: var(--sans, "DM Sans", system-ui, sans-serif);
  color: var(--body, #1e293b);
}

.aa-chat-panel.is-left {
  right: auto;
  left: max(var(--aa-chat-gap), env(safe-area-inset-left, 0px));
}

.aa-chat-panel.is-open {
  display: flex;
  animation: aa-chat-in 0.22s var(--ease, ease-out);
}

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

.aa-chat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, #0f2740 0%, var(--navy, #0a1929) 100%);
  color: #fff;
}

.aa-chat-panel__head h2 {
  margin: 0;
  font-family: var(--display, Manrope, "DM Sans", sans-serif);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.aa-chat-panel__head p {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  opacity: 0.72;
}

.aa-chat-panel__x {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.aa-chat-panel__x:hover {
  background: rgba(255, 255, 255, 0.16);
  opacity: 1;
}

.aa-chat-panel__body {
  flex: 1 1 auto;
  min-height: 6rem;
  overflow-y: auto;
  padding: 0.9rem 1rem;
  background:
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(37, 99, 235, 0.08), transparent 55%),
    var(--page, #f8fafc);
}

.aa-chat-msg {
  display: flex;
  margin-bottom: 0.55rem;
}

.aa-chat-msg--visitor {
  justify-content: flex-end;
}

.aa-chat-msg--staff {
  justify-content: flex-start;
}

.aa-chat-msg__bubble {
  max-width: 85%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.85rem;
  font-size: 0.875rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.aa-chat-msg--visitor .aa-chat-msg__bubble {
  background: var(--brand, #2563eb);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.22);
}

.aa-chat-msg--staff .aa-chat-msg__bubble {
  background: #fff;
  border: 1px solid var(--line, #e2e8f0);
  color: var(--ink, #0f172a);
  border-bottom-left-radius: 0.25rem;
}

.aa-chat-panel__form {
  border-top: 1px solid var(--line, #e2e8f0);
  padding: 0.75rem;
  background: #fff;
  display: grid;
  gap: 0.45rem;
  flex: 0 1 auto;
  max-height: min(55vh, 20rem);
  overflow-y: auto;
  min-height: 0;
}

.aa-chat-panel__form input,
.aa-chat-panel__form textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--ink, #0f172a);
  background: #fff;
}

.aa-chat-panel__form input:focus,
.aa-chat-panel__form textarea:focus {
  outline: 2px solid var(--brand, #2563eb);
  outline-offset: 1px;
  border-color: transparent;
}

.aa-chat-panel__form textarea {
  resize: none;
  min-height: 2.75rem;
}

.aa-chat-form-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 0.25rem;
  z-index: 2;
  display: grid;
  gap: 0.4rem;
}

.aa-chat-panel__form button[type="submit"] {
  width: 100%;
  border: 0;
  border-radius: 0.75rem;
  background: var(--brand, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.aa-chat-panel__form button[type="submit"]:hover {
  background: var(--brand-hover, #1d4ed8);
}

.aa-chat-panel__form button[type="submit"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.aa-chat-end {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #fff;
  color: #475569;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

.aa-chat-end:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.aa-chat-end[hidden] {
  display: none !important;
}

.aa-chat-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
  overflow: hidden;
}

.aa-chat-recaptcha {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 78px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.aa-chat-recaptcha[hidden] {
  display: none !important;
}

.aa-chat-recaptcha.is-ok {
  min-height: 0;
}

.aa-chat-recaptcha > div {
  transform-origin: center top;
}

/* Panou îngust (~360px): scale ușor ca bara normală să încapă */
@media (max-width: 400px) {
  .aa-chat-recaptcha:not(.is-ok) > div {
    transform: scale(0.92);
  }
}

.aa-chat-recaptcha__ok {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 0.65rem;
  padding: 0.5rem 0.65rem;
}

.aa-chat-status {
  font-size: 0.75rem;
  color: var(--mute, #64748b);
  padding: 0 0.85rem 0.35rem;
  margin: 0;
  background: #fff;
}

.aa-chat-ended {
  border-top: 1px solid var(--line, #e2e8f0);
  padding: 0.9rem 0.85rem 1rem;
  background: #fff;
  text-align: center;
}

.aa-chat-ended[hidden] {
  display: none !important;
}

.aa-chat-ended p {
  margin: 0 0 0.65rem;
  font-size: 0.875rem;
  color: var(--mute, #64748b);
}

.aa-chat-ended button {
  border: 0;
  border-radius: 0.75rem;
  background: var(--brand, #2563eb);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.aa-chat-ended button:hover {
  background: var(--brand-hover, #1d4ed8);
}

.aa-chat-fallback {
  padding: 0.65rem 0.85rem 0.85rem;
  border-top: 1px solid var(--line, #e2e8f0);
  background: #f8fafc;
  overflow-y: auto;
  max-height: 14rem;
}

.aa-chat-fallback[hidden] {
  display: none !important;
}

.aa-chat-fallback__card {
  font-size: 0.82rem;
  line-height: 1.45;
}

.aa-chat-fallback__title {
  margin: 0 0 0.25rem;
  font-weight: 700;
  color: var(--ink, #0f172a);
  font-size: 0.9rem;
}

.aa-chat-fallback__meta {
  margin: 0 0 0.45rem;
  color: #64748b;
  font-size: 0.75rem;
}

.aa-chat-fallback__text {
  margin: 0 0 0.65rem;
  color: #334155;
}

.aa-chat-body--offline {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.85rem 1rem;
}

.aa-chat-offline {
  width: 100%;
  text-align: center;
  padding: 0.35rem 0.15rem 0.5rem;
}

.aa-chat-offline__art {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.15rem auto 0.45rem;
}

.aa-chat-offline__emoji {
  font-size: 2.75rem;
  line-height: 1;
}

.aa-chat-offline__title {
  margin: 0.15rem 0 0.35rem;
  font-size: 1rem;
  font-weight: 750;
  color: var(--ink, #0f172a);
  letter-spacing: -0.01em;
}

.aa-chat-offline__lead {
  margin: 0 auto 0.35rem;
  max-width: 16.5rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #475569;
}

.aa-chat-offline__meta {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  color: #94a3b8;
}

.aa-chat-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
}

.aa-chat-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #dbe3ef;
  background: #fff;
  color: #1e293b !important;
  text-decoration: none !important;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.aa-chat-chip:hover {
  border-color: #93c5fd;
  background: #f8fbff;
  transform: translateY(-1px);
}

.aa-chat-offline__wa-note {
  margin: 0 auto 0.55rem;
  max-width: 16rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #64748b;
}

.aa-chat-offline__wa-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.aa-chat-offline__wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: #128c7e;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.8rem;
  font-weight: 700;
}

.aa-chat-offline__wa:hover {
  background: #0f766e;
}

.aa-chat-fallback .aa-chat-chips {
  justify-content: flex-start;
}

.aa-chat-fallback .aa-chat-offline__wa-note {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
  max-width: none;
}

.aa-chat-fallback .aa-chat-offline__wa-list {
  justify-content: flex-start;
}

@media (max-width: 480px) {
  .aa-chat-panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
  }

  .aa-chat-panel.is-left {
    left: 0.5rem;
    right: 0.5rem;
  }

  .aa-chat-launcher {
    --aa-chat-gap: 0.75rem;
  }
}
