/* ------------------------------------------------------------------
   Lead capture dialog - shared across free-tool pages
   (QR generator, speed checker, WhatsApp chat generator, etc.)
   Depends on css/styles.css for design tokens.
   ------------------------------------------------------------------ */

.lead-dialog {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--ink);
  max-width: min(520px, 94vw);
  width: 520px;
  margin: auto;
}
.lead-dialog::backdrop {
  background: rgba(22, 17, 15, 0.75);
  backdrop-filter: blur(4px);
}
.lead-dialog[open] {
  animation: dialogIn 0.25s ease;
}
@keyframes dialogIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.lead-form {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid rgba(244, 239, 230, 0.1);
  border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 4vw, 2.2rem);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.lead-form h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  margin-bottom: 0.5rem;
}
.lead-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.4rem;
  line-height: 1.55;
}

.lead-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.lead-close:hover { background: rgba(244, 239, 230, 0.08); color: var(--cream); }
.lead-close:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.lead-form select {
  font: inherit;
  font-family: var(--font-body);
  color: var(--cream);
  background: rgba(22, 17, 15, 0.6);
  border: 1.5px solid rgba(244, 239, 230, 0.15);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  min-height: 48px;
  width: 100%;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%23b9b0a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.6rem;
}
.lead-form select:focus-visible {
  outline: none;
  border-color: var(--orange);
  background-color: rgba(22, 17, 15, 0.85);
  box-shadow: 0 0 0 3px rgba(245, 115, 27, 0.25);
}
.lead-form select option { background: var(--bg); color: var(--cream); }

.lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0.3rem 0 1rem;
  cursor: pointer;
}
.lead-consent input[type="checkbox"] {
  accent-color: var(--orange);
  width: 18px; height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}
.lead-consent a { color: var(--orange); text-decoration: underline; }

.lead-form .form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.lead-form .form-actions .btn { width: 100%; }

.form-status {
  min-height: 1.2em;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  text-align: center;
}
.form-status.is-error { color: #ff8a8f; }
.form-status.is-success { color: #6edc8e; }

@media (prefers-reduced-motion: reduce) {
  .lead-dialog[open] { animation: none; }
}
