/* ========================================
   Member Forms - Shared form styles
   Used by profile, upload and contact forms
   ======================================== */

/* Profile / Form Section Layout */
.profile-section,
.member-section {
  padding: var(--space-xl) 0;
  padding-bottom: calc(var(--space-xl) + 80px);
}

.profile-header,
.page-header {
  margin-bottom: var(--space-xl);
  text-align: center;
}

.profile-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: var(--space-xs);
}

.profile-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
}

/* Alert Messages */
.alert {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.alert-success {
  background: #d1fae5;
  border: 1px solid #10b981;
  color: #065f46;
}

.alert-error {
  background: #fee2e2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

.alert-icon {
  flex-shrink: 0;
}

/* Form Container */
.profile-form {
  max-width: 800px;
  margin: 0 auto;
}

/* Fieldset / Card */
.profile-fieldset {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  background: var(--bg-card, #fff);
}

.profile-legend {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-color);
  padding: 0 var(--space-sm);
}

/* Grid Layout */
.profile-field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .profile-field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .field-full {
    grid-column: 1 / -1;
  }

  .field-small {
    max-width: 120px;
  }
}

/* Individual Field */
.profile-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.profile-label {
  font-weight: 500;
  color: var(--text-color);
  font-size: 0.875rem;
}

.required {
  color: #ef4444;
}

/* Inputs & Textareas */
.profile-input,
.profile-textarea {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--bg-input, #fff);
  color: var(--text-color);
}

.profile-input:focus,
.profile-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.profile-input:disabled {
  background: var(--bg-muted, #f3f4f6);
  cursor: not-allowed;
  opacity: 0.7;
}

.profile-input.input-error {
  border-color: #ef4444;
}

.profile-textarea {
  resize: vertical;
  min-height: 100px;
}

/* File input styling */
input[type="file"].profile-input {
  padding: var(--space-sm);
}

/* Help text */
.field-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.char-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: var(--space-xs);
}

/* Form Actions */
.profile-actions {
  display: flex;
  justify-content: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-muted, #f3f4f6);
  color: var(--text-color);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-hover, #e5e7eb);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-muted, #f3f4f6);
}

.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.875rem;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1.125rem;
}

/* Email Field Special Styling */
.email-display {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.email-input {
  flex: 1;
}

.email-pending-notice {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius-md);
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  color: #92400e;
}

/* Password Section */
.password-section {
  margin-top: var(--space-sm);
}

.password-section .profile-field-grid {
  gap: var(--space-md);
}

/* Family Members */
.family-member-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  background: var(--bg-card, #fff);
}

.family-member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
}

.family-member-title {
  font-weight: 600;
  color: var(--text-color);
}

.family-member-remove {
  color: #ef4444;
  border-color: #ef4444;
}

.family-member-remove:hover {
  background: #fee2e2;
}
