/* The home page's own chat box (templates/chat.html, static/chat.js). */
.site-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: "Inter", Arial, sans-serif;
}

.site-chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: var(--charcoal);
  box-shadow: 0 14px 36px rgba(7, 6, 4, 0.28);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.site-chat-toggle:hover,
.site-chat-toggle:focus-visible {
  background: var(--gold-soft);
  color: var(--charcoal);
}

/* styles.css gives every input 100% width and 52px, and every button a clay fill: undo that here. */
.site-chat .site-chat-close,
.site-chat .site-chat-close:hover {
  min-height: 0;
  padding: 0 4px;
  background: transparent;
  color: var(--paper);
  transform: none;
}

.site-chat .site-chat-form input[type="text"],
.site-chat .site-chat-form input[type="tel"] {
  min-height: 44px;
}

.site-chat .site-chat-consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
}

.site-chat .site-chat-form button[type="submit"]:hover {
  background: var(--clay-dark);
  color: #fffaf0;
}

.site-chat-panel {
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.site-chat-panel[hidden] {
  display: none;
}

.site-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--charcoal-soft);
  color: var(--paper);
}

.site-chat-head img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
}

.site-chat-head h2 {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
}

.site-chat-close {
  border: 0;
  background: transparent;
  color: var(--paper);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.site-chat-body {
  overflow-y: auto;
  padding: 16px;
}

.site-chat-hello {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--soft);
  font-size: 0.95rem;
}

.site-chat-form {
  display: grid;
  gap: 10px;
}

.site-chat-form label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 700;
}

.site-chat-form input[type="text"],
.site-chat-form input[type="tel"],
.site-chat-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}

.site-chat-form textarea {
  resize: vertical;
}

.site-chat-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.site-chat-form .site-chat-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(215, 180, 106, 0.14);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.45;
}

.site-chat-consent input {
  margin-top: 2px;
  flex: none;
}

.site-chat-form button[type="submit"] {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: var(--charcoal);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.site-chat-form button[disabled] {
  opacity: 0.6;
  cursor: wait;
}

.site-chat-status {
  margin: 0;
  font-size: 0.85rem;
}

.site-chat-status.success {
  color: #2f6b3a;
}

.site-chat-status.error {
  color: #a23a2a;
}

/* Phones: the gold "Get my cash offer" bar (styles.css, 640px) spans the bottom, so the chat sits just above it. */
@media (max-width: 640px) {
  .site-chat {
    right: 12px;
    bottom: 76px;
  }

  .site-chat-panel {
    max-height: calc(100vh - 150px);
  }

  .site-chat-toggle span {
    display: none;
  }

  .site-chat-toggle {
    width: 52px;
    padding: 0;
    justify-content: center;
  }
}
