/*
 * The Hand Lab — chat booking widget styles.
 * Palette: Hand Lab brand — washed sage green (#5B705A) + charcoal (#31353C).
 * All classes are prefixed `hlc-` so the widget can be embedded on any page.
 */

.hlc-widget,
.hlc-widget * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.hlc-widget {
  --hlc-bg: #fffdfd;
  --hlc-panel: #ffffff;
  --hlc-pink-50: #eef2ec;
  --hlc-pink-100: #e3ebe0;
  --hlc-pink-300: #b9c9b3;
  --hlc-pink-500: #7c9179;
  --hlc-pink-600: #5b705a;
  --hlc-ink: #31353c;
  --hlc-muted: #8a8085;
  --hlc-border: #dbe4d7;
  --hlc-error-bg: #fdecec;
  --hlc-error-border: #f2c4c4;
  --hlc-error-ink: #8a2b2b;
  --hlc-serif: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --hlc-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 420px;
  overflow: hidden;
  background: var(--hlc-bg);
  border: 1px solid var(--hlc-border);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(35, 31, 32, 0.12);
  font-family: var(--hlc-sans);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--hlc-ink);
}

/* ---------- Header ---------- */

.hlc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--hlc-pink-50), #ffffff 70%);
  border-bottom: 1px solid var(--hlc-border);
  flex-shrink: 0;
}

.hlc-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--hlc-ink);
  color: #fff;
  font-family: var(--hlc-serif);
  font-size: 15px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.hlc-brand {
  flex: 1;
  min-width: 0;
}

.hlc-brand-name {
  font-family: var(--hlc-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hlc-brand-tagline {
  font-size: 11.5px;
  color: var(--hlc-pink-600);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.hlc-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hlc-lang {
  display: inline-flex;
  border: 1px solid var(--hlc-pink-300);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.hlc-lang button {
  border: 0;
  background: transparent;
  padding: 5px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--hlc-pink-600);
  cursor: pointer;
}

.hlc-lang button.hlc-active {
  background: var(--hlc-ink);
  color: #fff;
}

.hlc-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--hlc-border);
  border-radius: 50%;
  background: #fff;
  color: var(--hlc-muted);
  font-size: 15px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.hlc-icon-btn:hover {
  color: var(--hlc-pink-600);
  border-color: var(--hlc-pink-300);
}

/* ---------- Transcript ---------- */

.hlc-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  background:
    radial-gradient(circle at 100% 0%, rgba(249, 227, 233, 0.55), transparent 42%),
    var(--hlc-bg);
}

.hlc-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 16px;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: hlc-pop 0.18s ease-out;
}

.hlc-bot {
  align-self: flex-start;
  background: var(--hlc-panel);
  border: 1px solid var(--hlc-border);
  border-bottom-left-radius: 5px;
}

.hlc-user {
  align-self: flex-end;
  background: var(--hlc-ink);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.hlc-error {
  background: var(--hlc-error-bg);
  border-color: var(--hlc-error-border);
  color: var(--hlc-error-ink);
}

.hlc-note {
  background: var(--hlc-pink-50);
  border: 1px dashed var(--hlc-pink-300);
  color: var(--hlc-pink-600);
  font-size: 13px;
}

@keyframes hlc-pop {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typing indicator */

.hlc-typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 13px 16px;
}

.hlc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hlc-pink-500);
  animation: hlc-bounce 1.1s infinite ease-in-out;
}

.hlc-typing span:nth-child(2) { animation-delay: 0.15s; }
.hlc-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes hlc-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ---------- Quick replies & actions ---------- */

.hlc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: flex-start;
  max-width: 95%;
  animation: hlc-pop 0.18s ease-out;
}

