/* ============================================================
   City Mobile Vets Assistant
   Uses the site's Sorbet & Ink tokens from style.css.
   All selectors are namespaced .cmv-a* so nothing leaks into the page.
   ============================================================ */

.cmv-a {
  --a-radius: 18px;
  font-family: var(--font-body);
  color: var(--navy-deep);
}

/* ---------- launcher ---------- */

.cmv-a-launcher {
  position: fixed;
  right: 24px;
  bottom: 100px; /* sits above the existing WhatsApp bubble */
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 12px 14px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy-deep);
  background: var(--white);
  border: 2.5px solid var(--navy);
  border-radius: var(--radius-pill);
  box-shadow: 4px 4px 0 var(--navy);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cmv-a-launcher:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--navy);
}

.cmv-a-launcher:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--navy); }

.cmv-a-launcher-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--peach);
  border: 2px solid var(--navy);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.cmv-a-launcher-icon svg { width: 15px; height: 15px; stroke: var(--navy); }

.cmv-a-open .cmv-a-launcher { display: none; }

/* ---------- panel ---------- */

.cmv-a-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 96;
  width: min(400px, calc(100vw - 48px));
  max-height: min(640px, calc(100vh - 48px));
  display: none;
  flex-direction: column;
  background: var(--cream);
  border: 2.5px solid var(--navy);
  border-radius: var(--radius-card);
  box-shadow: 8px 8px 0 var(--navy);
  overflow: hidden;
}

.cmv-a-open .cmv-a-panel { display: flex; }

.cmv-a[dir="rtl"] .cmv-a-panel,
.cmv-a[dir="rtl"] .cmv-a-launcher { right: auto; left: 24px; }

/* ---------- header ---------- */

.cmv-a-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--peach);
  border-bottom: 2.5px solid var(--navy);
  flex: 0 0 auto;
}

.cmv-a-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--navy-deep);
  margin: 0;
  flex: 1 1 auto;
  line-height: 1.2;
}

.cmv-a-header button {
  flex: 0 0 auto;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 10px;
  color: var(--navy-deep);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1;
  padding: 7px 10px;
  cursor: pointer;
}

.cmv-a-header button:hover { background: var(--peach-100); }

.cmv-a-close span, .cmv-a-back span { font-size: 1.05rem; }

.cmv-a[dir="rtl"] .cmv-a-back span { display: inline-block; transform: scaleX(-1); }

/* ---------- body ---------- */

.cmv-a-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 18px 22px;
  -webkit-overflow-scrolling: touch;
}

.cmv-a-body p { font-size: 0.95rem; line-height: 1.6; }
.cmv-a-body p + p { margin-top: 10px; }

.cmv-a-h {
  font-family: var(--font-display);
  font-size: 1.12rem;
  margin-bottom: 12px;
  color: var(--navy-deep);
}

.cmv-a-intro { font-size: 0.97rem; }

.cmv-a-disclaimer {
  margin-top: 12px;
  background: var(--peach-100);
  border: 2px solid var(--navy);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.86rem !important;
  font-weight: 500;
}

.cmv-a-step {
  font-size: 0.78rem !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: 0.75;
  margin-bottom: 6px;
}

.cmv-a-sub { font-size: 0.88rem !important; opacity: 0.85; margin: 14px 0 10px; }
.cmv-a-note { font-size: 0.83rem !important; opacity: 0.8; margin-top: 12px; }
.cmv-a-limit {
  font-size: 0.86rem !important;
  border-left: 3px solid var(--peach);
  padding-left: 12px;
  margin-top: 14px;
}
.cmv-a[dir="rtl"] .cmv-a-limit {
  border-left: 0;
  border-right: 3px solid var(--peach);
  padding-left: 0;
  padding-right: 12px;
}

.cmv-a-warn {
  background: var(--alert-bg);
  border: 2px solid var(--alert);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.87rem !important;
  color: var(--alert);
  font-weight: 500;
  margin-top: 12px;
}

.cmv-a-list { margin: 8px 0 0; padding-inline-start: 20px; font-size: 0.9rem; }
.cmv-a-list li { margin-bottom: 5px; }

/* ---------- option buttons ---------- */

.cmv-a-options { display: grid; gap: 10px; margin-top: 18px; }

.cmv-a-opt {
  width: 100%;
  text-align: start;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy-deep);
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 14px;
  padding: 13px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 3px 3px 0 var(--peach-300);
}

.cmv-a-opt:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--peach-300); }

.cmv-a-opt-wa {
  background: var(--wa-green);
  color: var(--white);
  border-color: var(--navy);
  box-shadow: 3px 3px 0 var(--navy);
}
.cmv-a-opt-wa:hover { box-shadow: 5px 5px 0 var(--navy); }

/* ---------- generic buttons ---------- */

.cmv-a-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border: 2px solid var(--navy);
  border-radius: var(--radius-pill);
  padding: 11px 20px;
  cursor: pointer;
  background: var(--white);
  color: var(--navy-deep);
}

.cmv-a-btn-primary { background: var(--navy); color: var(--white); }
.cmv-a-btn-wa { background: var(--wa-green); color: var(--white); }
.cmv-a-btn-ghost { background: transparent; border-style: dashed; font-weight: 500; }

.cmv-a-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- forms ---------- */

.cmv-a-field { margin-bottom: 14px; border: 0; padding: 0; }

