/*
  CTA 12 — 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-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --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__card {
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid var(--slate-200);
  border-radius: 1rem;
  background-color: var(--white);
  padding: 2rem;
}

.avatars {
  display: flex;
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 2px solid var(--white);
  color: var(--white);
  font-size: 0.625rem;
  font-weight: 600;
  margin-left: -0.625rem;
}

.avatar:first-child {
  margin-left: 0;
}

.avatar--blue {
  background-color: #3b82f6;
}
.avatar--emerald {
  background-color: #10b981;
}
.avatar--amber {
  background-color: #f59e0b;
}
.avatar--dark {
  background-color: var(--slate-900);
}

.stars {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.125rem;
  color: #fbbf24;
}

.stars svg {
  width: 0.875rem;
  height: 0.875rem;
}

.cta__heading {
  margin: 1rem 0 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 {
  margin-top: 1.75rem;
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0.625rem;
}

.input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--slate-300);
  border-radius: 999px;
  background-color: var(--white);
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--slate-900);
  transition:
    box-shadow 280ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 280ms ease;
}

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

.input:focus-visible {
  border-color: var(--slate-900);
  box-shadow: 0 0 0 5px rgba(15, 23, 42, 0.08);
  outline: none;
}

.input[aria-invalid="true"] {
  border-color: #f87171;
}

.input[aria-invalid="true"]:focus-visible {
  border-color: #ef4444;
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.12);
}

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

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

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

.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;
}

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

/* Motion — disabled entirely under reduced motion; every element already
   renders at its final, fully visible state outside this media query. The
   focus ring above still appears instantly either way — only its animated
   grow is skipped — so focus visibility is never lost. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes al-cta12-up {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes al-cta12-chip {
    from {
      opacity: 0;
      transform: scale(0.6);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  .chip {
    animation: al-cta12-chip 450ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }

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