.lead-panel,
.lead-dialog {
  --lead-ink: var(--ink, #172c55);
  --lead-blue: var(--blue, #365fca);
  --lead-muted: var(--muted, #58657a);
  --lead-paper: var(--paper, #f7f8fc);
  --lead-line: var(--line, #dce2ed);
  box-sizing: border-box;
  color: var(--lead-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.lead-panel *,
.lead-close {
  box-sizing: border-box;
}

.lead-panel {
  width: 100%;
  padding: 32px;
  border: 1px solid var(--lead-line);
  border-radius: 24px;
  background: #fff;
}

.lead-heading { margin-bottom: 24px; }
.lead-eyebrow {
  margin: 0 0 12px;
  color: var(--lead-blue);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.lead-title {
  margin: 0;
  color: var(--lead-ink);
  font-size: clamp(1.625rem, calc(1.5rem + .625vw), 2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.lead-title:focus { outline: none; }
.lead-description {
  margin: 14px 0 0;
  max-width: 46ch;
  color: var(--lead-muted);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}
/* The inline section supplies the visible introduction. Keep the form's
   own name and description available to assistive technology; both become
   visible again when the same panel moves into the dialog. */
#lead-form-host .lead-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.lead-form { margin: 0; padding: 0; }
.lead-field { min-width: 0; }
.lead-field label {
  display: block;
  margin: 0 0 7px;
  color: var(--lead-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.lead-field input {
  display: block;
  width: 100%;
  height: 50px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #8491a8;
  border-radius: 12px;
  background: var(--lead-paper);
  color: var(--lead-ink);
  font: 400 16px/1.2 var(--font-sans);
  appearance: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.lead-field input::placeholder { color: #657189; opacity: 1; }
.lead-field input:focus { border-color: var(--lead-blue); background: #fff; }
.lead-contacts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 20px; }
.lead-consent-field { margin-top: 20px; }
.lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  color: var(--lead-muted);
  font-size: 12px;
  line-height: 1.55;
  cursor: pointer;
}
.lead-consent input {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: var(--lead-blue);
  cursor: pointer;
}
.lead-consent a { color: #2c55b1; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lead-field-error { display: block; margin-top: 6px; color: #a23232; font-size: 12px; line-height: 1.4; }
.lead-field-error:empty { display: none; }
.lead-field input[aria-invalid="true"] { border-color: #b34242; }
.lead-consent input[aria-invalid="true"] { outline: 2px solid #b34242; outline-offset: 2px; }
.lead-error,
.lead-success { margin: 18px 0 0; padding: 13px 15px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.lead-error { background: #fff0ef; color: #922d2d; }
.lead-error p { margin: 0; }
.lead-success { border: 1px solid #c5ddcc; background: #edf7f0; color: #235237; }
.lead-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  margin: 22px 0 0;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--lead-blue);
  color: #fff;
  font: 600 16px/1.3 var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}
/* A vector mask survives the shared handler replacing the button label. */
.lead-submit::after { flex: 0 0 auto; display: block; width: 1em; height: 1em; content: ''; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 19 19 5M7 5h12v12' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 19 19 5M7 5h12v12' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; font-size: 24px; font-weight: 400; line-height: 1; }
.lead-submit:active { transform: translateY(1px); }
.lead-submit:disabled { background: #5e75ae; cursor: progress; }
.lead-submit:disabled::after { content: '…'; background: none; -webkit-mask: none; mask: none; }
.lead-loading-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lead-field input:focus-visible,
.lead-consent input:focus-visible,
.lead-panel a:focus-visible,
.lead-submit:focus-visible,
.lead-close:focus-visible,
.lead-error:focus-visible,
.lead-success:focus-visible { outline: 3px solid var(--lead-blue); outline-offset: 3px; }

.lead-dialog {
  position: fixed;
  inset: 0;
  width: calc(100% - 32px);
  max-width: 592px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 80px rgba(13, 29, 58, .24);
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.lead-dialog::backdrop { background: rgba(13, 29, 58, .62); }
.lead-dialog .lead-panel { padding-top: 40px; border: 0; border-radius: 0; }
.lead-dialog .lead-heading { padding-right: 36px; }
.lead-closebar {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 0;
  pointer-events: none;
}
.lead-close {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--lead-line);
  border-radius: 50%;
  background: #fff;
  color: var(--lead-ink);
  cursor: pointer;
  pointer-events: auto;
  transition: background-color 150ms ease;
}
@media (hover: hover) {
  .lead-submit:not(:disabled):hover { background: #284da8; }
  .lead-close:hover { background: var(--lead-paper); }
}
@media (max-width: 560px) {
  .lead-panel { padding: 25px 22px; border-radius: 20px; }
  .lead-heading { margin-bottom: 22px; }
  .lead-eyebrow { font-size: 11px; }
  .lead-description { font-size: 14px; }
  .lead-contacts { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .lead-dialog { width: calc(100% - 20px); max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); border-radius: 20px; }
  .lead-dialog .lead-panel { padding: 32px 22px 26px; }
  .lead-dialog .lead-heading { padding-right: 27px; }
  .lead-close { top: 9px; right: 9px; }
}
@media (max-width: 359px) {
  .lead-panel { padding-right: 18px; padding-left: 18px; }
  .lead-dialog .lead-panel { padding-right: 18px; padding-left: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .lead-field input,
  .lead-submit,
  .lead-close { transition: none; }
  .lead-submit:active { transform: none; }
}
