/* Widget chat visitor landing — FAQ + WhatsApp fallback */

/**
 * Stack di atas tombol scroll-to-top (eks-scroll-top.css).
 * Offset diselaraskan dengan right/bottom scroll-top per breakpoint.
 */
.eks-landing-body {
  --eks-scroll-top-offset: 1rem;
  --eks-scroll-top-size: 2.75rem;
  --eks-fab-stack-gap: 0.75rem;
  --eks-chat-launcher-size: 3rem;
}

@media (min-width: 640px) {
  .eks-landing-body {
    --eks-scroll-top-offset: 1.5rem;
  }
}

.eks-chat__launcher {
  position: fixed;
  right: 1rem;
  bottom: calc(
    var(--eks-scroll-top-offset) + var(--eks-scroll-top-size) + var(--eks-fab-stack-gap)
  );
  z-index: 1080;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #00d084, #00a86b);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 208, 132, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.eks-chat__launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0, 208, 132, 0.42);
}

.eks-chat__launcher:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.eks-chat__launcher-icon {
  display: inline-flex;
}

.eks-chat {
  position: fixed;
  right: 1rem;
  bottom: calc(
    var(--eks-scroll-top-offset) + var(--eks-scroll-top-size) + var(--eks-fab-stack-gap)
    + var(--eks-chat-launcher-size) + var(--eks-fab-stack-gap)
  );
  z-index: 1085;
  width: min(100vw - 2rem, 22rem);
}

.eks-chat__panel {
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 32rem);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 20, 26, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.eks-chat__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.eks-chat__title {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.eks-chat__subtitle {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
}

.eks-chat__close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.eks-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.eks-chat__bubble {
  max-width: 92%;
  padding: 0.65rem 0.8rem;
  border-radius: 0.85rem;
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.eks-chat__bubble--bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.eks-chat__bubble--user {
  align-self: flex-end;
  background: rgba(0, 208, 132, 0.18);
  color: #eafff6;
  border: 1px solid rgba(0, 208, 132, 0.35);
}

.eks-chat__bubble--meta {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #00d084;
  margin-bottom: 0.25rem;
}

.eks-chat__wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.65rem;
  background: #25d366;
  color: #052e16;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
}

.eks-chat__wa-btn:hover {
  filter: brightness(1.05);
  color: #052e16;
}

.eks-chat__footer {
  padding: 0.65rem 1rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.eks-chat__privacy {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.45);
}

.eks-chat__form {
  margin: 0;
}

.eks-chat__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.eks-chat__input-row {
  display: flex;
  gap: 0.45rem;
}

.eks-chat__input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.84rem;
}

.eks-chat__input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.eks-chat__input:focus {
  outline: none;
  border-color: rgba(0, 208, 132, 0.55);
  box-shadow: 0 0 0 2px rgba(0, 208, 132, 0.2);
}

.eks-chat__send {
  flex-shrink: 0;
  padding: 0.55rem 0.85rem;
  border: none;
  border-radius: 0.65rem;
  background: #00d084;
  color: #0f1115;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.eks-chat__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eks-chat__intro {
  padding: 0.85rem 1rem 1rem;
  overflow-y: auto;
  max-height: min(58vh, 26rem);
}

.eks-chat__intro-lead {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}

.eks-chat__intro-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.eks-chat__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.eks-chat__field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}

.eks-chat__field-input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 0.84rem;
}

.eks-chat__field-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.eks-chat__field-input:focus {
  outline: none;
  border-color: rgba(0, 208, 132, 0.55);
  box-shadow: 0 0 0 2px rgba(0, 208, 132, 0.2);
}

.eks-chat__consent {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.eks-chat__consent input {
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: #00d084;
}

.eks-chat__intro-error {
  margin: 0;
  font-size: 0.78rem;
  color: #ff8f8f;
}

.eks-chat__intro-submit {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 0.65rem;
  background: #00d084;
  color: #0f1115;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}

.eks-chat__intro-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.eks-chat__chat[data-eks-chat-ready="0"] .eks-chat__footer,
.eks-chat__chat[data-eks-chat-ready="0"] .eks-chat__messages {
  pointer-events: none;
  user-select: none;
}

.eks-chat__chat[hidden] {
  display: none !important;
}

.eks-chat__intro[hidden] {
  display: none !important;
}

.eks-chat__chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

@media (min-width: 640px) {
  .eks-chat__launcher {
    right: 1.5rem;
  }

  .eks-chat {
    right: 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .eks-chat__launcher-label {
    display: none;
  }

  .eks-chat {
    right: 1rem;
    left: 1rem;
    width: auto;
  }
}
