/**
 * HVAC Forms CSS Bundle (FIXED & HARMONIZED)
 * Styles for registration, profile, and other form pages
 * 
 * @requires hvac-design-system.css
 * @requires hvac-components.css
 * @version 2.0.0 - Harmonized with design system
 * @since 2025-08-21
 */

/* ===== FORM LAYOUTS ===== */

.hvac-form-container {
  max-width: 800px;
  margin: 0 auto;
  background-color: var(--hvac-neutral-0);
  border: 1px solid var(--hvac-neutral-200);
  border-radius: var(--hvac-radius-base);
  box-shadow: var(--hvac-shadow-base);
  overflow: hidden;
}

.hvac-form-header {
  padding: var(--hvac-space-6);
  background-color: var(--hvac-neutral-50);
  border-bottom: 1px solid var(--hvac-neutral-200);
  text-align: center;
}

.hvac-form-title {
  font-size: var(--hvac-text-2xl);
  font-weight: var(--hvac-font-bold);
  color: var(--hvac-neutral-900);
  margin: 0 0 var(--hvac-space-2) 0;
}

.hvac-form-subtitle {
  font-size: var(--hvac-text-base);
  color: var(--hvac-neutral-600);
  margin: 0;
}

.hvac-form-body {
  padding: var(--hvac-space-8);
}

.hvac-form-section {
  margin-bottom: var(--hvac-space-8);
  padding-bottom: var(--hvac-space-6);
  border-bottom: 1px solid var(--hvac-neutral-100);
}

.hvac-form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.hvac-form-section-title {
  font-size: var(--hvac-text-lg);
  font-weight: var(--hvac-font-semibold);
  color: var(--hvac-neutral-900);
  margin: 0 0 var(--hvac-space-4) 0;
  padding-bottom: var(--hvac-space-2);
  border-bottom: 2px solid var(--hvac-primary-500);
}

/* ===== FORM GRID LAYOUTS ===== */

.hvac-form-grid {
  display: grid;
  gap: var(--hvac-space-4);
}

.hvac-form-grid-2 {
  grid-template-columns: 1fr 1fr;
}

.hvac-form-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.hvac-form-full {
  grid-column: 1 / -1;
}

/* ===== ENHANCED FORM ELEMENTS ===== */

.hvac-form-group {
  margin-bottom: var(--hvac-space-4);
}

.hvac-form-group.required .hvac-label::after {
  content: " *";
  color: var(--hvac-error-500);
  font-weight: var(--hvac-font-bold);
}

.hvac-label {
  display: block;
  font-size: var(--hvac-text-sm);
  font-weight: var(--hvac-font-semibold);
  color: var(--hvac-neutral-900);
  margin-bottom: var(--hvac-space-2);
  line-height: var(--hvac-leading-snug);
}

/* Input field enhancements */
.hvac-input-wrapper {
  position: relative;
}

.hvac-input-icon {
  position: absolute;
  left: var(--hvac-space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--hvac-neutral-400);
  font-size: var(--hvac-text-base);
  pointer-events: none;
}

.hvac-input.has-icon {
  padding-left: calc(var(--hvac-space-4) + var(--hvac-space-6));
}

/* File upload styling */
.hvac-file-upload {
  position: relative;
  display: inline-block;
  cursor: pointer;
  width: 100%;
}

.hvac-file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.hvac-file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--hvac-space-8);
  border: 2px dashed var(--hvac-neutral-300);
  border-radius: var(--hvac-radius-base);
  background-color: var(--hvac-neutral-50);
  color: var(--hvac-neutral-600);
  font-weight: var(--hvac-font-medium);
  transition: all var(--hvac-transition-base);
  min-height: 120px;
  flex-direction: column;
  gap: var(--hvac-space-2);
}

.hvac-file-upload:hover .hvac-file-upload-label {
  border-color: var(--hvac-primary-400);
  background-color: var(--hvac-primary-50);
  color: var(--hvac-primary-700);
}

.hvac-file-upload.has-file .hvac-file-upload-label {
  border-color: var(--hvac-success-400);
  background-color: var(--hvac-success-50);
  color: var(--hvac-success-700);
}

