/* Blog sidebar lead form — matches the existing .cg-sidebar-cta card (black card, #59C449 pill button). */

.cg-lead-card {
  background: #000;
  color: #fff;
  padding: 28px 24px 24px;
  border-radius: 12px;
  margin: 20px;
}

.cg-lead-card__title {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
  margin: 0 0 8px;
}

.cg-lead-card__intro {
  font-size: 14px;
  line-height: 1.55;
  color: #ccc;
  margin: 0 0 20px;
}

.cg-lead-field {
  margin-bottom: 14px;
}

.cg-lead-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 6px;
}

.cg-lead-req {
  color: #59C449;
}

.cg-lead-opt {
  color: #9a9a9a;
  font-weight: 400;
}

.cg-lead-field input {
  display: block;
  width: 100%;
  height: 46px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 16px; /* 16px stops iOS zooming on focus */
  color: #111;
  background: #fff;
  border: 2px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.cg-lead-field input::placeholder {
  color: #8a8a8a;
  opacity: 1;
}

.cg-lead-field input:focus {
  outline: none;
  border-color: #59C449;
  box-shadow: 0 0 0 3px rgba(89, 196, 73, .35);
}

.cg-lead-field input.is-invalid,
.cg-lead-field input.is-invalid:focus {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, .25);
}

.cg-lead-error {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #ff8f8f;
}

.cg-lead-error:empty {
  display: none;
}

.cg-lead-alert {
  margin-bottom: 16px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #ffc2c2;
  background: rgba(255, 107, 107, .12);
  border: 1px solid #ff6b6b;
  border-radius: 8px;
}

.cg-lead-alert[hidden],
.cg-lead-view[hidden],
.cg-lead-success[hidden] {
  display: none;
}

.cg-lead-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  color: #000;
  background: #59C449;
  border: 1px solid #59C449;
  border-radius: 25px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.cg-lead-submit:hover {
  color: #fff;
  background: transparent;
  border-color: #fff;
}

.cg-lead-submit:focus-visible {
  outline: 3px solid rgba(89, 196, 73, .6);
  outline-offset: 3px;
}

.cg-lead-submit:disabled,
.cg-lead-submit:disabled:hover {
  color: #000;
  background: #59C449;
  border-color: #59C449;
  opacity: .75;
  cursor: progress;
}

.cg-lead-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, .25);
  border-top-color: #000;
  border-radius: 50%;
  animation: cg-lead-spin .7s linear infinite;
}

.cg-lead-submit[aria-busy="true"] .cg-lead-spinner {
  display: inline-block;
}

@keyframes cg-lead-spin {
  to { transform: rotate(360deg); }
}

.cg-lead-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: #9a9a9a;
  text-align: center;
}

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.cg-lead-card .cg-lead-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cg-lead-success {
  padding: 16px 0 8px;
  text-align: center;
}

.cg-lead-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  background: #59C449;
  border-radius: 50%;
}

.cg-lead-success__title {
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px;
}

.cg-lead-success__title:focus {
  outline: none;
}

.cg-lead-success__text {
  font-size: 14px;
  line-height: 1.55;
  color: #ccc;
  margin: 0;
}

/* Tablet: sidebar drops below the article at full width — use two columns. */
@media (min-width: 576px) and (max-width: 991.98px) {
  .cg-lead-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }

  /* Three fields: phone gets its own full-width row on small tablets. */
  .cg-lead-field--phone {
    grid-column: 1 / -1;
  }

  .cg-lead-submit {
    width: auto;
    min-width: 260px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Mobile */
@media (max-width: 575.98px) {
  .cg-lead-card {
    margin: 20px 0;
    padding: 24px 18px 20px;
  }

  .cg-lead-card__title {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cg-lead-spinner {
    animation-duration: 1.6s;
  }

  .cg-lead-field input,
  .cg-lead-submit {
    transition: none;
  }
}
