/* ETT Support Chatbot — theme-matched floating assistant */

.ett-chatbot {
  --ett-cb-primary: #1e3568;
  --ett-cb-primary-soft: #eef1f7;
  --ett-cb-accent: #e8912d;
  --ett-cb-accent-soft: #faf0e0;
  --ett-cb-fg: #2a3348;
  --ett-cb-muted: #6b7388;
  --ett-cb-card: #ffffff;
  --ett-cb-border: #e4e6ee;
  --ett-cb-radius: 1.15rem;
  --ett-cb-font: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --ett-cb-display: "Sora", ui-sans-serif, system-ui, sans-serif;

  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 99999;
  font-family: var(--ett-cb-font);
  color: var(--ett-cb-fg);
}

.ett-chatbot[hidden] {
  display: none !important;
}

/* Launcher */
.ett-chatbot__launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.35rem;
  height: 3.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--ett-cb-primary);
  color: #f7f8fb;
  cursor: pointer;
  box-shadow:
    0 10px 30px rgba(30, 53, 104, 0.35),
    0 2px 0 rgba(232, 145, 45, 0.85);
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s ease,
    background 0.25s ease;
  animation: ett-cb-enter 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ett-chatbot__launcher:hover,
.ett-chatbot__launcher:focus-visible {
  transform: translateY(-3px) scale(1.02);
  background: color-mix(in srgb, var(--ett-cb-primary) 88%, #000);
  box-shadow:
    0 16px 36px rgba(30, 53, 104, 0.4),
    0 2px 0 var(--ett-cb-accent);
  outline: none;
}

.ett-chatbot.is-open .ett-chatbot__launcher {
  background: var(--ett-cb-accent);
  color: #3d2410;
  box-shadow: 0 10px 28px rgba(232, 145, 45, 0.4);
}

.ett-chatbot__launcher-pulse {
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid color-mix(in srgb, var(--ett-cb-accent) 70%, transparent);
  animation: ett-cb-pulse 2.4s ease-out infinite;
  pointer-events: none;
}

.ett-chatbot.is-open .ett-chatbot__launcher-pulse {
  display: none;
}

.ett-chatbot__launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
}

@media (max-width: 420px) {
  .ett-chatbot__launcher {
    width: 3.1rem;
    height: 3.1rem;
  }
}

/* Nudge bubble */
.ett-chatbot__nudge {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.85rem);
  width: min(17.5rem, calc(100vw - 2.5rem));
  padding: 0.9rem 1rem 1rem;
  background: var(--ett-cb-card);
  border: 1px solid var(--ett-cb-border);
  border-radius: var(--ett-cb-radius);
  box-shadow: 0 18px 40px rgba(42, 51, 72, 0.18);
  animation: ett-cb-nudge-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ett-chatbot__nudge[hidden] {
  display: none !important;
}

.ett-chatbot__nudge::after {
  content: "";
  position: absolute;
  right: 1.6rem;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: var(--ett-cb-card);
  border-right: 1px solid var(--ett-cb-border);
  border-bottom: 1px solid var(--ett-cb-border);
  transform: rotate(45deg);
}

.ett-chatbot__nudge-text {
  margin: 0;
  padding-right: 1.2rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ett-cb-fg);
}

.ett-chatbot__nudge-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  border: 0;
  background: transparent;
  color: var(--ett-cb-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

/* Panel */
.ett-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.85rem);
  display: flex;
  flex-direction: column;
  width: min(22.5rem, calc(100vw - 2rem));
  height: min(32rem, calc(100vh - 6.5rem));
  overflow: hidden;
  background: var(--ett-cb-card);
  border: 1px solid var(--ett-cb-border);
  border-radius: calc(var(--ett-cb-radius) + 0.25rem);
  box-shadow: 0 24px 60px rgba(30, 53, 104, 0.28);
  transform-origin: bottom right;
  animation: ett-cb-panel-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ett-chatbot__panel[hidden] {
  display: none !important;
}

