/* Connect form — self-contained styles for the DevLink code component.
   Neutral palette hardcoded so it renders identically inside Webflow's Shadow
   DOM (which has none of the app's :root tokens). Font inherits from the host. */

.cf__form {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  width: 100%;
  max-width: 30rem;
  margin-inline: auto;
  font-family: inherit;
  box-sizing: border-box;
}

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

.cf__row {
  display: flex;
  gap: 0.875rem;
}

.cf__field {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.cf__input,
.cf__select,
.cf__textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  /* Mid-grey stroke so the fields read clearly against a light background. */
  border: 1px solid #c2c2c2;
  border-radius: 8px;
  background: #ffffff;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  appearance: none;
}

.cf__textarea {
  resize: vertical;
  min-height: 8rem;
}

.cf__select {
  padding-right: 2.75rem;
  cursor: pointer;
}

.cf__input::placeholder,
.cf__textarea::placeholder {
  color: #8a8a8a;
}

.cf__input:focus-visible,
.cf__select:focus-visible,
.cf__textarea:focus-visible {
  outline: none;
  border-color: #2d62ff;
  box-shadow: 0 0 0 3px rgba(45, 98, 255, 0.15);
}

.cf__field.is-error .cf__input,
.cf__field.is-error .cf__select,
.cf__field.is-error .cf__textarea {
  border-color: #d93025;
}

/* Error + hint text. Empty elements collapse so the layout doesn't jump. */
.cf__error {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #d93025;
}

.cf__error:empty {
  display: none;
}

.cf__checkbox:focus-visible,
.cf__consent-label a:focus-visible {
  outline: 2px solid #2d62ff;
  outline-offset: 2px;
  border-radius: 3px;
}

.cf__chevron {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  display: flex;
  color: #6b6b6b;
  pointer-events: none;
}

/* ── Consent checkbox + disclaimer ────────────────────────────────────────── */
.cf__consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.25rem 0.25rem 0;
}

.cf__checkbox {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.15rem;
  accent-color: #1a1a1a;
  cursor: pointer;
}

.cf__consent-label {
  font-size: 0.6875rem;
  line-height: 1.4;
  color: #6b6b6b;
  cursor: pointer;
}

.cf__consent-label a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cf__consent.is-error .cf__consent-label {
  color: #d93025;
}

/* ── Submit ───────────────────────────────────────────────────────────────── */
.cf__submit {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid #c2c2c2;
  border-radius: 8px;
  background: #ffffff;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

/* Invert on hover — a clear affordance that it's clickable. */
.cf__submit:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #ffffff;
}

.cf__submit:focus-visible {
  outline: 2px solid #2d62ff;
  outline-offset: 2px;
}

/* ── Visually-hidden label (placeholder is not an accessible name) ─────────── */
.cf__label-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Success ──────────────────────────────────────────────────────────────── */
.cf--done {
  max-width: 30rem;
  margin-inline: auto;
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-family: inherit;
}

.cf__check {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #1a1a1a;
  color: #ffffff;
  font-size: 1.25rem;
}

.cf__done-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: #1a1a1a;
}

.cf__done-body {
  margin: 0;
  color: #6b6b6b;
}

/* ── WebMCP: highlight while an agent is driving the form ──────────────────── */
form:tool-form-active {
  outline: 2px dashed #2d62ff;
  outline-offset: 4px;
  border-radius: 8px;
}

input:tool-submit-active {
  outline: 2px solid #d93025;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .cf__row {
    flex-direction: column;
    gap: 0.875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cf__input,
  .cf__select,
  .cf__textarea,
  .cf__submit {
    transition: none;
  }
}
