/* Email gate overlay — a compact sticky bottom card over the report.
   Self-contained so it sits cleanly over any author HTML.

   One layout at every width: eyebrow title, input + submit on a single row,
   one-line data-use notice. The phone media query only shrinks sizes and swaps
   the button label ("Get the full report" -> "Unlock"). */
.es-gate {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 1rem;
  z-index: 2147483647;
  pointer-events: none;
}

.es-gate__card {
  pointer-events: auto;
  width: 100%;
  max-width: 640px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  /* Bottom padding sits under small notice text, which carries little visual
     weight — slightly less than the top reads as equal. */
  padding: 1.1rem 1.25rem 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-align: left;
}

/* Post-submit "Check your inbox" heading (injected without the title id). */
.es-gate__card h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0b192e;
}

.es-gate__card p {
  margin: 0 0 1rem;
  color: #555;
}

/* The gate title is an eyebrow — small, uppercase, brand orange. */
#es-gate-title {
  margin: 0 0 0.7rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d85410;
}

.es-gate__form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* flex-basis 0 + min-width 0 let the input shrink below its placeholder's
   natural width, so only the full-width error ever wraps to its own line.
   Keep the font at 1rem (16px) so iOS Safari doesn't zoom on focus. */
.es-gate__form input[type="email"] {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  font-family: inherit; /* form controls don't inherit the card's Open Sans by default */
  font-size: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.es-gate__form input[type="email"]:focus {
  outline: 0;
  border-color: #f86f24;
  box-shadow: 0 0 0 3px rgba(248, 111, 36, 0.2);
}

.es-gate__form button {
  flex: 0 0 auto;
  padding: 0.65rem 1.1rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: #f86f24;
  border: 1px solid #f86f24;
  border-radius: 8px;
  cursor: pointer;
}

.es-gate__form button:hover {
  background: #d85410;
  border-color: #d85410;
}

.es-gate__form button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* The button carries two labels; desktop shows the full one. */
.es-gate__btn-short {
  display: none;
}

.es-gate__hp {
  position: absolute;
  left: -9999px;
}

/* Both rules carry the .es-gate__card prefix to outrank the generic
   `.es-gate__card p` above — without it that rule's margins/color win. */
.es-gate__card .es-gate__error {
  flex-basis: 100%;
  margin: 0.25rem 0 0;
  color: #b91c1c;
  font-size: 0.9rem;
}

.es-gate__error:empty {
  display: none; /* don't reserve a blank line while there's no error */
}

.es-gate__card .es-gate__notice {
  margin: 1rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #6b717e;
}

.es-gate__notice a {
  color: #d85410;
  text-decoration: underline;
}

@media (max-width: 640px) {
  .es-gate {
    padding: 0.6rem;
  }

  .es-gate__card {
    padding: 0.9rem 1rem 0.8rem;
    border-radius: 12px;
  }

  #es-gate-title {
    font-size: 0.7rem;
    margin-bottom: 0.55rem;
  }

  .es-gate__form input[type="email"] {
    padding: 0.55rem 0.75rem;
  }

  .es-gate__form button {
    padding: 0.55rem 0.9rem;
    font-size: 0.9rem;
  }

  .es-gate__btn-full {
    display: none;
  }

  .es-gate__btn-short {
    display: inline;
  }

  .es-gate__card .es-gate__notice {
    margin-top: 0.85rem;
    font-size: 0.68rem;
  }
}
