/* Form Components
   ========================================================================== */

/* Form Group Container */
.form-group {
  margin-block-end: var(--space-4, 1rem);
}

/* Form Labels */
.form-label {
  display: block;
  margin-block-end: var(--space-2, 0.5rem);
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: 500;
  color: var(--color-text-primary, #1a1a1a);
}

.form-label--required::after {
  content: " *";
  color: var(--color-danger, #dc2626);
}

/* Form Input */
.form-input {
  display: block;
  width: 100%;
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  font-size: var(--font-size-base, 1rem);
  line-height: 1.5;
  color: var(--color-text-primary, #1a1a1a);
  background-color: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: var(--radius-md, 0.375rem);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
  outline: 0;
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary, #3b82f6) l c h / 0.2);
}

.form-input::placeholder {
  color: var(--color-text-tertiary, #9ca3af);
  opacity: 1;
}

.form-input:disabled {
  background-color: var(--color-surface-secondary, #f3f4f6);
  opacity: 0.6;
  cursor: not-allowed;
}

.form-input--error {
  border-color: var(--color-danger, #dc2626);
}

.form-input--error:focus {
  border-color: var(--color-danger, #dc2626);
  box-shadow: 0 0 0 3px oklch(from var(--color-danger, #dc2626) l c h / 0.2);
}

/* Form Select */
.form-select {
  display: block;
  width: 100%;
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  font-size: var(--font-size-base, 1rem);
  line-height: 1.5;
  color: var(--color-text-primary, #1a1a1a);
  background-color: var(--color-surface, #ffffff);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right var(--space-3, 0.75rem) center;
  background-size: 16px 12px;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: var(--radius-md, 0.375rem);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  appearance: none;
}

.form-select:focus {
  outline: 0;
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary, #3b82f6) l c h / 0.2);
}

.form-select--error {
  border-color: var(--color-danger, #dc2626);
}

/* Form Textarea */
.form-textarea {
  display: block;
  width: 100%;
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  font-size: var(--font-size-base, 1rem);
  line-height: 1.5;
  color: var(--color-text-primary, #1a1a1a);
  background-color: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: var(--radius-md, 0.375rem);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  resize: vertical;
}

.form-textarea:focus {
  outline: 0;
  border-color: var(--color-primary, #3b82f6);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary, #3b82f6) l c h / 0.2);
}

.form-textarea--error {
  border-color: var(--color-danger, #dc2626);
}

/* Checkbox Group */
.form-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2, 0.5rem);
  margin-block-end: var(--space-4, 1rem);
}

.form-checkbox {
  width: 1rem;
  height: 1rem;
  margin-block-start: 0.25rem;
  flex-shrink: 0;
  cursor: pointer;
}

.form-checkbox:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-checkbox-label {
  font-size: var(--font-size-base, 1rem);
  color: var(--color-text-primary, #1a1a1a);
  cursor: pointer;
  user-select: none;
}

/* Radio Group */
.form-radio-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2, 0.5rem);
  margin-block-end: var(--space-3, 0.75rem);
}

.form-radio {
  width: 1rem;
  height: 1rem;
  margin-block-start: 0.25rem;
  flex-shrink: 0;
  cursor: pointer;
}

.form-radio:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-radio-label {
  font-size: var(--font-size-base, 1rem);
  color: var(--color-text-primary, #1a1a1a);
  cursor: pointer;
  user-select: none;
}

/* Form Error Message */
.form-error {
  display: block;
  margin-block-start: var(--space-2, 0.5rem);
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-danger, #dc2626);
}
