/* ==========================================================================
   AIRH Form Styles — Futuristic Neumorphism
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Form Container
   --------------------------------------------------------------------------- */
.form {
  width: 100%;
  max-width: var(--form-max-width);
}

.form--wide {
  max-width: 100%;
}

/* ---------------------------------------------------------------------------
   Form Group
   --------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-5);
}

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

/* ---------------------------------------------------------------------------
   Label
   --------------------------------------------------------------------------- */
.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.form-label--required::after {
  content: '*';
  color: var(--color-error);
  font-weight: 700;
  font-size: var(--text-xs);
}

.form-label__optional {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-tertiary);
  margin-left: var(--space-1);
}

/* ---------------------------------------------------------------------------
   Hint / Help Text
   --------------------------------------------------------------------------- */
.form-hint {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  line-height: var(--leading-normal);
}

/* ---------------------------------------------------------------------------
   Error Message
   --------------------------------------------------------------------------- */
.form-error {
  font-size: var(--text-xs);
  color: var(--color-error-text);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  line-height: var(--leading-normal);
}

.form-error__icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Form Row (horizontal fields)
   --------------------------------------------------------------------------- */
.form-row {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.form-row .form-group--fixed {
  flex: 0 0 auto;
}

/* ---------------------------------------------------------------------------
   Form Sections — Neumorphic separated blocks
   --------------------------------------------------------------------------- */
.form-section {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: none;
  position: relative;
}

.form-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border-light), transparent);
}

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

.form-section:last-child::after {
  display: none;
}

.form-section__title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.form-section__title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: linear-gradient(180deg, var(--color-accent), #6366f1);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.form-section__description {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-6);
  line-height: var(--leading-relaxed);
}

/* ---------------------------------------------------------------------------
   Inline Form Layout
   --------------------------------------------------------------------------- */
.form--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-4);
}

.form--inline .form-group {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 160px;
}

.form--inline .form-group--action {
  flex: 0 0 auto;
}

/* ---------------------------------------------------------------------------
   Form Actions — Neumorphic footer
   --------------------------------------------------------------------------- */
.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: none;
  position: relative;
}

.form-actions::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border-light), transparent);
}

.form-actions--right { justify-content: flex-end; }
.form-actions--between { justify-content: space-between; }

/* ---------------------------------------------------------------------------
   Checkbox / Radio Group
   --------------------------------------------------------------------------- */
.form-check-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.form-check-group--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 639px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-row .form-group {
    margin-bottom: var(--space-5);
  }

  .form--inline {
    flex-direction: column;
    align-items: stretch;
  }

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

  .form-actions > * {
    width: 100%;
  }
}
