/**
 * Form Components
 * Inputs, textareas, selects, and form layouts
 */

/* Form Group */
.hvn-theme-form-group {
  margin-bottom: var(--hvn-theme-space-lg);
}

/* Labels */
.hvn-theme-form-label {
  display: block;
  margin-bottom: var(--hvn-theme-space-sm);
  font-weight: var(--hvn-theme-font-weight-medium);
  color: var(--hvn-theme-text-primary);
}

/* Input Fields */
.hvn-theme-form-control {
  width: 100%;
  padding: var(--hvn-theme-input-padding);
  font-size: var(--hvn-theme-font-size-md);
  font-family: var(--hvn-theme-font-family-base);
  color: var(--hvn-theme-text-primary);
  background: var(--hvn-theme-input-bg);
  border: 1px solid var(--hvn-theme-input-border);
  border-radius: var(--hvn-theme-input-radius);
  transition: all var(--hvn-theme-transition-base);
}

.hvn-theme-form-control:focus {
  outline: none;
  border-color: var(--hvn-theme-input-border-focus);
  box-shadow: 0 0 0 3px rgba(108, 96, 254, 0.1);
}

.hvn-theme-form-control::placeholder {
  color: var(--hvn-theme-color-gray-500);
  opacity: 1;
}

/* Textarea */
textarea.hvn-theme-form-control {
  min-height: 120px;
  resize: vertical;
}

/* Select */
select.hvn-theme-form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  padding-right: 2.5rem;
}

/* Checkbox & Radio */
.hvn-theme-checkbox,
.hvn-theme-radio {
  display: flex;
  align-items: center;
  gap: var(--hvn-theme-space-sm);
  margin-bottom: var(--hvn-theme-space-sm);
  cursor: pointer;
}

.hvn-theme-checkbox input,
.hvn-theme-radio input {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.hvn-theme-checkbox label,
.hvn-theme-radio label {
  margin: 0;
  cursor: pointer;
}

/* Form Row (for inline fields) */
.hvn-theme-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hvn-theme-space-md);
  margin-bottom: var(--hvn-theme-space-lg);
}

.hvn-theme-form-row .hvn-theme-form-group {
  flex: 1;
  margin-bottom: 0;
}

/* Search Form */
.hvn-theme-search-form {
  display: flex;
  gap: var(--hvn-theme-space-sm);
}

.hvn-theme-search-form .hvn-theme-form-control {
  flex: 1;
}

.hvn-theme-search-form .hvn-theme-btn {
  flex-shrink: 0;
}

/* Comment Form */
.comment-form {
  margin-top: var(--hvn-theme-space-xl);
}

.comment-form p {
  margin-bottom: var(--hvn-theme-space-lg);
}

.comment-form label {
  display: block;
  margin-bottom: var(--hvn-theme-space-xs);
  font-weight: var(--hvn-theme-font-weight-medium);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: var(--hvn-theme-input-padding);
  border: 1px solid var(--hvn-theme-input-border);
  border-radius: var(--hvn-theme-input-radius);
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--hvn-theme-input-border-focus);
}

.comment-form .form-submit {
  margin-bottom: 0;
}

/* Form Validation */
.hvn-theme-form-control.is-invalid {
  border-color: var(--hvn-theme-brand-error);
}

.hvn-theme-form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.1);
}

.hvn-theme-invalid-feedback {
  display: block;
  margin-top: var(--hvn-theme-space-xs);
  font-size: var(--hvn-theme-font-size-sm);
  color: var(--hvn-theme-brand-error);
}