/*
 * The lead form that stands between a visitor and the demo download.
 *
 * Draws on the variables in styles.css, which loads first. It is a dialog, so
 * it sits above everything and dims the page behind it; the form itself is
 * four fields and one button, because every extra field costs completions.
 */

.lead-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(3, 12, 24, .72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lead-backdrop[hidden] { display: none; }

.lead-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 32px 28px;
  position: relative;
}

.lead-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.lead-close:hover { color: var(--text); border-color: var(--line-strong); }
.lead-close:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.lead-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 10px;
}
.lead-card h2 {
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: -.015em;
  margin: 0 0 8px;
  text-wrap: balance;
  padding-right: 40px;
}
.lead-card > p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 22px;
}

.lead-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.lead-grid .wide { grid-column: 1 / -1; }

.lead-field { display: flex; flex-direction: column; gap: 6px; }
.lead-field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.lead-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 21, 40, .6);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: border-color .15s ease;
}
.lead-field input::placeholder { color: rgba(163, 184, 206, .45); }
.lead-field input:focus { outline: none; border-color: var(--green); }
.lead-field input[aria-invalid="true"] { border-color: var(--red); }
.lead-error {
  font-size: 12px;
  color: var(--red);
  min-height: 1.2em;
}

/* Bots fill every field; people never see this one. */
.lead-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.lead-actions {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.lead-actions .button { flex: 1 1 auto; justify-content: center; }
.lead-actions .button[disabled] { opacity: .55; cursor: wait; }
.lead-note {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted-2);
  margin: 12px 0 0;
}

/* After a successful submission the same card turns into the download. */
.lead-done { text-align: center; padding: 10px 0 4px; }
.lead-done .tick {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 2px solid var(--green);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}
.lead-done h2 { padding-right: 0; }
.lead-done p { margin-bottom: 18px; }

.lead-status {
  font-size: 13px;
  color: var(--red);
  margin-top: 10px;
  min-height: 1.2em;
}

@media (max-width: 520px) {
  .lead-grid { grid-template-columns: 1fr; }
  .lead-card { padding: 26px 20px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .lead-field input { transition: none; }
}
