:root {
  --gcg-chat-bottom: 24px;
  --gcg-chat-right: 24px;
  --gcg-chat-window-bottom: 112px;
  --gcg-chat-border: rgba(10, 95, 199, 0.2);
}

#gcg-chat-btn {
  position: fixed;
  right: var(--gcg-chat-right);
  bottom: var(--gcg-chat-bottom);
  z-index: 3000;

  width: 330px;
  max-width: calc(100vw - 32px);
  min-height: 86px;

  display: flex;
  align-items: center;
  gap: 14px;

  padding: 12px 18px;
  border: 1px solid var(--gcg-chat-border);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 90px rgba(6, 31, 73, 0.22);

  cursor: pointer;
  transition: var(--gcg-transition);
}

#gcg-chat-btn:hover {
  transform: translateY(-4px);
}

.gcg-chat-btn-icon-wrap {
  width: 62px;
  height: 62px;
  min-width: 62px;

  display: grid;
  place-items: center;

  border-radius: 50%;
  border: 1px solid rgba(11, 95, 199, 0.18);
  background: linear-gradient(135deg, rgba(0, 168, 216, 0.16), rgba(11, 95, 199, 0.12));
}

.gcg-chat-btn-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
}

.gcg-chat-btn-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.gcg-chat-btn-text strong {
  color: var(--gcg-navy);
  font-size: 1rem;
  font-weight: 900;
}

.gcg-chat-btn-text small {
  color: var(--gcg-blue);
  font-size: 0.78rem;
  font-weight: 800;
}

#gcg-chat-window {
  position: fixed;
  right: 24px;
  bottom: var(--gcg-chat-window-bottom);
  z-index: 3300;

  width: 390px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 145px);

  display: none;
  flex-direction: column;
  overflow: hidden;

  border-radius: 28px;
  border: 1px solid var(--gcg-chat-border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 40px 110px rgba(6, 31, 73, 0.32);
}

#gcg-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 16px;
  color: white;
  background: linear-gradient(135deg, var(--gcg-navy), var(--gcg-blue));
}

.gcg-avatar {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 50%;
  background: white;
}

.gcg-chat-title {
  display: flex;
  flex-direction: column;
}

.gcg-chat-title strong {
  font-size: 0.94rem;
}

.gcg-chat-title small {
  font-size: 0.72rem;
  opacity: 0.86;
}

#gcg-chat-close {
  margin-left: auto;

  width: 34px;
  height: 34px;

  border: none;
  border-radius: 50%;

  color: white;
  background: rgba(255, 255, 255, 0.16);
  font-size: 1.2rem;
}

#gcg-chat-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;

  background:
    linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.96)),
    url("/assets/bg/gcg-bg.webp");

  background-size: cover;
  background-position: center;
}

.gcg-msg-user,
.gcg-msg-bot {
  max-width: 86%;
  margin: 8px 0;
  padding: 11px 13px;

  clear: both;
  border-radius: 16px;

  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}

.gcg-msg-user {
  float: right;
  color: white;
  background: linear-gradient(135deg, var(--gcg-blue), var(--gcg-cyan));
}

.gcg-msg-bot {
  float: left;
  color: #173553;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(10, 95, 199, 0.14);
}

.gcg-msg-bot a {
  color: var(--gcg-blue);
  font-weight: 900;
}

.gcg-typing {
  opacity: 0.75;
  font-style: italic;
}

#gcg-chat-input-area {
  display: flex;
  gap: 8px;

  padding: 12px;
  border-top: 1px solid rgba(10, 95, 199, 0.15);
  background: rgba(255, 255, 255, 0.94);
}

#gcg-chat-input {
  flex: 1;

  border: 1px solid rgba(10, 95, 199, 0.18);
  border-radius: 14px;
  padding: 12px;

  outline: none;
  color: var(--gcg-navy);
  background: rgba(255, 255, 255, 0.94);
  font-size: 0.9rem;
}

#gcg-chat-input:focus {
  border-color: rgba(0, 168, 216, 0.65);
  box-shadow: 0 0 0 4px rgba(0, 168, 216, 0.1);
}

#gcg-chat-mic,
#gcg-chat-send {
  border: none;
  border-radius: 14px;
  font-weight: 900;
  transition: var(--gcg-transition);
}

#gcg-chat-mic {
  width: 46px;
  color: var(--gcg-navy);
  background: rgba(11, 95, 199, 0.08);
  border: 1px solid rgba(10, 95, 199, 0.14);
}

#gcg-chat-mic.listening {
  color: white;
  background: linear-gradient(135deg, var(--gcg-orange), var(--gcg-blue));
}

#gcg-chat-send {
  padding: 0 16px;
  color: white;
  background: linear-gradient(135deg, var(--gcg-navy), var(--gcg-blue));
}

#gcg-privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 20px;
  background: rgba(3, 12, 28, 0.68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.gcg-privacy-box {
  width: min(520px, 94vw);
  padding: 26px;

  border-radius: 26px;
  border: 1px solid rgba(10, 95, 199, 0.16);

  color: #173553;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 40px 100px rgba(6, 31, 73, 0.28);
}

.gcg-privacy-box h3 {
  margin-bottom: 12px;
  color: var(--gcg-navy);
}

.gcg-privacy-box p {
  margin-bottom: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.gcg-privacy-box button {
  width: 100%;
  margin-top: 8px;
  padding: 13px 16px;

  border: none;
  border-radius: 14px;

  color: white;
  background: linear-gradient(135deg, var(--gcg-navy), var(--gcg-blue));
  font-weight: 900;
}

/* Chat mobile */
@media (max-width: 1024px) {
  #gcg-chat-btn {
    display: none;
  }

  #gcg-chat-window {
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(86px + env(safe-area-inset-bottom));
    width: auto;
    height: 66vh;
    max-height: 72vh;
    border-radius: 26px;
  }
}

@media (max-width: 480px) {
  #gcg-chat-window {
    height: 68vh;
  }

  #gcg-chat-send {
    padding: 0 12px;
  }
}