.ett-chatbot__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.9rem;
  background:
    linear-gradient(135deg, var(--ett-cb-primary) 0%, color-mix(in srgb, var(--ett-cb-primary) 75%, #0f1c38) 100%);
  color: #f7f8fb;
}

.ett-chatbot__brand {
  margin: 0;
  font-family: var(--ett-cb-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.ett-chatbot__status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  opacity: 0.92;
}

.ett-chatbot__status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
  animation: ett-cb-dot 1.8s ease-in-out infinite;
}

.ett-chatbot__header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.ett-chatbot__clear {
  appearance: none;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ett-chatbot__clear:hover,
.ett-chatbot__clear:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

.ett-chatbot__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ett-chatbot__close:hover,
.ett-chatbot__close:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

.ett-chatbot__messages {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  background:
    linear-gradient(180deg, var(--ett-cb-primary-soft) 0%, #fff 42%);
  scroll-behavior: smooth;
}

.ett-chatbot__msg {
  display: flex;
  margin: 0 0 0.75rem;
  animation: ett-cb-msg-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ett-chatbot__msg--user {
  justify-content: flex-end;
}

.ett-chatbot__bubble {
  max-width: 88%;
  padding: 0.75rem 0.9rem;
  border-radius: 1rem;
  font-family: var(--ett-cb-font);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.55;
  word-break: break-word;
  white-space: normal;
}

.ett-chatbot__msg--bot .ett-chatbot__bubble {
  background: #fff;
  border: 1px solid var(--ett-cb-border);
  border-bottom-left-radius: 0.35rem;
  color: var(--ett-cb-fg);
  box-shadow: 0 4px 14px rgba(42, 51, 72, 0.06);
}

.ett-chatbot__msg--bot .ett-chatbot__bubble p {
  margin: 0 0 0.55em;
}

.ett-chatbot__msg--bot .ett-chatbot__bubble p:last-child {
  margin-bottom: 0;
}

.ett-chatbot__msg--bot .ett-chatbot__bubble .ett-chatbot__heading {
  margin: 0 0 0.45em;
  font-family: var(--ett-cb-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ett-cb-primary);
}

.ett-chatbot__msg--bot .ett-chatbot__bubble ul {
  margin: 0.35em 0 0.55em;
  padding-left: 1.15rem;
}

.ett-chatbot__msg--bot .ett-chatbot__bubble li {
  margin: 0.2em 0;
}

.ett-chatbot__msg--bot .ett-chatbot__bubble a {
  color: var(--ett-cb-primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.ett-chatbot__msg--bot .ett-chatbot__bubble strong {
  font-weight: 750;
  color: var(--ett-cb-primary);
}

.ett-chatbot__msg--user .ett-chatbot__bubble {
  background: var(--ett-cb-accent);
  color: #3d2410;
  border-bottom-right-radius: 0.35rem;
  font-weight: 600;
  white-space: pre-wrap;
}

.ett-chatbot__msg--typing .ett-chatbot__bubble {
  display: inline-flex;
  gap: 0.28rem;
  align-items: center;
  min-height: 2.4rem;
  padding-inline: 0.95rem;
}

.ett-chatbot__dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--ett-cb-muted);
  animation: ett-cb-typing 1.1s ease-in-out infinite;
}

.ett-chatbot__dot:nth-child(2) {
  animation-delay: 0.15s;
}

.ett-chatbot__dot:nth-child(3) {
  animation-delay: 0.3s;
}

.ett-chatbot__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.15rem 0 0.85rem;
}

.ett-chatbot__chip {
  appearance: none;
  margin: 0;
  padding: 0.4rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--ett-cb-primary) 22%, var(--ett-cb-border));
  border-radius: 999px;
  background: #fff;
  color: var(--ett-cb-primary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.ett-chatbot__chip:hover,
.ett-chatbot__chip:focus-visible {
  background: var(--ett-cb-accent-soft);
  border-color: var(--ett-cb-accent);
  outline: none;
  transform: translateY(-1px);
}

.ett-chatbot__form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--ett-cb-border);
  background: #fff;
}

.ett-chatbot__input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--ett-cb-border);
  border-radius: 999px;
  background: var(--ett-cb-primary-soft);
  color: var(--ett-cb-fg);
  font-family: inherit;
  font-size: 0.9rem;
}

.ett-chatbot__input:focus {
  outline: 2px solid color-mix(in srgb, var(--ett-cb-primary) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--ett-cb-primary);
  background: #fff;
}

.ett-chatbot__send {
  flex-shrink: 0;
  margin: 0;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--ett-cb-primary);
  color: #f7f8fb;
  font-family: var(--ett-cb-display);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ett-chatbot__send:hover,
.ett-chatbot__send:focus-visible {
  background: color-mix(in srgb, var(--ett-cb-primary) 85%, #000);
  outline: none;
  transform: translateY(-1px);
}

.ett-chatbot__send:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.ett-chatbot .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes ett-cb-enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ett-cb-pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.12);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

@keyframes ett-cb-nudge-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ett-cb-panel-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ett-cb-msg-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ett-cb-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

@keyframes ett-cb-typing {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ett-chatbot__launcher,
  .ett-chatbot__launcher-pulse,
  .ett-chatbot__nudge,
  .ett-chatbot__panel,
  .ett-chatbot__msg,
  .ett-chatbot__status-dot,
  .ett-chatbot__dot {
    animation: none !important;
  }
}
