/*
  CTA 28 — standalone HTML/CSS/JS implementation.
  No build step, no framework, no external dependency: copy these three
  files into any project and open index.html as-is.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-400: #94a3b8;
  --slate-600: #475569;
  --emerald-50: #ecfdf5;
  --emerald-700: #047857;
  --white: #ffffff;
  --font-sans:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--slate-900);
  background-color: var(--white);
  line-height: 1.5;
}

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

.cta {
  padding: clamp(3.5rem, 2.9rem + 2.4vw, 5.5rem) clamp(1rem, 0.3rem + 3vw, 2rem);
}

.cta__inner {
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cta__heading {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.75rem, 1.4rem + 1.8vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.cta__description {
  margin: 0.75rem 0 0;
  max-width: 24rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--slate-600);
}

.cta__form-wrap {
  position: relative;
  margin-top: 1.75rem;
  width: 100%;
}

.cta__outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cta__outline.is-invalid rect {
  stroke: #dc2626;
}

.cta__field-error {
  margin: 0.75rem 0 0;
  width: 100%;
  font-size: 0.75rem;
  color: #dc2626;
  text-align: center;
}

.cta__field-error[hidden] {
  display: none;
}

.cta__form {
  position: relative;
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0.625rem;
  padding: 0.5rem;
}

.input {
  width: 100%;
  min-width: 0;
  border: none;
  border-radius: 999px;
  background-color: var(--white);
  padding: 0.875rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--slate-900);
}

.input::placeholder {
  color: var(--slate-400);
}

.input:focus-visible {
  outline: 2px solid var(--slate-900);
  outline-offset: 2px;
}

.button {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.875rem 1.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 150ms ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.button:focus-visible {
  outline: 2px solid var(--slate-900);
  outline-offset: 2px;
}

.button--primary {
  color: var(--white);
  background-color: var(--slate-900);
}

.button--primary:hover {
  background-color: var(--slate-700);
}

.cta__success {
  margin-top: 1.75rem;
  width: 100%;
  border-radius: 999px;
  background-color: var(--emerald-50);
  color: var(--emerald-700);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.cta__success[hidden] {
  display: none;
}

.cta__fineprint {
  margin: 1rem 0 0;
  font-size: 0.75rem;
  color: var(--slate-400);
}

@media (min-width: 640px) {
  .cta__form {
    flex-direction: row;
  }

  .input {
    border: none;
  }
}

/* Motion — disabled entirely under reduced motion; the outline renders
   fully drawn and every element already renders at its final, fully
   visible state outside this media query. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes al-cta28-draw {
    from {
      stroke-dashoffset: 100;
    }
    to {
      stroke-dashoffset: 0;
    }
  }

  @keyframes al-cta28-up {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .draw rect {
    stroke-dasharray: 100;
    animation: al-cta28-draw 1400ms cubic-bezier(0.65, 0, 0.35, 1) 500ms both;
  }

  .reveal {
    animation: al-cta28-up 600ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}