.hlc-btn {
  border: 1px solid var(--hlc-pink-500);
  border-radius: 999px;
  background: #fff;
  color: var(--hlc-pink-600);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.hlc-btn:hover {
  background: var(--hlc-pink-50);
}

.hlc-btn:active {
  transform: scale(0.97);
}

.hlc-btn-primary {
  background: var(--hlc-ink);
  border-color: var(--hlc-ink);
  color: #fff;
}

.hlc-btn-primary:hover {
  background: #3a3435;
}

.hlc-btn-ghost {
  border-color: var(--hlc-border);
  color: var(--hlc-muted);
  font-weight: 500;
}

.hlc-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Card lists (services, packages, add-ons) */

.hlc-list {
  flex-direction: column;
  flex-wrap: nowrap;
  width: 95%;
  max-height: 264px;
  overflow-y: auto;
  padding-right: 4px;
  /* Flex items with overflow:auto have min-height 0 inside the flex-column
     transcript — without this the whole list collapses to zero height once
     the chat history overflows. */
  flex-shrink: 0;
}

.hlc-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--hlc-border);
  border-radius: 13px;
  background: var(--hlc-panel);
  padding: 11px 14px;
  font: inherit;
  color: var(--hlc-ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hlc-card:hover {
  background: var(--hlc-pink-50);
  border-color: var(--hlc-pink-300);
}

.hlc-card-name {
  font-weight: 600;
  font-size: 14px;
}

.hlc-card-sub {
  font-size: 12.5px;
  color: var(--hlc-muted);
}

.hlc-card-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--hlc-pink-600);
}

/* Slot grid */

.hlc-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  width: 95%;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
  flex-shrink: 0; /* same flexbox collapse guard as .hlc-list */
}

.hlc-slot {
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
  font-size: 12.5px;
}

/* ---------- Forms ---------- */

.hlc-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 95%;
  background: var(--hlc-panel);
  border: 1px solid var(--hlc-border);
  border-radius: 14px;
  padding: 13px;
}

.hlc-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--hlc-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.hlc-input {
  width: 100%;
  border: 1px solid var(--hlc-border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  /* iOS Safari auto-zooms the whole page when a focused input is under 16px
     and never zooms back out — after the email step the summary rendered
     zoomed with its right edge clipped (client screenshot, 2026-09-01).
     16px removes the trigger; must stay >= 16px. */
  font-size: 16px;
  color: var(--hlc-ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hlc-input:focus {
  border-color: var(--hlc-pink-500);
  box-shadow: 0 0 0 3px rgba(217, 139, 163, 0.18);
}

.hlc-form-error {
  font-size: 12.5px;
  color: var(--hlc-error-ink);
}

.hlc-form-row {
  display: flex;
  gap: 8px;
}

.hlc-form-row > .hlc-btn {
  flex-shrink: 0;
}

.hlc-form-row > .hlc-input {
  flex: 1;
  min-width: 0;
}

/* ---------- Summary card ---------- */

.hlc-summary {
  align-self: flex-start;
  width: 95%;
  background: var(--hlc-pink-50);
  border: 1px solid var(--hlc-pink-100);
  border-radius: 15px;
  padding: 14px 16px;
  animation: hlc-pop 0.18s ease-out;
}

.hlc-summary-title {
  font-family: var(--hlc-serif);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 9px;
}

.hlc-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: 13.5px;
}

.hlc-summary-label {
  color: var(--hlc-muted);
  flex-shrink: 0;
}

.hlc-summary-value {
  text-align: right;
  font-weight: 500;
}

.hlc-summary-services {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--hlc-pink-100);
}

.hlc-summary-guest {
  font-size: 12px;
  font-weight: 700;
  color: var(--hlc-pink-600);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 6px 0 2px;
}

.hlc-summary-total {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--hlc-pink-300);
  font-weight: 700;
  font-size: 14.5px;
}

/* ---------- Stripe payment bubble ---------- */

.hlc-payment {
  align-self: flex-start;
  width: 95%;
  background: var(--hlc-panel);
  border: 1px solid var(--hlc-border);
  border-radius: 15px;
  padding: 14px;
  animation: hlc-pop 0.18s ease-out;
}

.hlc-payment-mount {
  min-height: 90px;
}

/* ---------- Floating (launcher) mode ---------- */

.hlc-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999998;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  background: var(--hlc-fab-bg, #231f20);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 13px 20px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(35, 31, 32, 0.3);
  transition: transform 0.15s ease;
}

.hlc-fab:hover {
  transform: translateY(-2px);
}

.hlc-fab-emoji {
  font-size: 17px;
}

.hlc-panel-float {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 999999;
  width: 380px;
  height: min(640px, calc(100vh - 110px));
  display: none;
}

.hlc-panel-float.hlc-open {
  display: block;
}

/* ---------- Mobile ---------- */

@media (max-width: 480px) {
  .hlc-panel-float {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
  }

  .hlc-panel-float .hlc-widget {
    border-radius: 0;
    border: 0;
  }

  .hlc-msg {
    max-width: 92%;
  }

  .hlc-list,
  .hlc-slots,
  .hlc-form,
  .hlc-summary,
  .hlc-payment {
    width: 100%;
  }
}
