/* Forms: Unified styling for all Django forms.
 * Load via: <link rel="stylesheet" href="{% static 'css/forms.css' %}">
 *
 * Design: Linear layout (stacked, full-width), rounded-2xl inputs,
 * blue focus ring, uppercase label convention.
 */

/* Wrapper for each form field */
.form-field {
  margin-bottom: 1.5rem;
  width: 100%;
}

/* Field labels */
.form-label {
  display: block;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

/* Shared input/textarea/select base */
.form-input,
.form-textarea,
.form-select {
  appearance: none;
  display: block;
  width: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid #d1d5db;
  border-radius: 1rem;
  background: #ffffff;
  color: #111827;
  font-size: 0.875rem;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #6b7280;
}

/* Textarea */
.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Select */
.form-select {
  cursor: pointer;
}

/* File input */
.form-file {
  display: block;
  width: 100%;
  font-size: 0.875rem;
  color: #6b7280;
}

.form-file::file-selector-button {
  margin-right: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 0;
  font-size: 0.75rem;
  font-weight: 900;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  transition: background 0.2s ease;
}

.form-file::file-selector-button:hover {
  background: #dbeafe;
}

/* Field errors */
.form-error {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #ef4444;
  font-weight: 700;
}

/* Non-field error block */
.form-non-field-errors {
  border-radius: 1rem;
  background: #fef2f2;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid #fecaca;
}

.form-non-field-errors h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #991b1b;
  margin: 0 0 0.5rem;
}

.form-non-field-errors ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.form-non-field-errors li {
  font-size: 0.875rem;
  color: #b91c1c;
  line-height: 1.5;
}

/* Checkbox/Radio rows */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: #3b82f6;
}

.form-check-label {
  font-size: 0.875rem;
  color: #374151;
}

/* Disabled state */
.form-input:disabled,
.form-textarea:disabled,
.form-select:disabled {
  background: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Password toggle wrapper — if you add a show/hide toggle */
.form-password-wrapper {
  position: relative;
}

.form-password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  font-size: 0.875rem;
  padding: 0.25rem;
}

.form-password-toggle:hover {
  color: #374151;
}

/* Helper text */
.form-helper {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.375rem;
}
