/* Forms CSS - Common form styling across the site */

/* Form controls */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--bg, #ffffff);
  width: 100%;
  box-sizing: border-box;
  font-size: 14px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  font-family: inherit;
}

.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Form groups */
.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

/* Form labels */
.form-label,
label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #374151);
  margin-bottom: 4px;
  display: block;
}

/* Required field indicator */
.required::after {
  content: " *";
  color: #dc2626;
}

/* Form errors */
.field-error,
.form-error {
  color: #dc2626;
  font-size: 12px;
  margin-top: 4px;
}

.form-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 16px;
}

/* Help text */
.form-help,
.help-text {
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-top: 4px;
}

/* Checkboxes and radio buttons */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  margin-right: 8px;
}

.checkbox-group,
.radio-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* File inputs */
input[type="file"] {
  border: 1px dashed var(--line, #e5e7eb);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  background: var(--bg-light, #f9fafb);
}

/* Textarea */
textarea {
  min-height: 100px;
  resize: vertical;
}

/* Select dropdown */
select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 32px;
}

/* Disabled states */
.form-control:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  background-color: var(--bg-muted, #f3f4f6);
  color: var(--muted, #6b7280);
  cursor: not-allowed;
}

/* Form buttons */
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Responsive form layout */
@media (max-width: 768px) {
  .form-row {
    gap: 8px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }
}