/* Checkbox and radio styling */
.hvac-checkbox-group,
.hvac-radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--hvac-space-3);
}

.hvac-checkbox-item,
.hvac-radio-item {
  display: flex;
  align-items: flex-start;
  gap: var(--hvac-space-3);
}

.hvac-checkbox,
.hvac-radio {
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--hvac-primary-500);
  cursor: pointer;
}

.hvac-checkbox-label,
.hvac-radio-label {
  font-size: var(--hvac-text-base);
  color: var(--hvac-neutral-700);
  cursor: pointer;
  line-height: var(--hvac-leading-normal);
  margin: 0;
}

/* Multi-select styling */
.hvac-select-multiple {
  min-height: 120px;
  padding: var(--hvac-space-2);
}

.hvac-select-multiple option {
  padding: var(--hvac-space-2);
  margin-bottom: var(--hvac-space-1);
  border-radius: var(--hvac-radius-sm);
}

/* ===== FORM ACTIONS ===== */

.hvac-form-actions {
  padding: var(--hvac-space-6);
  background-color: var(--hvac-neutral-50);
  border-top: 1px solid var(--hvac-neutral-200);
  display: flex;
  gap: var(--hvac-space-4);
  justify-content: flex-end;
  align-items: center;
}

.hvac-form-actions.centered {
  justify-content: center;
}

.hvac-form-actions.spread {
  justify-content: space-between;
}

/* ===== VALIDATION STATES ===== */

.hvac-form-group.has-error .hvac-input,
.hvac-form-group.has-error .hvac-textarea,
.hvac-form-group.has-error .hvac-select {
  border-color: var(--hvac-error-500);
  background-color: var(--hvac-error-50);
}

.hvac-form-group.has-error .hvac-input:focus,
.hvac-form-group.has-error .hvac-textarea:focus,
.hvac-form-group.has-error .hvac-select:focus {
  border-color: var(--hvac-error-500);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.hvac-form-group.has-success .hvac-input,
.hvac-form-group.has-success .hvac-textarea,
.hvac-form-group.has-success .hvac-select {
  border-color: var(--hvac-success-500);
  background-color: var(--hvac-success-50);
}

.hvac-error-message {
  font-size: var(--hvac-text-sm);
  color: var(--hvac-error-600);
  margin-top: var(--hvac-space-1);
  display: flex;
  align-items: center;
  gap: var(--hvac-space-1);
}

.hvac-success-message {
  font-size: var(--hvac-text-sm);
  color: var(--hvac-success-600);
  margin-top: var(--hvac-space-1);
  display: flex;
  align-items: center;
  gap: var(--hvac-space-1);
}

.hvac-help-text {
  font-size: var(--hvac-text-sm);
  color: var(--hvac-neutral-600);
  margin-top: var(--hvac-space-1);
  line-height: var(--hvac-leading-normal);
}

/* ===== PROFILE SPECIFIC STYLES ===== */

.hvac-profile-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--hvac-space-8);
  max-width: 1200px;
  margin: 0 auto;
}

.hvac-profile-sidebar {
  background-color: var(--hvac-neutral-0);
  border: 1px solid var(--hvac-neutral-200);
  border-radius: var(--hvac-radius-base);
  padding: var(--hvac-space-6);
  height: fit-content;
  box-shadow: var(--hvac-shadow-sm);
}

.hvac-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--hvac-primary-500);
  color: var(--hvac-neutral-0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--hvac-text-2xl);
  font-weight: var(--hvac-font-bold);
  margin: 0 auto var(--hvac-space-4) auto;
}

.hvac-profile-name {
  text-align: center;
  font-size: var(--hvac-text-lg);
  font-weight: var(--hvac-font-semibold);
  color: var(--hvac-neutral-900);
  margin: 0 0 var(--hvac-space-2) 0;
}

.hvac-profile-role {
  text-align: center;
  font-size: var(--hvac-text-sm);
  color: var(--hvac-neutral-600);
  margin: 0 0 var(--hvac-space-4) 0;
}

