/* ASAP PT Clinic Q&A widget — bottom-right, does not cover header Call button */
:root {
  --cqa-navy: #0b3a5b;
  --cqa-navy-deep: #082c45;
  --cqa-cream: #f7f3ea;
  --cqa-ink: #1a2430;
  --cqa-muted: #5a6570;
  --cqa-accent: #c45c26;
  --cqa-border: rgba(11, 58, 91, 0.18);
  --cqa-shadow: 0 12px 40px rgba(8, 44, 69, 0.22);
  --cqa-z: 40; /* below sticky header call (~50+) if needed; still above page content */
}

#clinic-qa-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: var(--cqa-z);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--cqa-ink);
  box-sizing: border-box;
}

#clinic-qa-root *,
#clinic-qa-root *::before,
#clinic-qa-root *::after {
  box-sizing: border-box;
}

.cqa-launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--cqa-navy);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--cqa-shadow);
  transition: background 0.15s ease, transform 0.1s ease;
}

.cqa-launcher:hover,
.cqa-launcher:focus-visible {
  background: var(--cqa-navy-deep);
  outline: 2px solid var(--cqa-accent);
  outline-offset: 2px;
}

.cqa-launcher[aria-expanded="true"] {
  background: var(--cqa-navy-deep);
}

.cqa-panel {
  display: none;
  width: min(360px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 96px));
  margin-bottom: 10px;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--cqa-border);
  border-radius: 16px;
  box-shadow: var(--cqa-shadow);
  overflow: hidden;
}

#clinic-qa-root.cqa-open .cqa-panel {
  display: flex;
}

#clinic-qa-root.cqa-open .cqa-launcher-wrap {
  display: flex;
  justify-content: flex-end;
}

.cqa-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 10px;
  background: var(--cqa-navy);
  color: #fff;
}

.cqa-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.cqa-header p {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.9;
  font-weight: 400;
}

.cqa-close {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.cqa-close:hover,
.cqa-close:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.cqa-body {
  padding: 12px 14px 14px;
  overflow-y: auto;
  background: var(--cqa-cream);
}

.cqa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.cqa-chip {
  border: 1px solid var(--cqa-border);
  background: #fff;
  color: var(--cqa-navy);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.cqa-chip:hover,
.cqa-chip:focus-visible {
  border-color: var(--cqa-navy);
  outline: 2px solid var(--cqa-accent);
  outline-offset: 1px;
}

.cqa-form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.cqa-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--cqa-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
  color: var(--cqa-ink);
}

.cqa-input:focus-visible {
  outline: 2px solid var(--cqa-navy);
  outline-offset: 1px;
}

.cqa-ask {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--cqa-accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.cqa-ask:hover,
.cqa-ask:focus-visible {
  filter: brightness(1.05);
  outline: 2px solid var(--cqa-navy);
  outline-offset: 1px;
}

.cqa-ask:disabled {
  opacity: 0.6;
  cursor: wait;
}

.cqa-answer {
  min-height: 3.2em;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--cqa-border);
  color: var(--cqa-ink);
  font-size: 14px;
}

.cqa-answer[data-state="empty"] {
  color: var(--cqa-muted);
}

.cqa-answer[data-state="nomatch"] {
  border-color: rgba(196, 92, 38, 0.45);
}

.cqa-cta {
  display: none;
  margin-top: 10px;
}

.cqa-cta.is-visible {
  display: block;
}

.cqa-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--cqa-navy);
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}

.cqa-call:hover,
.cqa-call:focus-visible {
  background: var(--cqa-navy-deep);
  outline: 2px solid var(--cqa-accent);
  outline-offset: 2px;
}

.cqa-note {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--cqa-muted);
}

/* Keep clear of header Call on phones — sit above bottom chrome, never top-right */
@media (max-width: 640px) {
  #clinic-qa-root {
    right: 12px;
    bottom: 12px;
    left: auto;
  }

  .cqa-panel {
    width: min(100vw - 24px, 360px);
    max-height: min(70vh, 480px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cqa-launcher {
    transition: none;
  }
}
