/**
 * ElevenLabs Stelos Widget — Pre-chat intake form
 *
 * Mirrors the ElevenLabs widget's own terms sheet (widget 0.18.2 tokens):
 * white sheet, 24px radius, 12px padding, Inter 14/20, 36px pill buttons
 * with an 18px radius, 10px input radius, black accent.
 * Selectors are doubled up so theme / Elementor kit styles cannot win.
 */

.elsw-intake {
  position: fixed;
  z-index: 100000;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  box-sizing: border-box;
  width: calc(100% - 32px);
  max-width: 400px;
  max-height: calc(100vh - 32px);
  margin: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  background: #ffffff;
  color: #000000;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 2px 24px 1px rgba(0, 0, 0, 0.16);
  font-family: Inter, -apple-system, system-ui, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  animation: elsw-intake-in 0.2s ease;
}

.elsw-intake[hidden] {
  display: none !important;
}

.elsw-intake *,
.elsw-intake *::before,
.elsw-intake *::after {
  box-sizing: border-box;
}

@keyframes elsw-intake-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ── Body ──────────────────────────────────────────────────── */
.elsw-intake .elsw-intake__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 8px 8px;
}

.elsw-intake .elsw-intake__title {
  margin: 0;
  padding: 0;
  color: #000000;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: normal;
  text-transform: none;
}

.elsw-intake .elsw-intake__text,
.elsw-intake .elsw-intake__consent,
.elsw-intake .elsw-intake__error {
  margin: 0;
  padding: 0;
  font-family: inherit;
  letter-spacing: normal;
}

.elsw-intake .elsw-intake__text {
  color: #000000;
  font-size: 14px;
  line-height: 20px;
}

/* ── Fields ────────────────────────────────────────────────── */
.elsw-intake .elsw-intake__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.elsw-intake .elsw-intake__label {
  display: block;
  margin: 0;
  padding: 0;
  color: #000000;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  letter-spacing: normal;
  text-transform: none;
}

.elsw-intake input.elsw-intake__input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0 12px;
  background: #ffffff;
  color: #000000;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: normal;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.elsw-intake input.elsw-intake__input:hover {
  border-color: #d1d5db;
}

.elsw-intake input.elsw-intake__input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 1px #000000;
  outline: none;
}

.elsw-intake input.elsw-intake__input[aria-invalid='true'] {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px #dc2626;
}

.elsw-intake .elsw-intake__error {
  color: #dc2626;
  font-size: 12px;
  line-height: 16px;
}

.elsw-intake .elsw-intake__error[hidden] {
  display: none !important;
}

.elsw-intake .elsw-intake__consent {
  margin-top: 8px;
  color: #6b7280;
  font-size: 12px;
  line-height: 16px;
}

.elsw-intake .elsw-intake__consent a {
  color: #000000;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.elsw-intake .elsw-intake__consent a:hover {
  color: #374151;
}

/* ── Actions ───────────────────────────────────────────────── */
.elsw-intake .elsw-intake__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.elsw-intake button.elsw-intake__btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0 16px;
  background: #ffffff;
  color: #000000;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: normal;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.elsw-intake button.elsw-intake__btn:hover {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #000000;
}

.elsw-intake button.elsw-intake__btn:active {
  background: #f3f4f6;
}

.elsw-intake button.elsw-intake__btn--primary {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
}

.elsw-intake button.elsw-intake__btn--primary:hover {
  background: #1f2937;
  border-color: #1f2937;
  color: #ffffff;
}

.elsw-intake button.elsw-intake__btn--primary:active {
  background: #374151;
  border-color: #374151;
}

.elsw-intake button.elsw-intake__btn:focus {
  outline: none;
}

.elsw-intake button.elsw-intake__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #000000;
}

/* ── Touch screens: 16px inputs stop iOS zooming on focus ──── */
@media (pointer: coarse) {
  .elsw-intake input.elsw-intake__input {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .elsw-intake {
    animation: none;
  }
}
