/* CLUTCHwx Concierge. Scripted contact panel + persistent launcher.
 * Reuses the site tokens defined in styles.css (--pine, --gold, --paper, ...).
 */

.cx-launcher {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px 13px 17px;
  border-radius: 999px 999px 999px 4px;
  background: var(--pine, #062c24);
  color: var(--white, #fcfbf6);
  font-size: .95rem;
  font-weight: 650;
  letter-spacing: -.01em;
  box-shadow: 0 14px 34px rgba(4, 31, 25, .34), inset 0 0 0 1px rgba(213, 175, 89, .34);
  transition: transform .26s var(--ease, cubic-bezier(.22,.8,.26,1)), box-shadow .26s var(--ease, cubic-bezier(.22,.8,.26,1));
}
.cx-launcher svg { width: 20px; height: 20px; stroke: var(--gold, #d5af59); }
.cx-launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(4, 31, 25, .4), inset 0 0 0 1px rgba(213, 175, 89, .6); }
body.modal-open .cx-launcher { opacity: 0; pointer-events: none; }

@media (max-width: 560px) {
  .cx-launcher { padding: 12px 17px 12px 15px; font-size: .9rem; }
  .cx-launcher span { display: none; }
  .cx-launcher { border-radius: 999px; padding: 14px; }
}

.cx-shell { position: fixed; inset: 0; z-index: 90; display: grid; place-items: end center; }
.cx-scrim { position: absolute; inset: 0; background: rgba(4, 31, 25, .58); backdrop-filter: blur(3px); }

.cx-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100% - 24px, 480px);
  max-height: min(88vh, 720px);
  margin-bottom: max(16px, env(safe-area-inset-bottom));
  background: var(--paper, #f4f2ea);
  color: var(--ink, #112f26);
  border-radius: 18px 18px 6px 18px;
  box-shadow: 0 30px 70px rgba(4, 31, 25, .45);
  overflow: hidden;
}

.cx-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 20px 16px;
  background: var(--pine, #062c24);
  color: var(--white, #fcfbf6);
}
.cx-eyebrow { margin: 0 0 4px; font-size: .68rem; font-weight: 650; letter-spacing: .18em; text-transform: uppercase; color: var(--gold, #d5af59); }
.cx-head h2 { font-size: 1.32rem; line-height: 1.15; letter-spacing: -.035em; }
.cx-close { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; color: var(--muted-dark, #b3c6bb); transition: background .2s, color .2s; }
.cx-close:hover { background: rgba(213, 175, 89, .16); color: var(--white, #fcfbf6); }
.cx-close svg { width: 18px; height: 18px; }

.cx-log { padding: 18px 20px 4px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; }
.cx-msg p { margin: 0; padding: 10px 14px; font-size: .94rem; line-height: 1.45; }
.cx-msg.cx-bot { align-self: flex-start; max-width: 88%; }
.cx-msg.cx-bot p { background: var(--white, #fcfbf6); border: 1px solid var(--line, rgba(24,51,40,.19)); border-radius: 14px 14px 14px 3px; }
.cx-msg.cx-you { align-self: flex-end; max-width: 82%; }
.cx-msg.cx-you p { background: var(--pine, #062c24); color: var(--white, #fcfbf6); border-radius: 14px 14px 3px 14px; font-weight: 550; }

.cx-stage { padding: 12px 20px 18px; }

.cx-choices { display: flex; flex-direction: column; gap: 8px; }
.cx-choice, .cx-sms {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 15px;
  text-align: left;
  background: var(--white, #fcfbf6);
  border: 1px solid var(--line, rgba(24,51,40,.19));
  border-radius: 12px;
  transition: border-color .2s, transform .2s var(--ease, cubic-bezier(.22,.8,.26,1)), box-shadow .2s;
}
.cx-choice span, .cx-sms span { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cx-choice strong { font-size: .95rem; letter-spacing: -.015em; }
.cx-choice small { font-size: .8rem; color: var(--muted, #53655b); }
.cx-choice svg, .cx-sms svg { width: 19px; height: 19px; color: var(--gold, #d5af59); }
.cx-choice svg:last-child, .cx-sms svg:last-child { width: 16px; height: 16px; color: var(--muted, #53655b); }
.cx-choice:hover, .cx-sms:hover { border-color: var(--gold, #d5af59); transform: translateX(2px); box-shadow: 0 6px 18px rgba(4, 31, 25, .08); }
.cx-sms { margin-top: 10px; background: transparent; border-style: dashed; font-weight: 600; }

.cx-form { display: flex; flex-direction: column; gap: 12px; }
.cx-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 460px) { .cx-fields { grid-template-columns: 1fr; } }
.cx-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cx-field.cx-full { grid-column: 1 / -1; }
.cx-field > span { font-size: .78rem; font-weight: 650; letter-spacing: .01em; }
.cx-field em { font-style: normal; font-weight: 500; color: var(--muted, #53655b); }
.cx-field input, .cx-field textarea {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: .95rem;
  color: var(--ink, #112f26);
  background: var(--white, #fcfbf6);
  border: 1px solid var(--line, rgba(24,51,40,.19));
  border-radius: 9px;
}
.cx-field textarea { resize: vertical; min-height: 60px; }
.cx-field input:focus-visible, .cx-field textarea:focus-visible { outline: 3px solid #ac7927; outline-offset: 2px; }
.cx-field input[aria-invalid="true"], .cx-field textarea[aria-invalid="true"] { border-color: #a3341f; }

.cx-err, .cx-error-summary { font-size: .8rem; color: #8d2c1a; }
.cx-error-summary { margin: 0; font-weight: 600; }

.cx-consent { display: flex; align-items: flex-start; gap: 9px; font-size: .82rem; line-height: 1.4; color: var(--muted, #53655b); }
.cx-consent input { width: 17px; height: 17px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--pine, #062c24); }

.cx-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.cx-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--pine, #062c24);
  color: var(--white, #fcfbf6);
  border-radius: 10px 10px 10px 3px;
  font-size: .97rem;
  font-weight: 650;
  letter-spacing: -.01em;
  transition: background .2s, transform .2s var(--ease, cubic-bezier(.22,.8,.26,1));
}
.cx-send svg { width: 17px; height: 17px; color: var(--gold, #d5af59); }
.cx-send:hover:not(:disabled) { background: var(--deep, #041f19); transform: translateY(-1px); }

.cx-status { margin: 0; font-size: .85rem; line-height: 1.45; color: #8d2c1a; }
.cx-fallback { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; font-weight: 600; color: var(--ink, #112f26); border-bottom: 1px solid var(--gold, #d5af59); align-self: flex-start; padding-bottom: 2px; }
.cx-fallback svg { width: 15px; height: 15px; }

.cx-foot { margin: 0; padding: 12px 20px 16px; font-size: .74rem; line-height: 1.4; color: var(--muted, #53655b); border-top: 1px solid var(--line, rgba(24,51,40,.19)); }

.cx-done { text-align: center; padding: 6px 0 2px; }
.cx-mark { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 50%; background: var(--pine, #062c24); }
.cx-mark svg { width: 22px; height: 22px; color: var(--gold, #d5af59); stroke-width: 2; }
.cx-done h3 { font-size: 1.22rem; letter-spacing: -.03em; }
.cx-done p { margin: 7px 0 0; font-size: .9rem; line-height: 1.45; color: var(--muted, #53655b); }
.cx-ref { font-size: .76rem !important; letter-spacing: .04em; }
.cx-done-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.cx-again { padding: 12px 18px; background: var(--pine, #062c24); color: var(--white, #fcfbf6); border-radius: 10px; font-weight: 650; font-size: .92rem; }
.cx-secondary { padding: 11px 18px; border: 1px solid var(--line, rgba(24,51,40,.19)); border-radius: 10px; font-weight: 600; font-size: .92rem; }

/* Inline triggers that replaced the old mailto links. */
.cx-trigger { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .cx-launcher, .cx-choice, .cx-sms, .cx-send { transition: none; }
  .cx-launcher:hover, .cx-choice:hover, .cx-sms:hover, .cx-send:hover:not(:disabled) { transform: none; }
}

@media (min-width: 720px) {
  .cx-shell { place-items: center; }
  .cx-panel { margin-bottom: 0; border-radius: 20px 20px 6px 20px; }
}

/* Inline triggers reuse existing link/button treatments. These buttons replaced
 * <a href="mailto:..."> elements, so they must inherit the same selectors'
 * geometry where the base stylesheet targeted the anchor specifically.
 */
.footer-top > nav button.cx-trigger {
  font-size: .75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 44px;
  width: 100%;
  text-align: left;
}
.text-link.cx-trigger { width: auto; text-align: left; font-family: inherit; }

/* The log scrolls under the header as the conversation grows. Fade the top edge
 * so a part-scrolled bubble reads as intentional rather than clipped.
 */
.cx-log {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16px);
}

/* Raised clear of the site's sticky mobile Brand Fit bar while that bar is showing. */
.cx-launcher.cx-lifted {
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + var(--cx-lift, 0px));
}
