/*
 * Lead capture: see lib/capture.php. Brand tokens only, so each site follows
 * its own palette and type.
 *
 * The card and dialog read as a note from the agent: their photo, name and
 * licence designation on the slate band, a thin accent rule, then one
 * question in the display face. Everything else stays quiet.
 */

/* --- The agent header ------------------------------------------------------ */

.capture__head {
  display: flex; align-items: center; gap: 0.85rem;
  margin: 0; padding: 1rem 3rem 1rem 1.2rem;
  background: var(--c-slate, var(--c-ink)); color: var(--c-white);
  border-bottom: 2px solid var(--c-accent);
}
.capture__face {
  flex: none; width: 3.4rem; height: 3.4rem; border-radius: 50%; object-fit: cover; object-position: 50% 20%;
  border: 2px solid var(--c-accent); background: var(--c-paper-alt);
}
.capture__who { margin: 0; line-height: 1.25; }
.capture__name { display: block; font-family: var(--f-display, Georgia, serif); font-size: 1.15rem; letter-spacing: 0.01em; }
.capture__role { display: block; font-size: 0.72rem; opacity: 0.78; margin-top: 0.15rem; }

/* --- Shared pieces ------------------------------------------------------------ */

[data-capture-slot] { padding: 1.15rem 1.2rem 1rem; }

.capture__heading {
  font-family: var(--f-display, Georgia, serif); font-weight: 400;
  font-size: 1.45rem; line-height: 1.2; color: var(--c-ink); margin: 0 0 0.9rem;
}

.capture__close {
  position: absolute; top: 0.55rem; right: 0.55rem; z-index: 1; width: 2.2rem; height: 2.2rem;
  border: 0; border-radius: 50%; background: transparent; color: var(--c-white);
  font-size: 1.45rem; line-height: 1; cursor: pointer; opacity: 0.8;
}
.capture__close:hover, .capture__close:focus-visible { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.capture__close:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 1px; }

/* --- The three choices ---------------------------------------------------------- */

.capture__intent { display: grid; gap: 0.5rem; }
.capture__intent .capture__heading { margin-bottom: 0.4rem; }
.capture__choice {
  display: flex; align-items: center; gap: 0.8rem; width: 100%;
  padding: 0.7rem 0.75rem; text-align: left; font: inherit; cursor: pointer;
  border: 1px solid var(--c-line); border-radius: 2px; background: var(--c-paper); color: var(--c-ink);
  transition: border-color 0.15s, background-color 0.15s;
}
.capture__choice:hover { border-color: var(--c-accent); background: var(--c-paper-alt); }
.capture__choice:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 1px; }
.capture__choice-icon, .capture__choice-go {
  flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.capture__choice-icon { width: 1.5rem; height: 1.5rem; color: var(--c-accent-deep); }
.capture__choice-go { width: 1rem; height: 1rem; margin-left: auto; color: var(--c-muted); transition: transform 0.15s; }
.capture__choice:hover .capture__choice-go { transform: translateX(2px); color: var(--c-ink); }
.capture__choice-text { display: block; font-weight: 600; font-size: 0.95rem; line-height: 1.25; }
.capture__choice-note { display: block; font-weight: 400; font-size: 0.78rem; color: var(--c-muted); margin-top: 0.1rem; }

/* --- Forms ------------------------------------------------------------------------ */

.capture__form .field { margin: 0 0 0.75rem; }
.capture__form label { display: block; font-size: 0.78rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--c-ink-soft); }
.capture__form input, .capture__form select, .capture__form textarea {
  width: 100%; box-sizing: border-box; padding: 0.7rem 0.8rem; font: inherit; font-size: 1rem;
  border: 1px solid transparent; border-bottom-color: var(--c-line); border-radius: 2px;
  background: var(--c-paper-alt); color: var(--c-ink);
  transition: border-color 0.15s, background-color 0.15s;
}
.capture__form input:focus, .capture__form select:focus, .capture__form textarea:focus {
  outline: none; background: var(--c-paper); border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft);
}
.capture__form .btn--primary { margin-top: 0.4rem; padding-top: 0.85rem; padding-bottom: 0.85rem; font-size: 1rem; }
.capture__form .cf-turnstile { margin: 0.4rem 0; }
.capture__error { display: block; color: var(--c-error); font-size: 0.78rem; margin-top: 0.25rem; }
.capture__error:empty { display: none; }
.capture__note, .capture__privacy { font-size: 0.75rem; color: var(--c-muted); margin: 0.55rem 0 0; }
.capture__privacy a { color: inherit; }
.capture__status { font-size: 0.85rem; color: var(--c-error); margin: 0.5rem 0 0; }
.capture__status:empty { display: none; }
.capture__thanks {
  margin: 0; padding: 0.4rem 0 0.2rem 1rem; border-left: 2px solid var(--c-accent);
  font-family: var(--f-display, Georgia, serif); font-size: 1.2rem; line-height: 1.4; color: var(--c-ink);
}

