/* Website Factory - reusable form component styles.
   Framework-agnostic, theme-adaptive. If the host site defines its own design
   tokens (--brand-color, --primary-text-color, etc.) they win; otherwise the
   component falls back to prefers-color-scheme-aware defaults so it looks right
   dropped onto any site, light or dark. */
factory-form {
  display: block;
  /* Adaptive fallbacks (used only when the host does not define the token). */
  --ff-bg: rgba(0, 0, 0, 0.035);
  --ff-border: rgba(0, 0, 0, 0.2);
  --ff-text: #18181b;
  --ff-muted: rgba(0, 0, 0, 0.5);
  --ff-brand: #3479e0;
  --ff-btn-text: #ffffff;
}
@media (prefers-color-scheme: dark) {
  factory-form {
    --ff-bg: rgba(255, 255, 255, 0.06);
    --ff-border: rgba(255, 255, 255, 0.22);
    --ff-text: rgba(255, 255, 255, 0.95);
    --ff-muted: rgba(255, 255, 255, 0.45);
  }
}

.ff-form { display: flex; flex-direction: column; gap: 1rem; margin: 0; }

.ff-field { display: flex; flex-direction: column; gap: 0.4rem; }

.ff-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--secondary-text-color, var(--ff-muted));
}

.ff-input,
.ff-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--primary-text-color, var(--ff-text));
  background: var(--background-elevated-color, var(--ff-bg));
  border: 1px solid var(--divider-color, var(--ff-border));
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ff-textarea { min-height: 120px; resize: vertical; }

.ff-input::placeholder,
.ff-textarea::placeholder { color: var(--muted-text-color, var(--ff-muted)); }

.ff-input:focus,
.ff-textarea:focus {
  border-color: var(--brand-color, var(--ff-brand));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-color, var(--ff-brand)) 30%, transparent);
}

.ff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.95rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--white-color, var(--ff-btn-text));
  background: var(--brand-color, var(--ff-brand));
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--brand-color, var(--ff-brand)) 35%, transparent);
}
.ff-btn:hover { transform: translateY(-1px); opacity: 0.95; }
.ff-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.ff-error { margin: 0; font-size: 0.88rem; color: #e5484d; }
.ff-error[hidden] { display: none; }

.ff-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

.ff-privacy {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--muted-text-color, var(--ff-muted));
}

/* Success reveal (in-page, no redirect) */
.ff-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  padding: 0.5rem 0;
  animation: ff-fade-in 0.35s ease both;
}
.ff-success[hidden] { display: none; }

.ff-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #22a35a;
  font-size: 1.7rem;
  line-height: 1;
}
.ff-success-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-text-color, var(--ff-text));
}
.ff-success-body {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.55;
  color: var(--secondary-text-color, var(--ff-muted));
}
.ff-cta { margin-top: 0.4rem; width: auto; padding-left: 2.25rem; padding-right: 2.25rem; text-decoration: none; }

@keyframes ff-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
