/* ============================================================
   EveryChat — Simple WebChat Widget
   Standalone CSS — loaded inside a full-viewport iframe.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --accent: #2563EB;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 10%, #ffffff);
  --accent-dim: color-mix(in srgb, var(--accent) 14%, #ffffff);

  --wc-ink: #16191F;
  --wc-ink-2: #5A6473;
  --wc-ink-3: #98A0AD;
  --wc-line: #ECEEF1;
  --wc-line-2: #E2E5EA;
  --wc-surface: #FFFFFF;
  --wc-surface-2: #F6F7F9;
  --wc-surface-3: #EEF0F3;

  --wc-font: 'Inter', system-ui, -apple-system, sans-serif;

  --wc-radius: 20px;
  --wc-radius-sm: 12px;

  --wc-shadow: 0 12px 40px -8px rgba(20, 28, 48, .22), 0 2px 8px rgba(20, 28, 48, .08);
  --wc-shadow-bar: 0 10px 30px -6px rgba(20, 28, 48, .28), 0 2px 6px rgba(20, 28, 48, .10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
  font-family: var(--wc-font);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Widget root — floating bubble, offset from corner
   ============================================================ */
.wc {
  position: fixed;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  font-family: var(--wc-font);
  color: var(--wc-ink);
  pointer-events: auto;
}

.wc--simple {
  right: 18px;
  bottom: 18px;
  gap: 3px;
}

/* ============================================================
   Launcher button (wide pill)
   ============================================================ */
.wc-bubble {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 24px 7px 7px;
  background: var(--wc-surface);
  border: none;
  border-radius: 100px 0 100px 100px;
  box-shadow: var(--wc-shadow);
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2, .9, .25, 1), box-shadow .15s;
  align-self: flex-end;
  font-family: inherit;
}
.wc-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px -8px rgba(20,28,48,.26), 0 3px 10px rgba(20,28,48,.10);
}
.wc-bubble:active { transform: translateY(0); }

/* Circular icon badge */
.wc-bubble__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  flex: none;
}
.wc-bubble__icon svg {
  width: 20px;
  height: 20px;
}

/* "TEXT US" label */
.wc-bubble__label {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--wc-ink);
  padding-right: 2px;
}

/* ============================================================
   Panel (Text Us box)
   ============================================================ */
.wc-panel {
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--wc-surface);
  border-radius: var(--wc-radius);
  box-shadow: var(--wc-shadow);
  overflow: hidden;
  transform-origin: bottom right;
  animation: wc-rise .34s cubic-bezier(.2,.9,.25,1) forwards;
  display: flex;
  flex-direction: column;
  max-height: min(560px, calc(100vh - 130px));
}
@keyframes wc-rise {
  from { transform: translateY(16px) scale(.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.wc-panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--wc-line);
}
.wc-panel__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  flex: none;
}
.wc-panel__avatar svg { width: 20px; height: 20px; }
.wc-panel__titles { flex: 1; min-width: 0; }
.wc-panel__title {
  font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  color: var(--wc-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wc-panel__sub {
  font-size: 12.5px; color: var(--wc-ink-2); margin-top: 1px;
  display: flex; align-items: center; gap: 6px;
}
.wc-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22C55E; flex: none;
  box-shadow: 0 0 0 3px rgba(34,197,94,.16);
}
.wc-x {
  width: 30px; height: 30px; flex: none;
  border: none; background: var(--wc-surface-2);
  border-radius: 9px; cursor: pointer;
  display: grid; place-items: center;
  color: var(--wc-ink-2);
  transition: background .15s, color .15s;
}
.wc-x:hover { background: var(--wc-surface-3); color: var(--wc-ink); }
.wc-x svg { width: 16px; height: 16px; }

.wc-panel__body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

/* ============================================================
   Form fields
   ============================================================ */
.wc-intro {
  font-size: 13.5px; line-height: 1.5; color: var(--wc-ink-2);
  margin: 0 0 16px;
}
.wc-field { margin-bottom: 12px; }
.wc-field__label {
  display: block;
  font-size: 12px; font-weight: 600; color: var(--wc-ink-2);
  margin-bottom: 6px;
}
.wc-input, .wc-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--wc-ink);
  background: var(--wc-surface);
  border: 1.5px solid var(--wc-line-2);
  border-radius: 11px;
  padding: 11px 12px;
  transition: border-color .15s, box-shadow .15s;
}
.wc-input::placeholder, .wc-textarea::placeholder { color: var(--wc-ink-3); }
.wc-input:focus, .wc-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.wc-textarea { resize: none; min-height: 92px; line-height: 1.45; }

.wc-btn {
  width: 100%;
  font-family: inherit;
  font-size: 14.5px; font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .15s, transform .05s;
}
.wc-btn:hover { filter: brightness(1.06); }
.wc-btn:active { transform: translateY(1px); }
.wc-btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.wc-btn svg { width: 17px; height: 17px; }

/* ============================================================
   Success state
   ============================================================ */
.wc-done {
  text-align: center;
  padding: 26px 18px 30px;
}
.wc-done__check {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  color: var(--accent);
  display: grid; place-items: center;
  animation: wc-pop .4s cubic-bezier(.2,1.3,.4,1) forwards;
}
.wc-done__check svg { width: 28px; height: 28px; }
@keyframes wc-pop { from { transform: scale(.5); } to { transform: scale(1); } }
.wc-done__title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 6px; }
.wc-done__text { font-size: 13.5px; line-height: 1.5; color: var(--wc-ink-2); margin: 0 auto; max-width: 260px; }

/* ============================================================
   Powered-by footer
   ============================================================ */
.wc-powered {
  text-align: center;
  font-size: 11px; font-weight: 500;
  color: var(--wc-ink-3);
  padding: 9px 12px;
  border-top: 1px solid var(--wc-line);
  background: var(--wc-surface);
  letter-spacing: .01em;
}
.wc-powered b { font-weight: 700; color: var(--wc-ink-2); }

/* ============================================================
   Prompt bubble (appears above the launcher)
   ============================================================ */
.wc-prompt {
  background: var(--accent);
  border-radius: 100px 100px 0px 100px;
  padding: 8px 13px;
  box-shadow: var(--wc-shadow-bar);
  align-self: flex-end;
  animation: wc-rise .34s cubic-bezier(.2, .9, .25, 1) forwards;
  cursor: default;
}
.wc-prompt__text {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--accent-ink);
  margin: 0;
  white-space: nowrap;
}

@keyframes wc-prompt-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(6px) scale(.97); }
}
.wc-prompt--hiding {
  animation: wc-prompt-out .2s ease forwards;
  pointer-events: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .wc-panel, .wc-done__check, .wc-prompt { animation: none !important; }
}
