/* Lead Request modal — native <dialog>, cheremisina tokens */

html.lead-form-open {
  overflow: hidden;
}

.lead-form {
  border: none;
  padding: 0;
  max-width: min(480px, calc(100vw - 16px));
  width: 100%;
  background: transparent;
  color: var(--ink);
  margin: auto;
  max-height: calc(100vh - 8px);
  max-height: calc(100dvh - 8px);
}

.lead-form::backdrop {
  background: color-mix(in srgb, var(--ink) 42%, transparent);
  backdrop-filter: blur(2px);
}

.lead-form-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 24px 64px rgba(26, 24, 20, 0.18);
  padding: 14px 14px 12px;
  max-height: calc(100vh - 8px);
  max-height: calc(100dvh - 8px);
  overflow: hidden;
}

.lead-form-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-sm, 8px);
  background: transparent;
  color: var(--mute);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.lead-form-close:hover,
.lead-form-close:focus-visible {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 1px;
}

.lead-form-body[data-lead-panel="form"] {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.lead-form-title {
  flex-shrink: 0;
  margin: 0 0 8px;
  padding-right: 32px;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lead-form-subtitle {
  display: none;
}

.lead-form-success-msg {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-2);
}

.lead-form-success-aside {
  margin: 0 0 12px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--mute);
}

.lead-form-success-aside a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lead-form-success-aside a:hover,
.lead-form-success-aside a:focus-visible {
  color: var(--accent);
}

.lead-form-success-actions {
  display: grid;
  gap: 8px;
}

.lead-form-success-tg {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  font-size: 0.95rem;
  line-height: 1.2;
}

.lead-form-fields {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 8px;
}

.lead-form-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.lead-form-grid-2 {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.lead-form-field {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
}

.lead-form-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lead-form-field input,
.lead-form-field select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: var(--radius-sm, 8px);
  background: var(--white, #fff);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  box-sizing: border-box;
}

.lead-form-field input:focus,
.lead-form-field select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 1px;
}

.lead-form-consent {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--mute);
}

.lead-form-consent input {
  margin-top: 1px;
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.lead-form-consent a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lead-form-consent a:hover,
.lead-form-consent a:focus-visible {
  color: var(--accent);
}

.lead-form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lead-form-status {
  flex-shrink: 0;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.lead-form-status.is-error {
  color: var(--accent);
}

.lead-form-submit {
  flex-shrink: 0;
  width: 100%;
  min-height: 42px;
  margin-top: 0;
  padding: 10px 12px;
  font-size: 0.95rem;
  line-height: 1.2;
}

.lead-form.is-loading .lead-form-submit {
  opacity: 0.72;
  pointer-events: none;
}

.lead-form-done {
  width: 100%;
  min-height: 40px;
  margin-top: 0;
  padding: 9px 12px;
  font-size: 0.9rem;
}

.foot-lead-link {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}

.foot-lead-link:hover,
.foot-lead-link:focus-visible {
  color: var(--accent);
}

@media (min-width: 640px) {
  .lead-form-panel {
    padding: 18px 18px 14px;
  }

  .lead-form-title {
    font-size: 20px;
  }

  .lead-form-success-msg {
    font-size: 15px;
  }
}

@media (max-width: 380px) {
  .lead-form-grid-2 {
    grid-template-columns: 1fr;
  }
}
