/* ==========================================================================
   FORM-3.CSS - TAB SUB-FORM & ĐỒNG BỘ KHÔNG LỖI GAP
   ========================================================================== */

/* 1. KHUNG CHỨA CÁC NÚT TAB */
.fit-sub-tab-group {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px !important;
  background-color: #f2f2f7 !important;
  padding: 4px !important;
  border-radius: 10px !important;
  margin: 0 auto 20px auto !important;
  border: 1px solid #e5e5ea !important;
  box-sizing: border-box !important;
  width: fit-content !important;
  max-width: 100% !important;
}

/* 2. NÚT TAB THÀNH PHẦN */
.fit-sub-tab-group button.fit-sub-tab-btn,
.fit-sub-tab-group .fit-sub-tab-btn {
  display: inline-flex !important;
  float: none !important;
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px 16px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border: none !important;
  background: transparent !important;
  color: #6e6e73 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-align: center !important;
  outline: none !important;
  box-shadow: none !important;
  user-select: none !important;
  white-space: nowrap !important;
  margin: 0 !important;
}

.fit-sub-tab-group button.fit-sub-tab-btn:hover,
.fit-sub-tab-group .fit-sub-tab-btn:hover {
  color: #1d1d1f !important;
}

/* TRẠNG THÁI ACTIVE */
.fit-sub-tab-group button.fit-sub-tab-btn.active,
.fit-sub-tab-group .fit-sub-tab-btn.active {
  background-color: #ffffff !important;
  color: #1d1d1f !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

/* 3. QUẢN LÝ ẨN/HIỆN NỘI DUNG TAB (SỬA LỖI GAP) */
.fit-tab-content {
  display: none !important; /* Bắt buộc ẩn hẳn khỏi layout để không chiếm chiều cao */
  height: 0 !important;
  overflow: hidden !important;
  opacity: 0;
}

.fit-tab-content.active {
  display: block !important; /* Chỉ hiện khi active */
  height: auto !important;
  overflow: visible !important;
  opacity: 1 !important;
  animation: fitTabFade 0.25s ease-in-out;
}

@keyframes fitTabFade {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 4. RESPONSIVE MOBILE */
@media (max-width: 767px) {
  .fit-sub-tab-group {
    padding: 3px !important;
    width: 100% !important;
  }
  
  .fit-sub-tab-group button.fit-sub-tab-btn,
  .fit-sub-tab-group .fit-sub-tab-btn {
    flex: 1 !important;
    padding: 8px 6px !important;
    font-size: 13px !important;
  }
}