/* Secure Village PH website assistant. Uses the site's colour tokens from style.css. */

.svc-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--navy, #153B4F);
  color: #fff;
  font: 700 14.5px/1 inherit;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(15, 44, 59, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.svc-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(15, 44, 59, 0.34); }
.svc-launcher:focus-visible, .svc-panel button:focus-visible, .svc-panel input:focus-visible,
.svc-panel select:focus-visible, .svc-panel textarea:focus-visible { outline: 3px solid #2E86AB; outline-offset: 2px; }
.svc-launcher.svc-hidden { display: none; }

.svc-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1001;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 600px;
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  background: var(--surface, #fff);
  color: var(--text-primary, #1B2530);
  border: 1px solid var(--hairline, #E4E1D9);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 44, 59, 0.28);
  overflow: hidden;
  font-size: 14px;
}
.svc-panel[hidden] { display: none; }

.svc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--navy, #153B4F);
  color: #fff;
}
.svc-title { font-weight: 800; font-size: 15.5px; }
.svc-sub { font-size: 12px; opacity: 0.78; margin-top: 2px; }
.svc-close {
  flex: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.svc-close:hover { background: rgba(255, 255, 255, 0.26); }

.svc-chat, .svc-lead { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.svc-chat[hidden], .svc-lead[hidden] { display: none; }

.svc-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--background, #F5F3EE);
}
.svc-msg {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.svc-bot { align-self: flex-start; background: var(--surface, #fff); border: 1px solid var(--hairline, #E4E1D9); border-bottom-left-radius: 4px; }
.svc-user { align-self: flex-end; background: var(--navy, #153B4F); color: #fff; border-bottom-right-radius: 4px; }
.svc-typing { color: var(--text-secondary, #6B7280); font-style: italic; }
.svc-error { background: #fdf0ef; border-color: #f0c9c6; color: #8a2a25; }

.svc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 14px 10px; background: var(--background, #F5F3EE); }
.svc-chips[hidden] { display: none; }
.svc-chip {
  padding: 8px 12px;
  border: 1px solid var(--navy, #153B4F);
  border-radius: 999px;
  background: transparent;
  color: var(--navy, #153B4F);
  font: 600 13px/1.2 inherit;
  font-family: inherit;
  cursor: pointer;
}
.svc-chip:hover { background: rgba(21, 59, 79, 0.08); }

.svc-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--hairline, #E4E1D9); background: var(--surface, #fff); }
.svc-input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--hairline, #E4E1D9);
  border-radius: 12px;
  font: inherit;
  font-size: 16px; /* 16px stops iPhone Safari zooming the page on focus */
  color: inherit;
  background: #fff;
}
.svc-send {
  flex: none;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--navy, #153B4F);
  color: #fff;
  font: 700 14px/1 inherit;
  font-family: inherit;
  cursor: pointer;
}
.svc-send:disabled { opacity: 0.55; cursor: not-allowed; }
.svc-wide { width: 100%; padding: 13px 16px; }

.svc-foot { display: flex; flex-direction: column; gap: 4px; padding: 8px 14px 12px; background: var(--surface, #fff); }
.svc-link { align-self: flex-start; padding: 4px 0; border: 0; background: none; color: var(--navy, #153B4F); font: 700 13.5px/1.2 inherit; font-family: inherit; text-decoration: underline; cursor: pointer; }
.svc-note { font-size: 11.5px; color: var(--text-muted, #9A9C9F); }

.svc-lead { overflow-y: auto; padding: 14px 16px 18px; }
.svc-leadintro { margin: 0 0 10px; color: var(--text-secondary, #6B7280); }
.svc-leadform { display: flex; flex-direction: column; gap: 10px; }
.svc-field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 12.5px; color: var(--text-secondary, #6B7280); }
.svc-field input, .svc-field select, .svc-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--hairline, #E4E1D9);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-primary, #1B2530);
  background: #fff;
}
.svc-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--text-secondary, #6B7280); }
.svc-consent input { margin-top: 3px; flex: none; }
.svc-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.svc-leadmsg { min-height: 18px; font-size: 13px; }
.svc-ok { color: #1F7A55; font-weight: 600; }
.svc-bad { color: #A12E2E; font-weight: 600; }

@media (max-width: 520px) {
  .svc-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 86vh; max-height: 86vh; border-radius: 18px 18px 0 0; }
  .svc-launcher { right: 14px; bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .svc-launcher { transition: none; }
}