.hvac-profile-stats {
  display: flex;
  flex-direction: column;
  gap: var(--hvac-space-3);
}

.hvac-profile-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--hvac-space-2) 0;
  border-bottom: 1px solid var(--hvac-neutral-100);
}

.hvac-profile-stat:last-child {
  border-bottom: none;
}

.hvac-profile-stat-label {
  font-size: var(--hvac-text-sm);
  color: var(--hvac-neutral-600);
}

.hvac-profile-stat-value {
  font-size: var(--hvac-text-sm);
  font-weight: var(--hvac-font-semibold);
  color: var(--hvac-neutral-900);
}

.hvac-profile-main {
  background-color: var(--hvac-neutral-0);
  border: 1px solid var(--hvac-neutral-200);
  border-radius: var(--hvac-radius-base);
  box-shadow: var(--hvac-shadow-sm);
  overflow: hidden;
}

/* ===== REGISTRATION SPECIFIC STYLES ===== */

.hvac-registration-progress {
  padding: var(--hvac-space-4) var(--hvac-space-6);
  background-color: var(--hvac-primary-50);
  border-bottom: 1px solid var(--hvac-primary-200);
  margin-bottom: var(--hvac-space-6);
}

.hvac-progress-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.hvac-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--hvac-space-2);
  flex: 1;
  position: relative;
}

.hvac-progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  right: -50%;
  width: 100%;
  height: 2px;
  background-color: var(--hvac-neutral-300);
  z-index: 1;
}

.hvac-progress-step.completed::after {
  background-color: var(--hvac-primary-500);
}

.hvac-progress-step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--hvac-neutral-300);
  color: var(--hvac-neutral-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--hvac-text-sm);
  font-weight: var(--hvac-font-bold);
  position: relative;
  z-index: 2;
}

.hvac-progress-step.completed .hvac-progress-step-number {
  background-color: var(--hvac-primary-500);
  color: var(--hvac-neutral-0);
}

.hvac-progress-step.current .hvac-progress-step-number {
  background-color: var(--hvac-primary-500);
  color: var(--hvac-neutral-0);
  box-shadow: 0 0 0 4px var(--hvac-primary-100);
}

.hvac-progress-step-label {
  font-size: var(--hvac-text-xs);
  color: var(--hvac-neutral-600);
  text-align: center;
  font-weight: var(--hvac-font-medium);
}

.hvac-progress-step.current .hvac-progress-step-label {
  color: var(--hvac-primary-700);
  font-weight: var(--hvac-font-semibold);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Mobile styles */
@media (max-width: 767px) {
  .hvac-form-container {
    margin: 0 calc(-1 * var(--hvac-space-4));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .hvac-form-body {
    padding: var(--hvac-space-4);
  }
  
  .hvac-form-grid-2,
  .hvac-form-grid-3 {
    grid-template-columns: 1fr;
  }
  
  .hvac-form-actions {
    flex-direction: column;
    gap: var(--hvac-space-3);
  }
  
  .hvac-form-actions .hvac-button {
    width: 100%;
  }
  
  .hvac-profile-container {
    grid-template-columns: 1fr;
    gap: var(--hvac-space-4);
  }
  
  .hvac-profile-sidebar {
    order: 1;
  }
  
  .hvac-profile-main {
    order: 0;
  }
  
  .hvac-progress-steps {
    flex-direction: column;
    gap: var(--hvac-space-4);
  }
  
  .hvac-progress-step::after {
    display: none;
  }
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 1023px) {
  .hvac-form-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  
  .hvac-profile-container {
    grid-template-columns: 250px 1fr;
    gap: var(--hvac-space-6);
  }
}

/* ===== PRINT STYLES ===== */

@media print {
  .hvac-form-actions,
  .hvac-file-upload,
  .hvac-button {
    display: none !important;
  }
  
  .hvac-form-container {
    box-shadow: none !important;
    border: 1px solid #000 !important;
  }
  
  .hvac-input,
  .hvac-textarea,
  .hvac-select {
    border: 1px solid #000 !important;
    background: white !important;
  }
}