/* --- Dialog: centred on desktop, a bottom sheet on phones. Opened only by a
   visitor's tap or, on desktop, the exit popup. ------------------------------------ */

.capture-dialog {
  /* Above the search quick-look (.lmodal, 1200), below the photo viewer (.lbox, 1300). */
  position: fixed; inset: 0; z-index: 1250; display: flex; align-items: center; justify-content: center;
  background: rgba(26, 26, 26, 0.5); padding: 16px;
}
.capture-dialog[hidden] { display: none; }
.capture-dialog__panel {
  position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--c-paper); color: var(--c-ink); border-radius: 2px;
  box-shadow: 0 24px 70px rgba(26, 26, 26, 0.35);
  animation: capture-rise 0.22s ease-out;
}
html.has-capture-dialog { overflow: hidden; }
@media (max-width: 767px) {
  .capture-dialog { align-items: flex-end; padding: 0; }
  .capture-dialog__panel { max-width: none; max-height: 90vh; }
}

/* --- Corner card: a third of a phone screen until the visitor picks a choice. ---- */

.capture-card {
  position: fixed; right: 20px; bottom: 20px; z-index: 900; width: 360px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px); overflow: auto; box-sizing: border-box;
  background: var(--c-paper); color: var(--c-ink); border-radius: 2px;
  box-shadow: 0 16px 50px rgba(26, 26, 26, 0.28);
  animation: capture-rise 0.3s ease-out;
}
@media (max-width: 767px) {
  .capture-card { left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; max-height: 33vh; }
  .capture-card.is-form { max-height: 85vh; }
  .capture-card .capture__head { padding: 0.6rem 3rem 0.6rem 0.9rem; }
  .capture-card .capture__face { width: 2.4rem; height: 2.4rem; }
  .capture-card [data-capture-slot] { padding: 0.8rem 0.9rem 0.8rem; }
  .capture-card .capture__heading { font-size: 1.2rem; }
  .capture-card .capture__choice { padding: 0.55rem 0.65rem; }
  .capture-card .capture__choice-note { display: none; }
}
@keyframes capture-rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .capture-card, .capture-dialog__panel { animation: none; }
  .capture__choice, .capture__choice-go, .capture__form input { transition: none; }
}

/* --- Call button: a photo pill in the bottom-right corner on phones, hidden
   while the card or a dialog is up. ----------------------------------------------- */

.capture-call { display: none; }
@media (max-width: 767px) {
  .capture-call {
    display: inline-flex; align-items: center; gap: 0.55rem;
    position: fixed; right: 14px; bottom: 14px; z-index: 800;
    padding: 0.3rem 1rem 0.3rem 0.3rem; border-radius: 999px; text-decoration: none;
    background: var(--c-slate, var(--c-ink)); color: var(--c-white);
    font-weight: 600; font-size: 0.9rem; line-height: 1;
    box-shadow: 0 8px 24px rgba(26, 26, 26, 0.28);
  }
  .capture-call__face {
    width: 2.25rem; height: 2.25rem; border-radius: 50%; object-fit: cover; object-position: 50% 20%;
    border: 2px solid var(--c-accent); background: var(--c-paper-alt);
  }
  .capture-call:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
  html.has-capture-card .capture-call, html.has-capture-dialog .capture-call { display: none; }
}

/* --- Top bar: in the page flow, so it never covers anything. --------------------- */

.capture-topbar {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 0.55rem 2.8rem; background: var(--c-slate, var(--c-ink)); color: var(--c-white); font-size: 0.85rem;
  border-bottom: 1px solid var(--c-accent);
}
.capture-topbar__text { margin: 0; text-align: center; }
.capture-topbar__text a { color: inherit; text-decoration: none; }
.capture-topbar__text a:hover, .capture-topbar__text a:focus-visible { text-decoration: underline; text-decoration-color: var(--c-accent); text-underline-offset: 3px; }
.capture-topbar__close {
  position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: inherit; font-size: 1.3rem; width: 2.2rem; height: 2.2rem; cursor: pointer;
}

/* --- Inline signup (partials/capture-updates.php). ------------------------------- */

.capture-updates { background: var(--c-paper-alt); padding: 2.5rem 16px; border-top: 2px solid var(--c-accent); }
.capture-updates .capture__form { max-width: 520px; margin: 0 auto; }
.capture-updates .capture__form input, .capture-updates .capture__form select { background: var(--c-paper); }

/* The line under a dialog heading (the exit popup's offer). */
.capture__lead { margin: -0.4rem 0 1rem; font-size: 0.92rem; line-height: 1.5; color: var(--c-body, var(--c-ink-soft)); }