.cmv-a-field label,
.cmv-a-field legend {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 6px;
  padding: 0;
}

.cmv-a-opt-tag { font-weight: 400; opacity: 0.7; }

.cmv-a-field input[type="text"],
.cmv-a-field input[type="tel"],
.cmv-a-field input[type="number"],
.cmv-a-field select,
.cmv-a-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--navy-deep);
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 11px;
  padding: 10px 12px;
  outline: none;
}

.cmv-a-field textarea { resize: vertical; min-height: 74px; }

.cmv-a-radios { display: flex; flex-wrap: wrap; gap: 8px; }

.cmv-a-radio, .cmv-a-check {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 11px;
  padding: 9px 13px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.cmv-a-check { width: 100%; }
.cmv-a-checks { display: grid; gap: 8px; }
.cmv-a-check-none { border-style: dashed; }

.cmv-a-radio input, .cmv-a-check input { margin: 2px 0 0; accent-color: var(--navy); }

.cmv-a-error {
  color: var(--alert);
  font-weight: 700;
  font-size: 0.87rem !important;
  margin-top: 8px;
}

/* ---------- ask / FAQ ---------- */

.cmv-a-ask label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.cmv-a-ask-row { display: flex; gap: 8px; }
.cmv-a-ask-row input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 2px solid var(--navy);
  border-radius: 11px;
  padding: 10px 12px;
  background: var(--white);
  color: var(--navy-deep);
}
.cmv-a-ask-row .cmv-a-btn { padding: 10px 16px; }

.cmv-a-answer {
  margin-top: 14px;
  background: var(--peach-100);
  border: 2px solid var(--navy);
  border-radius: 14px;
  padding: 14px 16px;
}
.cmv-a-answer h4 { font-family: var(--font-display); font-size: 0.98rem; margin-bottom: 8px; }

.cmv-a-faq-list { display: grid; gap: 8px; }

.cmv-a-faq-q {
  width: 100%;
  text-align: start;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--navy-deep);
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 11px;
  padding: 10px 13px;
  cursor: pointer;
}
.cmv-a-faq-q:hover { background: var(--peach-100); }

/* ---------- services ---------- */

.cmv-a-services { display: grid; gap: 10px; margin-top: 14px; }

.cmv-a-service {
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 12px;
  padding: 12px 14px;
}
.cmv-a-service h4 { font-family: var(--font-display); font-size: 0.97rem; margin-bottom: 4px; }
.cmv-a-service p { font-size: 0.87rem !important; }

/* ---------- emergency ---------- */

.cmv-a-alert {
  background: var(--alert-bg);
  border: 2.5px solid var(--alert);
  border-radius: var(--a-radius);
  padding: 16px 18px;
}

.cmv-a-alert-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem !important;
  color: var(--alert);
  margin-bottom: 10px;
}

.cmv-a-alert-badge {
  width: 26px; height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--alert);
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}

.cmv-a-list-alert { margin-bottom: 10px; font-weight: 600; }

/* ---------- summary ---------- */

.cmv-a-summary {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-mono, ui-monospace, "SFMono-Regular", Menlo, monospace);
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 12px;
  padding: 13px 15px;
  max-height: 260px;
  overflow: auto;
  margin-top: 12px;
  text-align: start;
}

/* ---------- footer ---------- */

.cmv-a-footer-hidden { display: none; }

.cmv-a-footer {
  flex: 0 0 auto;
  border-top: 2px solid var(--navy);
  background: var(--peach-100);
  padding: 10px 16px;
}

.cmv-a-footer-link {
  display: block;
  text-align: center;
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--navy-deep);
  text-decoration: underline;
}

.cmv-a-live {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- focus visibility ---------- */

.cmv-a button:focus-visible,
.cmv-a a:focus-visible,
.cmv-a input:focus-visible,
.cmv-a select:focus-visible,
.cmv-a textarea:focus-visible,
.cmv-a [tabindex]:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

.cmv-a-field input:focus,
.cmv-a-field select:focus,
.cmv-a-field textarea:focus,
.cmv-a-ask-row input:focus {
  box-shadow: 3px 3px 0 var(--peach);
}

/* ---------- mobile ---------- */

@media (max-width: 620px) {
  .cmv-a-launcher {
    right: 16px;
    /* the site's WhatsApp bubble is 62px tall at bottom:24px, so clear 86px + gap */
    bottom: 98px;
    padding: 10px 16px 10px 12px;
    font-size: 0.88rem;
  }

  .cmv-a[dir="rtl"] .cmv-a-launcher { right: auto; left: 16px; }

  .cmv-a-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-height: 88vh;
    max-height: 88dvh;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    border-width: 2.5px 0 0;
    box-shadow: 0 -6px 0 rgba(43, 79, 126, 0.16);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .cmv-a[dir="rtl"] .cmv-a-panel { right: 0; left: 0; }

}

/* The site's own WhatsApp bubble occupies the same corner as the panel, so it is
   hidden while the assistant is open at every breakpoint. The panel carries its own
   always-visible WhatsApp link, so the call to action is never lost. */
body.cmv-a-lock .wa-float { display: none; }

/* keep the page behind the sheet from scrolling on touch devices */
@media (max-width: 620px) {
  body.cmv-a-lock { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .cmv-a-launcher, .cmv-a-opt { transition: none; }
}
