/* ========================================
   FORM COMPONENTS
   Reusable form elements: inputs, selects, textareas, checkboxes, radio buttons
   ======================================== */

/* Form Group - Wrapper for label + input */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-group:last-child {
  margin-bottom: 0;
}

/* Labels */
.form-label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.025em;
}

.form-label--required::after {
  content: " *";
  color: var(--color-primary);
}

/* Input Fields */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-bg-secondary, #18181b);
  border: 2px solid var(--color-border, #2d2d31);
  border-radius: 8px;
  color: var(--color-text);
  font-family: var(--font-family-primary);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(74, 198, 255, 0.1);
}

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

/* Select Dropdown */
.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23efeff1' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  padding-right: 40px;
  appearance: none;
}

/* Textarea */
.form-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-family-primary);
}

/* File Input */
.form-file {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: var(--color-bg-secondary, #18181b);
  border: 2px dashed var(--color-border, #2d2d31);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-file:hover {
  border-color: var(--color-primary);
  background: rgba(74, 198, 255, 0.05);
}

.form-file::file-selector-button {
  padding: 8px 16px;
  margin-right: 12px;
  background: var(--color-primary);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-file::file-selector-button:hover {
  background: var(--color-primary-dark, #7c3aed);
}

/* Radio Buttons */
.form-radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.form-radio {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--color-bg-secondary, #18181b);
  border: 2px solid var(--color-border, #2d2d31);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-radio:hover {
  border-color: var(--color-primary);
  background: rgba(74, 198, 255, 0.05);
}

.form-radio input[type="radio"] {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.form-radio input[type="radio"]:checked ~ .form-radio-label {
  color: var(--color-primary);
  font-weight: 600;
}

.form-radio-label {
  flex: 1;
  font-size: 1rem;
  color: var(--color-text);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.form-radio-description {
  display: block;
  margin-top: 4px;
  font-size: 0.875rem;
  color: var(--color-text-muted, #777);
}

/* Checkbox */
.form-checkbox {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.form-checkbox-label {
  flex: 1;
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
}

.form-checkbox-label a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Range Slider */
.form-range {
  width: 100%;
  height: 6px;
  background: var(--color-bg-secondary, #18181b);
  border-radius: 3px;
  outline: none;
  appearance: none;
}

.form-range::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(74, 198, 255, 0.2);
}

.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-range::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(74, 198, 255, 0.2);
}

/* Range Value Display */
.form-range-value {
  display: block;
  margin-top: var(--spacing-sm);
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* Error States */
.form-input--error,
.form-select--error,
.form-textarea--error {
  border-color: #ef4444;
}

.form-error-message {
  display: block;
  margin-top: var(--spacing-sm);
  font-size: 0.875rem;
  color: #ef4444;
}

/* Help Text */
.form-help-text {
  display: block;
  margin-top: var(--spacing-sm);
  font-size: 0.875rem;
  color: var(--color-text-muted, #777);
}

/* Form Row - Multiple inputs side by side */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

@media (max-width: 767px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Submit Button */
.form-submit {
  width: 100%;
  padding: 16px 32px;
  background: var(--color-primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.form-submit:hover {
  background: var(--color-primary-dark, #7c3aed);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(74, 198, 255, 0.3);
}

.form-submit:active {
  transform: translateY(0);
}

.form-submit:disabled {
  background: var(--color-bg-secondary, #18181b);
  color: var(--color-text-muted, #777);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
