/**
 * Agency Pro Contact Form — frontend styles.
 */

.apcf-form-wrap {
  --apcf-primary: #2563eb;
  max-width: 640px;
  margin: 0 auto;
}

.apcf-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.apcf-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.apcf-field-row--full { grid-column: 1 / -1; }
.apcf-field-row--half { grid-column: span 1; }

.apcf-field-row label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #334155;
  font-size: 0.9rem;
}

.apcf-required { color: #dc2626; margin-left: 2px; }

.apcf-field input[type="text"],
.apcf-field input[type="email"],
.apcf-field input[type="tel"],
.apcf-field input[type="url"],
.apcf-field input[type="number"],
.apcf-field input[type="date"],
.apcf-field select,
.apcf-field textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.apcf-field input:focus,
.apcf-field select:focus,
.apcf-field textarea:focus {
  outline: none;
  border-color: var(--apcf-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--apcf-primary) 20%, transparent);
}

.apcf-checkbox-label,
.apcf-radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.apcf-honeypot {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.apcf-form-actions { margin-top: 0.25rem; }

.apcf-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 0.75rem 1.5rem;
  background: var(--apcf-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.apcf-submit:hover { opacity: 0.92; }
.apcf-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.apcf-form-message {
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  margin-top: 0.75rem;
}
.apcf-form-message[hidden] {
  display: none !important;
}
.apcf-form-message.is-success {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #6ee7b7;
  color: #065f46;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.15);
}
.apcf-form-message.is-success::before {
  content: "✓ ";
  font-weight: 700;
}
.apcf-form-message.is-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.apcf-error {
  padding: 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
}

.apcf-form-title { margin: 0 0 0.35rem; font-size: 1.5rem; color: #0f172a; }
.apcf-form-desc { margin: 0 0 1rem; color: #64748b; line-height: 1.6; }
.apcf-help-text { margin: 0.35rem 0 0; font-size: 0.85rem; color: #64748b; }
.apcf-field-heading { margin: 0.5rem 0 0; }
.apcf-heading { margin: 0; font-size: 1.05rem; color: #0f172a; border-bottom: 2px solid var(--apcf-primary); padding-bottom: 0.35rem; }
.apcf-consent-label { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.9rem; line-height: 1.5; }

.apcf-theme-minimal .apcf-field input,
.apcf-theme-minimal .apcf-field select,
.apcf-theme-minimal .apcf-field textarea { border: none; border-bottom: 2px solid #cbd5e1; border-radius: 0; padding-left: 0; }
.apcf-theme-minimal .apcf-submit { border-radius: 0; }

.apcf-theme-bordered .apcf-form { padding: 1.5rem; border: 2px solid #e2e8f0; border-radius: 12px; background: #fff; }
.apcf-theme-compact .apcf-fields { gap: 0.65rem; }
.apcf-theme-compact .apcf-field input,
.apcf-theme-compact .apcf-field textarea { padding: 0.5rem 0.65rem; font-size: 0.95rem; }

@media (max-width: 640px) {
  .apcf-fields { grid-template-columns: 1fr; }
  .apcf-field-row--half { grid-column: 1 / -1; }
}

/* Embedded on homepage */
.apcf-form-wrap--home.apcf-theme-home .apcf-form {
  gap: 0;
}

.apcf-form-wrap--home .apcf-field-heading,
.apcf-form-wrap--cta .apcf-field-heading {
  display: none;
}
